Android APK decompile+modify+repackage+sign

1. Download the decompilation toolkit.

Decompilation toolkit address: Baidu Netdisk
Extraction code: dsu3
After decompression, there are four compressed packages: apktool.rar, dex2jar, jdgui, Auto-Sign;
Insert image description here
note, change the path of the decompilation package to English to prevent this. Accident.

2. Rename the APK package to ZIP and unzip it. Place it in the decompilation root directory.

Insert image description here
Modify the suffix of the APK to zip and unzip it.
Insert image description here
Enter the unzipped package and get the classes.dex file.
Insert image description here
Copy the classes.dex file to the dex2jar folder.
Insert image description here
Enter cmd in the folder, enter the command line, and use the following command: dex2jar.bat classes.dex.
Insert image description here
A jar file will be generated in the dex2jar folder.
Insert image description here
Use jdgui to open the jar package and you can see the source code, but it cannot be modified. You need to perform the following operations to modify the code.
Insert image description here

3. Use apktool to decompile and modify the smail file and repackage it.

There are three tools in the apktool folder.
Insert image description here
Place the APK that needs to be decompiled into a different folder.
Insert image description here
Open cmd and enter the following command: apktool.bat d -f <APK name> -o <output folder name>
Insert image description here
After decompilation, a folder will be generated
Insert image description here
. Contains various resource files for the program.
Insert image description here
Check the location of the code that needs to be modified in jdgui, and then modify it in the smali folder.
Insert image description here
Save after modification.

4.Repackage

Go back to the apktool directory and execute the packaging command: apktool.bat b <folder name>
Insert image description here
Two folders will be generated in the folder.
Insert image description here
The dist file contains the APK we need. Although the APK was generated, it cannot be installed directly due to the signature.
Insert image description here

5.Re-sign

Copy the generated APK into the Auto-Sign folder.
Insert image description here
Execute the signing command: java -jar signapk.jar testkey.x509.pem testkey.pk8 app-Luohu-release.apk app-Luohu-release-new.apk.
Insert image description here
app-Luohu-release-new.apk is the re-signed software name (you can choose the name yourself).
Insert image description here

Guess you like

Origin blog.csdn.net/nanjumufeng/article/details/131779970