yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] kevdog:
Maybe I'm making a big leap here -- but if you are using other people's pngs, can't you drag/drop these into the resultant zip file after you compile with apktool rather than decompiling them, moving them to your apktool project, and then compiling them again? Seems like it would save some time.
[G1 Android Development] :
*C0mpu13rFr34k is banging his head through a wall
[G1 Android Development] Brut.all:
Yeah, of course, you could do this that way. Actually I have suggested this solution in my last post, but have edited it out - still you could read this in a quotation in C0mpu13rFr34k's post :-)

If you add new files, then you would have to create some dummy 9.png files first, of course with valid borders, etc. and then build and replace. Worse is: you would have to replace these files after each build and usually you build and app several times, so for me this solution does not have much sense.
[G1 Android Development] :
*C0mpu13rFr34k stopped banging his head through a wall.
[G1 Android Development] kevdog:
Seems like a headbangers ball around here!!!
[G1 Android Development] iScream^:
Hi.

I'm trying to edit an apk(actually, I tried 2) without success. I can extract and edit the content, but I can't pack it back together. It says these things in log: http://img576.imageshack.us/img576/3339/apktool1.jpg

w7 x64, admin privileges for the command prompt.

Thanks in advance.
[G1 Android Development] lmbd:
Tried today decompiling and compiling a framework-res.apk but got the same error, too.
[G1 Android Development] kevdog:
Make sure its a stock ROM -- not a themed ROM or framework.
[G1 Android Development] lmbd:
Is it imposssible to edit a edited framework-res?
[G1 Android Development] :
Nope you just have to decompile the original framework-res then the modified framework-res then you copy everything you need from the themed framework-res over in the original and now you can start modding ;) Or you can just extract it (themed) if you are only modding pngs :)
[G1 Android Development] Brut.all:
I think most of modded apks should work normally with apktool. As I said: if Android OS can read some apk, then it's valid and apktool should be able read it as well (ofc there may be some bugs/unsupported features in apktool) :-)

iScream^'s problem was different, we have solved it here: http://xdaforums.com/showthread.php?p=7896641#post7896641

@lmbd

I don't think you really got exactly the same error, cause you probably use different locale in your system. If your error message is something like "The system can't find the specified file.", then look into my above link.
[G1 Android Development] lmbd:
seems to work :) thank you for the advice!
[G1 Android Development] SeaborneClink:
Thank you so much for this app :) Made my first foray into the real android world today.

Took apart WidgetLocker and added my own custom spin to my lock screen.
[G1 Android Development] Ateisti:
Great script, made it easy to apply a circle battery mod to my SGS.

There's a bug in the latest beta though, that doesn't allow you to select a project if you have more than one .apk in the place-apk-here-for-modding directory.

On line 215:

if /I %INPUT% LSS !count! (goto chc)

Should be:

if /I %INPUT% LSS 1 (goto chc)
[G1 Android Development] Daneshm90:
Right, thnx for tht. Wonder why ppl didnt complain :S

Update :

So ive been using this beta since i put it out, editing it anytime i found a quirk. And i think its stable enough to release. So heres the last one before i make it a stable release. I'll setup a poll in front thread asking for the stability of this beta and based on it i'll time the stable release. Plz if u have any issues, post here (try not to pm ;)), and i'll try to get it fixed.

Download Here
[G1 Android Development] x3gypxtianx:
I have decompiled framework-res.apk successfully from the /system/framework/ folder but having trouble compiling it again.

I keep getting:

Building APK
"An Error Occurred, Please Check The Log (Option 21)"
Press any key to continue...

Any idea why this is happening?

Update: After going through the log, I noticed that all the issues are from public.xml. About 50~60 of the drawable values have this error:

(path of public.xml : line number) "declared here is not defined"

I checked, though, and they're all there... :/
[G1 Android Development] rori~:
This happens frequently when I experiment bad edits :-)

Sent from my Nexus One
[G1 Android Development] Daneshm90:
Won't flame you ;)

99.9% its happening because ur decompiling a themed framework-res.apk

Try doing so to a stock one and you won't experience these issues.

Reason i say "flame" is cuz its been mentioned 5+ times in this thread.
[G1 Android Development] addelh:
Hey Danesh,

