Oktober 01, 2014

How to Decompile, Recompile & Sign apk

How to Decompile, Recompile & Sign

 This Guide/Tutorial for Windows user

Requirement :

1. Android SDK, you can download from here (this including Java)
2. Download Latest Apktool 4.2.2 (Including Sign & baksmali) from here (this Support All apk from GB/ICS/JB 4.1.2/4.2.2)
3. Notepad++ for your tool editing xml/smali you can download from here

If you already download/Installed Android sdk/java & Notepadd++ you just download Latest Apktool 4.2.2


Download Latest Apktool, extract to :

Windows XP : C:\Document and setting\folder your computer name

Windows 7 : C:\user\folder your computer name

copy your apk & framework-res.apk/SemcGenericUxpRes.apk/framework 2 to same folder with apktool

Now you can start Editing apk

Example Editing Walkman

Open Command Prompt (CMD)

to decompile :


Code:
apktool if framework-res.apk
apktool d semcmusic.apk ( can be whatever name you give to your apk )
Some Original system apps need installed framework 2 like on stock ROM (SemcGenericUxpRes.apk)

Example

Code:
apktool if framework-res.apk
apktool if semcgenericuxpres.apk
apktool d semcmusic.apk ( can be whatever name you give to your apk )
You can start editing as you want


to recompile :

Code:
apktool b -f -d semcmusic.apk ( can be whatever name you give to your apk )
If done, you can exit CMD

open original SemcMusic.apk using Winrar or 7zip go to folder semcmusic>dist, open semcmusic.apk using Winrar or 7zip

Drag & drop folder META-INF & Lib in original apk to Modified apk, set compression to store and click ok

to sign :

Move apk modified from folder semcmusic>dist to same folder with apktool

Open Command Prompt (CMD)

Example

Code:
java -jar SignApk.jar testkey.x509.pem testkey.pk8 semcmusic.apk semcmusic_signed.apk ( can be whatever name you give to your apk )
NOTE : Sign apk only for apps 3rd Party but you can use for system>app but not all apps

to zipalign :

Open Command Prompt (CMD)

Example

Code:
zipalign -fv 4 semcmusic_signed.apk semcmusic_signed_zipaligned.apk

How to Decompile/Recompile Jar/Editing classes.dex

Copy Jar file to same folder Apktool

Example

framework.jar

to decompile :

Open framework.jar using Winrar or 7zip and extract classes.dex

Drag & drop classes.dex to Quick-Baksmali (CMD)

if done, you can find folder classes-out

now you can start editing smali file using Notepad++


to recompile :

Drag & drop folder classes-out to Quick-Smali (CMD)

if done, you can find New file "new-classes.dex"

rename file to classes.dex

Open framework.jar using Winrar or 7zip

Drag & drop file classes.dex modified to framework.jar using Winrar or 7zip set compression to normal
 
NOTE : If you get error when compiling, don't blame me lolz it's your mistake when editing apk 
 
Thanks to Brut.all for apktool
Thanks to Yorzua for Sign apk tool/file
Thanks to Team Reject for Quick baksmali/smali file

0 komentar:

Posting Komentar