Android混淆打包
一、理论知识
proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# This is a configuration file for ProGuard. # http://proguard.sourceforge.net/index.html#manual/usage.html -dontusemixedcaseclassnames -dontskipnonpubliclibraryclasses -verbose # Optimization is turned off by default. Dex does not like code run # through the ProGuard optimize and preverify steps (and performs some # of these optimizations on its own). -dontoptimize -dontpreverify # Note that if you want to enable optimization, you cannot just # include optimization flags in your own project configuration file; # instead you will need to point to the # "proguard-android-optimize.txt" file instead of this one from your # project.properties file. -keepattributes *Annotation* -keep public class com.google.vending.licensing.ILicensingService -keep public class com.android.vending.licensing.ILicensingService # For native methods, see http://proguard.sourceforge.net/manual/examples.html#native -keepclasseswithmembernames class * { native <methods>; } # keep setters in Views so that animations can still work. # see http://proguard.sourceforge.net/manual/examples.html#beans -keepclassmembers public class * extends android.view.View { void set*(***); *** get*(); } # We want to keep methods in Activity that could be used in the XML attribute onClick -keepclassmembers class * extends android.app.Activity { public void *(android.view.View); } # For enumeration classes, see http://proguard.sourceforge.net/manual/examples.html#enumerations -keepclassmembers enum * { public static **[] values(); public static ** valueOf(java.lang.String); } -keep class * implements android.os.Parcelable { public static final android.os.Parcelable$Creator *; } -keepclassmembers class **.R$* { public static <fields>; } # The support library contains references to newer platform versions. # Don't warn about those in case this app is linking against an older # platform version. We know about them, and they are safe. -dontwarn android.support.**
以下则个是我们项目混淆的个性化配置文件proguard-project.txt
# 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 *;
#}
-renamesourcefileattribute SourceFile
-keepattributes SourceFile,LineNumberTable
-dontwarn android.**
-dontwarn edu.edut.lsf.payment.link.**
-libraryjars ..\Download_Install\lib\classes.jar
-keep class org.jboss.netty.util.internal.AtomicFieldUpdaterUtil
-keep class org.jboss.netty.util.internal.AtomicFieldUpdaterUtil$Node
-keep class org.jboss.netty.util.internal.LinkedTransferQueue$Node
-keep class edu.edut.robin.activities.LeWebJsActivity$AppStoreInterface
-keepclasseswithmembers class * {
public static void main(java.lang.String[]);
}
-keepclasseswithmembers class org.jboss.netty.util.internal.AtomicFieldUpdaterUtil$Node {
*;
}
-keepclasseswithmembers class edu.edut.robin.activities.LeWebActionActivity$AppstoreWebInterface {
*;
}
-keepclasseswithmembers class edu.edut.robin.utils.SilentInstallAssistant$* {
*;
}
-keepclasseswithmembers class edu.edut.robin.silentinstaller.utils.SilentInstallAssistant$* {
*;
}
-keepclasseswithmembers class edu.edut.robin.utils.Pm$* {
*;
}
-keepclasseswithmembers class org.jboss.netty.util.internal.LinkedTransferQueue {
volatile transient org.jboss.netty.util.internal.LinkedTransferQueue$Node head;
volatile transient org.jboss.netty.util.internal.LinkedTransferQueue$Node tail;
volatile transient int sweepVotes;
}
-keepclasseswithmembers class org.jboss.netty.util.internal.LinkedTransferQueue$Node {
*;
}
-keepclasseswithmembers class edu.edut.robin.activities.LeWebJsActivity$AppStoreInterface {
*;
}
-keepclasseswithmembers class * extends edu.edut.lsf.payment.WebSubmitInterface {
*;
}
-keepclasseswithmembers class edu.edut.lsf.payment.WebSubmitInterface {
*;
}
-keep public class com.unionpay.** {*; }
-keep public class edu.edut.lsf.** {*; }
注:由于牵扯到保密的问题,一些关于项目的东西换成了edu.edut或edu.edut.robin
volatile transient org.jboss.netty.util.internal.LinkedTransferQueue$Node head;
volatile transient org.jboss.netty.util.internal.LinkedTransferQueue$Node tail;
volatile transient int sweepVotes;
}
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——混淆打包
网上搜了一大堆,在此不一一赘诉. 直接讲解了 如上图这么配置,其实就是加上一句话而已.告诉打包工具混淆打包的代码放在./proguard-project.txt这里 proguard.config=. ...
- Android 混淆打包
有些时候我们希望我们自己的apk包不能被别人反编译而获取自己的源代码.这就需要我们通过Android提供的混淆打包技术来完成. 一.没有引用外部包的情况: 这种情况下代码混淆的方式相对简单: 1)只需 ...
- Android 混淆打包不混淆第三方jar包
项目由于要公布,所以要混淆打包. 混淆打包流程: 1.在proguard-project.txt文件里加入不须要混淆的类和第三方的jar包 这个是保持自己包中不须要混淆的类,假设有些类调用了jni ...
- 微信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的 ...
随机推荐
- MVC 上传 下载
[上传]带进度条 view 注:添加easyui的js文件 <script type="text/javascript"> function fileSelected ...
- 鼠绘漫画 for wp8.1
技术规格总结: 这个APP 总体上是下载图片的一个APP 所以对图片的查看&控制上需要一定功力,至少有一个稳定的缩小,放大的图片控件. 搭载WP系统的手机,内存上大部分不是很大,所以内存的控制 ...
- 添加到SQLAgentReaderRole角色后报拒绝SELECT权限
最近有点大意,同事需要查看作业的权限,"理所当然"就将对应登录名添加到SQLAgentReaderRole角色. msdb的SQLAgentReaderRole数据库角色的成员继承 ...
- 《机电传动控制》PLC仿真
1.红绿灯 经仿真,可以完成所设定的要求.对比普通的红绿灯,知识加了X25和X20的控制,来控制夜间模式 . 2.传送带 经仿真,可以完成所设定的要求. 总结:这两个仿真都是亲自完成,感觉难度有些大. ...
- Mongodb在windows下的安装和启动
在windows下安装的参考官方地址:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-windows/ Mongodb的安装与启 ...
- C#下没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG))
C#下没有注册类 (异常来自 HRESULT:0x80040154 (REGDB_E_CLASSNOTREG)) 原因:没有原生支持64位,而是以32位兼容方式运行 解决办法:在项目属性里设置“生成” ...
- sed处理文本文件
SQL文件处理在以select 开通的行的上一行添加 explain analyze 并写入文本(-i)sed -i '/^select/i\explain analyze' test_load2.l ...
- Python字符串格式化
一.使用格式化符来格式化字符串: Python支持的所有格式化符 格式化符 意义 'd' 返回要格式化对象的十进制表示,如果可以 'i' 返回要格式化对象的十进制表示,如果可以 'o' 返回要格式化对 ...
- Java Web开发中MVC设计模式简介
一.有关Java Web与MVC设计模式 学习过基本Java Web开发的人都已经了解了如何编写基本的Servlet,如何编写jsp及如何更新浏览器中显示的内容.但是我们之前自己编写的应用一般存在无条 ...
- sqlserver 插入数据时异常,仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'XXXXX.dbo.XXXXXXXXX'中的标识列指定显式值。
INSERT INTO XXXXXXXXX.dbo.XXXXXXXXX select * from XXXXXXXXX 仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'X ...