Awesome job on the script mate. Wondering if you could help me through this error though :(.

I'll explain what i'm trying to do and how i'm doing it;

I'm running Cyanogen Mod 6.0 on a HTC Desire. I'm wanting to edit a lock screen in the app 'Widgetlocker'.

Previously i've been using adb to pull the apk and after editing the image i wanted i'd push it back and it works fine untill i reboot my phone. Then it deletes Widgetlocker.

With your script i've been running the following;

0 - Pulling apk from /data/app/com.teslacoilsw.widgetlocker-1.apk

1 - Extracts fine

- I edit the image i want

2 - Optimizes fine

3 - I've tried selecting both System and Regular apk and it zips fine

4 - Here's the problem when i hit Sign apk i get the following;

Signing Apk

"An Error Occured, Please Check The Log <option 21>"

When i check the logs this is what i see;

Exception in thread "main" Could Not Find C:\AndroidSDK\tools\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk

The system cannot find the file specified.

java.lang.UnsupportedClassVersionError: com/android/signapk/SignApk (Unsupported major.minor version 49.0)

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

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

at java.security.SecureClassLoader.defineClass(Unknown 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)

Exception in thread "main"

Hope i've provided sufficient information.

Thanks in advance! :)

-del
[G1 Android Development] Daneshm90:
Hey.

How did u sign ur apk before? Try putting tht .jar in apk manager other folder.
[G1 Android Development] kevdog:
What version of apktool is in the final beta? 1.3.2 was just released.
[G1 Android Development] addelh:
Hey,

That's the thing.. I dont think i was ever signing it.

I'd do the following steps;

adb pull data/app/com.teslacoilsw.widgetlocker-1.apk com.teslacoil.widgetlocker-1.apk

I'd edit the image i want in drawable-hdpi then place it back in the apk, then;

adb remount

adb push com.teslacoilsw.widgetlocker-1.apk data/app/

Done.

Am i doing something wrong in the procedure?

Cheers!

-del

PS. This is also a paid app.. If that makes a difference.
[G1 Android Development] Daneshm90:
Well its an app on the /data partition, upon change it must be resigned.

Without resigning it won't show up in ur app drawer, and upon installing it will give u a parsing error.

See if ur path to apk manager has any wierd spaces/symbols in it.
[G1 Android Development] g00ndu:
daneshm90, many thanks for your wonderful tool. it really make the modding of apk a breeze. the keep folder was a brilliant idea, and make it so easy to modify the apk now.

p/s: yes, i notice there was a bug, but it's a small one and most of the time, i do it one at a time. :D
[G1 Android Development] L0cke:
Is the mediafire link not working for anyone else?
[G1 Android Development] mrdodge:
Confirmed... link seems to be down. Looks like mediafire servers are offline
[G1 Android Development] junkdruggler:
Yeah mediafire is down
[G1 Android Development] tKoHaXoR:
So when can we expect a mirror before the end of today? :D
[G1 Android Development] Daneshm90:
Relax, i'll upload it from my pc and update the OP.
[G1 Android Development] Daneshm90:
Ok so i updated OP. Screw beta, ive been using it for a while now and haven't found issues (if i did i tweaked em). So if u find issues, please post em. The features i've added on to OP as well, mostly ur gonna see stability and a new projects/keep methods.
[G1 Android Development] Asadullah:
So how do I change this to work with my release key if say for instance my keystore is,

scoobydoo.keystore
[G1 Android Development] mousse04:
Hi everyone,

I searched on this thread but I didn't find my answer, so this is my problem.

i just want to modify the framework-res.apk and re push it.

The framework-res.apk is not themed, so no problem.

This is my process:

-1- I place my framewok-res.apk into place-apk-here-for-modding.

-2- I launch the application and I select my framework

-3- I decompile it. The results is in project.

-4- I modify it and I relaunch the application. I select framework-res.apk

-5- I compile it. So, a build folder is created in project and a unsignedframework-res.apk is created.

If I push this apk in my phone I have bootloop

So I try to sign it but I got the same bootloop

Can someone help me?

Thanks a lot
[G1 Android Development] blakestiffler:
can someone tell me how to fix the "missing libsox" problem????

error:

The program sox is missing or is not in your PATH
[G1 Android Development] s_dimaio:
you have to:

- decompile framework-res.apk

- edit the file

- compile framework-res.apk

