Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,807,458 Members 47,202 Now Online
XDA Developers Android and Mobile Development Forum

[Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

Tip us?
 
Rizal Lovins
Old
(Last edited by Rizal Lovins; 17th August 2013 at 03:28 AM.)
#1  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor - OP
Thanks Meter 14,794
Posts: 1,453
Join Date: May 2012
Location: Bandung - One ring to rule them all, one ring to find them, one ring to bring them all
Lightbulb [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Jar

How to Decompile, Recompile & Sign apk

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


Closer to me? everything about me and my work!!!
DON'T PM me for any question regarding my work, please post in specific thread, anyone can help you, I WON'T respond
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
The Following 159 Users Say Thank You to Rizal Lovins For This Useful Post: [ Click to Expand ]
 
Rizal Lovins
Old
(Last edited by Rizal Lovins; 17th August 2013 at 03:20 AM.)
#2  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor - OP
Thanks Meter 14,794
Posts: 1,453
Join Date: May 2012
Location: Bandung - One ring to rule them all, one ring to find them, one ring to bring them all
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


Closer to me? everything about me and my work!!!
DON'T PM me for any question regarding my work, please post in specific thread, anyone can help you, I WON'T respond
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
The Following 49 Users Say Thank You to Rizal Lovins For This Useful Post: [ Click to Expand ]
 
Rizal Lovins
Old
(Last edited by Rizal Lovins; 17th August 2013 at 03:23 AM.)
#3  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor - OP
Thanks Meter 14,794
Posts: 1,453
Join Date: May 2012
Location: Bandung - One ring to rule them all, one ring to find them, one ring to bring them all
Credits :

Thanks to Brut.all for apktool
Thanks to Yorzua for Sign apk tool/file
Thanks to Team Reject for Quick baksmali/smali file


NOTE : If you get error when compiling, don't blame me lolz it's your mistake when editing apk


Closer to me? everything about me and my work!!!
DON'T PM me for any question regarding my work, please post in specific thread, anyone can help you, I WON'T respond
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
The Following 18 Users Say Thank You to Rizal Lovins For This Useful Post: [ Click to Expand ]
 
auni
Old
#4  
auni's Avatar
Senior Member
Thanks Meter 1,887
Posts: 956
Join Date: Nov 2011
Location: Dhaka
Great Guide Rizal. I am sure many were asking for it.
The Following 3 Users Say Thank You to auni For This Useful Post: [ Click to Expand ]
 
Mtakween
Old
#5  
Mtakween's Avatar
Senior Member
Thanks Meter 1,193
Posts: 961
Join Date: Nov 2012
Location: Dubai
great tut but can you add some screens/screenshots

i wont be here till 1/9/2013 due to my vacation
The Following User Says Thank You to Mtakween For This Useful Post: [ Click to Expand ]
 
Rizal Lovins
Old
#6  
Rizal Lovins's Avatar
Recognized Developer / Recognized Themer / Recognized Contributor - OP
Thanks Meter 14,794
Posts: 1,453
Join Date: May 2012
Location: Bandung - One ring to rule them all, one ring to find them, one ring to bring them all
Quote:
Originally Posted by auni View Post
Great Guide Rizal. I am sure many were asking for it.
Thanks, yeah some user confusing editing apk, so i share latest apktool with easy guide

Quote:
Originally Posted by Mtakween View Post
great tut but can you add some screens/screenshots
Later i will add screenshot for this tutorial


Closer to me? everything about me and my work!!!
DON'T PM me for any question regarding my work, please post in specific thread, anyone can help you, I WON'T respond
Lead Developer of LOVINS DEV : The 2 Brothers - Rizal Lovins & ibanez7
 
carlito-lt26i
Old
#7  
carlito-lt26i's Avatar
Senior Member
Thanks Meter 296
Posts: 122
Join Date: Nov 2012
Default Re: [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Ja

thx nice guide

Sent from my LT26i using xda app-developers app
 
Rajeev
Old
#8  
Rajeev's Avatar
Senior Member
Thanks Meter 8,935
Posts: 7,426
Join Date: Nov 2012
Location: Chennai , I N D I A

 
DONATE TO ME
Default Re: [Share Latest Apktool 4.2.2/Guide/Tutorial/] How to Decompile/Compile/Sign Apk/Ja

No doubt.. Its a great guide for some one like me.... Will sit today night and going to learn.... Thanks a lot..

From My Xperia S With XTX7 ROM
If You Like My Work Please Consider A Small Donation

For Donating Click Below

 
Please Do The Following:
Sign In To Your PayPal Account Page
Go To 'Send Payment'
Enter My Email ID "dipesh.febrius@gmail.com"
Option "Personal Payment" Doesn't Work For India, So Kindly Set "Online Purchases". And Check Goods or Service (Preferably Service)
Make The Payment of The Desired Amount of Donation You Want To Send.
Thank You For Your Kind Donations!
 
WahyuAndri
Old
#9  
WahyuAndri's Avatar
Junior Member
Thanks Meter 75
Posts: 29
Join Date: Dec 2012
Location: Mojokerto
now bookmark it!! thanks dude!!
The Following User Says Thank You to WahyuAndri For This Useful Post: [ Click to Expand ]
 
Yorzua
Old
#10  
Yorzua's Avatar
Recognized Themer
Thanks Meter 4,071
Posts: 1,814
Join Date: Aug 2010
Location: Gotham City

 
DONATE TO ME
Thumbs up thanks

Thanks for the credits, buddy
nice share there

The Following User Says Thank You to Yorzua For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes