DIY: How To Decompile An Apk


  1. niteNarmor

    niteNarmor Well-Known Member Contributor

    Decided to make this thread for people like me who do not know how to decompile an apk. This is totally a step by step guide. Following this exactly will produce the results you were looking for. This is how I changed the system background thanks to katracho for the instructions after you decompiled the apk:
    Code (Text):
    1. [U][I][COLOR=red]PLEASE FOLLOW THE STEPS EXACTLY: I AM NOT RESPONSIBLE FOR
    2. UNDESIRED RESULTS OR YOU MAKING YOUR PHONE INTO A DOOR
    3. STOP.[/COLOR][/I][/U]
    Again, this is how I did it:

    First you need 4 things.
    1. Latest Java installed -> Java
      Make sure if you are using a 64 bit Windows 7 OS that you install the same version for JAVA.
    2. Download Apk Manager - Link ->Apk Manager
    3. Download Apk Tools - Link ->Apk Tools
    4. Download Apk Tools Installer - Link ->Apk Tools Installer
    Once files are downloaded:
    1. Open the C:\ directory on your computer and make a folder called apk_manager
    2. Extract Apk Manger to that folder.
    3. Open apk_manager folder. Inside you will find a folder called "other". Take note of that.
    4. Extract Apk Tools to "other" in apk_manager folder
    5. Extract Apk Installer to same.
    As you do step 4 and 5 it will ask when you move the files into folder if you want to replace existing files, choose Yes. (Thank you Ralkkai as I forgot about that).

    You need to set a path for ADB so the computer can modify the path statement that will enable an MS-DOS window opened in Microsoft Windows as well as older programs to locate files that may be required to run the program.
    1. Navigate to My Computer
    2. Right click
    3. Properties
    4. Advanced System Settings
    5. Advanced
    6. Environment Variables
    7. System variables
    8. Scroll down and highlight Path
    9. Edit
    10. Type C:\AndroidSDK\tools;C:\AndroidSDK\platform-tools
    11. Click OK 3 times to exit
    There has been a few issues with Java not being recognized on some computers. Below are the steps that should be taken to ensure Java is recognized:

    1. Make sure Java is installed:

    2. Open Environment Variables.
    The first thing you should see when you open the environment variable screen on your computer is 2 boxes.
    1. User variables for (insert your computer name here)
    2. System variables.​
    3. Go to User variables for (computer name)

    4. Hit new.
    Next you should see a screen pop up saying New User Variable
    Variable name:
    Variable value:​
    In Variable Name:
    6. Type: Classpath

    In Variable value:
    7. Type: ".;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip;C:\Program Files (x86)\Java\jre7\lib\ext\QTJava.zip;" WITHOUT QUOTES

    Next do the EXACT same thing in System variables.
    If you scroll down in System variable you should see JAVA_HOME.​
    If not hit new:
    Pop up screen will appear.​

    In Variable name

    8. Type: JAVA_HOME (in caps)

    In Variable value

    9. Type: C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin

    You should also see (if you scroll down further) QTJAVA. If not;​

    10. Hit new

    In Variable Name

    11. Type: QTJAVA

    In Variable value :

    12. Type: C:\Program Files (x86)\Java\jre7\lib\ext\QTJava.zip

    That should solve all the path issues.​


    Now time for the fun stuff:
    1. Plug phone into computer.
    2. Open the apk_manager folder and find a file called Script. Double click to run.
      Again, this is how to decompile an apk. Will also show how to recompile in this post.
    3. Read through ALL the options apk_manager provides. Then read them again.
    4. Type 0 for adb pull. (This option will actually pull the file from where ever it is on phone).
    5. Once you selected that option, you will see:
      Where do you want adb to pull the apk from?
      Example of input : /system/app/launcher.apk
      Type input:​
      YOU HAVE TO KNOW EXACTLY WHAT FILE AND WHERE THE FILE IS LOCATED AT!!!!
    6. Once selected you will see:
      Pulling apk
      What filename would you like this app to stored as ?
      Eg (launcher.apk)
      Type input:​
    7. Name the file whatever you want. I would suggest the same name it already has.
    8. Next you will see:
      Would you like to set this as your current project (y/n)?
      Type input:​
    9. Type y then hit enter
      After that is done you will see the "Please make your decision:" line again.​
    10. Type 9 to Decompile apk (again, this is how I did it)
      You will see: Decompiling apk​

    To view the file you just decompiled:
    1. Goto apk_manager on your C:\ directory
    2. Open apk_mananger
    3. Open "Projects" folder (no quotes). Inside you will find the file you just decompiled.
      To view the xml files you are modifying, you need to right click on the xml file and choose notepad. Also notepad++ works on just about any code available.

    After you have modified the file and are ready to compile and finish your project:

    1. Type 11 to compile apk - You will see:
      Building Apk
      Is this a system apk (y/n)
      Type input:​
    2. For the sake of argument, this will be a system apk. Type y - hit enter
      You will see:

      Aside from the signatures, would you like to copy over any additional files that you didn't modify from the original apk in order to ensure least # of errors (y/n)
      Type input:​
    3. Type y - hit enter. (Again, this is what I did)
      You will see the program extracting then:

      Everything is OK
      Folders: (# of folders it made)
      Files: (# of files it extracted)
      Size: (size of the files)
      Compressed (size of compressed files)
      In the apk manager folder u'll find a keep folder. Within it, delete everything you have modified and leave files that you haven't. If you have modified any xml, then delete resources.arsc from that folder as well. Once done then press enter on this script.
      Press any key to continue...​
    4. Press any key to continue :)
      You will see the program compressing the files.​


    And that is it. If you read all the selections in Apk Manager then you will see the selections for how to put the files back into you phone.

    Sorry this is so long but I wanted to make sure that even people like me know exactly how to decompile apks.

    Anything you want me to add or delete, please let me know.

    Advertisement
  2. Ralkkai

    Ralkkai Well-Known Member

    ive been wanting to find something like this so i could poke around DSP Manager to see if i could find anything that could be done about the EQ not working on the TU. great work and thanks a ton! i might start hacking and cracking at it this weekend when i get the time.
  3. niteNarmor

    niteNarmor Well-Known Member Contributor

    DSP Manager? Is that the one that shows an EQ type screen when headphones are plugged in?
  4. Ralkkai

    Ralkkai Well-Known Member

    its not when you plug in headphones. its got individual settings for headphones, speakers and blue tooth for EQ and whatnot but for some reason it crashed whenever i mess with the EQ when headphones are plugged in. you can find the apk from searching google since its not in the store.
  5. niteNarmor

    niteNarmor Well-Known Member Contributor

    Not doubting you but are you sure its not in the play store? Was this one where you had to flash, like with the Beats Audio?
  6. Ralkkai

    Ralkkai Well-Known Member

    i think the beats one is a mod of dsp manager. idk but i do know the one i have isnt available from the store
  7. niteNarmor

    niteNarmor Well-Known Member Contributor

    If that is the one you have to flash, then you have to mount storage then flash for it to work right. I had to do that. When I did have it.
  8. Ralkkai

    Ralkkai Well-Known Member

    well its on my internal storage so id assume that means its mounted already. all i really know is that i think Loota had said taht it might not work right since it was made for cyanogenmod
  9. niteNarmor

    niteNarmor Well-Known Member Contributor

    It will be in your internal storage anyways but for some reason if you mount the storage first then flash it seems to work. But Loota knows more than I.
  10. Ralkkai

    Ralkkai Well-Known Member

    im gonna try mounting and then installing from zip and see what we get. sry for jacking the thread lol
  11. niteNarmor

    niteNarmor Well-Known Member Contributor

    Your cool. This is how we all learn. Make sure to mount storage first.
  12. Ralkkai

    Ralkkai Well-Known Member

    still the same issue lol
  13. niteNarmor

    niteNarmor Well-Known Member Contributor

    lol so maybe it is what loota stated then.

    EDIT: Where did the apk come from?
  14. Ralkkai

    Ralkkai Well-Known Member

    the apk came from cyanogenmod. i know for starters that that is an issue. it was built around ics framework and whatnot i believe and im running it inside a gingerbread built rom. from what i read you shoudl be able to run it on any ics rom and alot of ppl say they got it working on gingerbread with some force close issue. im on my tablet right now so i cant link the website but xda has a thread on it. you should find it if you search for dsp manager zip or apk
  15. niteNarmor

    niteNarmor Well-Known Member Contributor

    Check the permissions. owner, group, others should be checked under read and just the owner under write should be checked. All others unchecked.
  16. Ralkkai

    Ralkkai Well-Known Member

    Done and done. I think its just something in the app not playing right with the rom. Bass and room effects work fine though and other eq apps work fine so idk
  17. niteNarmor

    niteNarmor Well-Known Member Contributor

    Hmmmm. Well, now you can decompile the apk and maybe find a solution to this. :) Good luck.
  18. Ralkkai

    Ralkkai Well-Known Member

    Lol that's the plan
  19. Ralkkai

    Ralkkai Well-Known Member

    when i extract the second 2 zips to the "others" folder it pops up with a "do you want to replace this file" screen? i click yes right? basically same file?

    EDIT: i dont know what im doing wrong but i have java and the SDK installed but its telling me that adb is not found. so i havent even gotten off the ground yet lol
  20. niteNarmor

    niteNarmor Well-Known Member Contributor

    Sorry was out of city in a dead zone.

    Yes. Replace the two files. If you haven't done so.

    My computer was acting weird too. I had Java installed but it was telling me it wasnt. Have you entered the path into the variable screen with adb?
  21. Ralkkai

    Ralkkai Well-Known Member


    I haven't and that's probably where I'm getting hung up. Did u need to set a path for Java and the adb both or just the adb? And I was having an issue with having an old version of Java so once I got rid of the old and just had the new that part is working but I get stuck in cmd with it not recognizing the adb
  22. niteNarmor

    niteNarmor Well-Known Member Contributor

    Yeah that's why I didn't include the link for Java as they are always doing updates.

    Set path for adb and apk manager.
  23. Ralkkai

    Ralkkai Well-Known Member

    ok how do i set a path? lol
  24. niteNarmor

    niteNarmor Well-Known Member Contributor

    Let me get on computer so I can type faster. 10 mins
  25. niteNarmor

    niteNarmor Well-Known Member Contributor

    For adb -

    1. Navigate to My Computer
    2. Right click
    3. Properties
    4. Advanced System Settings
    5. Advanced
    6. Environment Variables
    7. System variables
    8. Scroll down and highlight Path
    9. Edit
    10.
    Type C:\AndroidSDK\tools and C:\AndroidSDK\platform-tools

    EDIT: Also amended the steps in thread to reflect how to set the path.

Share This Page