- copy into the new framework-res.apk the "meta-inf" folder and the "androidmanifest.xml" of the original framework-res.apk (using for example 7-zip)

- push the new framework-res.apk into you device

now it should works!

bye
[G1 Android Development] Daneshm90:
Correct if ur using an older apk manager. With the new one, when u compile, say yes to system app, then say yes to "more than signature", now delete from the "keep" folder w/e u don't want to keep (i.e stuff u modified). Then just continue with the script. That should give u no problems.
[G1 Android Development] s_dimaio:
how wonderful is the progress! thanks!!!
[G1 Android Development] mousse04:
Thanks a lot men...

everything works perfect...

You are the men ;-)!!!!
[G1 Android Development] L0cke:
Okay, I'm probably missing something here but I if opt to delete the modified files I end up with an unsigned.apk with none of the modified files in :S They still remain decompiled in the projects folder.

I am trying to do this on Rosie.apk

If anyone has done it for Rosie using 4.9 please let me know of the correct steps.
[G1 Android Development] benji:
having an issue with apkmanager. these are the exact steps i take

and my phone boots but its missing the wallpaper and when i unlock EVERYTHING forcecloses

ive done this about 15 times and same results everytime

doesnt matter if i make any changes to .xml's/images or not

if anyone can help, thank you!

edit: didnt see this

seems to have resolved my issue but ill be doing a little bit more testing
[G1 Android Development] thebowers:
Maps 4.5 Won't decompile

com.google.android.apps.maps-2.apk is placed in place-apk-here-for-modding folder. When I do 9 to decompile it just gives me the check error log. So the error log shows this.

Thu 09/09/2010 -- 21:50:06.63|
--------------------------------------------------------------------------
java version "1.6.0_20"
Java(TM) SE Runtime Environment (build 1.6.0_20-b02)
Java HotSpot(TM) Client VM (build 16.3-b01, mixed mode, sharing)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find D:\android\tools\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged.apk
Could Not Find D:\android\tools\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-signed.apk
Could Not Find D:\android\tools\Apk_Manager_4.8\place-apk-here-for-modding\../place-apk-here-for-modding/repackaged-unsigned.apk
I: Baksmaling...
Exception in thread "main" brut.androlib.AndrolibException: brut.androlib.AndrolibException: File already exists: ..\out\smali\A\a.smali
at brut.androlib.Androlib.decodeSourcesSmali(Unknown Source)
at brut.androlib.ApkDecoder.decode(Unknown Source)
at brut.apktool.Main.cmdDecode(Unknown Source)
at brut.apktool.Main.main(Unknown Source)
Caused by: brut.androlib.AndrolibException: File already exists: ..\out\smali\A\a.smali
at brut.androlib.src.SmaliDecoder.decodeClassDefItem(Unknown Source)
at brut.androlib.src.SmaliDecoder.decode(Unknown Source)
at brut.androlib.src.SmaliDecoder.decode(Unknown Source)
... 4 more

Ideas? I can do just about any other app but this one.

EDIT: Just tried the new beta version and it works beautifully!!! I love this tool.
[G1 Android Development] monstermuffin20:
Java was not found?

--------------------------------------------------------------------------
|10/09/2010 -- 16:36:55.21|
--------------------------------------------------------------------------
'java' is not recognized as an internal or external command,
operable program or batch file.
[G1 Android Development] monstermuffin20:
fixed java thing, bow i cant sign apk's :confused:

--------------------------------------------------------------------------
|10/09/2010 -- 18:42:35.32|
--------------------------------------------------------------------------
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b07)
Java HotSpot(TM) Client VM (build 17.0-b17, mixed mode, sharing)
java.io.FileNotFoundException: ..\place-apk-here-for-modding\unsignedunsignedframework-res.apk (The system cannot find the file specified)
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at com.android.signapk.SignApk.main(SignApk.java:437)
Could Not Find C:\Users\Rian\Desktop\i\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedunsignedframework-res.apk
[G1 Android Development] wesblake:
adb missing?

Hi. I have the sdk, used it a lot already, and have the PATH info set up, but when I try to run this program in linux, I get "The program adb is missing or is not in your PATH, please install it or fix your PATH variable"

Well, if I echo the PATH variable, I get:

/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/wesblake/Document/web-projects/code-library/android-sdk-linux_86/tools

