yashsingh1/xdaforums huggingface dataset:
[G1 Android Development] jsmccabe78:
fantastic tool. thank you.

question:

i cannot compile my themed apk as it contains xmls with capital letters (which are referring to original apks with capital letters in their package name - using tmobile theme chooser). if i remove these, it compiles and installs fine.

anyone have success / a workaround?

my ultimate goal is to exchange the main launcher icon in each apk to a consistent theme...maybe there is an easier way? new to android...
[G1 Android Development] roscoenr:
If all you are doing it's chanting

changing icons then there is no need to decompile the apks just use 7zip our something similar to replace the icons. When use 7 zip do not unzip only navigate with in the apk and replace the png that should be located in res/drawable_hdpi
[G1 Android Development] klquicksall:
Just wanted to say thanks to everyone who helped me out in here. Great thread.
[G1 Android Development] jsmccabe78:
thank you. am not being clear; my question is a tad more advanced (am aware of changing images in apks, CWM mods, etc.)

what i am trying to do is build an apk for tmobile's theme chooser (part of CM7).

what is great about this theme style is you do not have to edit individual apks; you redirect them.

for example, i redirect:

<package-redirections android:name="se.catharsis.android.calendar" android:resource="@xml/se_catharsis_android_calendar" android:minSdkVersion="7" />

so instead of using the native xml, the theme will use my xml. the name is based on the package name.

however take amazon's package name:

<package-redirections android:name="com.amazon.mShop.android" android:resource="@xml/com_amazon_mShop_android" android:minSdkVersion="7" />

it has a capital letter. so when i go to compile my apk (which has ~30 of these xmls with 100s of images) it fails due to that capital letter. if i delete the capital letter it compiles, though will not alter the xml as it is named incorrectly.

does this make sense? anyone know a solution? thanks.
[G1 Android Development] roscoenr:
my bad that make more sense sorry i can't help you there
[G1 Android Development] SWFlyerUK:
Hi Guys,

I'm a little confused here - I've put my .apk in "place-apk-here-for-modding", run the .bat file and I'm getting "ADB was not found. . . . blah blah blah"

I've got my phone plugged in through ADB, and have confirmed via "adb devices"

Any suggestions as to where I go from here, I've not got the faintest on how to work with .apks, :D

Regards.
[G1 Android Development] roscoenr:
You need abd in your path
[G1 Android Development] gunnermike:
im trying to get framework-res.apk and twframework-res.apk installed to i can dork woth some apps, but it isnt happening. im on windows 7. any ideads? what other info would be help you guys help me?
[G1 Android Development] KreAch3R:
Hi! I have been using your program for a while now, great life saver!:)

I think I have a request. Could you implement a option for which apktool will be used (between 1.3.1 and 1.3.2)? I have to switch them manually (because some files like the one and some others the other). So it would be cool if we could select it at the beginning of our work with the script.
[G1 Android Development] klquicksall:
this is a great tool. Thanks so much.
[G1 Android Development] fernando sor:
That is a known issue. 1.3.2 wont recompile certain xmls without parsing errors and 1.3

1 can't recompile gmail sources (smali) without errors. I would just swap them out as you need to.
[G1 Android Development] Daneshm90:
Yes definitely....im thinkin of callin it..."Compatibility mode" :)
[G1 Android Development] 1982Strand:
So, I tried editing some system apps to add and improve languages in them.

I'm using them in miui 1.4.1 Rom btw..

I am struggling with the re-compiling, only by using the following method:

1. Decompile

2. Edit/add files (I.e. add values-da/strings.xml to res folder..)

3. Recompile, yes to the 2 options

4. Add everything from original apk, except res folder and resources.ascr to my recompiled apk

5. Push the file..

It works on the phone, but miui theming no longer applies to the respective apk?? I mean for instance, when I try to apply a theme to mms.apk, it doesn't modify it, it just stays the same..?

Oh, if I don't copy all from original apk, besides the above, my recompiled apk is smaller in filesize and doesn't work on the phone. Am I using the right method? It doesn't matter weather I try signing the file or not.. (guess I shouldn't sign it because its a system app)

But how do I Recompile it, so it keeps its original signatures, but contains the added/edited strings.xml files in the res folder?

