[Guide] Decompile with Apk Tool [Easy Way]

Search This thread

paroulis

Senior Member
Sep 23, 2010
223
50
Chalkida -Evia
I have a question, follow the instructions and all the applications that created works perfectly !! But what I notice is that the longer see the list of applications on my blind side, ie not recognize them the play store.What could be wrong?
 

SpEcHiDe

Member
Oct 7, 2013
6
1

bboyjunio

Member
Nov 17, 2012
18
2
Targu Neamt
What is wrong here?
I followed the exact steps to "How to add Dolby In Roms?"
error.png
 

Bob Squire99

Member
Feb 7, 2014
33
7
Decompiling a specific app

I used virtuous ten studio to decompile eleven music player apk. I get the assets folder but it only shows fonts. In res I see a long list of folders. I am confused which parts to change and which parts to finally add to the actual theme. Can anyone help me. I attached the apk for eleven music so you can see what i mean when you decompile it with vts.
 

Attachments

  • Eleven.apk
    5.1 MB · Views: 28

shegeloaf

Senior Member
Jun 9, 2014
1,010
223
sydney


## 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.

f6f8ecf510f10ce4c2c308a5f8a0ea7b.jpg



Command Prompt:

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

32013a151ec069c5099725789edc10ac.jpg


Code:
Your cmd will probly look like this..

C:\users\yourname>

so type in

cd.. [COLOR="Red"](Yes include the '..' and press enter after you type each command.)[/COLOR]

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

dd6f52dd0a63e9cfec11257816610e7e.jpg



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)

0469af0a4f59683b5afd65bbaa517560.jpg


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 :victory:

66f044a6c2f13780fcc0fc4b7cb664dc.jpg


3b486e7ae9e032f8eb4bab257abafe7f.jpg



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

131ce3032fc2e7ca4371de574ebec108.jpg


16f0361f73797450f7af2457791b36fd.jpg



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! :highfive:

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! :fingers-crossed:

this for windows or mac?
 

Jeembooy

New member
Feb 2, 2015
3
0
somebody help please?

c:\Users\abainza\apktool>apktool if SystemUI.apk
Exception in thread "main" brut.androlib.AndrolibException: Arsc file contains z
ero or multiple packages
at brut.androlib.res.decoder.ARSCDecoder$ARSCData.getOnePackage(ARSCDeco
der.java:431)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:566)
at brut.androlib.Androlib.installFramework(Androlib.java:473)
at brut.apktool.Main.cmdInstallFramework(Main.java:250)
at brut.apktool.Main.main(Main.java:81)

c:\Users\abainza\apktool>

this is what i always get..
 

Vivek_Neel

Inactive Recognized Contributor / Themer
Dec 23, 2012
10,372
23,696
31
Chennai
c:\Users\abainza\apktool>apktool if SystemUI.apk
Exception in thread "main" brut.androlib.AndrolibException: Arsc file contains z
ero or multiple packages
at brut.androlib.res.decoder.ARSCDecoder$ARSCData.getOnePackage(ARSCDeco
der.java:431)
at brut.androlib.res.AndrolibResources.installFramework(AndrolibResource
s.java:566)
at brut.androlib.Androlib.installFramework(Androlib.java:473)
at brut.apktool.Main.cmdInstallFramework(Main.java:250)
at brut.apktool.Main.main(Main.java:81)

c:\Users\abainza\apktool>

this is what i always get..

Install the framework . apktool if framework-res.apk

Sent from my A0001 using Tapatalk 2
 

Jeembooy

New member
Feb 2, 2015
3
0
already did sir, i install first the frame work then the systemui, the problem occurs also in the systemui it also appears when "apktool if systemUI.apk" what to do sir?
 

chocochipsz

New member
Sep 6, 2016
3
0
hello u need help about decompile and recompile

AFAIK, for systemUI, you need to replace resources.arsc, classes.dex and the res folder..
Nicely done, btw..

My phone samsung a500h and i try too mod my system and i try to decompile my system framework and success. But if i want to recompile im have problem eror and have this notivication

W: Could not find sources
I: Building resources...
CANNOT LINK EXECUTABLE: cannot locate symbol "_ZN7android12AssetManager12addAssetPathERKNS_7String8EPi" referenced by "/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.0"...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.0, p, --min-sdk-version, 21, --target-sdk-version, 21, -F, /data/data/per.pqy.apktool/APKTOOL4988366208346002069.tmp, -x, -0, arsc, -S, /sdcard/apktool/framework-res_src/res, -M, /sdcard/apktool/framework-res_src/AndroidManifest.xml]
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:358)
at brut.androlib.Androlib.buildResources(Androlib.java:283)
at brut.androlib.Androlib.build(Androlib.java:206)
at brut.androlib.Androlib.build(Androlib.java:176)
at brut.apktool.Main.cmdBuild(Main.java:228)
at brut.apktool.Main.main(Main.java:79)
Caused by: brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.0, p, --min-sdk-version, 21, --target-sdk-version, 21, -F, /data/data/per.pqy.apktool/APKTOOL4988366208346002069.tmp, -x, -0, arsc, -S, /sdcard/apktool/framework-res_src/res, -M, /sdcard/apktool/framework-res_src/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:357)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:336)
... 5 more
Caused by: brut.common.BrutException: could not exec command: [/data/data/per.pqy.apktool/apktool/openjdk/bin/aapt5.0, p, --min-sdk-version, 21, --target-sdk-version, 21, -F, /data/data/per.pqy.apktool/APKTOOL4988366208346002069.tmp, -x, -0, arsc, -S, /sdcard/apktool/framework-res_src/res, -M, /sdcard/apktool/framework-res_src/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:89)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:355)
... 6 more
So how can i fix that problem? Hope u can teply and can help me to fix this problem thanks
And sorry about my english:D
 

