Preface
Record every step of learning reversal.
tool
1. The function of apktool
: Decompile and package to generate apk
2.
The function of apksigner: Sign the apk
Instructions: AndroidSDK tool, in the directory of build-tools/corresponding version, for example: build-tools\28.0.3, in this directory is The script (apksigner.bat) is a jar package (apksigner.jar) under lib. You can configure build-tools\28.0.3 into the environment variable.
step
1. Place apktool.jar and the apk to be decompiled in the same directory, open the command line, and go to the directory path;
2. Execute the following decompilation command
java -jar apktool.jar d -f xxx.apk -o test
Note 1: d means decoding, -f means forcing, -o means specifying the directory generated by decompilation (test here is the directory generated by decompilation)
Note 2: If a main exception occurs when executing the command, you need to update apktool If .jar
is executed successfully, the test directory will be generated, which contains the decompiled content.
3. Modify the data in the decompiled directory (here is the test directory) as needed.
4. Regenerate unsigned apk
java -jar apktool.jar b 反编译生成的目录(此处是test)
After the execution is completed, the dist directory will be generated under test, and the apk in this directory is an unsigned apk.
5. Signature
Enter the dist directory, place the signature key file in the directory, and
execute the following command:
apksigner sign –ks 密钥库名 –ks-key-alias 密钥库名 xxx.apk
Note: xxx.apk here is the apk to be signed