网上搜了一大堆,在此不一一赘诉。

直接讲解了

如上图这么配置,其实就是加上一句话而已。告诉打包工具混淆打包的代码放在./proguard-project.txt这里

proguard.config=./proguard-project.txt

进入proguard-project.txt文件

有人说放开上面的注释就可以了。可惜。我没弄懂,低版本好像可以。

# :后面跟的是注释,可以不用看。


-dontwarn android.app.**
-keep class android.app.**{*;}

上面两句话,我用导很多,因为我引用了很多的第三方包。第三方包我们可以不用去混淆。所以,dontwarn 是告诉打包工具,这个包别警告了。 keep是保持包里面的类和方法。

剩下的。就可以从我这里直接拷贝了。

# To enable ProGuard in your project, edit project.properties
# to define the proguard.config property as described in that file.
#
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in ${sdk.dir}/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the ProGuard
# include property in project.properties.
#
# 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 *;
#}
-dontpreverify -repackageclasses '' -allowaccessmodification -optimizations !code/simplification/arithmetic -keepattributes *Annotation* #-dontwarn com.xx.bbb.**
#-keep class com.xx.bbb.** { *;} -dontwarn android.app.**
-keep class android.app.**{*;} -dontwarn android.support.**
-keep class android.support.**{*;} -dontwarn com.tencent.**
-keep class com.tencent.**{*;} -dontwarn org.apache.http.entity.mime.**
-keep class org.apache.http.entity.mime.**{*;} -dontwarn com.newland.**
-keep class com.newland.**{*;} -dontwarn com.umeng.**
-keep class com.umeng.**{*;} -dontwarn com.baidu.location.**
-keep class com.baidu.location.**{*;} -dontwarn com.squareup.picasso.**
-keep class com.squareup.picasso.**{*;} -dontwarn Decoder.**
-keep class Decoder.**{*;} -dontwarn com.quickpos.**
-keep class com.quickpos.**{*;} -dontwarn com.sina.**
-keep class com.sina.**{*;} -dontwarn com.itron.**
-keep class com.itron.**{*;} -dontwarn com.qtpay.qtjni.**
-keep class com.qtpay.qtjni.**{*;} -dontwarn com.hx.messagejar.**
-keep class com.hx.messagejar.**{*;} -dontwarn com.loopj.android.http.**
-keep class com.loopj.android.http.**{*;} -dontwarn com.nostra13.universalimageloader.**
-keep class com.nostra13.universalimageloader.**{*;} -dontwarn com.readystatesoftware.systembartint.**
-keep class com.readystatesoftware.systembartint.**{*;} -dontwarn com.pgyersdk.**
-keep class com.pgyersdk.**{*;} -dontwarn Decoder.**
-keep class Decoder.**{*;} -dontwarn Decoder.**
-keep class Decoder.**{*;} -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.view.View { public <init>(android.content.Context); public <init>(android.content.Context, android.util.AttributeSet); public <init>(android.content.Context, android.util.AttributeSet, int); public void set*(...); } -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet); } -keepclasseswithmembers class * { public <init>(android.content.Context, android.util.AttributeSet, int); } -keepclassmembers class * implements android.os.Parcelable { static android.os.Parcelable$Creator CREATOR; } -keepclassmembers class **.R$* { public static <fields>; }