I double-checked, and that is the correct directory for the sdk tools, why am I getting this error? Thanks.

**EDIT**

Nevermind, It took me posting this here to notice I do have my path wrong, should be "Documents" not "Document". Thanks!
[G1 Android Development] sneaky_zekey:
was the linux version updated to 4.9 too, or is it left behind.
[G1 Android Development] Brut.all:
@Daneshm90

I've just found explanation/confirmation of META-INF/AndroidManifest.xml method in the Android sources :-)

if ((flags&PARSE_IS_SYSTEM) != 0) {
// If this package comes from the system image, then we
// can trust it... we'll just use the AndroidManifest.xml
// to retrieve its signatures, not validating all of the
// files.
JarEntry jarEntry = jarFile.getJarEntry("AndroidManifest.xml");
certs = loadCertificates(jarFile, jarEntry, readBuffer);

:-)
[G1 Android Development] Daneshm90:
Awesome, thanks for looking it up. Finally a reason to the madness ;)
[G1 Android Development] Tayutama:
So minor problem after upgrading to 4.9

I'm trying to modify a framework-res.apk and it runs without errors and compiles again but my phone won't boot when i push the modified framework-res.apk to my phone

Had no problems with this in 4.8
[G1 Android Development] Brut.all:
Try to unzip this framework-res.apk and zip it back without compression. https://code.google.com/p/android-apktool/issues/detail?id=67#c4

@Daneshm90

Changelog would be good - I would know whether you have updated apktool in 4.9 :-)
[G1 Android Development] xtort1417:
is there any chance of getting the linux version to run on OSX?
[G1 Android Development] Daneshm90:
Yea gotta do that. In the script though i've included a "about" page where it lists the versions of all components involved.

The only 2 features added are :

1. "Keep Folder" - where when u recompile an app, it asks u whether if its a system app or not, if u say yes, it copies over the meta-inf from the original apk, then it asks if u want to further retain some of the contents of the original apk, if u say yes to this, it creates a keep folder in the main directory, within it w/e u don't delete will replace ur modified apk (ie if u want to retain ur manifest.xml ud leave it there).

2. "Multiple Projects" - Allows u to switch/choose ur current project and everything u do with is done under its own name under the directory "projects".
[G1 Android Development] bretac:
First off, I have to say this is an awesome tool. Thanks for making it!

Now, on to business. I'm pretty much a noob at android apps, but I'm trying to add some new functionality to an existing market app (it's free). It has some quirks in it, and they annoy me. I wanted to edit them using eclipse and hopefully get to know more about working with android apps along the way. So I used your tool to decompile the app and then imported the project into eclipse. All the xml and smali files show up, but there's no .java file for the app (just R.java). Any ideas?
[G1 Android Development] Daneshm90:
This is completely dependant on what apktool does, apktool doesn't decompile into .java files instead .smali files, hence this tool won't either ;)
[G1 Android Development] Bouncer5:
I seem to be having some problem (Windows)

I press 9 to decompile, replaced the few icons just to test it out, press 11 to recompile, and im getting a error

Log found here
[G1 Android Development] Brut.all:
libpng error: Read Error
ERROR: Failure processing PNG image C:\Documents and Settings\Owner\Desktop\apk_manager_4.9\other\..\projects\framework-res.apk\res\drawable-hdpi\statusbar_background.9.png

Did you do anything with this file? Try to open it using image editor - to see whether it's broken or something.
[G1 Android Development] :
I'm trying to add CM settings to a Settings.apk but I'm getting these errors when I try to recompile:

C:\Users\Emil\Documents\HTC Hero\Tools\Apk_Manager_Beta_4.9_BETA_FINAL\other\..\projects\Settings.apk\res\values\public.xml:1510: error: Multiple entry names declared for public entry identifier 0x48c in type string (cm_settings_title vs sound_category_calls_title).
C:\Users\Emil\Documents\HTC Hero\Tools\Apk_Manager_Beta_4.9_BETA_FINAL\other\..\projects\Settings.apk\res\values\public.xml:1513: Originally defined here.
C:\Users\Emil\Documents\HTC Hero\Tools\Apk_Manager_Beta_4.9_BETA_FINAL\other\..\projects\Settings.apk\res\values\public.xml:1510: error: Public symbol string/sound_category_calls_title declared here is not defined.