OftenAfraid

New member
Nov 15, 2016
3
0
Can't recompile?

I am unable to recompile. I think I have not properly installed or missing some instruction. I have samsung GT-s7582. So I installed framework-res.apk. But it's not helping and I can only decompile. Do I also need to install framework.jar ?
 

drsaidalavi

Senior Member
Jul 1, 2012
341
59
Rwquest for a new tutorial

Hello, I am watching your APK tool tutorial.It is a great help for new bees like me
I have bought and installed the launcher X in my Elelphone P 8000. It is very nice launcher with lots of options. but the developer quit the project and not responding to our requests. I want to randomize the transition effect in the application drawer and also randomize the screen effects like, 'sunny', ' dandrolene', 'rainy' etc on the home screen.
In simple words, how to add the option 'RANDOM' in the transition effects and home screen effects, so that they change automatically at intervals in a random fashion
Can you kindly give the details how it can be done using APK tool.
Secondaly is it possible to make the background of certain applications like Messaging, Whatsapp etc to transparent by editing the XML.file?.
Kindly help me
Saidalavi
 

Draybeat

New member
Apr 12, 2018
1
0
Hi can some one help mi decompile an apk and all remove or edit root checkers(packages) ie system/xbin/su....then recompile it.im using an old device with kitkat so i cant install magisk.
 

TheKingOppaiDragon

New member
Jul 24, 2019
4
0
why i get this error

C:\Android\apktool>apktool d com.dena.a12026418_1.1.0.apk
I: Baksmaling...
testI: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Could not decode arsc file
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:55)
at brut.androlib.res.AndrolibResources.getResPackagesFromApk(AndrolibResources.java:315)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:50)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:43)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:148)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:128)
at brut.apktool.Main.main(Main.java:65)
Caused by: java.io.IOException: Expected: 0x001c0001, got: 0x00000000
at brut.util.ExtDataInput.skipCheckInt(ExtDataInput.java:48)
at brut.androlib.res.decoder.StringBlock.read(StringBlock.java:45)
at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:97)
at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
... 8 more
 

Top Liked Posts

  • There are no posts matching your filters.
  • 178


    ## 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.

    f6f8ecf510f10ce4c2c308a5f8a0ea7b.jpg



    Command Prompt:

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

    32013a151ec069c5099725789edc10ac.jpg


    Code:
    Your cmd will probly look like this..
    
    C:\users\yourname>
    
    so type in
    
    cd.. [COLOR="Red"](Yes include the '..' and press enter after you type each command.)[/COLOR]
    
    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

    dd6f52dd0a63e9cfec11257816610e7e.jpg



    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)

    0469af0a4f59683b5afd65bbaa517560.jpg


    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 :victory:

    66f044a6c2f13780fcc0fc4b7cb664dc.jpg


    3b486e7ae9e032f8eb4bab257abafe7f.jpg



    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

    131ce3032fc2e7ca4371de574ebec108.jpg


    16f0361f73797450f7af2457791b36fd.jpg



    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! :highfive:

    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! :fingers-crossed:

    11
    Fix a corrupted Java Jre ( Development package )

    • Download JavaRa




    • Run with Administrator permissions

    • Click Remove Java Runtime

    ex5FCGf.png


    • Click on Additional Tasks

    CKCvO2t.png


    • Select the following and click Run

    HkBLp3U.png


    ( Remove Startup Entry, Remove Outdated JRE Firefox Extensions, Clean JRE Temp Files. )

    • Re-install from here:



    Note that JavaRA might have updated and has onscreen instructions to help you fix your JRE.

    4
    AFAIK, for systemUI, you need to replace resources.arsc, classes.dex and the res folder..
    Nicely done, btw..
    3
    Has the APK been signed? If not, see Here.
    3
    can u share your apktool stuff ?



    Sent from my ST25i using xda premium
    The aapt file, the apktool jar and apktool file? That only, right?

    ---------- Post added at 11:57 PM ---------- Previous post was at 11:53 PM ----------

    http://www.mediafire.com/?b4au2n8pz1e153p
    This is the 3 files i put..in C:\Windows...