01. 微信资源包混淆介绍
微信资源包混淆项目: https://github.com/shwenzhang/AndResGuard
资源包混淆作用
* 1. 避免其他人拷贝图片资源
* 2. 把 apk 变小 (apk 瘦身步骤)
开发中到底用不用: 看需求, 可以使用资源包混淆,
02. 微信资源包混淆 AndResguard 常用命令
1. 配置 config.xml 文件
- <issue id="sign" isactive="true">
- <!--the signature file path, in window use \, in linux use /, and the default path is the running location-->
- <path value="E:\ngyb\day2\MobileSafe\ngyb.jks"/>
- <!--storepass-->
- <storepass value="123456"/>
- <!--keypass-->
- <keypass value="123456"/>
- <!--alias-->
- <alias value="ngyb"/>
- </issue>
2. 简单命令 (对签名和未签名 apk 都可以)
java -jar andresguard.jar ..\build\MobileSafe_signed.apk
3. 指定配置文件或输出目录
java -jar andresguard.jar ..\build\MobileSafe_signed.apk -config config.xml -out ngyb
4. 使用 7zip 打包
- java -jar andresguard.jar ..\build\MobileSafe_signed.apk -config config.xml
- -7zip 7za.exe -out ngyb_new
03.ant 打包手机卫士 - 集成 AndResguard
- <!-- 任务 9: 集成微信资源包混淆 AndResGuard -->
- <target name="andResGuard" depends="generateUnsignedApk">
- <echo message="任务 9: 微信资源包混淆"/>
- <exec executable="${java.exe}">
- <arg value="-jar"/>
- <arg value="${andresguard.jar}"/>
- <arg value="${unsignedApk}"/>
- <arg value="-config"/>
- <arg value="${config.xml}"/>
- <arg value="-out"/>
- <arg value="${resGuardOut}"/>
- </exec>
- </target>
来源: http://www.bubuko.com/infodetail-2946651.html