apktool反编译回编译及签名说明

No1: download jar file from github repo firstly:

https://github.com/iBotPeaches/Apktool/releases

No2: copy apk to your apktool.jar dir and run command:

D:rmapktool> 

java -jar apktool.jar d -f test.apk -o TEST

this command means Decompile file test.apk to out dir  TEST directory.

demo print:

I: Using Apktool 2.4.1 on test.apk
I: Loading resource table...
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:Users**AppDataLocalapktoolframework1.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...

No3:modify files in TEST what you want and then compile file use command:

D:rmapktool>

java -jar apktool.jar b TEST

demo print:

I: Using Apktool 2.4.1
I: Checking whether sources has changed...
I: Smaling smali folder into classes.dex...
I: Checking whether resources has changed...
I: Building resources...
W: fakeLogOpen(/dev/log_system) failed
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_system) failed
W: fakeLogOpen(/dev/log_stats) failed
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_system) failed
W: fakeLogOpen(/dev/log_stats) failed
W: fakeLogOpen(/dev/log_crash) failed
W: fakeLogOpen(/dev/log_stats) failed
I: Copying libs... (/lib)
I: Building apk file...
I: Copying unknown files/dir...
I: Built apk...

No4:sign

keytool -genkey -alias abc.keystore -keyalg RSA -validity 20000 -keystore abc.keystore

keytool -importkeystore -srckeystore abc.keystore -destkeystore abc.keystore -deststoretype pkcs12

jarsigner -verbose -keystore abc.keystore -signedjar testx.apk TESTdist	est.apk abc.keystore

No5: complete

原文地址:https://www.cnblogs.com/mignet/p/sign_apk.html