常用库的混淆

# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in D:\android_studio\sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# 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 *;
#}

-optimizationpasses 5          # 指定代码的压缩级别
-dontusemixedcaseclassnames   # 是否使用大小写混合
-dontpreverify           # 混淆时是否做预校验
-verbose                # 混淆时是否记录日志

-dontpreverify  #预校验
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/*  # 混淆时所采用的算法
#忽略警告
-ignorewarning
#保护代码中的Annotation不被混淆,这在JSON实体映射时非常重要,比如fastJSON
-keepattributes *Annotation*
#抛出异常时保留代码行号
-keepattribtes SourceFile,LineNumberTable

#-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    # 保持哪些类不被混淆
#如果有引用v4包可以添加下面这行
-keep public class * extends android.support.v7.**

-keepclasseswithmembernames class * {  # 保持 native 方法不被混淆
    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 * {     # 保持枚举 enum 类不被混淆
    public static **[] values();
    public static ** valueOf(java.lang.String);
}
-keep class * implements android.os.Parcelable { # 保持 Parcelable 不被混淆
    public static final android.os.Parcelable$Creator *;
}

# for alibaba android hot fix
-keep class * extends java.lang.annotation.Annotation
-keepclasseswithmembernames class * {
    native <methods>;
}

-keep public class javax.**

-keep class * implements java.io.Serializable # 保持 Serializable 不被混淆

# Keep native methods
-keepclassmembers class * {
    native <methods>;
}

# Keep native methods
-keepclassmembers class * {
    native <methods>;
}

-keep public class org.** {*;}
-dontwarn java.awt.**

##################FragmentArgs库不混淆################
#FragmentArgs
-keep class com.hannesdorfmann.fragmentargs.** { *; }
##################fresco库不混淆################
#fresco
-keep class com.facebook.** {*;}
-dontwarn okio.**
-dontwarn com.squareup.okhttp.**
-dontwarn okhttp3.**
-dontwarn javax.annotation.**
-dontwarn com.android.volley.toolbox.**
-dontwarn com.facebook.**
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
    @com.facebook.common.internal.DoNotStrip *;
}
# Works around a bug in the animated GIF module which will be fixed in 0.12.0
-keep class com.facebook.imagepipeline.animated.factory.AnimatedFactoryImpl {
    public AnimatedFactoryImpl(com.facebook.imagepipeline.bitmaps.PlatformBitmapFactory,com.facebook.imagepipeline.core.ExecutorSupplier);
}

##################okhttp库不混淆################
#okhttp
#-keep class com.hbss.http.okhttp.**{*;}
#-keep class okio.**{*;}
#-keep class com.squareup.okhttp.**{*;}
#-keep class okhttp3.**{*;}
#-keep class javax.annotation.**{*;}
#-keep class com.android.volley.toolbox.**{*;}

##################alipay支付宝支付不混淆################
#alipayAdk-20150610.jar
-dontwarn com.alipay.**
-keep class com.alipay.**{*;}
-keep class com.ta.utdid2.**{*;}
-keep class com.ut.device.**{*;}
##################高德地图不混淆################
#AMap_3DMap_V3.2.1_20160225.jar
-dontwarn com.amap.**
-keep class com.amap.api.**{*;}
-keep class com.autonavi.**{*;}
-keep class com.loc.**{*;}
##################eventbus不混淆################
#eventbus.jar
-dontwarn de.greenrobot.event.**
-keep class de.greenrobot.event.**{*;}
#不加会报错,no method call onEvent 
#回调方法不混淆
-keepclassmembers class ** {
    public void onEvent*(**);
    public void onEvent*(**);
    void *(**On*Event); 
}
-keep public class * extends com.hbss.smarterstore.ui.EventBusEvent
-keepclasseswithmembers class * {   # 保持EventBus中接收方法不被混淆
    public void onEventMainThread(*);
}
##################fastjon不混淆################
#fastjon-1.2.5.jar
-dontwarn com.alibaba.**
-keep class com.alibaba.fastjson.**{*;}


#Flame.jar
-dontwarn com.pocketdigi.utils.**
-keep class com.pocketdigi.utils.**{*;}
##################http不混淆################
#httpmime-4.1.3
-dontwarn com.org.apache.http.entity.mime.**
-keep class com.org.apache.http.entity.mime.**{*;}
##################动画库不混淆################
#jzlv.jar
-dontwarn com.twotoasters.jazzylistview.**
-keep class com.twotoasters.jazzylistview.**{*;}

##################权限管理不混淆################
#permissiongen.jar
-dontwarn kr.co.namee.permissiongen.**
-keep class kr.co.namee.permissiongen.**{*;}
-keep public class * extends android.support.v4.app.Fragment {
    private void permission*();
}
##################友盟分享不混淆################
#SocialSDk-email
-dontwarn com.umeng.socialize.**
-keep class com.umeng.socialize.**{*;}
#SocialSDK-QQZone_1;
-dontwarn com.tencent.**
-keep class com.tencent.**{*;}
#SocialSDK-Sina
-dontwarn com.sina.sso.**
-keep class com.sina.sso.**{*;}
##################imageloader不混淆################
#imageloader
-dontwarn com.nostra13.universalimageloader.**
-keep class com.nostra13.universalimageloader.**{*;}
##################zxing扫码库不混淆################
#zxing.jar
-dontwarn com.google.zxing.**
-keep class com.google.zxing.**{*;}

#bugly
-dontwarn com.tencent.bugly.**
-keep public class com.tencent.bugly.**{*;}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值