• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root DIY: How To Decompile An Apk

I installed Java in Program Files as in this picture but still get 'mode' is not recognized as an internal or external command,
operable program or batch file.
'java' is not recognized as an internal or external command,
operable program or batch file.
'adb' is not recognized as an internal or external command,
operable program or batch file.

2002-12-08120000-10_zpsb387ee28.jpg picture by Merlinda_George - Photobucket
(This is my Wife's account:p)

Make sure you see this C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin in your Environment Variables and this C:\AndroidSDK\platform-tools;C:\AndroidSDK\tools in Environment Variables Path on your computer.

I had to install Java several times before I figured that out.
 
nitenarmor thanks for the guide also fact that your avaialble to answer questions cuz i tried it previously having to google like a mofo cuz most guides were incomplete or "abandoned". im gonna try crack at this apk modding again.
 
nitenarmor thanks for the guide also fact that your avaialble to answer questions cuz i tried it previously having to google like a mofo cuz most guides were incomplete or "abandoned". im gonna try crack at this apk modding again.
Glad to see someone appreciates this.

That is the reason I did this guide was to have a complete noob guide, so even someone like I can follow.

I plan to stay on top of all questions as long as I am able to. There will be times however, I may not answer in a timely manner. I travel alot for work and either be out of service or just plain working. But I will answer!!!!!
 
i opened it up but i dont know anything about java and xml so until i get the chance to learn it i wont be able to do much. i have it working on my phone now just cant use the equalizer. what im considering doing is seeing about decomping another equalizer and comparing notes but right now i have no idea what the hell to look at
 
i opened it up but i dont know anything about java and xml so until i get the chance to learn it i wont be able to do much. i have it working on my phone now just cant use the equalizer. what im considering doing is seeing about decomping another equalizer and comparing notes but right now i have no idea what the hell to look at

Lol :D
 
Make sure you see this C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin in your Environment Variables and this C:\AndroidSDK\platform-tools;C:\AndroidSDK\tools in Environment Variables Path on your computer.

I had to install Java several times before I figured that out.

Where would I find C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin at in Environment Variables:confused:
 
Where would I find C:\Program Files\Java\jdk1.6.0_27;%JAVA_HOME%\bin at in Environment Variables:confused:

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

you do the same thing for java, java is located in either program files or program files x86
 
I didn't see it what does that mean please reply ASAP gotta wake up early for my Cruise to the Bahamas!!!!:D:D:D :party: time to Party! (tommorrow:()

dmcjr22 you posted before me ...lol :smokingsomb:

i had to set :a CLASSPATH and PATH for Java on User variables and System variables like this, everything working excellent

User variables:

(CLASSPATH) C:\Program Files\Java\jdk1.7.0_07\bin
(PATH) C:\Program Files\Java\jdk1.7.0_07\bin

System variables:
(CLASSPATH) C:\Program Files\Java\jdk1.7.0_07\bin
(PATH) C:\Program Files\Java\jdk1.7.0_07\bin

so now my paths looks like this

PATH: C:\Program Files\Java\jdk1.7.0_07\bin;C:\Users\Boricua\AppData\Local\Android\android-sdk\tools;C:\Users\Boricua\AppData\Local\Android\android-sdk\platform-tools

i'm i doing extra steps? idk but is working excellent
 
btw you can allways :

1- go to Control Panel
2-System and Maintenance
3-System
4-Advance System Settings
5-Evironmental variables
6 set PATH
7- Done
8- :smokingsomb:
 
Thanks so much for this. I've been trying to decompile the Talk.apk on CM10

Everything seems ok, but when I decompile (9) I get the following error

Code:
-------------------------------------------------------------------------- 
|30.10.2012 -- 10:52:44,34| 
-------------------------------------------------------------------------- 
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
2278 KB/s (1237573 bytes in 0.530s)
Could Not Find c:\apk_manager\place-apk-here-for-modding\../place-apk-here-for-modding/signedTalk.apk
Could Not Find c:\apk_manager\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedTalk.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f0b0005 dimen/roster_list_item_shove_over_distance, config=-v13
    at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
    at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
    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:120)
    at brut.apktool.Main.main(Main.java:57)

I make some changes to the .smali code in the project folder, then try to recompile (11) and get another error. I chose y for a system app and y again for the signatures question. The next part about the "Keep" folder I just left as I didn't edit any xml files.
Code:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
    at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
    at brut.androlib.Androlib.build(Androlib.java:159)
    at brut.androlib.Androlib.build(Androlib.java:154)
    at brut.apktool.Main.cmdBuild(Main.java:174)
    at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
    at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
    at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
    ... 4 more
The system cannot find the file specified.

I push the apk, but any changes I made to the .smali file don't seem to have been saved. If I pull the edited apk from my phone, my changes are missing

What am I doing wrong?! :)
 
Thanks so much for this. I've been trying to decompile the Talk.apk on CM10

Everything seems ok, but when I decompile (9) I get the following error

Code:
-------------------------------------------------------------------------- 
|30.10.2012 -- 10:52:44,34| 
-------------------------------------------------------------------------- 
java version "1.7.0_09"
Java(TM) SE Runtime Environment (build 1.7.0_09-b05)
Java HotSpot(TM) 64-Bit Server VM (build 23.5-b02, mixed mode)
2278 KB/s (1237573 bytes in 0.530s)
Could Not Find c:\apk_manager\place-apk-here-for-modding\../place-apk-here-for-modding/signedTalk.apk
Could Not Find c:\apk_manager\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedTalk.apk
I: Baksmaling...
I: Loading resource table...
Exception in thread "main" brut.androlib.AndrolibException: Multiple resources: spec=0x7f0b0005 dimen/roster_list_item_shove_over_distance, config=-v13
    at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:65)
    at brut.androlib.res.data.ResConfig.addResource(ResConfig.java:58)
    at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:196)
    at brut.androlib.res.decoder.ARSCDecoder.readConfig(ARSCDecoder.java:165)
    at brut.androlib.res.decoder.ARSCDecoder.readType(ARSCDecoder.java:130)
    at brut.androlib.res.decoder.ARSCDecoder.readPackage(ARSCDecoder.java:105)
    at brut.androlib.res.decoder.ARSCDecoder.readTable(ARSCDecoder.java:82)
    at brut.androlib.res.decoder.ARSCDecoder.decode(ARSCDecoder.java:48)
    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:120)
    at brut.apktool.Main.main(Main.java:57)

