android——混淆打包
网上搜了一大堆,在此不一一赘诉。
直接讲解了

如上图这么配置,其实就是加上一句话而已。告诉打包工具混淆打包的代码放在./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——混淆打包的更多相关文章
- Android混淆打包配置总结
Android打包失败出现Proguard returned with error code 1. See console的错误 这个问题是由于代码混淆引起的,找不到引用包. 只需在你的proguar ...
- android -------- 混淆打包报错(warning - InnerClass annotations are missing corresponding EnclosingMember annotations)
最近做Android混淆打包遇到一些问题,Android Sdutio 3.1 版本打包的 错误如下: Android studio warning - InnerClass annotations ...
- Android 混淆打包
有些时候我们希望我们自己的apk包不能被别人反编译而获取自己的源代码.这就需要我们通过Android提供的混淆打包技术来完成. 一.没有引用外部包的情况: 这种情况下代码混淆的方式相对简单: 1)只需 ...
- Android 混淆打包不混淆第三方jar包
项目由于要公布,所以要混淆打包. 混淆打包流程: 1.在proguard-project.txt文件里加入不须要混淆的类和第三方的jar包 这个是保持自己包中不须要混淆的类,假设有些类调用了jni ...
- Android混淆打包
一.理论知识 ProGuard是一款免费的Java类文件压缩器.优化器和混淆器.它能发现并删除无用类.字段(field).方法和属性值(attribute).它也能优化字节码并删除无用的指令.最后 ...
- 微信android混淆打包减少安装包大小
首先,感谢微信android团队的分享 微信中的资源混淆工具主要为了混淆资源ID长度(例如将res/drawable/welcome.png混淆为r/s/a.png),同时利用7z深度压缩,大大减少了 ...
- android混淆打包配置(忽略第三方jar)
在project.properties里加上 proguard.config=proguard.cfg proguard.cfg 配置如下: -optimizationpasses 5-dontu ...
- android studio...混淆打包全揭秘
前言,当前android studio使用的版本较新,低版本的如果有差异,或者问题,欢迎拍砖! 1.修改配置文件 找到配置文件,build.gradle,修改如下. signingConfigs ...
- apk混淆打包注意事项
混淆打包搞了好几天才初步了解,其中碰到很多Debug正常,Release的apk不能用,基本都是第三方的jar的问题,所以要排除混淆. 1. Json解析对象出错 用到fastJson或者GJson的 ...
随机推荐
- python - 类的方法
类的方法分为:普通方法. 静态方法和类方法 调用方式 特征 普通方法 由对象去调用执行,属于类 至少一个self,对象调用 静态方法 属于类,但通过类来调用,不依赖于任何对象,方法内部不需要对象封 ...
- WebApi2官网学习记录---JSON与XML的序列化
JSON序列化: WebAPI的默认序列库使用的是Json.NET,可以在Globally中配置使用DataContractJsonSerializer 进行序列化 protected void Ap ...
- idea导入项目出错
在idea导如项目后,总是会报错,每个类都会报错.解决的办法是: 1. 2.添加本地jdk 3.添加项目中的lib包
- .net 判断日期格式yyyy-MM-dd hh:MM:ss的正则表达式
加上引用: using System.Text.RegularExpressions; /// <summary> /// 检查字符串是否是日期格式 /// </sum ...
- C# Winform中DataGridView的DataGridViewCheckBoxColumn CheckBox选中判断
1.DataGridViewCheckBoxColumn CheckBox是否选中 在判断DataGridView中CheckBox选中列的时候,用DataGridViewRow.Cells[0].F ...
- CODEVS 3139 栈练习3
3139 栈练习3 时间限制: 2 s 空间限制: 128000 KB 题目等级 : 黄金 Gold 题目描述 Description 比起第一题,本题加了另外一个操作,访问栈顶元素(编号3,保 ...
- K60的DMA多路脉冲计数
最近在做飞思卡尔的智能车,由于要用到两路脉冲计数,但是由于K60只有3个FTM, 一个分给电机,一个分给舵机,另一个用于正交解码. 所以FTM用不到了,只能另行办法.LPT虽然也可以计数,但是却只能计 ...
- Jquery对选取到的元素显示指定的长度,对于的字符串用“...”显示
$(function() { $(".video_name").each(function() { var s = $(this).text(); $()); }); }); fu ...
- hdu5338 ZZX and Permutations(贪心、线段树)
转载请注明出处: http://www.cnblogs.com/fraud/ ——by fraud ZZX and Permutations Time Limit: 6000/300 ...
- vector的用法总结
Reference Constructors vector Constructs a vector of a specific size or with elements of a specific ...