1.配置proguard-rules.pro和module文件混淆成中文:
-
在proguard-rules.pro的配置:
#中文混淆 -classobfuscationdictionary ./proguard-keys.txt -packageobfuscationdictionary ./proguard-keys.txt -obfuscationdictionary ./proguard-keys.txt在module的目录下创建proguard-keys.txt文件,里面写上一堆中文:

混淆成中文,参考文档链接:https://blog.csdn.net/jiangwei0910410003/article/details/616189452.混淆资源文件,使用微信的AndResGuard:
1.在项目的build.gradle文件中加上AndResGuard的配置:dependencies { // 微信的资源混淆工具:不仅能全面混淆资源文件,还能缩减资源文件的整体体积 classpath 'com.tencent.mm:AndResGuard-gradle-plugin:1.2.10' }2.在module的目录下创建一个and_res_guard.gradle文件,文件内容如下:
apply plugin: 'AndResGuard' andResGuard { // mappingFile = file("./resource_mapping.txt") mappingFile = null use7zip = true useSign = true // 打开这个开关,会keep住所有资源的原始路径,只混淆资源的名字 keepRoot = false whiteList = [ // for your icon "R.drawable.icon", // for fabric "R.string.com.crashlytics.*", // for google-services "R.string.google_app_id", "R.string.gcm_defaultSenderId",

本文详细介绍如何使用ProGuard和AndResGuard进行安卓应用的代码和资源混淆,包括配置步骤、常见问题解决方案及反编译方法。

2219

被折叠的 条评论
为什么被折叠?



