简单Android代码混淆(转)

代码混淆步骤:

1,project.properties中打开代码混淆功能,加入proguard.config=proguard.cfg

2,编辑proguard.cfg文件,项目没有自动生成时可手工新建并放到项目根目录,内容如下

-optimizationpasses 5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -dontpreverify -verbose -optimizations !code/simplification/arithmetic,!field/*,!class/merging/* -ignorewarnings -libraryjars libs/android-support-v4.jar -dontwarn android.support.v4.** -keep class android.support.v4.** { *; } -keep interface android.support.v4.app.** { *; } -keep public class * extends android.support.v4.** -keep public class * extends android.app.Fragment -libraryjars libs/asmack.jar -libraryjars libs/aws-android-sdk-1.7.1.1-core.jar -libraryjars libs/aws-android-sdk-1.7.1.1-s3.jar -libraryjars libs/LibFrameWidget.jar -libraryjars libs/LibFramework.jar -libraryjars libs/locSDK_4.0.jar -libraryjars libs/umeng_sdk.jar -libraryjars libs/zxing-core.jar -keep public class * extends android.app.Activity -keep public class * extends android.app.Application -keep public class * extends android.app.Service -keep public class * extends android.content.BroadcastReceiver -keep public class * extends android.content.ContentProvider -keep public class com.android.vending.licensing.ILicensingService -keepclasseswithmembernames class * { native <methods>; } -keepclasseswithmembernames class * { public <init>(android.content.Context, android.util.AttributeSet); } -keepclasseswithmembernames class * { public <init>(android.content.Context, android.util.AttributeSet, int); } -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; }

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/zwssgp.html