yashsingh1/xdaforums huggingface dataset:
[Xoom Android Development] jim_panse:
You have to assign the ids in the right order.

For example:

<public type="drawable" name="stat_sys_battery_0" id="0x0108049c" />
<public type="drawable" name="stat_sys_battery_100" id="0x0108049e" />
<public type="drawable" name="stat_sys_battery_15" id="0x0108049f" />
<public type="drawable" name="stat_sys_battery_28" id="0x010804a1" />
<public type="drawable" name="stat_sys_battery_43" id="0x010804a3" />
<public type="drawable" name="stat_sys_battery_57" id="0x010804a4" />
<public type="drawable" name="stat_sys_battery_71" id="0x010804a6" />
<public type="drawable" name="stat_sys_battery_85" id="0x010804a8" />
[B]<public type="drawable" name="stat_sys_battery_1" id="0x010804a9" />
<public type="drawable" name="stat_sys_battery_2" id="0x010804aa" />
<public type="drawable" name="stat_sys_battery_3" id="0x010804ab" />
<public type="drawable" name="stat_sys_battery_4" id="0x010804ac" />[/B]

look at the last four. You have to make sure, that you assign only numbers that aren't in use. So you can put it on the end of public type or so,

The correct order for Hex is:

0 1 2 3 4 5 6 7 8 9 a b c d e f

That is for public.xml

And of course you have to add the neccesary paths in stat_sys_battery.xml
[Xoom Android Development] sangreal06:
Also, FYI, the IDs in public.xml go in order (by resource type).

edit: doh, beaten
[Xoom Android Development] jim_panse:
But the have changed something. It is not working. They assigned weird ids... have to look into it more deeply.

EDIT: They didnt assign in the right order. They have dummys everywhere. Hard to find the last used id
[Xoom Android Development] sangreal06:
Not sure what you are seeing...
[Xoom Android Development] jim_panse:
The normal way is for public drawable ids in the right order

and then for public layout ids in the right order. One after one. Now they have some jumps between the ids and didnt put them in order. But i think i found the right id
[Xoom Android Development] sangreal06:
Oh, I see.. I'm not sure what the deal is with the dummy IDs
[Xoom Android Development] jim_panse:
I dont know it too... But i will find out :)

I think apktool is not compatible with this kind of modding...

Found some issues on google tracker and the people could solve it with a new version of apktool...

We need the Honeycomb sources :(
[Xoom Android Development] nbeebe24:
Here's the framework file I've been working on http://www.mediafire.com/?x918859f93kfxo8. All I'm trying to do is replace the stock battery with one that tells me percentages
[Xoom Android Development] jim_panse:
I think this cannot be achieved without the proper sources so apktool gets a "real" update.

Tried it last night and couldnt get it to work but everything was correct...
[Xoom Android Development] Bazar617:
What about creating new ids that havemore characters than what's tere, that way you're almost guaranteed to not double up on the dummiy ids... just a thought

Xooming with Tapatalk
[Xoom Android Development] jim_panse:
Thats not working...

I already created the correct order and didn't miss an id. But didnt work.

Googling telled me, that it sounds like an error with apktool
[Xoom Android Development] sangreal06:
I'll look into the Dummy thing, not sure if it is a bug (the behavior is certainly intentional, but since it isn't documented I can't say why the dummy IDs are created. I'll have to review the aapt source some more). In the meantime, I've fixed your battery mod (attached)

Cheers
[Xoom Android Development] jim_panse:
You got it working?

What did i wrong?
[Xoom Android Development] nbeebe24:
Thank you for modifying this to work. What did you do exactly? Also, I meant to add the charging animations as well, if I can't get that working will you take a look at it? Thanks again
[Xoom Android Development] sangreal06:
I didn't change anything, I just took the new drawable files and resources.arsc from the file posted. I checked the public.xml file and the new IDs were already in the correct order (I used excel to sort the file properly).

The public.xml file is stored in resources.arsc
[Xoom Android Development] jim_panse:
why wasn't it working for me? Weird. How do you sort after ids in excel?

Nevermind. Found it!

Thats a neat idea to sort the ids in excel! Makes it much much easier!

Edit2: Battery Percentage is working for Euro 3g.

Thanks Sangreal for the tip with Excel. :)
[Xoom Android Development] sangreal06:
Glad to help... Hope to see many more mods/themes :)
[Xoom Android Development] nbeebe24:
If I upload my framework with the battery animation will you help me out with it please? I don't completely understand your explanation of how you got my battery mod to work
[Xoom Android Development] sangreal06:
Sure, upload it and I will take a look. For your battery mod this is all I did:

1) Downloaded your framework-res.apk

2) Opened it in WinRar

3) Opened stock framework-res.apk in WinRar

4) Dragged the new png files from your framework-res.apk into stock framework-res.apk

5) Dragged the updated drawable xml file from your framework-res.apk into stock framework-res.apk

6) Dragged the resources.arsc from your framework-res.apk into stock framework-res.apk

7) zipaligned and pushed to my xoom.
[Xoom Android Development] nbeebe24:
Okay, so I followed your directions to the t and was still unable to get the results you got. Anyway, here is the file with the battery animations included http://www.mediafire.com/?b3r9h4sabq53llw. I am working on adding other elements into my Xoom, but I don't want to have to keep coming to you to get them working :-). I thank you again for taking the time to do this for me!
[Xoom Android Development] Bazar617:
Dammit, now I have to create 200 new images. Lmao jk, this is awesome. You're a pioneer dude! Will definitely be putting this in my themes after I've created the images.
[Xoom Android Development] sangreal06:
Thanks for the kind words. I think the usefulness of this release will be short-lived though, as Brut.all seems to be wrapping up Honeycomb support in apktool

There was an issue with your stat_sys_battery_charge.xml. I don't know what the issue was since I couldn't decode it, but if you post your XML I will look at it. Regardless, I created a new stat_sys_battery_charge.xml and it is working now (attached).
[Xoom Android Development] nbeebe24:
Hmm... this apk doesn't seem to work for me either. The battery completely disappears like in the one I made
[Xoom Android Development] sangreal06:
That is weird. I've got it running on my Xoom... I would need to see the logcat from when the icon disappears.
[Xoom Android Development] nbeebe24:
I reapplied your apk and the charging icon came back, there's just no actual animation
[Xoom Android Development] sangreal06:
[highlight]This tool is no longer necessary as an official build of apktool is out which fixes all of these issues. Get it here[/highlight]

Well it changes with the % but it doesn't animate because I don't know how you want it to animate. You can try the attached apk which uses the animation from this mod: http://xdaforums.com/showthread.php?t=958788

If you're looking for a different animation I'll need more info. Also I'm guessing what you did wrong is to take the compiled stat_sys_battery_charge.xml from another mod and copy it into your framework-res.apk instead of decompiling it from the other mod and recompiling it in your xoom apk which is necessary so that the compiled file has the correct references based on the public.xml
[Xoom Android Development] nbeebe24:
That animation was exactly was I was trying to achieve Thanks again! I have one more request... Is it possible to add your CRT animation, ua string, sms etc string to this? I have the 3g
[Xoom Android Development] judison:
Can someone help me?

Hi,

(using aapt from a recent downloaded SDK, not the zip... nor an old aapt I had that did not worked)

I tried to create a new framework-res.apk from my original one, but it did not work

judison@jafar:~/MOD/xoom $ aapt v
Android Asset Packaging Tool, v0.2
judison@jafar:~/MOD/xoom $ java -jar honeytool.jar
Apktool v1.3.2 - a tool for reengineering Android apk files
Copyright 2010 Ryszard Wi?niewski <brut.alll@gmail.com>
...

Step 1, unpack/decode my original apk

judison@jafar:~/MOD/xoom $ java -jar honeytool.jar d ../../xoom/framework-res-ORIGINAL_CDN.apk orig
I: Loading resource table...
I: Loaded.
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.
I: Copying assets and libs..

Step 2 build... (I did no changes yet)

judison@jafar:~/MOD/xoom $ java -jar honeytool.jar b orig/ framework-res.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
I: Building apk file...

Is this warning something bad???

Step 3, adb push ... adb reboot

then I get boot animation loop. until I push the originar one back.

What I did wrong???
[Xoom Android Development] sangreal06:
framework-res.apk needs to be signed. Don't sign it yourself though, unless you're going to sign all the system apps or everything will FC with permission errors.

You can change the resources in the stock framework-res.apk without breaking the signature (except for AndroidManifest.xml). Alternatively, you can copy the AndroidManifest.xml and META-INF from the stock framework-res.apk but I haven't really tested that personally
[Xoom Android Development] jim_panse:
If you copy over the meta inf and android manifest it works. Tested it like 100 times :)
[Xoom Android Development] judison:
Thanks

Thanks...

adding META-INF and AndroidManifest from original, worked...

thats my Makefile

build:
rm framework-res.apk
java -jar honeytool.jar b framework-res framework-res.apk
zip -r framework-res.apk AndroidManifest.xml META-INF/

push:
adb remount
adb push framework-res.apk /system/framework/framework-res.apk
adb reboot

but every time I change my framework-res.apk I have to enter my google account email/password.

its normal? can I prevent that?
[Xoom Android Development] sangreal06:
That is normal, from my experience. I've heard that if you flash it as an update from cwm that doesn't happen though
[Xoom Android Development] sangreal06:
it seems you have the wrong framework-res.apk installed. Try this honeytook if framework-res.apk
[Xoom Android Development] arrtoodeetoo:
Like I said, framework-res.apk is just fine. I pulled it from my freshly installed 3.1 and it decompiled correctly.

SystemUI.apk is what is giving me the issue.

However, I think I see what might be the issue. This line:

Loading resource table from file: C:\Documents and Settings\owner\apktool\fra

mework\1.apk

is pulling info from another folder. Strange. I don't ever remember putting that folder there, but there are two files in it. 1.apk and 127.apk. What is this? And is this the source of the issue?
[Xoom Android Development] sangreal06:
I stand by my previous post.

You can decompile framework-res.apk because there are no dependencies. SystemUI.apk points to resources in framework-res.apk, and therefore you must install the correct framework-res.apk . This is done using the "apktool if" or in this case "honeytool if" command. Running this command, as I suggested before, creates the files in that directory.
[Xoom Android Development] arrtoodeetoo:
Thanks!

Once I get my XOOM un-softbricked, I'll try it.

I need the system.img for 3.1 to reflash.

I HAVE to remember to turn on USB debugging before I reboot. D'oh! :(

[Edit]

That did the trick! It decompiled.

Now to get my XOOM working again so I can get to working again.
[Xoom Android Development] coolfree:
rebuild error

D:\moto\XOOM\fam_bak>call honeytool d framework-res.apk

I: Loading resource table...

I: Loaded.

I: Decoding file-resources...

I: Decoding values*/* XMLs...

I: Done.

I: Copying assets and libs...

D:\moto\XOOM\fam_bak>call honeytool b framework-res

W: Could not find sources

I: Checking whether resources has changed...

I: Building resources...

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/animator

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/drawable-xlarge-mdpi

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/drawable-xlarge-nodpi

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/interpolator

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/layout-xlarge

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/mipmap-hdpi

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/mipmap-ldpi

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/mipmap-mdpi

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/values-xlarge

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/values-xlarge-land

invalid resource directory name: D:\moto\XOOM\fam_bak\framework-res\res/xml-xlarge

..................
[Xoom Android Development] sangreal06:
Looks like the aapt.exe you are using is outdated. Do you have the 3.1 SDK installed?
[Xoom Android Development] arrtoodeetoo:
I have a quick question.

When the files are decompiled, there is a folder (or sometimes two if there is an xlarge version) called Values. This folder has things like drawables.xml and such that control colors for certain things apparently (as they are linked with the @ tags.) However, when the apks are recompiled, this folder and its files disappear. Changing the colors in the values xlms and then recompiling has no effect.

So, what's the deal here?
[Xoom Android Development] sangreal06:
The values folder is compiled into resources.arsc
[Xoom Android Development] Anderdroid:
Is anyone able to decompile and recompile Gmail? I'd like to do two things:

1. Get it to always display images automatically (done this to froyo)

2. Raise the version code by 1 and resign (so it can install overtop, no rooting required for people to install it)

1. I can do with smali fine... But 2.? Need apktool or apkmanager but I can't get it to poop out the XML files. I also want to have two stretched fragments on portrait mode just like in landscape mode... so... Would need the xmls for that too.

OH and I'd like to hack Market to show in portrait mode... LOL

Been a while since I've done this whole Android decompiling stuff so I've forgotten a lot. Is it even possible to decompile the new Gmail properly?
[Xoom Android Development] sangreal06:
This build should work fine on GMail and Market but I believe they are Odex'd so you will need the latest baksmali to deodex them and get at the smali files
[Xoom Android Development] Anderdroid:
The ones from the Tab 10.1 from I/O are not odexed
[Xoom Android Development] coolfree:
Thanks friend

i use aapt in your packge
[Xoom Android Development] coolfree:
yes friend

i install it,and i use aapt include in your packge
[Xoom Android Development] Bazar617:
Hey Sangreal, you look busy with this thread, so no rush on this...

I have honeytool, I copied in the new aapt.exe from the 3.1 SDK update, grabbed my 3.1 files. (renamed honeytool to apktool), mounted the new framework and tried to decompile the browser, and got this error:

I: Decoding values*/* XMLs...

Exception in thread "main" java.lang.IllegalArgumentException: empty string is not allowed for ignorable whitespace

and gave me 8 different "at brut.androlib...."

The the thing is SystemUI, GoogleQuickSearch, and Launcher worked, but Browser, Gallery, LatinIme, Music, and Voice Search all gave this same error.

Have any idea what's causing this? Thanks man!
[Xoom Android Development] sangreal06:
Thanks, I see the issue. Stay tuned for a fix
[Xoom Android Development] sangreal06:
Updated OP with the fix
[Xoom Android Development] Brut.all:
@sangreal06

What is your implementation of multiple substitutions detector? It's easy to detect whether there are '%' chars not followed by another '%', but seems your implementation is much more advanced, e.g. it does not add formatted="false" for "%H:%M". I was trying to detect valid conversion types only (s, S, d, c, C, x, X, etc.), but there are many flags (-, +, 0, etc), so it makes detection harder than it seems.

Could you upload sources of your modifications?
[Xoom Android Development] Berzerker7:
Looks like you only include aapt.exe

So for anyone using OS X/Linux, here's the aapt binary that you need.
[Xoom Android Development] coolfree:
try new 1.1 version,but can't build

please try my framework.apk
[Xoom Android Development] sangreal06:
I can upload my sources later when I am home but I just based the multiple substitution logic on the latest aapt source (http://android.git.kernel.org/?p=pl...d64f1466a8d32f166bfd4791;hb=refs/heads/master)

The hasSubstitutionErrors function describes which substitutions can be ignored
[Xoom Android Development] sangreal06:
Your issue is definitely due to using an old aapt.exe. You probably have more than one version on your PC and the wrong one is being used. Check your PATH environmental variable
[Xoom Android Development] Brut.all:
Thanks! :-)
[Xoom Android Development] Dr.laser:
I'm working with LatinImeGoogle.apk

I get huge list of errors when trying to compile, all of them has "No resource identifier found for attribute 'keyBackground' in package 'com.android.inputmethod.latin'"

examble

C:\Users\user\Documents\Downloads\Compressed\apk_manager_4.9\other\..\projects\LatinImeGoogle.apk\res\layout\input_basic.xml:2: error: No resource identifier found for attribute 'keyBackground' in package 'com.android.inputmethod.latin'
C:\Users\user\Documents\Downloads\Compressed\apk_manager_4.9\other\..\projects\LatinImeGoogle.apk\res\layout\input_basic_highcontrast.xml:2: error: No resource identifier found for attribute 'keyBackground' in package 'com.android.inputmethod.latin'
C:\Users\user\Documents\Downloads\Compressed\apk_manager_4.9\other\..\projects\LatinImeGoogle.apk\res\layout\input_gingerbread.xml:2: error: No resource identifier found for attribute 'keyBackground' in package 'com.android.inputmethod.latin'
C:\Users\user\Documents\Downloads\Compressed\apk_manager_4.9\other\..\projects\LatinImeGoogle.apk\res\layout\input_gingerbread.xml:2: error: No resource identifier found for attribute 'keyLetterStyle' in package 'com.android.inputmethod.latin'
[Xoom Android Development] sangreal06:
Okay well the cause for this error is simple (but not the fix): Google has changed the package name from com.android.inputmethod.latin to com.google.android.inputmethod.latin

There is an attribute in AndroidManifest.xml (original-package) which tells the system to move the data from the old package but aapt does not seem to use this attribute when compiling resources. So the problem is, in all of those xml files the namespace is declared as com.android.inputmethod.latin. I'm not sure how Google compiles their resouces, but to use aapt I think you will have to manually change all of those xmlns attributes to the new package name.

If you use Notepad++ this isn't really that hard since you can replace across multiple documents at once.

Additionally, there are a few strings in strings.xml that aren't being escaped properly.
[Xoom Android Development] sangreal06:
I will leave this up, but apktool v1.4.1 has been released with Honeycomb support and additional fixes so I would use that, personally.
[Xoom Android Development] nbeebe24:
The battery mod isn't able to be incorporated in 3.1 is it?
[Xoom Android Development] Bazar617:
Nice! We appreciate the work you have done while we waited for this update. Thanks Sangreal!
[Xoom Android Development] Codespeare:
Works like a charm, thanks! Used it to fix my UAString in 3.1.
[Xoom Android Development] judison:
Error :(

* latest hnytool,

* Calendar.apk from a GalaxyTab 10.1 (HC 3.0)

$ java -jar hnytool.jar d Calendar.apk
I: Loading resource table...
Exception in thread "main" java.lang.ClassCastException: brut.androlib.res.data.value.ResFloatValue cannot be cast to brut.androlib.res.data.value.ResStringValue
at brut.androlib.res.data.value.ResPluralsValue.<init>(ResPluralsValue.java:35)
at brut.androlib.res.data.value.ResValueFactory.bagFactory(ResValueFactory.java:86)
at brut.androlib.res.decoder.ARSCDecoder.readComplexEntry(ARSCDecoder.java:213)
at brut.androlib.res.decoder.ARSCDecoder.readEntry(ARSCDecoder.java:177)
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:313)
at brut.androlib.res.AndrolibResources.loadMainPkg(AndrolibResources.java:51)
at brut.androlib.res.AndrolibResources.getResTable(AndrolibResources.java:44)
at brut.androlib.Androlib.getResTable(Androlib.java:44)
at brut.androlib.ApkDecoder.getResTable(ApkDecoder.java:143)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:93)
at brut.apktool.Main.cmdDecode(Main.java:119)
at brut.apktool.Main.main(Main.java:56)
[Xoom Android Development] Brut.all:
I don't use hnytool, but if there is a way to update apktool (apktool.jar), then use this one: http://www.multiupload.com/BPJW0WGTBG
[Xoom Android Development] judison:
Hi,

using apktool it worked :D

just to know, what is the difference from apktool and hnytool ?

if apk tool is HC aware...
[Xoom Android Development] Brut.all:
AFAIK hnytool is a fork of apktool v1.3.2 (or v1.3.1?) with added support for Honeycomb and other fixes. I think all these fixes are implemented in apktool v1.4.1 .
[Xoom Android Development] jim_panse:
you know if smali and baksmali could fixed the same way or do we have to wait for the source?
[Xoom Android Development] Bazar617:
Hey Sangreal, have you tried mounting the 3.2 framework? It mounts and decompiles in APKtool, but with a few errors. Didn't know if the aapt would have to be updated, because they have SDK for 3.1, but not one for 3.2.
[Xoom Android Development] Brut.all:
http://code.google.com/p/android-apktool/issues/detail?id=195#c3
[Xoom Android Development] bignadad:
No new updates? Really need to decompile Tiamat 2.0 ROM SystemUI.apk

pretty please?
[Xoom Android Development] Bazar617:
+1

10char
[Xoom Android Development] Instien:
I am also eagerly awaiting an update so I can get back to theming.
[Xoom Android Development] dwillMUFC:
Nearly there with my systeUI.apk file from asus eee pad transformer 3.2 rom. Everything apart from a few highly important xmls in values are there most importantly for me - colours.

Could it be to do with the resource it uses, as it being out of date for 3.2?

Here is my last log:

I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec:
0x01040404
at brut.androlib.res.data.ResPackage.getResSpec(ResPackage.java:61)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:55)
at brut.androlib.res.data.ResTable.getResSpec(ResTable.java:51)
at brut.androlib.res.data.value.ResReferenceValue.getReferent(ResReferen
ceValue.java:59)
at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResRefe
renceValue.java:46)
at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResSc
alarValue.java:50)
at brut.androlib.res.data.value.ResScalarValue.serializeXmlBody(ResScala
rValue.java:81)
at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(R
esScalarValue.java:67)
at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResour
ces.java:264)
at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137
)
at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:93)
at brut.androlib.ApkDecoder.decode(ApkDecoder.java:98)
at brut.apktool.Main.cmdDecode(Main.java:120)
at brut.apktool.Main.main(Main.java:57)

Thanks

Dan
[Xoom Android Development] arrtoodeetoo:
It looks like there's an update for apktool for 3.2 on google code, but I can't seem to get it to work. Hoping Sangreal swoops in to save the day...
[Xoom Android Development] Bazar617:
Did you update your SDK, and pull in the new aapt.exe to wherever your .jar file is? It's working flawlessly for me.