yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] -Mr. X-:
Well the windows and linux version both fail to decompile properly. Errors that have been posted in here before but the fixes for them dont work.
[G1 Android Development] theimpaler747:
Please make a mac version!!!!! PLEASE!!!! :)
[G1 Android Development] wingshot007:
thanks!

@Daneshm90, this worked flawlessly. Just had to read a few messages in the thread about the path to java and adb. Thanks for putting this together.
[G1 Android Development] sombionix:
Hey, so I have a question. I'm adding additional 'public entry identifiers' to the public xml file in the values folder located in the framework-res.apk. After adding the additional entries, I get multiple entry names declared when I try to recompile..which I expected obviously. So I go through one at a time and change the id number and then try to recompile. But then I get a bunch of errors that say:

ic.xml:3234: error: Public entry identifier 0x1080501 entry index is larger than

available symbols (index 1281, total symbols 1052).

C:\android-sdk-windows\tools\other\..\projects\framework-res.apk\res\values\publ

ic.xml:3234: error: Public symbol drawable/stat_sys_battery_19 declared here is

not defined.

Any ideas? Is there an easier way to reassign multiple entry numbers?
[G1 Android Development] Hatman41:
APK Manager Error

So I am useing APK Manager for the first time. I put the apk file that I want to modify in the place-apk-here-for-modding folder. I then select 22 and pick the apk then I hit 9 and get an error. This is from the error log. Any idea as to what is wrong? I am trying to uncompile com.htc.resources.apk and am useing the windows version 4.9

--------------------------------------------------------------------------

|Mon 10/04/2010 -- 13:03:47.34|

--------------------------------------------------------------------------

java version "1.3.1_01"

Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_01)

Java HotSpot(TM) Client VM (build 1.3.1_01, mixed mode)

Could Not Find C:\android\APK Manager\place-apk-here-for-modding\../place-apk-he

re-for-modding/signedcom.htc.resources.apk

Could Not Find C:\android\APK Manager\place-apk-here-for-modding\../place-apk-he

re-for-modding/unsignedcom.htc.resources.apk

java.lang.UnsupportedClassVersionError: brut/apktool/Main (Unsupported major.min

or version 50.0)

at java.lang.ClassLoader.defineClass0(Native Method)

at java.lang.ClassLoader.defineClass(Unknown Source)

at java.security.SecureClassLoader.defineClass(Unknow n Source)

at java.net.URLClassLoader.defineClass(Unknown Source)

at java.net.URLClassLoader.access$100(Unknown Source)

at java.net.URLClassLoader$1.run(Unknown Source)

at java.security.AccessController.doPrivileged(Native Method)

at java.net.URLClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClassInternal(Unknown Source)

**EDIT*** I was doing this from work on a winxp box. Now I am at home running windows 7 64 bit and It cannot find my java. I am guessing because it is not looking in the C:\Program Files (x86) but instead is looking in C:\Program Files
[G1 Android Development] in4nerd:
Evo-friendly?

I love this tool, I've used it countless times with my MyTouch system files and regular market apk's. I now have an Evo and when I try to decompile Mms.apk (the native messaging app) it says....I take that back actually. It just worked.

Bro I love this tool..haha thnx

But as a side note:

Sometimes you have to troubleshoot and try a couple times before it works...however, after you troubleshoot that one time, it works from then on. Weird, but hey..if it works, it works. Love this thing :D

Again, you made my dev life way easier.
[G1 Android Development] Dru79:
hello

I have problem with one apk (translated by me). I used APK Manager 4.9 and after click function -

compile

i had error:

--------------------------------------------------------------------------

|2010-10-05 -- 13:14:12,61|

--------------------------------------------------------------------------

java version "1.6.0_11"

Java(TM) SE Runtime Environment (build 1.6.0_11-b03)

Java HotSpot(TM) Client VM (build 11.0-b16, mixed mode, sharing)

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