Also. It seems to make no difference wether I use apktool 1.3.1 or 1.3.2
[G1 Android Development] KreAch3R:
I know that, and I do swap them.:) I thought that an option of

Apktoool version?
1. apktool 1.3.2.
2. apktool 1.3.1.

would be better.

Thank you!!:D
[G1 Android Development] fernando sor:
That would be an awesome option
[G1 Android Development] thefunkbot:
I've been using apk manager for weeks untill today, and now its now working for me (atleast for this one apk.) I know it has to be something wrong with the apkmanager because i've tried decompiling and recompiling with no edits and the app still forcecloses when i push it. When using apktool to decompile manually, i get this error. Its the dialeractivity.apk, and it depends on twframework-res and framework-res from what i understand. I have included a link to a paste of my command prompt.

http://pastebin.com/UwMCDNh8
[G1 Android Development] KreAch3R:
I completely agree. :)
[G1 Android Development] Daneshm90:
K added apk tool 1.3.1 option under update tools.

Let me know how it works out. Gotta do somethin similar for aapt as well cuz tht seems to cause issues depending on which ur using.
[G1 Android Development] silverxbv2:
I'm not at my pc right now, but where is update tools? I dont think I've ever seen that option.

Edit. Nevermind. I hadn't tried out 5.0 yet. Thanks for this.
[G1 Android Development] Raadius:
How can I edit .xml files once I extract the contents of the .apk? I don't want to use Eclipse :/
[G1 Android Development] fernando sor:
Use notepad ++
[G1 Android Development] nuggyunlimited:
I keep getting the java not found error and this is what my path say. I have the sdk, jdk, and jre can someone help me figure out how to get apk manager 4.9 to find java please

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\EgisTec\MyWinLocker 3\x86;C:\Program Files (x86)\EgisTec\MyWinLocker 3\x64;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Java\jre6\bin;C:\Program Files (x86)\QuickTime\QTSystem\
[G1 Android Development] Raadius:
Thanks but when I use the program everything comes back as [NUL] in black bg font, can't tell really what to edit :confused:
[G1 Android Development] dreamsforgotten:
If you extract files from an apk they are already compiled. Notepad ++ won't work. You'll have to compile with apk manager to be able to edit w notepad but no eclipse needed.
[G1 Android Development] fernando sor:
Obviously I'm referring to decompiled xmls. It won't work with a compiled or recompiled XML.file.
[G1 Android Development] dreamsforgotten:
I was making sure he understood I knew you knew what you were saying
[G1 Android Development] fernando sor:
........ :)
[G1 Android Development] Raadius:
Yes, I understood. Thanks.
[G1 Android Development] Part Four:
Yikes. Total noob here. Can't figure out how to install this. Running Ubuntu 10.10. Downloaded and extracted the .zip file to my desktop. Now what? Tried double clicking the Script.sh file, but just opened in gedit. Confused. Help would be greatly appreciated. Thanks.
[G1 Android Development] kirbnite:
Where do I get 5.0 from.
[G1 Android Development] db3:
You will need to make the script executable. Right-click the script.sh file, select properties (i think), then select permissions. I believe the checkbox is near the bottom.
[G1 Android Development] roscoenr:
Page 135 of this thread
[G1 Android Development] r0nin ar1es:
FYI The file for direct dowload is corrupted or something.

I got both these errors when trying to d/l

But when i went to the mrgaupload site, BAM! it worked.
[G1 Android Development] kirbnite:
thankyou so much
[G1 Android Development] LfcFan1977:
@madindehead

Firstly, I would recommend using v5.0 from page 135.

Secondly, do png's and xml's seperatly.

[9] decompile

swap the xml's

[11] compile

[y] system apk

[y] other files

in "keep" folder delete resource.arsc and the xml's you swapped.

[any key] to continue.

If you get no errors, then do the png's

[22] set current project

[2] unsignedframework-res.apk

[1] extract

swap the png's

[3] zip

[1] system apk

