2018-05-31 apktool

【转】ubuntu下apktool安装及使用

【转】使用apktool解包和打包apk

【转】安卓apk反编译、修改、重新打包、签名全过程


解包
apktool d xxx.apk -f

$ apktool d tmgp.apk
I: Using Apktool 2.2.1 on tmgp.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: /home/xy/.local/share/apktool/framework/1.apk
I: Regular manifest package...
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Baksmaling classes.dex...
I: Copying assets and libs...
I: Copying unknown files...
I: Copying original files...

$ ll
total 787024
drwxrwxr-x 3 xy xy      4096 May 31 13:19 ./
drwxrwxr-x 5 xy xy      4096 May 31 13:18 ../
drwxrwxr-x 7 xy xy      4096 May 31 13:20 tmgp/
-rwxrwxr-x 1 xy xy 805893248 May 31 13:17 tmgp.apk*

$ ll tmgp/
total 48
drwxrwxr-x  7 xy xy  4096 May 31 13:20 ./
drwxrwxr-x  3 xy xy  4096 May 31 13:19 ../
-rw-rw-r--  1 xy xy 15137 May 31 13:19 AndroidManifest.xml
-rw-rw-r--  1 xy xy   476 May 31 13:20 apktool.yml
drwxrwxr-x  8 xy xy  4096 May 31 13:20 assets/
drwxrwxr-x  3 xy xy  4096 May 31 13:20 lib/
drwxrwxr-x  3 xy xy  4096 May 31 13:20 original/
drwxrwxr-x 26 xy xy  4096 May 31 13:19 res/
drwxrwxr-x 10 xy xy  4096 May 31 13:20 smali/

重新打包
apktool b xxx -o xxx-new.apk
生成keystore
keytool -genkeypair -alias "test2" -keyalg "RSA" -keystore "test.keystore"
输入密码:
一路回车
到最后时输入y
查看签名:
keytool -list -keystore test.keystore

image.png

或者
keytool -printcert -file "test.crt"
给apk签名
jarsigner -verbose -keystore app.keystore -signedjar xxx-new.apk xxx-new.apk $alias

image.png
$ jarsigner -verbose -keystore test.keystore tmgp-unsigned2.apk test2

$ md5sum tmgp-unsigned2.apk
acd255e3cc1de56d2c26c62490e6ef3e  tmgp-unsigned2.apk
$ md5sum tmgp-unsigned2.apk
65d85027d1537f45f0d2c0bbfcaf9b98  tmgp-unsigned2.apk

$ md5sum tmgp.apk
acd255e3cc1de56d2c26c62490e6ef3e  tmgp.apk
$ md5sum tmgp.apk
bae12e18b9e8ef36a086105afbd1e880  tmgp.apk

zipalign
zipalign -f -v 4 xxx-new.apk xxx-new-new.apk
facebook生产秘钥串:
keytool -exportcert -alias -keystore | openssl sha1 -binary | openssl base64

你可能感兴趣的:(2018-05-31 apktool)