Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,781,289 Members 36,735 Now Online
XDA Developers Android and Mobile Development Forum

[Guide] Decompile with Apk Tool [Easy Way]

Tip us?
 
PulseDroid
Old
(Last edited by PulseDroid; 27th May 2014 at 02:23 PM.)
#1  
PulseDroid's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 2,339
Posts: 2,499
Join Date: Jan 2012
Cool [Guide] Decompile with Apk Tool [Easy Way]



## Due to exams I won't be able to reply on questions, there are however many experienced developers active on this thread like @SpaceCaker & @K.A. ##

I have seen a lot of guides on how to decompile with Apk Tool, but none are noob friendly, so I thought I would post this.

What You Need:

ApkTool
Java JDK/JRE 32 bit
Super Basic Cmd/terminal knowledge (My 5 year old brother can handle this)



Download Apk Tool Here: (Must be this one)

Mega

First you need to extract that zip folder to anywhere you choose, preferably on root of c/drive E.g: C:/android/apktool extracting the files to 'apktool' folder.

Now copy the apk you would like to mod into your Apk Tool folder.




Command Prompt:

Open up your Command Prompt by going to:
Start -> run -> type : Cmd



Code:
Your cmd will probly look like this..

C:\users\yourname>

so type in

cd.. (Yes include the '..' and press enter after you type each command.)

this will get you to back directory so now you will see

C:\users>

so type again

cd..

you should now see this:

C:\>

now type in:

cd 'apktoo'l/'directory'

for me it looks like:

cd android/apktool

now you should see:

C:/android/apktool>

and you are in the apktool directory



Installing Framework:

Now that you are in directory we need to install the device's framework to your system for it to compile correctly so type this:

apktool if framework-res.apk

Remember: Devices like HTC / Samsung / Huawei have other frameworks that are used in their apps too, sometimes you need to install them too.

This will install the devices framework to your system. (need to do this)



Decompiling:

Now to decompile the apk you want to edit, type this:

apktool d framework-res.apk framework1

or

apktool d music.apk music

music.apk is the apk your decompiling
music is the folder you're creating for the decompiled apk

Now go about your business






Recompiling/Finished Product:


Now to recompile your new apk type this:

apktool b music music-new.apk

or

apktool b framework1 framework-res-new.apk

framework1 is the folder with your edited files
framework-res-new.apk is your new apk file






We are NOT done just yet, we cannot use the new apk's... we have to take what we did and add it back to the original apk file to keep proper signature

use something like 7zip, take the 'resources.arcs' file and any other xml files you edited out of the "-new" apk and copy them into Original apk

Your new modded APK is now ready, Congrats!

If you get Java errors see here.
If you recompile fine but doesn't install " App couldn't not be installed " see here.
Good Luck Guys!


 

"What would be the purpose of fishing for thanks? Having one thank you as opposed to 10,000 makes no difference does it? It's just an ego thing I suppose. I don't and have never focused on someone's thank meter to judge their expertise and knowledge." - edfunkycold

The Following 152 Users Say Thank You to PulseDroid For This Useful Post: [ Click to Expand ]
 
Abhishek Anand
Old
#2  
Junior Member
Thanks Meter 2
Posts: 18
Join Date: Mar 2012
seems really helpful, will try and report
The Following User Says Thank You to Abhishek Anand For This Useful Post: [ Click to Expand ]
 
K.A.
Old
#3  
K.A.'s Avatar
Senior Member
Thanks Meter 1,283
Posts: 6,289
Join Date: Apr 2012
AFAIK, for systemUI, you need to replace resources.arsc, classes.dex and the res folder..
Nicely done, btw..
Samsung Galaxy Ace. CM10.1 | Google Nexus 4. KitKat TIME!!

[OT][SUPPORT]DESKTOPS AND LAPTOPS AIO THREAD.[General Off-Topic]
The Following 4 Users Say Thank You to K.A. For This Useful Post: [ Click to Expand ]
 
shubhamchamaria
Old
#4  
Recognized Contributor
Thanks Meter 2,267
Posts: 2,779
Join Date: Jan 2011
Location: Mumbai

 
DONATE TO ME
You could make a guide using Virtuous Ten Studio ...Most n00b friendly software ever made and very convenient too....
Nice guide btw

Sent from my HTC One V using Tapatalk 2
MY WORKS:

Nexus 4:
1.CM10.2 Nightlies