move the unsignedunsignedframework-res.apk in "place-apk-here-for-modding" folder to anywhere you like. Rename to "framework-res.apk" and adb push to correct folder in phone.
[G1 Android Development] madindehead:
Thank you, I will give this a try :)
[G1 Android Development] madindehead:
Still getting that error :(

22 Set current project

23 About / Tips / Debug Section

24 Update tools

25 Switch decompile mode

26 Quit

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

Please make your decision:11

Building Apk

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\res\drawable\stat_sys_battery.xml:1: error: Error parsing XML: not well-formed (invalid token)

E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\res\drawable\stat_sys_battery_charge.xml:1: error: Error parsing XML: not well-formed (invalid token)

E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\res\drawable\zzz_stat_sys_battery_1.xml:1: error: Error parsing XML: not well-formed (invalid token)

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\Mads\AppData\Local\Temp\APKT

OOL3896128828642886834.tmp, -x, -0, arsc, -S, E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\res, -M, E:\Mads\Downloads\Danesh-ApkManager 0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.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:\Users\Mads\AppData\Local\Temp\APKTOOL3896128828642886834.tmp, -x, -0, arsc, -S, E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\res, -M, E:\Mads\Downloads\Danesh-ApkManager-0033dfa\Danesh-ApkManager-0033dfa\other\..\projects\framework-res.apk\AndroidManifest.xml]

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

... 7 more

"An Error Occured, Please Check The Log (option 21)"

Press any key to continue . . .
[G1 Android Development] nuggyunlimited:
Since I couldn't get it up and running in windows I'm trying to set up on ubuntu 10.10 I have java and the sdk installed I just have to set the path variables I made the .sh an executable I just need to figure out how to set paths in ubuntu would anyone mind helping me? I'm trying to put the tools and platform tools in my path. Thanks in advance
[G1 Android Development] LfcFan1977:
@madindehead

The xml's you are trying to compile into the framework-res.apk, are they decompiled before you put them in /framework-res.apk/res/drawable?

If not, then try renaming the apk to "framework-res.zip", double click on it (not extract) and navigate to drawable folder, drop in the xml's and close the window. Rename back to framework-res.apk.

I have not tried the above and do not know if it will work.

Or decompile the framework that has the xml's you want to use. Move them anywhere you like. Decompile your new framework and add the decompiled xml's. Compile the apk.
[G1 Android Development] madindehead:
I tried decompiling it, and then copying over the files, and it didn't work. So will try the other method and check that. Just want it to work! Lol.

