Android 混淆及项目发布

来源:互联网 发布:万界淘宝商txt下载 编辑:程序博客网 时间:2024/05/16 19:27

Android代码混淆及项目发布步骤记录

http://blog.csdn.net/u011638883/article/details/26349215


android混淆-关于依赖第三方库

http://my.oschina.net/u/1402271/blog/184130

android 混淆文件proguard.cfg详解

http://blog.csdn.net/laoyao_moyan/article/details/7353768


Android 混淆代码总结

http://blog.csdn.net/lovexjyong/article/details/24652085



# To enable ProGuard in your project, edit project.properties# to define the proguard.config property as described in that file.## Add project specific ProGuard rules here.# By default, the flags in this file are appended to flags specified# in ${sdk.dir}/tools/proguard/proguard-android.txt# You can edit the include path and order by changing the ProGuard# include property in project.properties.## For more details, see#   http://developer.android.com/guide/developing/tools/proguard.html# Add any project specific keep options here:# If your project uses WebView with JS, uncomment the following# and specify the fully qualified class name to the JavaScript interface# class:#-keepclassmembers class fqcn.of.javascript.interface.for.webview {#   public *;#}####################################################################################通用###################################################################################-optimizations !code/simplification/arithmetic,!code/simplification/cast,!field/*,!class/merging/*-optimizationpasses 5-allowaccessmodification-dontpreverify-dontoptimize-dontshrink# The remainder of this file is identical to the non-optimized version# of the Proguard configuration file (except that the other file has# flags to turn off optimization).# #混淆时不会产生形形色色的类名 ##-dontusemixedcaseclassnames# #指定不去忽略非公共的库类 ##-dontskipnonpubliclibraryclasses-dontskipnonpubliclibraryclassmembers-keepattributes Signature-keepattributes *Annotation*-keepattributes Exceptions,InnerClasses,Signature-keepattributes SourceFile,LineNumberTable-verbose-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.widget.BaseAdapter-keep public class * extends android.content.BroadcastReceiver-keep public class * extends android.database.sqlite.SQLiteOpenHelper-keep public class * extends android.content.ContentProvider-keep public class * extends android.app.backup.BackupAgentHelper-keep public class * extends android.preference.Preference-keep public class * extends android.support.v4.app.Fragment-keep public class * extends android.support.v4.app.FragmentActivity-keep public class * extends android.support.v4.**    -keep interface android.support.v4.app.** { *; }  -keep public class com.google.vending.licensing.ILicensingService-keep public class com.android.vending.licensing.ILicensingService-keep public class android.accessibilityservice.**{*;}############################-keep public class * extends toolkit.android.SQLiteCipherDbHelper-keep public class * extends toolkit.android.SQLiteNormalDbHelper-keep public class * extends  net.sqlcipher.database.SQLiteOpenHelper-keep public class * extends com.glenet.hm.activity.BaseActivity-keep public class * extends com.glenet.hm.fragment.BaseFragment-keep public class * extends yjc.toolkit.app.ToolkitApplication-keep public class * extends com.glenet.hm.adapter.SimpleBaseAdapter#-keep class yjc.toolkit.** {*;}-keep class net.sqlcipher.** {*;}#-keep class toolkit.android.sqlite.** {*;}########################## For native methods, see http://proguard.sourceforge.net/manual/examples.html#native##【保护指定的类和类的成员的名称,如果所有指定的类成员出席(在压缩步骤之后)】#-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 *;}-keepclasseswithmembers class * {    public <init>(android.content.Context);}-keepclasseswithmembers class * {    public <init>(android.content.Context, android.util.AttributeSet);}-keepclasseswithmembers class * {    public <init>(android.content.Context, android.util.AttributeSet, int);} # keep setters in Views so that animations can still work.# see http://proguard.sourceforge.net/manual/examples.html#beans-keepclassmembers public class * extends android.view.View {   void set*(***);   *** get*();} # We want to keep methods in Activity that could be used in the XML attribute onClick-keepclassmembers class * extends android.app.Activity {   public void *(android.view.View);}# The support library contains references to newer platform versions.# Don't warn about those in case this app is linking against an older# platform version. We know about them, and they are safe. -keep class * extends android.view.View{*;}-keep class * extends android.app.Dialog{*;}-keep class * implements java.io.Serializable{*;}-keep public class com.glenet.hm.R$*{    public static final int *;}-keep public class yjc.toolkit.R$*{    public static final int *;}-keepclassmembers class com.glenet.hm.R$* {    *;}-keepclassmembers class **.R$* {    *;}####################################################################################用于指定程序中用到的jar文件#(可以看到引用的Library Project不需包含,#因为他们已经在project.properties文件中指定了)。####################################################################################-ignorewarnings-libraryjars libs/android-support-v4.jar-libraryjars libs/mframework.jar-libraryjars libs/ShareSDK-Core-2.3.12.jar-libraryjars libs/ShareSDK-QQ-2.3.12.jar-libraryjars libs/ShareSDK-QZone-2.3.12.jar-libraryjars libs/ShareSDK-Renren-2.3.12.jar-libraryjars libs/ShareSDK-SinaWeibo-2.3.12.jar-libraryjars libs/ShareSDK-TencentWeibo-2.3.12.jar-libraryjars libs/ShareSDK-Wechat-2.3.12.jar-libraryjars libs/ShareSDK-Wechat-Core-2.3.12.jar-libraryjars libs/ShareSDK-Wechat-Moments-2.3.12.jar-libraryjars libs/umeng-analytics-v5.2.3.jar-libraryjars libs/universal-image-loader-1.9.2-SNAPSHOT-with-sources.jar-libraryjars libs/umeng-fb-v4.3.2.jar-libraryjars E:\02_Dev_workspace\workspace\Toolkit.Sqlcipher\libs\guava-r09.jar-libraryjars E:\02_Dev_workspace\workspace\Toolkit.Sqlcipher\libs\commons-codec.jar#-libraryjars libs\guava-r09.jar#-libraryjars libs\commons-codec.jar####################################################################################用于表示保留(不混淆)引用的jar包中的内容。#必須啊  必須啊###################################################################################-keep class android.support.v4.** {*;}-keep class cn.sharesdk.onekeyshare.** {*;}-keep class cn.sharesdk.** {*;}-keep class com.sina.**{*;}-keep class **.R$* {*;}-keep class **.R{*;}-dontwarn cn.sharesdk.**-dontwarn **.R$*-keep class com.umeng.analytics.** {*;}-keep class com.umeng.fb.** {*;}-keep class com.google.common.** {*;}-keep class org.apache.commons.codec.** {*;}-keep class m.framework.** {*;}-keep class com.nostra13.universalimageloader.** {*;}-keep class com.handmark.pulltorefresh.** {*;}#-keep class com.tencent.** {*;}#-dontwarn demo.**#-keep class demo {*;} -dontwarn android.support.v4.**   -dontwarn com.google.common.**  # -dontwarn com.handmark.pulltorefresh.**-keep public class com.umeng.fb.ui.ThreadView {} ####################################################################################用于表示保留本地的bean文件下的实体类不被混淆。###################################################################################-keep class com.glenet.hm.xml.** {*;}####################################################################################保留本地涉及反射的类不被混淆####################################################################################-keep class com.wly.xxx.tool.DbModelUtils{*;}#-keep class com.wly.xxx.tool.JsonUtils{*;}-keep class javax.annotation.**{*;}-keep class java.lang.reflect.**{*;}-keepclassmembers class * {   public <init>(org.json.JSONObject);}####################################################################################处理Web JS与本地原生组件之间的调用过程不被混淆。#####################################################################################-keep class com.wly.xxx.activity.InsuranceQuotesActivity##-keep public class com.wly.xxx.activity.InsuranceQuotesActivity$MyJavaScriptInterface##-keep public class * implements com.wly.xxx.activity.InsuranceQuotesActivity$MyJavaScriptInterface##-keepclassmembers class com.wly.xxx.activity.InsuranceQuotesActivity$MyJavaScriptInterface {##   public *;##       private *;##}


0 0
原创粉丝点击