Android常用三方库混淆规则整理(小结)
本篇文章主要介绍了Android三方库混淆规则,分享给大家,具体如下:
基本指令
-optimizationpasses5 -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -ignorewarnings -dontpreverify -verbose -printmappingproguardMapping.txt -optimizations!code/simplification/cast,!field/*,!class/merging/* -keepattributes*Annotation*,InnerClasses -keepattributesSignature -renamesourcefileattributeSourceFile -keepattributesSourceFile,LineNumberTable
Android相关组件
-keeppublicclass*extendsandroid.support.v7.app.AppCompatActivity -keeppublicclass*extendsandroid.app.Application -keeppublicclass*extendsandroid.app.Service -keeppublicclass*extendsandroid.content.BroadcastReceiver -keeppublicclass*extendsandroid.content.ContentProvider -keeppublicclass*extendsandroid.app.backup.BackupAgentHelper -keeppublicclass*extendsandroid.preference.Preference -keeppublicclass*extendsandroid.view.View -keeppublicclasscom.android.vending.licensing.ILicensingService -keepclassandroid.support.**{*;} -keepclasseswithmembernamesclass*{ native; } -keepclassmembersclass*extendsandroid.support.v7.app.AppCompatActivity{ publicvoid*(android.view.View); } -keepclassmembersenum*{*;} -keeppublicclass*extendsandroid.view.View{ ***get*(); voidset*(***); public (android.content.Context); public (android.content.Context,android.util.AttributeSet); public (android.content.Context,android.util.AttributeSet,int); } -keepclasseswithmembersclass*{ public (android.content.Context,android.util.AttributeSet); public (android.content.Context,android.util.AttributeSet,int); } -keepclass*implementsandroid.os.Parcelable{ publicstaticfinalandroid.os.Parcelable$Creator*; } -keepclassmembersclass*implementsjava.io.Serializable{ staticfinallongserialVersionUID; privatestaticfinaljava.io.ObjectStreamField[]serialPersistentFields; privatevoidwriteObject(java.io.ObjectOutputStream); privatevoidreadObject(java.io.ObjectInputStream); java.lang.ObjectwriteReplace(); java.lang.ObjectreadResolve(); } -keepclass**.R$*{ *; } -keepclassmembersclass*{ void*(**On*Event); }
WebView
-keepclassmembersclassfqcn.of.javascript.interface.for.Webview{ public*; } -keepclassmembersclass*extendsandroid.webkit.WebViewClient{ publicvoid*(android.webkit.WebView,java.lang.String,android.graphics.Bitmap); publicboolean*(android.webkit.WebView,java.lang.String); } -keepclassmembersclass*extendsandroid.webkit.WebViewClient{ publicvoid*(android.webkit.WebView,jav.lang.String); }
友盟统计
-keepclasscom.umeng.**{*;} -keepclassmembersclass*{ public(org.json.JSONObject); } -keepclassmembersenum*{ publicstatic**[]values(); publicstatic**valueOf(java.lang.String); } -keeppublicclass[您的应用包名].R$*{ publicstaticfinalint*; }
微信
-keepclasscom.tencent.mm.opensdk.**{*;} -keepclasscom.tencent.wxop.**{*;} -keepclasscom.tencent.mm.sdk.**{*;}
Glide
-keeppublicclass*implementscom.bumptech.glide.module.GlideModule -keeppublicenumcom.bumptech.glide.load.resource.bitmap.ImageHeaderParser$**{ **[]$VALUES; public*; }
极光
-dontoptimize -dontpreverify -dontwarncn.jpush.** -keepclasscn.jpush.**{*;} -keepclass*extendscn.jpush.android.helpers.JPushMessageReceiver{*;} -dontwarncn.jiguang.** -keepclasscn.jiguang.**{*;}
okio
-dontwarnokio.** -keepclassokio.**{*;} -keepinterfaceokio.**{*;}
OkHttp3
-dontwarnokhttp3.** -keepclassokhttp3.**{*;} -keepinterfaceokhttp3.**{*;}
RxJava
-dontwarnsun.misc.** -keepclassmembersclassrx.internal.util.unsafe.*ArrayQueue*Field*{ longproducerIndex; longconsumerIndex; } -keepclassmembersclassrx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef{ rx.internal.util.atomic.LinkedQueueNodeproducerNode; } -keepclassmembersclassrx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef{ rx.internal.util.atomic.LinkedQueueNodeconsumerNode; }
Gson
-keepclasscom.google.gson.stream.**{*;}
Retrofit
-dontwarnretrofit2.** -keepclassretrofit2.**{*;} -keeppublicclass*extendsretrofit2.Converter{*;}
GreenDao
-keepclassmembersclass*extendsorg.greenrobot.greendao.AbstractDao{ publicstaticjava.lang.StringTABLENAME; } -keepclass**$Properties #IfyoudonotuseSQLCipher: -dontwarnorg.greenrobot.greendao.database.** #IfyoudonotuseRx: -dontwarnrx.**
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持毛票票。