1. apk文件的解包和打包
最新版的apktool:https://bitbucket.org/iBotPeaches/apktool/downloads/
首先更新apktool.jar爲最新版本,apktool腳本也是,複製到usr/local/bin目錄下,還有一改appt文件都是要複製
安裝文檔的網址
https://ibotpeaches.github.io/Apktool/install/
還需要通過chmod來修改
Download Linux wrapper script (Right click, Save Link As apktool)
- Download apktool-2 (find newest here)
- Make sure you have the 32bit libraries (ia32-libs) downloaded and installed by your linux package manager, if you are on a 64bit unix system.
- (This helps provide support for the 32bit native binary aapt, which is required by apktool)
- Rename downloaded jar to apktool.jar
- Move both files (apktool.jar & apktool) to /usr/local/bin (root needed)
- Make sure both files are executable (chmod +x)
- Try running apktool via cli
[解包和打包命令]
apktool d xxx.apk
apktool b xxx
2. 解包後的修改
修改yml文件中的versionCode
3. 生成簽名文件並簽名
http://www.jianshu.com/p/e9a685c88258
生成簽名文件的時候-alias後面那個是別名,可以自己給keystore文件設置一個別名,這個別名也是有密碼的。
keytool -genkey -keystore test.keystore -alias test -keyalg RSA -validity 10000
最後那個test是別名,也有可能是別的名比如mykey等
jarsigner -verbose -keystore test.keystore -signedjar signed.apk t.apk 'test'
4. 怎麼查看versionCode
也是通過aapt工具來進行查看的
aapt dump badging C:/Users/kuguan/Desktop/app-release_1.0.9.apk
不過這裏的aapt需要使用全路徑,也即是andorid SDK下的build_tools
5. 查看簽名文件
http://blog.csdn.net/wed110/article/details/38303637
用winrar打開待查看的apk,將其中META-INF文件夾解壓出來,得到其中的CERT.RSA文件
keytool -printcert -file META-INF/CERT.RSA