Android开发中混淆代码总结
为了防止自己的劳动成果被别人窃取,混淆代码能有效防止被反编译,也避免别人二次打包,下面来总结以下混淆代码的步骤:
语法
-include {filename} 从给定的文件中读取配置参数
-basedirectory {directoryname} 指定基础目录为以后相对的档案名称
-injars {class_path} 指定要处理的应用程序jar,war,ear和目录
-outjars {class_path} 指定处理完后要输出的jar,war,ear和目录的名称
-libraryjars {classpath} 指定要处理的应用程序jar,war,ear和目录所需要的程序库文件
-dontskipnonpubliclibraryclasses 指定不去忽略非公共的库类。
-dontskipnonpubliclibraryclassmembers 指定不去忽略包可见的库类的成员。
保留选项
-keep {Modifier} {class_specification} 保护指定的类文件和类的成员
-keepclassmembers {modifier} {class_specification} 保护指定类的成员,如果此类受到保护他们会保护的更好
-keepclasseswithmembers {class_specification} 保护指定的类和类的成员,但条件是所有指定的类和类成员是要存在。
-keepnames {class_specification} 保护指定的类和类的成员的名称(如果他们不会压缩步骤中删除)
-keepclassmembernames {class_specification} 保护指定的类的成员的名称(如果他们不会压缩步骤中删除)
-keepclasseswithmembernames {class_specification} 保护指定的类和类的成员的名称,如果所有指定的类成员出席(在压缩步骤之后)
-printseeds {filename} 列出类和类的成员-keep选项的清单,标准输出到给定的文件
压缩
-dontshrink 不压缩输入的类文件
-printusage {filename}
-whyareyoukeeping {class_specification}
优化
-dontoptimize 不优化输入的类文件
-assumenosideeffects {class_specification} 优化时假设指定的方法,没有任何副作用
-allowaccessmodification 优化时允许访问并修改有修饰符的类和类的成员
混淆
-dontobfuscate 不混淆输入的类文件
-printmapping {filename}
-applymapping {filename} 重用映射增加混淆
-obfuscationdictionary {filename} 使用给定文件中的关键字作为要混淆方法的名称
-overloadaggressively 混淆时应用侵入式重载
-useuniqueclassmembernames 确定统一的混淆类的成员名称来增加混淆
-flattenpackagehierarchy {package_name} 重新包装所有重命名的包并放在给定的单一包中
-repackageclass {package_name} 重新包装所有重命名的类文件中放在给定的单一包中
-dontusemixedcaseclassnames 混淆时不会产生形形色色的类名
-keepattributes {attribute_name,...} 保护给定的可选属性,例如LineNumberTable, LocalVariableTable, SourceFile, Deprecated, Synthetic, Signature, and
InnerClasses.
-renamesourcefileattribute {string} 设置源文件中给定的字符串常量
下面是我项目中用到的实例Dmeo:
proguard-project.txt
-keepclassmembers class fqcn.of.javascript.interface.for.webview {
public *;
}
-optimizationpasses 5
-dontusemixedcaseclassnames
-dontskipnonpubliclibraryclasses
-dontpreverify
-verbose
-optimizations !code/simplification/arithmetic,!field/,!class/merging/
-libraryjars libs/XUtils.jar
-libraryjars libs/android-support-v4.jar
-libraryjars libs/umeng-analytics-v5.6.4.jar
-libraryjars libs/AMap_Location_v2.0.0_20151117.jar
-libraryjars libs/AMap_Search_v2.6.0_20150914.jar
-libraryjars libs/Android_Map_V2.7.20151124.jar
-libraryjars libs/eventbus.jar
-libraryjars libs/gson-2.5.jar
-libraryjars libs/jpush-android-2.1.0.jar
-libraryjars libs/libammsdk.jar
-libraryjars libs/nineoldandroids.jar
-libraryjars libs/universal-image-loader-1.9.4-with-sources.jar
-libraryjars libs/alipaySdk-20160223.jar
-libraryjars ..\multi-image-selector
-libraryjars ..\cardview_v7
-libraryjars ..\library_zhy_StickyNavLayout
-libraryjars ..\recyclerview_V7
-libraryjars ..\library
-libraryjars ..\ViewpagerIndicator_lib
-libraryjars ..\ShareSDK
-libraryjars ..\multi-image-selector
-libraryjars ../Http
-libraryjars ../DanMuLib
-libraryjars ..\xlistview_lib
-keep class com.alipay.android.app.IAlixPay{*;}
-keep class com.alipay.android.app.IAlixPay Stub∗;−keepclasscom.alipay.android.app.IRemoteServiceCallback∗;−keepclasscom.alipay.android.app.IRemoteServiceCallback Stub{*;}
-keep class com.alipay.sdk.app.PayTask{ public *;}
-keep class com.alipay.sdk.app.AuthTask{ public *;}
-dontwarn cn.sharesdk.tencent.qq.**
-keep class cn.sharesdk.tencent.qq.* { ;}
-dontwarn com.umeng.analytics.**
-keep class com.umeng.analytics.* { ;}
-dontwarn com.umeng.analytics.social.**
-keep class com.umeng.analytics.social.* { ;}
-dontwarn cn.sharesdk.sina.weibo.**
-keep class cn.sharesdk.sina.weibo.* { ;}
-dontwarn u.aly.**
-keep class u.aly.* { ;}
-dontwarn com.sina.sso.**
-keep class com.sina.sso.* { ;}
-dontwarn cn.sharesdk.wechat.utils.**
-keep class cn.sharesdk.wechat.utils.* { ;}
-dontwarn com.alibaba.fastjson.**
-keep class com.alibaba.fastjson.* { ;}
-dontwarn com.alibaba.fastjson.annotation.**
-keep class com.alibaba.fastjson.annotation.* { ;}
-dontwarn com.alibaba.fastjson.asm.**
-keep class com.alibaba.fastjson.asm.* { ;}
-dontwarn com.alibaba.fastjson.codegen.**
-keep class com.alibaba.fastjson.codegen.* { ;}
-dontwarn com.alibaba.fastjson.parser.**
-keep class com.alibaba.fastjson.parser.* { ;}
-dontwarn com.alibaba.fastjson.parser.deserializer.**
-keep class com.alibaba.fastjson.parser.deserializer.* { ;}
-dontwarn com.alibaba.fastjson.serializer.**
-keep class com.alibaba.fastjson.serializer.* { ;}
-dontwarn com.alibaba.fastjson.support.spring.**
-keep class com.alibaba.fastjson.support.spring.* { ;}
-dontwarn com.alibaba.fastjson.util.**
-keep class com.alibaba.fastjson.util.* { ;}
-dontwarn com.google.gson.**
-keep class com.google.gson.* { ;}
-dontwarn com.google.gson.annotations.**
-keep class com.google.gson.annotations.* { ;}
-dontwarn com.google.gson.internal.**
-keep class com.google.gson.internal.* { ;}
-dontwarn com.google.gson.internal.bind.**
-keep class com.google.gson.internal.bind.* { ;}
-dontwarn com.google.gson.internal.bind.util.**
-keep class com.google.gson.internal.bind.util.* { ;}
-dontwarn com.google.gson.reflect.**
-keep class com.google.gson.reflect.* { ;}
-dontwarn com.google.gson.stream.**
-keep class com.google.gson.stream.* { ;}
-dontwarn com.lidroid.xutils.**
-keep class com.lidroid.xutils.* { ;}
-dontwarn com.lidroid.xutils.bitmap.**
-keep class com.lidroid.xutils.bitmap.* { ;}
-dontwarn com.lidroid.xutils.bitmap.callback.**
-keep class com.lidroid.xutils.bitmap.callback.* { ;}
-dontwarn com.lidroid.xutils.bitmap.core.**
-keep class com.lidroid.xutils.bitmap.core.* { ;}
-dontwarn com.lidroid.xutils.bitmap.download.**
-keep class com.lidroid.xutils.bitmap.download.* { ;}
-dontwarn com.lidroid.xutils.bitmap.factory.**
-keep class com.lidroid.xutils.bitmap.factory.* { ;}
-dontwarn com.lidroid.xutils.cache.**
-keep class com.lidroid.xutils.cache.* { ;}
-dontwarn com.lidroid.xutils.db.**
-keep class com.lidroid.xutils.db.* { ;}
-dontwarn com.lidroid.xutils.db.annotation.**
-keep class com.lidroid.xutils.db.annotation.* { ;}
-dontwarn com.lidroid.xutils.db.converter.**
-keep class com.lidroid.xutils.db.converter.* { ;}
-dontwarn com.lidroid.xutils.db.sqlite.**
-keep class com.lidroid.xutils.db.sqlite.* { ;}
-dontwarn com.lidroid.xutils.db.table.**
-keep class com.lidroid.xutils.db.table.* { ;}
-dontwarn com.lidroid.xutils.exception.**
-keep class com.lidroid.xutils.exception.* { ;}
-dontwarn com.lidroid.xutils.http.**
-keep class com.lidroid.xutils.http.* { ;}
-dontwarn com.lidroid.xutils.http.callback.**
-keep class com.lidroid.xutils.http.callback.* { ;}
-dontwarn com.lidroid.xutils.http.client.**
-keep class com.lidroid.xutils.http.client.* { ;}
-dontwarn com.lidroid.xutils.http.client.entity.**
-keep class com.lidroid.xutils.http.client.entity.* { ;}
-dontwarn com.lidroid.xutils.http.client.multipart.**
-keep class com.lidroid.xutils.http.client.multipart.* { ;}
-dontwarn com.lidroid.xutils.http.client.multipart.content.**
-keep class com.lidroid.xutils.http.client.multipart.content.* { ;}
-dontwarn com.lidroid.xutils.http.client.util.**
-keep class com.lidroid.xutils.http.client.util.* { ;}
-dontwarn com.lidroid.xutils.task.**
-keep class com.lidroid.xutils.task.* { ;}
-dontwarn com.lidroid.xutils.util.**
-keep class com.lidroid.xutils.util.* { ;}
-dontwarn com.lidroid.xutils.view.**
-keep class com.lidroid.xutils.view.* { ;}
-dontwarn com.lidroid.xutils.view.annotation.**
-keep class com.lidroid.xutils.view.annotation.* { ;}
-dontwarn com.lidroid.xutils.view.annotation.event.**
-keep class com.lidroid.xutils.view.annotation.event.* { ;}
-dontwarn com.mob.tools.**
-keep class com.mob.tools.* { ;}
-dontwarn com.mob.tools.gui.**
-keep class com.mob.tools.gui.* { ;}
-dontwarn com.mob.tools.network.**
-keep class com.mob.tools.network.* { ;}
-dontwarn com.mob.tools.utils.**
-keep class com.mob.tools.utils.* { ;}
-dontwarn android.support.v7.widget.**
-keep class android.support.v7.widget.* { ;}
-dontwarn android.support.v7.widget.**
-keep class android.support.v7.widget.* { ;}
-dontwarn com.squareup.picasso.**
-keep class com.squareup.picasso.* { ;}
-dontwarn com.nostra13.universalimageloader.**
-keep class com.nostra13.universalimageloader.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.disc.impl.ext.**
-keep class com.nostra13.universalimageloader.cache.disc.impl.ext.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.disc.impl.**
-keep class com.nostra13.universalimageloader.cache.disc.impl.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.disc.**
-keep class com.nostra13.universalimageloader.cache.disc.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.memory.impl.**
-keep class com.nostra13.universalimageloader.cache.memory.impl.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.memory.**
-keep class com.nostra13.universalimageloader.cache.memory.* { ;}
-dontwarn com.nostra13.universalimageloader.cache.**
-keep class com.nostra13.universalimageloader.cache.* { ;}
-dontwarn com.nostra13.universalimageloader.core.assist.deque.**
-keep class com.nostra13.universalimageloader.core.assist.deque.* { ;}
-dontwarn com.nostra13.universalimageloader.core.assist.**
-keep class com.nostra13.universalimageloader.core.assist.* { ;}
-dontwarn com.nostra13.universalimageloader.core.decode.**
-keep class com.nostra13.universalimageloader.core.decode.* { ;}
-dontwarn com.nostra13.universalimageloader.core.display.**
-keep class com.nostra13.universalimageloader.core.display.* { ;}
-dontwarn com.nostra13.universalimageloader.core.download.**
-keep class com.nostra13.universalimageloader.core.download.* { ;}
-dontwarn com.nostra13.universalimageloader.core.imageaware.**
-keep class com.nostra13.universalimageloader.core.imageaware.* { ;}
-dontwarn com.nostra13.universalimageloader.core.listener.**
-keep class com.nostra13.universalimageloader.core.listener.* { ;}
-dontwarn com.nostra13.universalimageloader.core.process.**
-keep class com.nostra13.universalimageloader.core.process.* { ;}
-dontwarn com.nostra13.universalimageloader.core.**
-keep class com.nostra13.universalimageloader.core.* { ;}
-dontwarn com.nostra13.universalimageloader.utils.**
-keep class com.nostra13.universalimageloader.utils.* { ;}
-dontwarn com.nostra13.universalimageloader.**
-keep class com.nostra13.universalimageloader.* { ;}
-dontwarn com.nineoldandroids.**
-keep class com.nineoldandroids.* { ;}
-dontwarn com.nineoldandroids.animation.**
-keep class com.nineoldandroids.animation.* { ;}
-dontwarn com.nineoldandroids.util.**
-keep class com.nineoldandroids.util.* { ;}
-dontwarn com.nineoldandroids.view.**
-keep class com.nineoldandroids.view.* { ;}
-dontwarn com.nineoldandroids.view.animation.**
-keep class com.nineoldandroids.view.animation.* { ;}
-dontwarn de.greenrobot.event.**
-keep class de.greenrobot.event.* { ;}
-dontwarn de.greenrobot.event.util.**
-keep class de.greenrobot.event.util.* { ;}
-dontwarn com.alipay.a.a.**
-keep class com.alipay.a.a.* { ;}
-dontwarn com.alipay.a.b.**
-keep class com.alipay.a.b.* { ;}
-dontwarn com.alipay.android.app.**
-keep class com.alipay.android.app.* { ;}
-dontwarn com.alipay.android.phone.mrpc.core.a.**
-keep class com.alipay.android.phone.mrpc.core.a.* { ;}
-dontwarn com.alipay.android.phone.mrpc.core.**
-keep class com.alipay.android.phone.mrpc.core.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.a.a.**
-keep class com.alipay.apmobilesecuritysdk.a.a.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.a.**
-keep class com.alipay.apmobilesecuritysdk.a.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.b.**
-keep class com.alipay.apmobilesecuritysdk.b.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.c.**
-keep class com.alipay.apmobilesecuritysdk.c.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.d.**
-keep class com.alipay.apmobilesecuritysdk.d.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.e.**
-keep class com.alipay.apmobilesecuritysdk.e.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.f.**
-keep class com.alipay.apmobilesecuritysdk.f.* { ;}
-dontwarn com.alipay.apmobilesecuritysdk.face.**
-keep class com.alipay.apmobilesecuritysdk.face.* { ;}
-dontwarn com.alipay.mobile.framework.service.annotation.**
-keep class com.alipay.mobile.framework.service.annotation.* { ;}
-dontwarn com.alipay.mobilesecuritysdk.face.**
-keep class com.alipay.mobilesecuritysdk.face.* { ;}
-dontwarn com.alipay.sdk.**
-keep class com.alipay.sdk.* { ;}
-dontwarn com.alipay.sdk.app.**
-keep class com.alipay.sdk.app.* { ;}
-dontwarn com.alipay.sdk.app.statistic.**
-keep class com.alipay.sdk.app.statistic.* { ;}
-dontwarn com.alipay.sdk.auth.**
-keep class com.alipay.sdk.auth.* { ;}
-dontwarn com.alipay.sdk.authjs.**
-keep class com.alipay.sdk.authjs.* { ;}
-dontwarn com.alipay.sdk.cons.**
-keep class com.alipay.sdk.cons.* { ;}
-dontwarn com.alipay.sdk.data.**
-keep class com.alipay.sdk.data.* { ;}
-dontwarn com.alipay.sdk.encrypt.**
-keep class com.alipay.sdk.encrypt.* { ;}
-dontwarn com.alipay.sdk.net.**
-keep class com.alipay.sdk.net.* { ;}
-dontwarn com.alipay.sdk.packet.impl.**
-keep class com.alipay.sdk.packet.impl.* { ;}
-dontwarn com.alipay.sdk.packet.**
-keep class com.alipay.sdk.packet.* { ;}
-dontwarn com.alipay.sdk.protocol.**
-keep class com.alipay.sdk.protocol.* { ;}
-dontwarn com.alipay.sdk.sys.**
-keep class com.alipay.sdk.sys.* { ;}
-dontwarn com.alipay.sdk.tid.**
-keep class com.alipay.sdk.tid.* { ;}
-dontwarn com.alipay.sdk.util.**
-keep class com.alipay.sdk.util.* { ;}
-dontwarn com.alipay.sdk.widget.**
-keep class com.alipay.sdk.widget.* { ;}
-dontwarn com.alipay.security.mobile.module.a.**
-keep class com.alipay.security.mobile.module.a.* { ;}
-dontwarn com.alipay.security.mobile.module.a.a.**
-keep class com.alipay.security.mobile.module.a.a.* { ;}
-dontwarn com.alipay.security.mobile.module.a.b.**
-keep class com.alipay.security.mobile.module.a.b.* { ;}
-dontwarn com.alipay.security.mobile.module.a.c.**
-keep class com.alipay.security.mobile.module.a.c.* { ;}
-dontwarn com.alipay.security.mobile.module.commonutils.**
-keep class com.alipay.security.mobile.module.commonutils.* { ;}
-dontwarn com.alipay.security.mobile.module.commonutils.constants.**
-keep class com.alipay.security.mobile.module.commonutils.constants.* { ;}
-dontwarn com.alipay.security.mobile.module.commonutils.crypto.**
-keep class com.alipay.security.mobile.module.commonutils.crypto.* { ;}
-dontwarn com.alipay.security.mobile.module.deviceinfo.**
-keep class com.alipay.security.mobile.module.deviceinfo.* { ;}
-dontwarn com.alipay.security.mobile.module.deviceinfo.constant.**
-keep class com.alipay.security.mobile.module.deviceinfo.constant.* { ;}
-dontwarn com.alipay.security.mobile.module.deviceinfo.listener.**
-keep class com.alipay.security.mobile.module.deviceinfo.listener.* { ;}
-dontwarn com.alipay.security.mobile.module.localstorage.**
-keep class com.alipay.security.mobile.module.localstorage.* { ;}
-dontwarn com.alipay.security.mobile.module.localstorage.util.**
-keep class com.alipay.security.mobile.module.localstorage.util.* { ;}
-dontwarn com.alipay.tscenter.biz.rpc.deviceFp.**
-keep class com.alipay.tscenter.biz.rpc.deviceFp.* { ;}
-dontwarn com.alipay.tscenter.biz.rpc.vkeydfp.**
-keep class com.alipay.tscenter.biz.rpc.vkeydfp.* { ;}
-dontwarn com.alipay.tscenter.biz.rpc.vkeydfp.request.**
-keep class com.alipay.tscenter.biz.rpc.vkeydfp.request.* { ;}
-dontwarn com.alipay.tscenter.biz.rpc.vkeydfp.result.**
-keep class com.alipay.tscenter.biz.rpc.vkeydfp.result.* { ;}
-dontwarn com.ut.device.**
-keep class com.ut.device.* { ;}
-dontwarn com.ta.utdid2.aid.**
-keep class com.ta.utdid2.aid.* { ;}
-dontwarn com.ta.utdid2.android.utils.**
-keep class com.ta.utdid2.android.utils.* { ;}
-dontwarn com.ta.utdid2.core.persistent.**
-keep class com.ta.utdid2.core.persistent.* { ;}
-dontwarn com.ta.utdid2.device.**
-keep class com.ta.utdid2.device.* { ;}
-dontwarn org.json.alipay.**
-keep class org.json.alipay.* { ;}
-dontwarn cn.sharesdk.tencent.qzone.**
-keep class cn.sharesdk.tencent.qzone.* { ;}
-dontwarn com.example.sharesdk.**
-keep class com.example.sharesdk.* { ;}
-dontwarn onekeyshare.**
-keep class onekeyshare.* { ;}
-dontwarn cn.sharesdk.framework.**
-keep class cn.sharesdk.framework.* { ;}
-dontwarn cn.sharesdk.wechat.favorite.**
-keep class cn.sharesdk.wechat.favorite.* { ;}
-dontwarn cn.sharesdk.wechat.moments.**
-keep class cn.sharesdk.wechat.moments.* { ;}
-dontwarn cn.sharesdk.wechat.friends.**
-keep class cn.sharesdk.wechat.friends.* { ;}
-dontwarn cn.sharesdk.wechat.utils.**
-keep class cn.sharesdk.wechat.utils.* { ;}
-dontwarn cn.sharesdk.tencent.qq.**
-keep class cn.sharesdk.tencent.qq.* { ;}
-dontwarn cn.sharesdk.sina.weibo.**
-keep class cn.sharesdk.sina.weibo.* { ;}
-dontwarn com.sina.**
-keep class com.sina.* { ;}
-dontwarn master.flame.danmaku.controller.**
-keep class master.flame.danmaku.controller.* {;}
-dontwarn master.flame.danmaku.danmaku.**
-keep class master.flame.danmaku.danmaku.* {;}
-dontwarn master.flame.danmaku.ui.widget..
-keep class master.flame.danmaku.ui.widget.* {;}
-dontwarn master.flame.danmaku.**
-keep class master.flame.danmaku.* {;}
-dontwarn tv.cjump.jni.**
-keep class tv.cjump.jni.* {;}
-keep class cn.sharesdk.*{;}
-keep class com.sina.*{;}
-keep class *.R$ {*;}
-keep class *.R{;}
-keep class onekeyshare.themes.classic.*{;}
-keep class onekeyshare.*{;}
-dontwarn cn.sharesdk.**
-dontwarn *.R$
-dontoptimize
-dontpreverify
-dontwarn cn.jpush.**
-keep class cn.jpush.* { ; }
-dontwarn com.google.**
-keep class com.google.gson.* {;}
-dontwarn com.google.**
-keep class com.google.protobuf.* {;}
-keepattributes Annotation
-keepattributes Signature
-keep public class * extends android.app.Activity
-keep public class * extends android.app.Application
-keep public class * extends android.app.Fragment
-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
-keep class com.hnw.hainiaowo.R$* {*;}
-keep class android.support.*{;}
-dontwarn android.support.**
-keepclassmembers class * {
public (org.json.JSONObject);
}
-keep public class com.hnw.hainiaowo.R$*{
public static final int *;
}
-keep class com.amap.api.mapcore.**{*;}
-keep class com.amap.api.maps.**{*;}
-keep class com.autonavi.amap.mapcore.*{*;}
-keep class com.amap.api.location.*{;}
-keep class com.amap.api.fence.*{;}
-keep class com.autonavi.aps.amapapi.model.*{;}
-keep class com.amap.api.services.*{;}
-keep class com.amap.api.maps2d.*{;}
-keep class com.amap.api.mapcore2d.*{;}
-keep class com.amap.api.navi.*{;}
-keep class com.autonavi.*{;}
-keep class com.tencent.mm.sdk.** {
*;
}
-dontwarn android.support.v7.cardview.**
-dontwarn com.zhy.view.**
-keep class com.zhy.view.* {;}
-dontwarn me.nereo.multi_image_selector.**
-keep class me.nereo.multi_image_selector.* {;}
-keep class me.nereo.multi_image_selector.adapter.* {;}
-keep class me.nereo.multi_image_selector.bean.* {;}
-keep class me.nereo.multi_image_selector.utils.* {;}
-keep class me.nereo.multi_image_selector.view.* {;}
-keep class me.nereo.multi_image_selector.adapter.* {;}
-dontwarn com.handmark.pulltorefresh.library.**
-keep class com.handmark.pulltorefresh.library.* {;}
-keep class com.handmark.pulltorefresh.library.extras.* {;}
-keep class com.handmark.pulltorefresh.library.internal.* {;}
-dontwarn android.support.v7.recyclerview.**
-dontwarn com.viewpagerindicator.**
-keep class com.viewpagerindicator.* {;}
-dontwarn me.maxwin.**
-keep class me.maxwin.* {;}
-keep class me.maxwin.view.* {;}
-dontwarn com.hainiaowo.http.**
-keep class com.hainiaowo.http.activity.* {;}
-keep class com.hainiaowo.http.* {;}
-keep class com.hainiaowo.http.base.* {;}
-keep class com.hainiaowo.http.app.* {;}
-keep class com.hainiaowo.http.rq.* {;}
-keep class com.hainiaowo.http.util.* {;}
-keepclasseswithmembernames class * { # 保持 native 方法不被混淆
native ;
}
-keepclasseswithmembers class * { # 保持自定义控件类不被混淆
public (android.content.Context, android.util.AttributeSet);
}
-keepclasseswithmembers class * {
public (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 *;
}
-keepclassmembers class ** {
public void onEvent*(**);
}
#Only required if you use AsyncExecutor
-keepclassmembers class * extends de.greenrobot.event.util.ThrowableFailureEvent {
(java.lang.Throwable);
}
-dontwarn com.lidroid.xutils.**
-keep class com.lidroid.xutils.*{;}
-keep class com.hnw.hainiaowo.entity.* { ;}
这是project.properties种的内容
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target.
target=android-19
android.library=false
android.library.reference.3=..\cardview_v7
android.library.reference.4=..\recyclerview_V7
android.library.reference.1=..\library_zhy_StickyNavLayout
android.library.reference.2=..\ViewpagerIndicator_lib
android.library.reference.6=..\multi-image-selector
android.library.reference.5=..\Http
android.library.reference.7=..\ShareSDK
android.library.reference.8=../DanMuLib
android.library.reference.10=../Xlistview_lib/xlistview_lib
android.library.reference.9=../library