Update: If I decompile the source framework, and then take the xmls out, it doesn't work. If I open it as a .zip using 7zip, it doesn't work either. At a loss here :(
[G1 Android Development] Daneshm90:
Hey

Firstly i hope the xml's are from similar firmwares right ?

If so it might be an aapt/apktool issue that ive come across numerous times.

Try selecting update tools in 5.0 and changing apktool to 1.3.1 and give it a shot again.

Does decompiling and recompiling w/o modifications work ?

Also what firmware is this ? Proprietary ?
[G1 Android Development] pymebrahimi:
i couldn't find the download link of Apkmanager for linux... where it is?!
[G1 Android Development] dreamsforgotten:
The linux version don't compare at all. The error log shows you your error in system stat battery line 1 there is a syntax error in your xml file have you looked at that hard to see if any of your code haas a mistake in it?
[G1 Android Development] dreamsforgotten:
The linux version don't compare at all. You can only have 1 project at a time you can't recompile proprietary software with it and its just plain basic.

Edit two different people lol didn't pay enough attention!

The error log shows you your error in system stat battery line 1 there is a syntax error in your xml file have you looked at that hard to see if any of your code haas a mistake in it?

Tapatalk issues didn't intend on double posting
[G1 Android Development] madindehead:
Yeah, I'm using the framework-res before the ROM was modified, and the modded version, which includes the battery mod. Both from same 2.3.3 base for DHD.

Will try the apktool 1.3.1. And yes, compiling without changing anything works.

It's from a Sense ROM.

I might try and see if I can get some help from the guys who make some of the battery mods for the Desire HD using this tool.
[G1 Android Development] fernando sor:
Are you trying to change the configuration on the battery? Meaning have it drop.in one hundredths instead of by 20s?
[G1 Android Development] kirbnite:
I will assist you if you zip up your project that will not compile and post a link for me to download.
[G1 Android Development] kirbnite:
Project meaning the entire decompiled framework with your changes in it.
[G1 Android Development] kirbnite:
Help with BlurHome.apk on Gingerbread with Droid X

I install framework-res.apk, moto-res.apk, and blur-res.apk. they install as 1.apk, 2.apk, 3.apk.

Java -jar apktool.jar if framework-res.apk

Java -jar apktool.jar if moto-res.apk

Java -jar apktool.jar if blur-res.apk

Then I can successfully decompile BlurHome.apk. I am using apktool 1.3.1 as I read the problems 1.3.2 was causing.

But when I recompile, I get errors.

I tried decompile, recompile with no changes and still get errors. Any help would be greatly appreciated.

Here is the error:

Directory of C:\Users\DummyName\Desktop\files\132\132

04/13/2011 03:50 PM <DIR> .

04/13/2011 03:50 PM <DIR> ..

05/13/2010 12:28 PM 5,441,083 aapt.exe

09/03/2010 11:13 AM 69 apktool.bat

09/03/2010 08:58 AM 1,343,302 apktool.jar

04/13/2011 03:51 PM <DIR> BlurHome

04/12/2011 09:16 AM 5,073,480 BlurHome.apk

4 File(s) 11,857,934 bytes

3 Dir(s) 3,399,725,056 bytes free

C:\Users\DummyName\Desktop\files\132\132>apktool b BlurHome

I: Checking whether sources has changed...

I: Smaling...

I: Checking whether resources has changed...

I: Building resources...

Included base package ID 2 already in use!

Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, C:\Users\DummyName\AppData\Local\Temp\APKTOOL301914103240410899.tmp, -I, C:\Users\DummyName\apktool\framework\1.apk, -I, C:\Users\DummyName\apktool\framework\3.apk, -I, C:\Users\DummyName\apktool\framework\2.apk, -S, C:\Users\DummyName\Desktop\files\132\132\BlurHome\res, -M, C:\Users\DummyName\Desktop\files\132\132\BlurHome\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:\U

sers\CLEARW~1\AppData\Local\Temp\APKTOOL301914103240410899.tmp, -I, C:\Users\Cle

arwave\apktool\framework\1.apk, -I, C:\Users\DummyName\apktool\framework\3.apk, -I, C:\Users\DummyName\apktool\framework\2.apk, -S, C:\Users\DummyName\Desktop\files\132\132\BlurHome\res, -M, C:\Users\DummyName\Desktop\files\132\132\BlurHome\AndroidManifest.xml] at brut.util.OS.exec(Unknown Source)

... 7 more

C:\Users\DummyName\Desktop\files\132\132>
[G1 Android Development] techargon:
alright, another noob here, any help would be appreciated

I downloaded apkmanager 4.9 and apktool 1.3.1, and i want to edit the framework-res.apk/res/values/strings (the "zz_roamingText1" to include my name).

the process i've been following is:

A.) placing the framework-res.apk in the modding folder,

B.) running script.bat

C.) inputting 22 (choosing 1 to select the apk)

D.) inputting 9 to decompile (no errors)

E.) going into the project folder and changing the "zz_roamingText1" using notepad++

F.) inputting 11 to compile (get errors) press any key, then enter y/y

G.) check keep folder (can't see the values folder in res, so i only delete the resources.arsc) press any key and it compiles.

H.) go into modding folder and remove the unsigned portion of the name

i.) place new framework-res into proper rom folder and re-zip for clock work.

What i want to know is will it still work even though it had errors for the 9png before i flash it? :confused: I zipped my log.txt because it was too large.
[G1 Android Development] Daneshm90:
Looks like a themed framework-res.

When decompiling, if u check in the res folders, some of the pngs will be corrupted.

Best bet is to get an unthemed version of your rom and transfer the images over. If ur familiar with adb u can give ur framework a shot n recover upon failure.
[G1 Android Development] techargon:
yeah it is themed, i was hoping to just add my name to the status bar. It's an awesome rom so i will probably just leave it be, as i am very happy with it.

I'm not familiar with adb, what is the path i would need to add for it. I added a path for java already so if i knew what to copy and paste i could do it. I would just push it in the script.bat right?

Thanks for the quick reply, and all you guys do to help us!
[G1 Android Development] Daneshm90:
Yea same thing as adding in java.

Well i wouldnt advise messing with framework-res unless u have adb working properly...unless you're ok with reflashing the rom or have the rom's framework-res in a .zip ready to flash.