android——混淆打包的更多相关文章

  1. Android混淆打包配置总结

    Android打包失败出现Proguard returned with error code 1. See console的错误 这个问题是由于代码混淆引起的,找不到引用包. 只需在你的proguar ...

  2. android -------- 混淆打包报错(warning - InnerClass annotations are missing corresponding EnclosingMember annotations)

    最近做Android混淆打包遇到一些问题,Android Sdutio 3.1 版本打包的 错误如下: Android studio warning - InnerClass annotations ...

  3. Android 混淆打包

    有些时候我们希望我们自己的apk包不能被别人反编译而获取自己的源代码.这就需要我们通过Android提供的混淆打包技术来完成. 一.没有引用外部包的情况: 这种情况下代码混淆的方式相对简单: 1)只需 ...

  4. Android 混淆打包不混淆第三方jar包

    项目由于要公布,所以要混淆打包. 混淆打包流程: 1.在proguard-project.txt文件里加入不须要混淆的类和第三方的jar包   这个是保持自己包中不须要混淆的类,假设有些类调用了jni ...

  5. Android混淆打包

    一.理论知识   ProGuard是一款免费的Java类文件压缩器.优化器和混淆器.它能发现并删除无用类.字段(field).方法和属性值(attribute).它也能优化字节码并删除无用的指令.最后 ...

  6. 微信android混淆打包减少安装包大小

    首先,感谢微信android团队的分享 微信中的资源混淆工具主要为了混淆资源ID长度(例如将res/drawable/welcome.png混淆为r/s/a.png),同时利用7z深度压缩,大大减少了 ...

  7. android混淆打包配置(忽略第三方jar)

    在project.properties里加上   proguard.config=proguard.cfg proguard.cfg 配置如下: -optimizationpasses 5-dontu ...

  8. android studio...混淆打包全揭秘

    前言,当前android studio使用的版本较新,低版本的如果有差异,或者问题,欢迎拍砖! 1.修改配置文件 找到配置文件,build.gradle,修改如下.    signingConfigs ...

  9. apk混淆打包注意事项

    混淆打包搞了好几天才初步了解,其中碰到很多Debug正常,Release的apk不能用,基本都是第三方的jar的问题,所以要排除混淆. 1. Json解析对象出错 用到fastJson或者GJson的 ...

随机推荐

  1. 关于IE11

    最近,一个开发代号为Windows Blue的Windows操作系统泄漏到了互联网上,该操作系统的内置浏览器为IE11,本文将介绍一下这个泄漏版的IE11中有哪些关键的新变化和新特性. 预先声明: 本 ...

  2. Struts2.3.16.3 基本9个jar包

    实践证明,Struts2.3.16.3 至少要下面9个Jar包才能正常启动. commons-fileupload-1.3.1.jar commons-logging-1.1.3.jar freema ...

  3. iframe的操作

    获取iframe的window,获取Iframe的document,获取父页面的window,某个环境是否iframe,动态创建iframe 这是demo.html,这个页用iframe嵌入了ifra ...

  4. Server2008R2:由于没有远程桌面授权服务器可以提供许可证,.....错误的解决 ---设计师零张

    一直使用远程桌面连接一台windows2008server服务器,今天突然报错,连不上了:   “由于没有远程桌面授权服务器可以提供许可证,远程会话被中断.请跟服务器管理员联系.”       由于是 ...

  5. 使用grid++report打印选中行

    接上一篇<hibernate+spring+mvc+Easyui框架模式下使用grid++report的总结>对grid++report做进一步开发 先写一下实现流程: 1.默认为全部载入 ...

  6. apache window环境下本地配置虚拟主机

    1.在httpd.conf中去掉如下注释: # Virtual hostsInclude conf/extra/httpd-vhosts.conf 2.在 httpd-vhosts.conf添加内容 ...

  7. Android 文件操作之openFileOutput

    openFileOutput()方法的第一参数用于指定文件名称,不能包含路径分隔符“/” ,如果文件不存在,Android 会自动创建它.创建的文件保存在/data/data/<package ...

  8. MVC4+Springnet+Nhibernate学习系列随笔(一)

    Springnet与asp.net mvc4集成大体步骤 1.首先要在MVC项目中引用的两个程序集(Spring.Web与Spring.Web.Mvc4) 集 2.修改MVC项目的Global.asa ...

  9. 避免ssh断开导致运行命令的终止:screen

    事情是这样的,需要使用ssh登陆服务器,进行工程的编译,结果不知道什么原因ssh出现write failed:broken pipe,掉线了.反复实验了好几次还是这样(白花花的时间啊,又是config ...

  10. linux系统下svn服务器操作命令

    linux系统下svn服务器操作命令 .输出指定文件或URL的内容.  svncat 目标[@版本]…如果指定了版本,将从指定的版本开始查找. svncat -r PREV filename > ...