C:\apk_manager_4.9 - najnowszy\other\..\projects\snowstorm.apk\res\values\styles.xml:110: error: Error: String types not allowed (at 'android:textColorPrimaryInverse' with value '\@android:color/primary_text_light <item name="colorBackground">@color/white</item> <item name="colorForeground">@color/black</item>\u0020').

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\JACEK\USTAWI~1\Temp\APKTOOL3165717063369561902.tmp, -I, C:\Documents and Settings\jacek\apktool\framework\1.apk, -S, C:\apk_manager_4.9 - najnowszy\other\..\projects\snowstorm.apk\res, -M, C:\apk_manager_4.9 - najnowszy\other\..\projects\snowstorm.apk\AndroidManifest.xml]

at brut.androlib.res.AndrolibResources.aaptPackage(Unknown Source)

at brut.androlib.Androlib.buildResourcesFull(Unknown Source)

at brut.androlib.Androlib.buildResources(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.androlib.Androlib.build(Unknown Source)

at brut.apktool.Main.cmdBuild(Unknown Source)

at brut.apktool.Main.main(Unknown Source)

Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\DOCUME~1\JACEK\USTAWI~1\Temp\APKTOOL3165717063369561902.tmp, -I, C:\Documents and Settings\jacek\apktool\framework\1.apk, -S, C:\apk_manager_4.9 - najnowszy\other\..\projects\snowstorm.apk\res, -M, C:\apk_manager_4.9 - najnowszy\other\..\projects\snowstorm.apk\AndroidManifest.xml]

at brut.util.OS.exec(Unknown Source)

... 7 more

I know that in ...\res\values\styles.xml lines:

<style name="Configure" parent="@android:style/Theme.Light">

<item name="android:textColorPrimaryInverse">\@android:color/primary_text_light <item name="colorBackground">@color/white</item> <item name="colorForeground">@color/black</item>\u0020</item>

<item name="android:textColor">@color/black</item>

<item name="android:background">@color/white</item>

