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的 ...
随机推荐
- iOS缓存功能
之前做缓存,没有考虑过这个具体的实现. 移动应用在处理网络资源时,一般都会做离线缓存处理,其中以图片缓存最为典型,其中很流行的离线缓存框架为SDWebImage. 但是,离线缓存会占用手机存储空间,所 ...
- maven常用插件pom配置
一.问题描述: 部署一个maven打包项目时,jar包,依赖lib包全部手动上传至服务器,然后用maven部署报错:Exception in thread "main" java. ...
- Python之路----------内置函数
1.abs(x)绝对值 #coding=utf-8 a = 1 b = -2 print(abs(a)) print(abs(b)) 2.all(iterable)可迭代对象里面所有内容为真返回真,空 ...
- 使用Cordova编译Android平台程序提示:Could not reserve enough space for 2097152KB object heap
大体的意思是系统内存不够用,创建VM失败.试了网上好几种方法都不行,最后这个方法可以了: 开始->控制面板->系统->高级设置->环境变量->系统变量 新建变量: 变量名 ...
- RDIFramework.NET平台代码生成器V3.1版本全新发布-更新于2016-10-29(提供下载)
本次主要更新内容: 1.增加对Oracle表创建语句的查看. 2.新增对MySql的代码生成支持. 3.全面重构对多线程的支持,改变以前会无故退出的现象. RDIFramework.NET代码生成器V ...
- [Android Tips] 23. How to fail/stop Gradle task immediately if some conditions are not met
throw new GradleException("conditions are not met") 参考 How to fail/stop task immediately i ...
- GPS部标平台的架构设计(四)-百度地图设计
部标GPS软件平台之百度地图设计 地图是客户端中不可缺少的一个模块,很多人在设计和画图时候,喜欢加上地图引擎这样高大上的字眼,显得自己的平台有内涵,说白了就是用第三方的SDK来开发,早期的GPS监 控 ...
- 发布一款Github博客皮肤
Major是一款基于jekyll的皮肤,没有用hexo,原因是换机器后无法更新博客,但是可以用U盘考环境.总之很麻烦!折腾纠结好久,还是用jekyll!不用发布直接push文章即可,方便快捷.用的放心 ...
- LDAP 中 CN, OU, DC 的含义
1. LDAP的存储规则 区分名(DN,Distinguished Name) 和自然界中的树不同,文件系统/LDAP/电话号码簿目录的每一片枝叶都至少有一个独一无二的属性,这一属性可以帮助我们来区别 ...
- 【C#进阶】多播委托和委托数组像是一回事~
这个MathOperation类有三静态方法,参数都是double,并且没有返回值,考虑用Action<>() 这种预定义的委托哦 class MathOperations { publi ...