【发布时间】:2018-05-04 16:01:17
【问题描述】:
我在 Android Studio 中有一个 AAR(库)项目,用于制作我们许可的库。我需要混淆我们发布的库,使人们难以反编译。但我似乎无法让 ProGuard 工作。当我解压缩 AAR 和下面的“classes.jar”时,所有的类名和变量都还在。我对 ProGuard 的使用很弱,所以想知道社区是否可以提供帮助。我有一个非常基本的 ProGuard 文件,它是在 Android Studio 为项目创建模板时生成的:
-printmapping out.map
-keepparameternames
-renamesourcefileattribute SourceFile
# -keepattributes Exceptions,InnerClasses,Signature,Deprecated,SourceFile,LineNumberTable,EnclosingMethod
-keepattributes Exceptions
# Preserve all annotations.
-keepattributes *Annotation*
# Preserve all public classes, and their public and protected fields and methods
-keep public class * {
public protected *;
}
【问题讨论】:
标签: android android-studio proguard