are bad. What`s wrong? Original (non-edited) app has same lines and works without problem. Help me and sorry for my little bad english.
[G1 Android Development] patriky:
Hi I have also problem :

mode nenˇ n*zvem vnitýnˇho ani vnŘjçˇho pýˇkazu,

spustiteln‚ho programu nebo d*vkov‚ho souboru.

java version "1.6.0_21"

Java(TM) SE Runtime Environment (build 1.6.0_21-b06)

Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)

can t findC:\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/signedcom.monotype.android.font.monoglyceride.apk.

cant findC:\apk_manager_4.9\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedcom.monotype.android.font.monoglyceride.apk.

I: Baksmaling...

I: Loading resource table...

I: Decoding resources...

I: Loading resource table from file: C:\Documents and Settings\Patriky\apktool\framework\1.apk

I: Copying assets and libs...

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

Would U tell me please why cant find the folder?

What I m doing wrong.

Thanx
[G1 Android Development] level_666:
Would be great if linux apk manager could be downloaded... at any mirror...
[G1 Android Development] xr4v3nx:
Same, I also get an error when compiling :X Any fix?
[G1 Android Development] Hatman41:
APK Manager Error

I am using winxp. I have APKManager installed in C:\APKManager I added com.htc.resources.apk and framework-res.apk to C:\APKManager\place-apk-here-for-modding. I then ran the script. I selected 22 and then picked framework-res.apk and then selected option 10 as this is a sense based rom. I then got the following error. Any insight as to how to fix this?

Please make your decision:10

Drag the dependee apk in this window or type its path

Example to decompile Rosie.apk, drag com.htc.resources.apk in this window

Type input: C:\APKManager\place-apk-here-for-modding\com.htc.resources.apk

"Sorry thats not the dependee apk, try again"

Drag the dependee apk in this window or type its path

Example to decompile Rosie.apk, drag com.htc.resources.apk in this window

Type input:
[G1 Android Development] O.D.B:
Please make version for Mac OSX :)
[G1 Android Development] floepie:
Just wow. I finally figured out what was plaguing me the entire time trying seemingly everything to get some apk's compiled! The solution was probably listed somewhere in this thread, but here goes:

When compiling I would always get errors - errors I couldn't quite comprehend. Anyways, it turns out that for whatever reason, on certain .9.png image files, their metadata was corrupt when first decompiling from the original framework-res.apk. This framework wasn't created by me, but the framework certainly works just fine. The log states that these problematic .9.pngs are renamed to simply .png files, leaving an "empty" .9.png in the decompiled folder. In order to recompile without error, these empty image files must be deleted. And, because, I did not modify the original files, and because they seem to work just fine in Android, I kept them in the "kept" folder so that they could be wrapped up into the compiled APK.

Well, I hope that solves someone else's problem out there!
[G1 Android Development] ilangoadigal:
Does anyone have any idea what would cause consistent force-closes on a recompiled apk? I decompile the APK and recompile it using the manager but I'm getting force closes on every app I try to do it with.
[G1 Android Development] floepie:
I see the same thing at times. Maybe you could try clearing out the cache?
[G1 Android Development] Marurban:
After compiling a modified application, and try to decompile it closes the console.

LOG:

java version "1.6.0_21"

Java(TM) SE Runtime Environment (build 1.6.0_21-b07)

Java HotSpot(TM) 64-Bit Server VM (build 17.0-b17, mixed mode)

W tym momencie 1.54.28.7337 byˆo nieoczekiwane.
[G1 Android Development] b16a2smith:
Here is what i am getting:

b16@Steve:~/Desktop/sdk/tools$ ./Script.sh

The program optipng is missing or is not in your PATH,

please install it or fix your PATH variable

The program aapt is missing or is not in your PATH,

please install it or fix your PATH variable

The program sox is missing or is not in your PATH,

please install it or fix your PATH variable

Sox? How do i go about editing the PATH for it.
[G1 Android Development] simmoexd97:
Hello guys i am VERY new to programming and i have a app and i want to change the picture on it but when i try to do that is saids that i don't have any project ''connected'' and when i type in nr.22 is saids: What is the Number of the app? Number? What does it number means? Can somebody tell me please!
[G1 Android Development] faxe3:
Yes ! I have the same question. I have my .apk file in the projects folder but i don't know what "Number" means !
[G1 Android Development] pardus:
I'm still new to the manager but as I see it once you have "Extract apk" then you will have a xxx.apk folder(!) in your projects folder, not an .apk file.

Then select #22 and choose the number to the left of your project eg:

- 1 - xxa.apk

- 2 - xxb.apk
[G1 Android Development] pardus:
Why am I getting this?

'zipalign' is not recognized as an internal or external command, operable program or batch file.

Could Not Find C:\apk_manager_4.9\place-apk-here-for-modding\signedxxx.apk

The system cannot find the file specified.

The system cannot find the file specified.

Zipalign.exe is in "C:\apk_manager_4.9\other" but it's not recognised or can't be found? [fixed this by placing all the files (including zipalign.exe) from "other" folder into the "apk_manager_4.9" folder]

signedxxx.apk IS in "C:\apk_manager_4.9\place-apk-here-for-modding\" with correct paths!!

Bugs perhaps?

Also the signed (but unaligned - 'cos I can't) won't install, the only thing I changed was the ya.png or app icon?
[G1 Android Development] faxe3:
But when i select "Extract apk" it says this:

Please make your decision:1

Please Select A Project To Work On (Option #22)

Press any key to continue . . .

And i does not make any folders in the project folder!

So how to i find out what number my .apk file i want to extract or decompile has?
[G1 Android Development] pardus:
Have you put your .apk file into the "place-apk-here-for-modding" folder?
[G1 Android Development] pardus:
Still getting:

Could Not Find C:\apk_manager_4.9\place-apk-here-for-modding\signedxxx.apk

The system cannot find the file specified.

and yet signedxxx.apk IS in "C:\apk_manager_4.9\place-apk-here-for-modding\"

so why can't it find it? Bizarre!:confused::confused:
[G1 Android Development] ilangoadigal:
I think I figured out what my problem was. Compile as regular app never works; I always have to compile as a system app and then do the process where I delete what I modified. Does 'compile as regular app' work for anyone else?
[G1 Android Development] in4nerd:
Getting a mac soon, had to ask..

Is the Linux version for/compatible with Mac??
[G1 Android Development] yumcax:
+1 I can't seem to get apktool working on my mac.
[G1 Android Development] lazer100:
Hello. I can not find the answer. How can I get apk manager 4.9 on win7х64? Is it possible?
[G1 Android Development] floepie:
Under what conditions is it permissible to simply replace an XML in compiled format without recompiling the entire APK (and generating a new resources file)?

For instance, Metamorph is routinely used to overwrite existing XMLs to theme a framework. Presumably, Metamorph is simply overwriting the existing XML without recompiling.

I'm just curious... Must the new XML be very close to the original XML in order to do this successfully? What are requirements for a simple replacement like this?
[G1 Android Development] lazer100:
Hello. I want to edit the xml. Made decompilation. Then he edited. Doing a compilation and error all the time. Please help, what's the problem?
[G1 Android Development] Brut.all:
You could replace compiled XML file as long as you don't use new resources in it. For example you can't add something like android:id="@+id/foo" to it. Or if you have added new drawables and use them in modified XML file, then you can't compile it and replace for other file, cause original resources.arsc does not know about these new drawables.
[G1 Android Development] floepie:
OK, thanks. Sounds like it's safe to say that if you don't add any lines to the XML, it should be fine if only values like colors or timings are modified.
[G1 Android Development] Tyler 3:
Hey can anyone please help me. I have spent hours trying to search and fix but still haven't been able to get it to work.

Whenever I run the script it says ADB was not found but I have followed many different guides and stuff and still haven't been able to get it to work. All I need to do is open up an application and view its code.
[G1 Android Development] junkdruggler:
If you have adb setup correctly it should still work... Always did the same thing to me...
[G1 Android Development] pardus:
Still trying to get to the bottom of this...

Would the usage of underscores/dashes cause any issue here? Why would a command prompt not be able to find a file in a folder?

this is the code in the .bat file

IF EXIST "%~dp0place-apk-here-for-modding\signed%capp%" zipalign -f 4 "%~dp0place-apk-here-for-modding\signed%capp%"
"%~dp0place-apk-here-for-modding\signedaligned%capp%"

which seems fine... or am I missing something?

Edit: OK I was able to ZipAlign it by putting the .apk file into the APK_manager folder, copying zipalign.exe & zlib1.dll to the same folder from 'other' and doing this from the command prompt:

F:\apk_manager_4.9>zipalign -f -v 4 signedxxx.apk xxx.apk

Verifying alignment of CGcalc.apk (4)...
54 META-INF/MANIFEST.MF (OK - compressed)
513 META-INF/CERT.SF (OK - compressed)
999 META-INF/CERT.RSA (OK - compressed)
2219 AndroidManifest.xml (OK - compressed)
.....................
18698 classes.dex (OK - compressed)
1282876 res/drawable/ya.png (OK)
1285938 resources.arsc (OK - compressed)
Verification succesful

This script has more bugs than a cape buffalo in the wet season!
[G1 Android Development] floepie:
^^ Because you probably stuck the file onto a folder (C drive) to which your user doesn't have write rights? That is often the case on the C drive. When you attempt to do so, W7 virtualizes the placement of that file so that it only appears to be in that folder from a windows perspective, when in reality it's located in the virtualstore directory in your user's directory.
[G1 Android Development] lazer100:
Who is going to help. How to edit the xml?
[G1 Android Development] ilangoadigal:
Try compiling as a system app and then deleting your changed xml and resources.arsc from the keep folder when prompted.
[G1 Android Development] lazer100:
To me it is not clear. Why I should remove these files? At what stage to do removal?

I want to compile apk with changed xml.
[G1 Android Development] cauli:
For a System build, Apk Manager creates a copy of the original apk files in the Keep folder. If you wish to modify a particular file, you remove it from the keep folder. After the modified apk files are compiled, the original files in the Keep folder are copied over the new files. So if you don't first remove the ones you want modified from Keep, none of the files will end up modified. AIUI.
[G1 Android Development] pardus:
er, using Win XP not W7 so no virtual file placement... also no such thing as write rights on that file or folder. I placed the file in the folder myself and I can physically see it's there, so sorry - your reply holds no water
[G1 Android Development] pardus:
Some further investigation found some of the bugs:

at line 395 - item in red must be added otherwise zipalign doesn't work:

:zipa
[COLOR="red"]cd other[/COLOR]
echo Zipaligning Apk
IF EXIST "%~dp0place-apk-here-for-moddi....

Also line 480 - item in red must be added otherwise the source (smali) gets decompiled too which makes the output file 10x bigger:

java -Xmx%heapy%m -jar apktool.jar d [COLOR="red"]-s[/COLOR] "../place-apk-here-for-moddi....

just my 2c worth...:)
[G1 Android Development] lazer100:
ilangoadigal

cauli

Thanks for the help. Now other problem.

I will write the steps.

I stitch on GalaxyS pure insertion JP6.

1. In APK Manager 4.9 I decompile framework-res.apk

2. In a folder the Project I edit a file xxxx.xml

3. In the Manager I allow a command to compile

4. There is folder Keep. In her I delete a file xxxx.xml and resources.arsc

5. Compilation comes to an end

6. I copy the "AndroidManifest.xml" file and "META-INF" folder from the original apk to the repacked apk.

7. I copy update.zip with new framework-res.apk in GalaxyS

8. Flash via 2e recovery

GalaxyS it can not be loaded. Only prompt S.

Again I stitch phone :)

What do I do not correctly? In what my error?

------------------------------------------------------

I think a problem with compilation.

I have made experiment.

1. Decompiled original framework-res.apk

2. That I do not edit

3. Compiled framework-res.apk

GalaxyS it can not be loaded. Only prompt S.

Again I stitch phone :)

Excuse for my English :)
[G1 Android Development] :
Does anyone here know what could be causing this? WTF is up with the notification bar? I have not modified an XML that could cause this and when I set it to another theme in CM settings I can see everything :confused:
[G1 Android Development] pardus:
FWIW, I don't think this is a magical decompiling/compiling solution because something sometimes seems to get lost in the translation (depending on the apk). Perhaps for simple apps/apk's it's fine.
[G1 Android Development] :
If the Galaxy S system is anything like the normal android system (I'm guessing it is :p) there is no need to do all that. Just decompile, edit, compile and flash ;)
[G1 Android Development] iDielord:
Can't get this to work at all for some reason. Decompiled framework-res.apk, made no change at all, pushed 11 to compile, and it reports an error :(
[G1 Android Development] :
You didn't sign it did you? And you did confirm that it was a system apk right? And the noob question: Did you name it correctly? :p
[G1 Android Development] yatindroid:
[Q] replace png

I want replace png simply nothing else to make new themes from previous or change icon HOW IT IS Possible?

not programmer

can only extract & zip files

i tried this way with winzip but apk don't install
[G1 Android Development] :
Ofc not. If it's a system apk then it must be pushed. If it's an apk you downloaded from the market then it must be signed.
[G1 Android Development] floepie:
Here's the problem and hopefully the solution to what I think troubles much of the compiling. Quite often, people begin with a modified framework and want to modify it further. This is fine, but all of the patch-9 files (*.9.PNG) must have the proper info embedded in them and the resources files must contain info about those very same patch-9 files.

So, if you're starting with a modified framework and want to modify it further, check the log after decompiling it for *.9.png files that were renamed to .png files because the metadata (either in the *.9.png or the resources file) is not readable. Most likely these are modified files generated by someone who did not modify the originals properly, which is fine if the end product works, but for decompiling/recompilng, it poses problems. If you find that any of the PNGs have been renamed in such a manner, you will also find in the decompiled folder TWO files pertaining to the file in question - one that was renamed PNG, and the other is a "ghost" file with no data in it.

In order to recompile this APK without error, this is what I do: First, delete those two files in the decompiled folder (the renamed one and the "ghost" file). Then, find the original, stock *decompiled* version of the .9.png, NOT the compiled version. You can often tell the difference between the two if you look carefully at the borders of the image file, where you might see black and white lines present in the decompiled version, but not the compiled version of the .9.png file. Insert the original, stock decompiled .9.png into the drawable-hdpi folder (or other appropriate folder). Now, when recompiling, remove or delete the original problematic .9.png from the "keep" folder in addition to any other files from the original you do not want to keep (you don't have to delete the resources file in the keep folder unless you modified any XMLs). Lastly, assuming you want that problematic .9.png file back in your APK because you prefer the way it looks over the original, simply copy over the extracted version of that .9.png back into the APK in its compiled version.

Hope that helps....
[G1 Android Development] :
It would give errors when compiling if you modify the 9 pngs or they are "broken" from start.
[G1 Android Development] lazer100:
Friends, somebody can help me?

The problem described above.
[G1 Android Development] :
I already answered you here?