-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项目混淆参考
最后编辑于 :
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 之前对项目混淆一直了解不是很透,趁着打包正式项目的时候有特意的去了解了一番,做些记录,备忘! 参考文章 1、and...
- 前言 安全意思比较薄弱,参与负责项目工程代码无混淆代码,究其原因 混淆会导致 App 运行可能出错,不愿深入研究;...
- 项目前段时间要抽取核心功能做成sdk版本,有jar包和apk。牵扯到将项目打包成jar和jar混淆2部分 在ecl...
- 前言 当我们万分努力将项目开发完成之后,提交最后一行代码后,会怎么样?长舒一口气,终于完成了,给自己放一天假,休息...
- eclipse中对Android代码进行混淆操作步骤如下: 首先将project.properties中打开(去掉...