HTC Desire:
1.Runny ROM

HTC One V:
1.SuPrimo ROM
2.Blue Sense 4.1
3.MIUI.us for One V
4.HTC One V VirginMobile Root
5.De-Sense(REMOVE HTC SENSE) Tool


IF YOU LIKE MY WORK AND WOULD LIKE TO HELP ME PLEASE CONSIDER A DONATION OR VISIT MY WEBSITE(http://slandroid.com)
The Following User Says Thank You to shubhamchamaria For This Useful Post: [ Click to Expand ]
 
macs18max
Old
#5  
Senior Member
Thanks Meter 1,461
Posts: 447
Join Date: Apr 2010
decompiling was fine.
I'm getting errors everywhere when trying to compile back... probably not meant for JB apks
HD2 EU, sandisk 16GB sd class10
Radio : 2.15.50.14
ROM : SlimROM data2ext / Various test ROMs NativeSD
Recovery:4ext (thanks to Madmaxx/Xylo)

The Following User Says Thank You to macs18max For This Useful Post: [ Click to Expand ]
 
shubhamchamaria
Old
#6  
Recognized Contributor
Thanks Meter 2,267
Posts: 2,779
Join Date: Jan 2011
Location: Mumbai

 
DONATE TO ME
Quote:
Originally Posted by macs18max View Post
decompiling was fine.
I'm getting errors everywhere when trying to compile back... probably not meant for JB apks
Install framework files....all of em

Sent from my HTC One V using Tapatalk 2
MY WORKS:

Nexus 4:
1.CM10.2 Nightlies

HTC Desire:
1.Runny ROM

HTC One V:
1.SuPrimo ROM
2.Blue Sense 4.1
3.MIUI.us for One V
4.HTC One V VirginMobile Root
5.De-Sense(REMOVE HTC SENSE) Tool


IF YOU LIKE MY WORK AND WOULD LIKE TO HELP ME PLEASE CONSIDER A DONATION OR VISIT MY WEBSITE(http://slandroid.com)
 
PulseDroid
Old
#7  
PulseDroid's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 2,339
Posts: 2,499
Join Date: Jan 2012
Thanks For helping him

 

"What would be the purpose of fishing for thanks? Having one thank you as opposed to 10,000 makes no difference does it? It's just an ego thing I suppose. I don't and have never focused on someone's thank meter to judge their expertise and knowledge." - edfunkycold

 
K.A.
Old
#8  
K.A.'s Avatar
Senior Member
Thanks Meter 1,283
Posts: 6,289
Join Date: Apr 2012
Quote:
Originally Posted by shubhamchamaria View Post
Install framework files....all of em

Sent from my HTC One V using Tapatalk 2
If decompiling is fine, then framework files problem shouldn't be there.
Can you tell the errors that occurred?

***.King ACE, Unofficial ERT de ACE OT.***
Samsung Galaxy Ace. CM10.1 | Google Nexus 4. KitKat TIME!!

[OT][SUPPORT]DESKTOPS AND LAPTOPS AIO THREAD.[General Off-Topic]
 
PulseDroid
Old
#9  
PulseDroid's Avatar
Recognized Contributor / Themer - OP
Thanks Meter 2,339
Posts: 2,499
Join Date: Jan 2012
Quote:
If decompiling is fine, then framework files problem shouldn't be there.
Can you tell the errors that occurred?
Actually it could be, it happened to me.

 

"What would be the purpose of fishing for thanks? Having one thank you as opposed to 10,000 makes no difference does it? It's just an ego thing I suppose. I don't and have never focused on someone's thank meter to judge their expertise and knowledge." - edfunkycold

 
K.A.
Old
#10  
K.A.'s Avatar
Senior Member
Thanks Meter 1,283
Posts: 6,289
Join Date: Apr 2012
Quote:
Originally Posted by PulseDroid View Post
Actually it could be, it happened to me.
Idk then, i've been working with JB apks for a while now...no framework problems if decompile is fine.. OR, the modifications must've been incorrectly done, i think..

***.King ACE, Unofficial ERT de ACE OT.***
Samsung Galaxy Ace. CM10.1 | Google Nexus 4. KitKat TIME!!

[OT][SUPPORT]DESKTOPS AND LAPTOPS AIO THREAD.[General Off-Topic]

Tags
apk, decompile, guide, tool
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes