美文网首页
android项目混淆参考

android项目混淆参考

作者: TMAC_EAH | 来源:发表于2018-03-12 11:42 被阅读0次
    -optimizationpasses 5
    -dontusemixedcaseclassnames
    -dontskipnonpubliclibraryclasses
    -dontpreverify
    -keepattributes InnerClasses
    -dontoptimize
    -dontskipnonpubliclibraryclassmembers
    #如果用到了反射需要加入
    -keepattributes EnclosingMethod
    -keepattributes Signature
    -ignorewarnings
    #------------------------------
    -verbose
    -optimizations !code/simplification/arithmetic,!field/*,!class/merging/*
    -dontskipnonpubliclibraryclassmembers
    -keepclassmembers class fqcn.of.javascript.interface.for.webview{
       public *;
    }
    -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 * extends android.app.backup.BackupAgentHelper
    -keep public class * extends android.preference.Preference
    -keep public class com.android.vending.licensing.ILicensingService
    
    
    -keepclasseswithmembernames class * {
        native <methods>;
    }
    -keepclasseswithmembers class * {
        public <init>(android.content.Context, android.util.AttributeSet);
    }
    -keepclasseswithmembers class * {
        public <init>(android.content.Context, android.util.AttributeSet, int);
    }
    -keepclassmembers class * extends android.app.Activity {
        public void *(android.view.View);
    }
    -keepclassmembers enum * {
    public static **[] values();
        public static ** valueOf(java.lang.String);
    }
    -keep class * implements android.os.Parcelable {
        public static final android.os.Parcelable$Creator *;
    }
    ##不混淆Serializable接口的子类中指定的某些成员变量和方法
    -keepclassmembers class * implements java.io.Serializable {
    static final long serialVersionUID;
    private static final java.io.ObjectStreamField[] serialPersistentFields;
    private void writeObject(java.io.ObjectOutputStream);
    private void readObject(java.io.ObjectInputStream);
    java.lang.Object writeReplace();
    java.lang.Object readResolve();
    }
    
    #保持WEB接口不被混淆
    #-keep class com.meipian.ui.edit.widget.IrichEditor.H5Hepler { *; }
    #-keep class com.meipian.ArticleAty.HtmlHepler { *; }
    #javabean 不能混淆
    -keep class com.meipian.bean.**{*;}
    -keep class com.meipian.domain.**{*;}
    #==========================================
    #不混淆R类里及其所有内部static类中的所有static变量字段
    -keepclassmembers class **.R$* {
    public static <fields>;
    }
    #不混淆第三方jar包中的类
    -dontwarn net.youmi.android.**
    -dontwarn cn.domob.android.**
    -keep class net.youmi.android.** {
    *;
    }
    
    -dontwarn org.xmlpull.**
    -dontwarn com.android.**
    -keep class com.android.** { *; }
    
    #===================bugtags=====================
    -keepattributes LineNumberTable,SourceFile
    -keep class com.bugtags.library.** {*;}
    -dontwarn com.bugtags.library.**
    -keep class io.bugtags.** {*;}
    -dontwarn io.bugtags.**
    -dontwarn org.apache.http.**
    -dontwarn android.net.http.AndroidHttpClient
    #===================bugtags=====================
    -dontusemixedcaseclassnames
    -dontshrink
    -dontoptimize
    -dontwarn com.google.android.maps.**
    -dontwarn android.webkit.WebView
    -dontwarn com.umeng.**
    -dontwarn com.tencent.weibo.sdk.**
    -dontwarn com.facebook.**
    -keep public class javax.**
    -keep public class android.webkit.**
    -dontwarn android.support.v4.**
    -keep enum com.facebook.**
    -keepattributes Exceptions,InnerClasses,Signature
    -keepattributes *Annotation*
    -keepattributes SourceFile,LineNumberTable
    
    -keep public interface com.facebook.**
    -keep public interface com.tencent.**
    -keep public interface com.umeng.socialize.**
    -keep public interface com.umeng.socialize.sensor.**
    -keep public interface com.umeng.scrshot.**
    -keep class com.android.dingtalk.share.ddsharemodule.** { *; }
    -keep public class com.umeng.socialize.* {*;}
    
    
    -keep class com.facebook.**
    -keep class com.facebook.** { *; }
    -keep class com.umeng.scrshot.**
    -keep public class com.tencent.** {*;}
    -keep class com.umeng.socialize.sensor.**
    -keep class com.umeng.socialize.handler.**
    -keep class com.umeng.socialize.handler.*
    -keep class com.umeng.weixin.handler.**
    -keep class com.umeng.weixin.handler.*
    -keep class com.umeng.qq.handler.**
    -keep class com.umeng.qq.handler.*
    -keep class UMMoreHandler{*;}
    -keep class com.tencent.mm.sdk.modelmsg.WXMediaMessage {*;}
    -keep class com.tencent.mm.sdk.modelmsg.** implements   com.tencent.mm.sdk.modelmsg.WXMediaMessage$IMediaObject {*;}
    -keep class im.yixin.sdk.api.YXMessage {*;}
    -keep class im.yixin.sdk.api.** implements im.yixin.sdk.api.YXMessage$YXMessageData{*;}
    -keep class com.tencent.mm.sdk.** {
     *;
    }
    -keep class com.tencent.mm.opensdk.** {
       *;
    }
    -dontwarn twitter4j.**
    -keep class twitter4j.** { *; }
    
    -keep class com.tencent.** {*;}
    -dontwarn com.tencent.**
    -keep public class com.umeng.com.umeng.soexample.R$*{
    public static final int *;
    }
    -keep public class com.linkedin.android.mobilesdk.R$*{
    public static final int *;
    }
    -keepclassmembers enum * {
    public static **[] values();
    public static ** valueOf(java.lang.String);
    }
    
    -keep class com.tencent.open.TDialog$*
    -keep class com.tencent.open.TDialog$* {*;}
    -keep class com.tencent.open.PKDialog
    -keep class com.tencent.open.PKDialog {*;}
    -keep class com.tencent.open.PKDialog$*
    -keep class com.tencent.open.PKDialog$* {*;}
    
    -keep class com.sina.** {*;}
    -dontwarn com.sina.**
    -keep class  com.alipay.share.sdk.** {
       *;
    }
    -keepnames class * implements android.os.Parcelable {
    public static final ** CREATOR;
    }
    
    -keep class com.linkedin.** { *; }
    -keepattributes Signature
    
    ##=============glide配置===============
    -keep public class * implements com.bumptech.glide.module.GlideModule
    -keep public enum com.bumptech.glide.load.resource.bitmap.ImageHeaderParser$** {
      **[] $VALUES;
      public *;
    }
    #-keepresourcexmlelements manifest/application/meta-data@value=GlideModule
    ##=============glide配置===============
    
    
    ##=============GSON配置===============
    -keep public class com.google.gson.**
    -keep public class com.google.gson.** {public private protected *;}
    -keepattributes Signature
    -keepattributes *Annotation*
    ##=============GSON配置===============
    
    
    
    ##=============OKHTTP===============
    -dontwarn com.squareup.okhttp3.**
    -keep class com.squareup.okhttp3.** { *;}
    -dontwarn okio.**
    ##=============OKHTTP配置===============
    
    ##########################保留内部类用例########################
    ##-keep class com.project.mocha_patient.login.FindForgotInfoActivity$ForgetResponse {*;}
    
    -dontwarn android.support.**
    -keep class android.support.** { *; }
    
    -dontwarn org.apache.**
    -keep class org.apache.** { *; }
    
    -keepclassmembers class * {
       public <init> (org.json.JSONObject);
    }
    -keep class org.json.** { *; }
    
    #=========七牛云储存=====
    -keep class com.qiniu.**{*;}
    -keep class com.qiniu.**{public <init>();}
    -ignorewarnings
    #=========七牛云储存=====
    #声明第三方jar包,不用管第三方jar包中的.so文件(如果有)
    #-libraryjars libs/afinal_0.5.1_bin.jar
    -libraryjars libs/android-support-v4.jar
    -libraryjars libs/glide-3.6.1.jar
    -libraryjars libs/gson-2.8.0.jar
    
    -libraryjars libs/converter-gson-2.0.0-beta2_.jar
    #-libraryjars libs/reactive-streams-1.0.0.jar
    -libraryjars libs/retrofit-2.3.0.jar
    #-libraryjars libs/rxandroid-2.0.0.jar
    #-libraryjars libs/rxjava-2.0.0-RC1.jar
    
    -libraryjars libs/okhttp-3.2.0.jar
    -libraryjars libs/okio-1.9.0.jar
    -libraryjars libs/SocialSDK_QQ_Simplify.jar
    -libraryjars libs/SocialSDK_Sina_Simplify.jar
    -libraryjars libs/SocialSDK_Sina_Full.jar
    
    -libraryjars libs/SocialSDK_WeChat_Simplify.jar
    -libraryjars libs/umeng_social_api.jar
    
    -libraryjars libs/umeng_social_net.jar
    -libraryjars libs/umeng-analytics-v6.0.1.jar
    -libraryjars libs/weiboSDKCore_3.1.4.jar
    #========================================================================
    # Retrofit
    -dontwarn retrofit2.**
    -keep class retrofit2.** { *; }
    -dontnote retrofit2.Platform
    -dontwarn retrofit2.Platform$Java8
    -keepattributes Signature
    -keepattributes Exceptions
    #okhttp
    -dontwarn okhttp3.**
    -keep class okhttp3.**{*;}
    
    #okio
    -dontwarn okio.**
    -keep class okio.**{*;}
    
    -dontwarn javax.annotation.**
    # RxJava RxAndroid
    #rx
    #-keep class rx.internal.util.unsafe.** { *; }
    -dontwarn sun.misc.**
    -keepclassmembers class rx.internal.util.unsafe.*ArrayQueue*Field* {
       long producerIndex;
       long consumerIndex;
    }
    -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueProducerNodeRef {
        rx.internal.util.atomic.LinkedQueueNode producerNode;
    }
    -keepclassmembers class rx.internal.util.unsafe.BaseLinkedQueueConsumerNodeRef {
        rx.internal.util.atomic.LinkedQueueNode consumerNode;
    }
    #==============
    -dontusemixedcaseclassnames
        -dontshrink
        -dontoptimize
        -dontwarn com.google.android.maps.**
        -dontwarn android.webkit.WebView
        -dontwarn com.umeng.**
        -dontwarn com.tencent.weibo.sdk.**
        -dontwarn com.facebook.**
        -keep public class javax.**
        -keep public class android.webkit.**
        -dontwarn android.support.v4.**
        -keep enum com.facebook.**
        -keepattributes Exceptions,InnerClasses,Signature
        -keepattributes *Annotation*
        -keepattributes SourceFile,LineNumberTable
    
        -keep public interface com.facebook.**
        -keep public interface com.tencent.**
        -keep public interface com.umeng.socialize.**
        -keep public interface com.umeng.socialize.sensor.**
        -keep public interface com.umeng.scrshot.**
        -keep class com.android.dingtalk.share.ddsharemodule.** { *; }
        -keep public class com.umeng.socialize.* {*;}
    
    
        -keep class com.facebook.**
        -keep class com.facebook.** { *; }
        -keep class com.umeng.scrshot.**
        -keep public class com.tencent.** {*;}
        -keep class com.umeng.socialize.sensor.**
        -keep class com.umeng.socialize.handler.**
        -keep class com.umeng.socialize.handler.*
        -keep class com.umeng.weixin.handler.**
        -keep class com.umeng.weixin.handler.*
        -keep class com.umeng.qq.handler.**
        -keep class com.umeng.qq.handler.*
        -keep class UMMoreHandler{*;}
        -keep class com.tencent.mm.sdk.modelmsg.WXMediaMessage {*;}
        -keep class com.tencent.mm.sdk.modelmsg.** implements   com.tencent.mm.sdk.modelmsg.WXMediaMessage$IMediaObject {*;}
        -keep class im.yixin.sdk.api.YXMessage {*;}
        -keep class im.yixin.sdk.api.** implements im.yixin.sdk.api.YXMessage$YXMessageData{*;}
        -keep class com.tencent.mm.sdk.** {
         *;
        }
        -keep class com.tencent.mm.opensdk.** {
       *;
        }
        -dontwarn twitter4j.**
        -keep class twitter4j.** { *; }
    
        -keep class com.tencent.** {*;}
        -dontwarn com.tencent.**
        -keep public class com.umeng.com.umeng.soexample.R$*{
        public static final int *;
        }
        -keep public class com.linkedin.android.mobilesdk.R$*{
        public static final int *;
            }
        -keepclassmembers enum * {
        public static **[] values();
        public static ** valueOf(java.lang.String);
        }
        -keep class com.tencent.open.TDialog$*
        -keep class com.tencent.open.TDialog$* {*;}
        -keep class com.tencent.open.PKDialog
        -keep class com.tencent.open.PKDialog {*;}
        -keep class com.tencent.open.PKDialog$*
        -keep class com.tencent.open.PKDialog$* {*;}
        -keep class com.sina.** {*;}
        -dontwarn com.sina.**
        -keep class  com.alipay.share.sdk.** {
           *;
        }
    -keep class com.hyphenate.** {*;}
    -dontwarn  com.hyphenate.**
    #-libraryjars libs/android-support-v7-appcompat.jar
    #-libraryjars libs/alicloud-android-sdk-httpdns-1.0.7.jar
    #-libraryjars libs/com.umeng.message_v3.0.6.jar
    #-libraryjars libs/utdid4all-1.1.5_proguard.jar
    
    #-libraryjars libs/android-support-design.jar
    #-libraryjars libs/android-support-v7-cardview.jar
    #-libraryjars libs/recyclerview-v7-23.1.1.jar
    -dontoptimize
    

    相关文章

      网友评论

          本文标题:android项目混淆参考

          本文链接:https://www.haomeiwen.com/subject/zblnfftx.html