I've edited public.xml (surprise xD) and strings.xml under some locales and /values

Thanks :D
[G1 Android Development] Brut.all:
And you have screwed up it ;-P "Multiple entry names declared for public entry identifier 0x48c" - I think this is self-explanatory: you have added string with ID used by other string.

Ahh and do you really need to edit public.xml file?
[G1 Android Development] :
Oh thanks (again again xD). I don't really know how that ID thing works. Do you need a special ID or can it just be random? I'm not sure I had to edit the public.xml but it was giving me errors before from it that might have been bacuse I didn't modify the strings but I'll try again :)

Thanks :D

EDIT: Yay it worked! I didn't need to edit public.xml. Now to test if the CM settings are added :)

Thanks again :D
[G1 Android Development] darkamikaze:
wow.. i wish i found this sooner.. donate button? do you have one D: ... helped a lot theming my captivate ..
[G1 Android Development] Virus:
hey guys i keep getting this in linux can sombody help

The program adb 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
[G1 Android Development] Brut.all:
"No resource found that matches the given name (at 'drawable' with value '@drawable/stat_sys_battery_05')." - I think this is self-explanatory. Do you have this resource in your dir?
[G1 Android Development] Shagman68:
Thanks I was about to pick up a drinking habit instead of finishing this project. I was thinking I could add the files after the fact, and that this was only gonna turn my text xml into a binary xml.

Sent from my Vibrant using the XDA app.
[G1 Android Development] bga7x:
Sorry if this was answered but has anyone got you tube to decompile?

*Edit NM got it!!!!! ;)
[G1 Android Development] sombionix:
Ok, I'm totally stuck for some reason. This has worked before in the past, but for some reason, not now. Please tell me if I'm doing something wrong. I'm trying to edit some xml in the framework-res.apk. However, when I compile the apk, the xml files I've edited will not convert back to binary. Here are the steps I've taken.

1. decompile apk

2. edit xml files in human readable format

3. add the original resources file to the projects folder

4. compile apk

5. Is this is system app? YES

6. It states, "in the keep folder, remove any file you modified and leave any you didn't. Also, remove the resources file if you edited any xml as well.

7. So I now remove the resources file and the xml files I've edited.

8 apk manager successfully compiles apk, however, the xml files I edited are not converting back to binary, they stay in human readable format.

What am I doing wrong here? Thank you in advance.
[G1 Android Development] Daneshm90:
First time ive encountered such an error. Anyway, im confused as to the reason behind ur step 3. Why are u copying the original resources.arsc ?

Can you also post ur log.txt ?

Thanks
[G1 Android Development] sombionix:
I actually thought I was supposed to take the resources files from the original. It seems after the apk is decompiled, there is no resource file in the projects folder. When there is no resource file in the projects folder and I go to compile the apk with option 11, I get the above error as seen in my log.
[G1 Android Development] Daneshm90:
Ah last time i remember seeing that was here Link

As u can see from the post after, Brut.all said its an issue with apktool, not sure if its been resolved yet. Can you upload ur framework-res.apk ? I want to see if i encounter the same issue. Thanks
[G1 Android Development] sombionix:
Here is the framework-res.apk I've been trying to edit.

The xml I'm trying to edit is under:

res>layout>status_bar_latest_event_content.xml

Thanks!
[G1 Android Development] Daneshm90:
Ok quick question, is this a vibrant framework-res ? Regardless, can u also upload ur twframework.apk ? Thanks
[G1 Android Development] sombionix:
Yes, this is for the Vibrant.
[G1 Android Development] Daneshm90:
Ok as far as i can tell, the reason this is hapenning is because you are trying to decompile a themed/xml edited apk. Reason i say this is because i have a i9000 running 2.1 and i can decompile/recompile my framework-res w/o errors. Try to get a stock framework-res.apk for ur firmware and see if the issue persists.
[G1 Android Development] sombionix:
Well slap me sideways and call me Betty. It worked! Can't say thank you enough, I've been trying to figure that out for 8 hours straight.
[G1 Android Development] Daneshm90:
Hehe, cool.

Yea i gotta add a tips/tricks section to op :p
[G1 Android Development] Brut.all:
Hmm... I was able to rebuild both above files using apktool 1.3.2 :-/ Themer broke some of 9.png files, but apktool autofix this problem.