一、理论知识
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的 ...
随机推荐
-
【CSS3】 理解CSS3 transform中的Matrix(矩阵)
理解CSS3 transform中的Matrix(矩阵) by zhangxinxu from http://www.zhangxinxu.com 本文地址:http://www.zhangxinxu ...
-
bat批处理延迟运行脚本(zz)
@echo off:aaapause 这里是你需要运行的程序for /l %%i in (0,1,10000) do echo %%i>nulgoto aaa 当然bat延迟运行还有其他的一些方 ...
-
java集合--java.util.ConcurrentModificationException异常
ConcurrentModificationException 异常:并发修改异常,当方法检测到对象的并发修改,但不允许这种修改时,抛出此异常.一个线程对collection集合迭代,另一个线程对Co ...
-
从FCN到DeepLab
图像语义分割,简单而言就是给定一张图片,对图片上的每一个像素点分类. 图像语义分割,从FCN把深度学习引入这个任务,一个通用的框架事:前端使用FCN全卷积网络输出粗糙的label map,后端使用CR ...
-
webcron
一个定时任务管理器,基于Go语言和beego框架开发.用于统一管理项目中的定时任务,提供可视化配置界面.执行日志记录.邮件通知等功能,无需依赖*unix下的crontab服务. 项目背景 开发此项目是 ...
-
echarts中的区域缩放组件dataZoom,主动触发选区缩放点击事件
options设置 toolbox: { // 工具栏 feature: { dataZoom : { // 选时间缩放功能 show : true, // show为true时,才能触发takeGl ...
-
Aes加解密,php
Aes类库 <?php namespace Aes; class Aes { /** * var string $method 加解密方法,可通过openssl_get_cipher_metho ...
-
【译】Focused and Diffuse Modes(专注与发散模式)
Focused and Diffuse Modes ---文章来源:coursera 面对一个问题,当无论如何都想不出办法时,你会怎么做呢?对于僵尸们来说,只需简单地不断用脑袋撞墙即可.然而活生生的大 ...
-
Zabbix告警脚本-短信
[root@iot-svndata02 bin]# cat zbsms.sh #!/bin/sh #curl http://221.179.180.137:8080/smsaServer/lkSend ...
-
linux中sed命令的使用
sed命令是linux或者shell编程中常用的筛选.替换命令,如果能熟练使用sed则对经常使用的人来说在工作上是非常有帮助的 下面把sed主要的用法列出来(有错误的地方大家可以指正): p命令只打印 ...