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的 ...
随机推荐
- 运用 Swing
一:Swing的组件: 组件(component,或称原件)就是你会放在GUI上的东西,这些东西用户可以看到并可以与之交互. 组件是可以嵌套的. 创建GUI的四个步骤: 1.创建window(JFra ...
- SSR———团队作业:小型论坛的设计与初步实现
小型论坛的设计与初步实现 这次团队作业,我们设计的是一个小型论坛,作为团队中的一员,我主要负责对用户进行需求调研与对用户体验的过程拍摄总结,力求我们的项目在力所能及的范围内更加完美 视频: 度盘链 ...
- Python学习【第六篇】运算符
运算符 算数运算: a = 21 b = 10 c = 0 c = a + b print ("1 - c 的值为:", c) c = a - b print ("2 - ...
- test [ ] 四类
test可理解的表达式类型分为四类: 表达式判断 字符串比较 数字比较 文件比较 test xxx 可以简写成 [ xxx ] 的形式,注意两端的空格. 1)判 ...
- Jmeter学习(三十三)调试工具Debug Sampler
一.Debug Sampler介绍: 使用Jmeter开发脚本时,难免需要调试,这时可以使用Jmeter的Debug Sampler,它有三个选项:JMeter properties,JMeter v ...
- 错误-spring3.2的架构在tomcat6.0中无法正常启动,抛出java.lang.NoClassDefFoundError: javax/servlet/AsyncListener
原因分析: 1:org.springframework.web.servlet-3.2支持Servlet3.0的版本. 2:tomcat6.0只支持Servlet2.5,而tomcat7.0支持Ser ...
- 只需三步--轻松反编译Android Apk文件
安卓程序是通过java语言进行编写的,可以很容易进行反编译.很多apk文件被反编译后再二次打包,就成了自己的产品,很是流氓.下面我们来看看如何进行apk的反编译,以及常用的防反编译手段. 一.反编译A ...
- 3.Java Script 类型
true: null==undefinedfalse: null===undefined
- 【皇甫】☀Hibernate入门
说说我们最近的一些事 二期已经过去了,下面迎接的就是二年,据原老师讲解,我们10月份就开始陆续找工作了,虽然他说我们找工作不是问题,可每个人都有自知之明,我也知道我所处的位置,所以我清楚我要怎么做,我 ...
- JSSDK用法//////////////////zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
参照微信官方文档,调试成功之后总结如下: 步骤一:绑定域名 先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”. 备注:登录后可在“开发者中心”查看对应的接口权限. 步骤二: ...