Either case, id give that framework a shot, considerin the pngs are replace by original ones when u use keep method, it should be fine...
[G1 Android Development] techargon:
I'll give it a try, I'm not to worried about having to re-flash. I'll let you know how it goes:o
[G1 Android Development] techargon:
Well, no luck. Every time i tried to flash it failed, so i just did a clockwork restore. thanks for the help and advice though!
[G1 Android Development] silverxbv2:
So with 5.0 where is the log? Mine just flashes very quickly in the script but leaves the log with just a date?
[G1 Android Development] Raadius:
I got a parsing error when I tried to install an APK. I think I may have recompiled it wrong? I had decompile and apk (not a system apk) so I can change image sizes in the layout folder.

I choose #3, extracted the apk, than I choose #9, decompile the apk. I than went into the project folder > res > layout and edited the image size when I was done, I back out the folder back to the project folder. I than went back to the APK Manager script and choose #11, compile, than choose #3, zip file, and than signed it and now Im getting a parsing error and cant install it? Somebody give me advise please?
[G1 Android Development] 1982Strand:
I'm new to Apk manager, but so far i made things work with it.

But only by doing some steps after the process with apk manager has finished, like copying files from original apk to newly compiled one.

Quick runover of steps to clarify:

1. decompile

2. edit

3. compile, y/y

4. delete editied files from keep folder

---APK manager is now done..

5. Copy everything but resources.ascr (and other edited files) from original apk to modified one

I'm just wondering why this is necessary, because the program should do this automatically with the "keep" function, but it still doesn't work with only using the manager..

I'm confused here...

What i'm trying to do is simply adding new languages to apks, by adding "values-da" with strings.xml files to the res folder, so i'm not changing smali codes or something like that...

Maybe i'm missing something? Anything to do with META-INF folder, or the classes.dex and androidmanifest.xml files?

Oh, somehow the edited apk file is somewhat bigger in filesize than the original, is there any way to use a higher compression level than "store"? (Already using comp. level 9 in the manager)
[G1 Android Development] dreamsforgotten:
I normally don't recompile an apk with edited images. If they are .9s use apk manager to decompile sure, edit in image editing software then pull your drawable folder from another fresh copy of the apk. Copy edited images in then drag and drop the drawable folder back in the apk. After (non system apps only) you must re-sign the apk as the md5 sum changes cause your images aren't the same size anymore. Keep in mind you will needto delete the original .apk from the phone copy the edited one to your sd and install it. Also note you can't update the apk anymore cause the new signature

Edit: image size in layout? Layout is many xml files if your talking about xml files the same applies about resigning and all cause the overall size of the apk still changes.
[G1 Android Development] chaz03:
Anyone know why I continuously get the "An error occured Please check the log" I increased the heap size to 512mb. Im trying to decompile the systemUI and framework-res of stock xoom wifi. Its got me stumped here...:(
[G1 Android Development] klquicksall:
This tool is working great for me. I just need some guidance on making the app drawer transparent. I know the samli code and the xml values but, I dont know what I need to decompile the rosie.apk with. Ive tried com.resources. but the app drawer is still black and not transparent with I flash it. Any advice would be great.
[G1 Android Development] dreamsforgotten:
What does the log say when you check it?
[G1 Android Development] $omator:
5.0 sucks :)
[G1 Android Development] kirbnite:
Yeah

Before you try to decompile SystemUI.apk, you need to install the framework-res.apk as 1.apk

To do this, in a command prompt go to a directory that has apktool.jar and framework-res.apk and type

Java -jar apktool.jar if framework-res.apk

Or

Rename a copy of framework-res.apk to 1.apk

And replace c:\users\yourname\apktool\1.apk

The framework-res.apk should decompile. Post a link to a copy of your framework and one of us can take a look.
[G1 Android Development] BrandoKC:
I am running Windows 7 64 bit and have the correct version of Java installed. However apk manager is not finding Java.

What is the proper way for me to format my PATH for ADB and Java? Java is in the program files folder and the SDK is located in the C directory.

Thanks in advance
[G1 Android Development] klquicksall:
solved

I solved it. I got the right samli code and decompiling the rosie with com. resources is all you need.