I make some changes to the .smali code in the project folder, then try to recompile (11) and get another error. I chose y for a system app and y again for the signatures question. The next part about the "Keep" folder I just left as I didn't edit any xml files.
Code:
Exception in thread "main" brut.androlib.AndrolibException: brut.directory.PathNotExist: apktool.yml
    at brut.androlib.Androlib.readMetaFile(Androlib.java:142)
    at brut.androlib.Androlib.build(Androlib.java:159)
    at brut.androlib.Androlib.build(Androlib.java:154)
    at brut.apktool.Main.cmdBuild(Main.java:174)
    at brut.apktool.Main.main(Main.java:59)
Caused by: brut.directory.PathNotExist: apktool.yml
    at brut.directory.AbstractDirectory.getFileInput(AbstractDirectory.java:103)
    at brut.androlib.Androlib.readMetaFile(Androlib.java:138)
    ... 4 more
The system cannot find the file specified.

I push the apk, but any changes I made to the .smali file don't seem to have been saved. If I pull the edited apk from my phone, my changes are missing

What am I doing wrong?! :)

Did you set the path for both the apk manager and java.?
The recompile error is from not deleting the file you did change. You still have to delete the file that was changed. Resources.arc only has to be deleted if you did change any XML file. The other files still have to deleted.
 
Ok if I'm understanding you correctly if I'm putting in a system background pic what do I delete from the keep folder at that point??

If it is just a system background pic then you delete the res folder. If you are doing the whole thing (system background including XML file) then you would delete res folder and the resources.arc.

EDIT: sorry for the late response. Been on plane for last hour. Have about an hour and half before next flight. So I will be available till then.

EDIT #2 make sure the pic is .png and not .jpg
Simply changing the extension does not always work.
 
Ok if I'm understanding you correctly if I'm putting in a system background pic what do I delete from the keep folder at that point??

if you go to katrahos thread on "how to change the system backround" there i posted detailed steps of what i did to change the system background ...
 
This will be my 1st time trying to decompile an .apk. All i'm trying to do is modify the colors of a theme from blue to orange (making it sound that simple shows just how bad of a noob i am). I've followed the OP, as far as i can tell, perfectly. Downloaded and installed all the programs, extracted them to the specified folders, and when I try to pull the .apk from the phone, it says "An Error Occurred, Please Check The Log <Option 21>" when i do, i get "adb is not recognized as an internal or external command, operable program or batch file." over and over again. Now, there's a couple of folks on this thread that have suggested, what seems to me, to "Create" paths in the enviromental variables section. I have tried that, i've tried re installing Java a good 10 times, editing PATHs, etc. it seems i've hit a wall, and i'm not sure what to do at this point.
As you answer my questions, please keep in mind that if there's a 100th level under NOOB, i'm there!
Thanks in advance!
 
This will be my 1st time trying to decompile an .apk. All i'm trying to do is modify the colors of a theme from blue to orange (making it sound that simple shows just how bad of a noob i am). I've followed the OP, as far as i can tell, perfectly. Downloaded and installed all the programs, extracted them to the specified folders, and when I try to pull the .apk from the phone, it says "An Error Occurred, Please Check The Log <Option 21>" when i do, i get "adb is not recognized as an internal or external command, operable program or batch file." over and over again. Now, there's a couple of folks on this thread that have suggested, what seems to me, to "Create" paths in the enviromental variables section. I have tried that, i've tried re installing Java a good 10 times, editing PATHs, etc. it seems i've hit a wall, and i'm not sure what to do at this point.
As you answer my questions, please keep in mind that if there's a 100th level under NOOB, i'm there!
Thanks in advance!

Lol we were all noops at one point.

For adb - have you installed the Samsung drivers?

For Java - make sure the path is set on your computer.

From what you are stating above (no disrespect intended) seems like you did not follow the OP exactly. You do have to create the paths for you computer.
 
Lol we were all noops at one point.

For adb - have you installed the Samsung drivers?

For Java - make sure the path is set on your computer.

From what you are stating above (no disrespect intended) seems like you did not follow the OP exactly. You do have to create the paths for you computer.

Oh by all means, disrespect away!!! (as a noob i understand the norm when dealing with noobs! no disrespect taken)
I have installed the drivers, and i'm not sure where to make sure the path is set for java. checking in the environmental variables section, i see nothing concerning java (maybe i have to keep installing it? what else could i be doing wrong?)
About creating paths, i did create the one you suggest
"10. Type C:\AndroidSDK\tools;C:\AndroidSDK\platform-tools" and it still did not work.
 
Oh by all means, disrespect away!!! (as a noob i understand the norm when dealing with noobs! no disrespect taken)
I have installed the drivers, and i'm not sure where to make sure the path is set for java. checking in the environmental variables section, i see nothing concerning java (maybe i have to keep installing it? what else could i be doing wrong?)
About creating paths, i did create the one you suggest
"10. Type C:\AndroidSDK\tools;C:\AndroidSDK\platform-tools" and it still did not work.

Are you running win? If so what version 32 or 64? If 64 make sure you download Java for 64.
 
Back
Top Bottom