Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 12 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save AwsafAlam/f53312cbb912cf3e4267a5971cd75db0 to your computer and use it in GitHub Desktop.
Save AwsafAlam/f53312cbb912cf3e4267a5971cd75db0 to your computer and use it in GitHub Desktop.
1. Download latest apktool version.
2. Download the batch file and aapt.exe.
3. Create a folder anywhere in the PC and put all the apktool.jar, aapt.exe and the batch script in that folder.
4. Open command prompt.
5. Navigate to the folder where you placed apktool.jar, batch script and the aapt.exe.
6. Now, you need to install the file using the " IF " command.
7. Type the following command.
apktool if name-of-the-app.apk
8. For decompiling use the command "d". The "d" stands for decompile.
apktool d name-of-the-app.apk
9. After the app is correctly decompiled, a new folder will be created in the same folder where you placed your app. This contains all the xml's and smali files which can be edited for different mode's.
10. To recompile the app use the following command " B ". The "b" simply means recompile.
apktool b name-of-the-app-folder
11. The final modded app will be in the "dist" folder located inside the original app folder created by apktool.
Signing the apk
1. open a new command prompt and change into the sign-apk directory using cmd
2. move the modified-unsigned apk into this folder
3. then type the following command -
java -jar signapk.jar certificate.pem key.pk8 path-of-the-folder-contaning-the-apk.apk path-of-the-new-signed-apk.apk
4. Once compiled, the signed apk will be found in the same folder.
@JuvenalAmarante
Copy link

Sorry but what do you mean "sign-apk directory" ? Is it the directory extracted from original apk file?

This "sign-apk" has been downloaded before the decompilation.

@Tanyike
Copy link

Tanyike commented Dec 26, 2020

i have really been looking for ways to edit a payloads this was very helpful.

@HelloWorld-dlroWolleH
Copy link

sir! please help me.
i recompiled apk file with
apktool b name-of-apk-folder
buttt! didnt create dist folder in apk folder and there isnt any recompiled apk
please help me!
thanks a lot!

@HelloWorld-dlroWolleH
Copy link

please answer me
thanks

@HelloWorld-dlroWolleH
Copy link

wow! what a good asnwer!๐Ÿ˜•๐Ÿ˜•๐Ÿ˜
thanks for answering me
๐Ÿ˜ ๐Ÿ˜ ๐Ÿ˜ 

@Pabubung
Copy link

Pabubung commented Jul 8, 2021

Where to get signapk.jar?

@nejmjaafar
Copy link

sir! please help me.
i recompiled apk file with
apktool b name-of-apk-folder
buttt! didnt create dist folder in apk folder and there isnt any recompiled apk
please help me!
thanks a lot!

you will find the dist folder under your apk folder, which means if you type "cd ./name-of-apk-folder/dist" after you ran the "apktool b name-of-apk-folder" command, you'll find yourself in the directory of the compiled apk file.

@delcullu
Copy link

Hi i decompiled project change it and compiled but i couldnt sign it. I got this error message:

Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder
at com.android.signapk.SignApk.addDigestsToManifest(SignApk.java:169)
at com.android.signapk.SignApk.main(SignApk.java:325)
Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519)
... 2 more

@delcullu
Copy link

Hi i decompiled project change it and compiled but i couldnt sign it. I got this error message:

Exception in thread "main" java.lang.NoClassDefFoundError: sun/misc/BASE64Encoder at com.android.signapk.SignApk.addDigestsToManifest(SignApk.java:169) at com.android.signapk.SignApk.main(SignApk.java:325) Caused by: java.lang.ClassNotFoundException: sun.misc.BASE64Encoder at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:636) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:182) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:519) ... 2 more

ok i solved using jdk8 thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment