yashsingh1/xdaforums huggingface dataset:
[HTC One X] Rainbowbright081:
Ho there!

I'm having problems recompiling systemui of elegancia sense 3.6.

My last error was bad magic values, somehow I got that fixed, but tried again without modding anything, got multiple errors from public.xml.

I have tried every method, every apktool there is out there....

Can anybody shed some light into my problem? I'm sure there is a noobish step I an missing, maybe decode w/o source? Do I need to install systemui like framework?
[HTC One X] fernando sor:
The apktool I posted decompiles the classes fine. Make sure you tag or install the framework resources from the rom your systemui is from. Framework res and htc. resources

a bad seed
[HTC One X] Rainbowbright081:
It'snot so much the decompile problems I have its the recompiling that is getting me.

I get tagging the framework, but I'm a bit of a noob when it comes to using those tags.

Would I need to install systemui in with framework and HTC.resources?

Lots of questions. Thank you

Edit: I will try your apktool tonight.
[HTC One X] rayford85:
If your not touching smali, type apktool d -s (path to your apk). It will copy class.dex instead of decompiling. Avoiding bad magic errors. But as long as the proper resources are installed. You shouldnt have a problem. Now the public errors can happen for different reasons. For instance. Say your adding animated signal icons. To systemui. You mod the required xml's, add your animated icons, and delete the stock icons. If you don't delete there public id as well it will throw errors. Remember that public will build new id's if needed so your ok to just delete the ones that throw errors. They will build back in the end.
[HTC One X] Rainbowbright081:
All I was editing was .9 and .png. wasn't adding or subtracting.

Another thing I noticed all my pngs weren't showing up in the decompile.

Rayford I will try your method this evening as well.

Edit: no xml or smali edits, I wanna get better with the compiling before I mess with those.
[HTC One X] fernando sor:
Really need to see what errors your getting on recompile. If you bork one image you will get an error for every image after that
[HTC One X] Rainbowbright081:
I will post a dropbox link this evening when I'm off work
[HTC One X] fernando sor:
Im sure its just a borked .9

Throw them in draw9patch when they're decompiled and look for bad patches
[HTC One X] Rainbowbright081:
I have 2 I images when decompiling get borked, I just don't know where to put the edges back in at.
[HTC One X] fernando sor:
Put them in draw9patch and check show bad patches. Then put one black chunk in the middle on the left side and one in the middle of the top.

Then draw a black line down the right side and one line all the way along the bottom and then save it. Then recompile
[HTC One X] fisha21:
Thanks for the advice. Tried using the apk from Sense 3.6 as suggested, but they are very different!

Ended up having to rename and replace as you suggested...not fun at all! Can't wait for an updated version of apktool!
[HTC One X] Rainbowbright081:
Hot diggity dog! fern, thanks so much! Your apktool, fixing the 3, thats right 3, .9 images that needed fixed, thanks to your instruction :), this problem recompiling my Systemui apk is finally fixed.

Again, thank you
[HTC One X] Smokem_I:
Awesome fern! Just grabbed the Apktool and will hopefully be able to accomplish something on my One S! Gonna have to stop by the reference thread for some guidance on themeing Sense 4.0. I'm so used to CM7 theme engine lol. I'll definitely need some help from your team! Thanks and keep the knowledge flowing!
[HTC One X] Rainbowbright081:
Smoke finally an upgrade for ya! If I can help u I will, after all, u were the first to offer me some help :)
[HTC One X] he_stheone64:
Hi Fernando - I accidentally stumbled about this thread (I have a One S, no X...). I never had issues with compiling framework, since I used a modded apktool version from day 1 (I used that already on Galaxy Nexus), which compiles plurals just fine.

Initially I also had some issue with com.htc.resources, but could solve these fairly quick. Since I`m sure One X com.htc. is fairly similar to One S, maybe my fix can help you guys too.

This was the original error log

C:\apk_manager_5.0\other\..\projects\com.htc.resources.apk\res\values\layouts.xml:3: error: Found tag layout where item is expected
C:\apk_manager_5.0\other\..\projects\com.htc.resources.apk\res\values\public.xml:1975: error: Public entry identifier 0x2050209 entry index is larger than available symbols (index 521, total symbols 521).
C:\apk_manager_5.0\other\..\projects\com.htc.resources.apk\res\values\public.xml:1975: error: Public symbol dimen/zero_dummy_dimen declared here is not defined.

This is how I solved it:

Step 1: Fixing layout tags in layouts.xml

I replaced all tags with:

<item type="layout" at the front and </item> at the end

<resources>
<item type="layout" name="htc_list_item_imageicon_text">@layout/zzzz_htc_list_item_imageicon_text</item>
<item type="layout" name="pin_keyboard">@layout/zzzz_pin_keyboard</item>
<item type="layout" name="zero_dummy_layout">@layout/alert_dialog</item>
<item type="layout" name="htc_list_item_2text_2stamp">@layout/zzzz_htc_list_item_2text_2stamp</item>
<item type="layout" name="htc_list_item_2text_bright">@layout/zzzz_htc_list_item_2text_bright</item>
<item type="layout" name="htc_list_item_image_2text_image_bright">@layout/zzzz_htc_list_item_image_2text_image_bright</item>
<item type="layout" name="htc_list_item_imageicon_2text_2stamp">@layout/zzzz_htc_list_item_imageicon_2text_2stamp</item>
<item type="layout" name="htc_list_item_separator">@layout/zzzz_htc_list_item_separator</item>
<item type="layout" name="htc_list_item_dlna_1">false</item>
</resources>

Step 2: Fixing public.xml error

Here I simply deleted the entry, since apktool is rebuilding that just fine

Hope that helps you guys here also with your issues.
[HTC One X] fernando sor:
Hey good to hear from you bro.

How are you even getting sense 4.0 com.htc.resources to decompile? I just get an empty folder
[HTC One X] he_stheone64:
Can you send me the X com.htc? Then I can double check, whether I can also fix it. Maybe apktool creates other issues with the added xhdpi folders, but I can check that if you send me the stock file.

Send from my One S
[HTC One X] fernando sor:
The only one I've tried is a leak for the rezound which does have the xdpi folders. I'll send it to you thanks
[HTC One X] he_stheone64:
Thx and received - decompiled successfully, fixed all issues and now waiting to compile...

TOUCHDOWN :D

I will upload the apk later, I randomly changed a few color values to ICS blue, so you`ll see it worked all fine. System seems to work for all Sense 4.0 ICS com.htc.resources

1. Fix Layoits.xml as described

2. Delete zero_dummy_dimen in public.xml

I will check later with stock com.htc.resources from One X, but I`m very confident I will see the same result ;)

If only someone could fix bloody m.10`s - that is the sole reason I focus on mods atm, not on full Themes, since without having access to m.10 files Themes will not have the quality I need. Good news is, Sense 4.0 is visually so much better, then old versions.

Edit: Here`s a new thread, that addresses this and more fixes

http://xdaforums.com/showthread.php?p=25817188#post25817188
[HTC One X] fisha21:
Not sure if you have a copy of the stock One X file, so have uploaded it here: https://www.box.com/shared/f9302a6bc63869ca0d52. Would be great if you can get it working...at the moment, any attempt to decompile results in an empty folder, so there are no xmls to fix!

I've found that editing one of the stock HTC skins lets you get around a lot of the limitations.

What I did find inetersting is that changing HTC skins allows you to change clock widget colour, lockscreen ring, homescreen dock etc without needing to edit m10 files. But if I change the relevant pngs in my skin, they then don't get applied. Any ideas how to fix this?
[HTC One X] he_stheone64:
I also finished a Skin for One s weeks ago, but there are too many parts, that are still overwritten by m.10 files. Certainly you can address a lot of areas, but I don`t like half baken Themes, so I decided not to publish the Skin and Theme, that is basically ready.

Edit: You are right - the file fernando has send me from Rezound worked perfect with my fix, as it did on One S. Your One X file already creates issues during decompile, which will be tough... So my fix was nice for One S and also great for fernando`s rezound issues, but we`re still not there for One X. I will see, whether I find a creative solution.
[HTC One X] Scabes24:
You sir are the man! :)

And I completely agree about the m10 problem. A full theme can't be complete without being able to modify the core of Sense UI.

Sent from my HTC One X
[HTC One X] he_stheone64:
Since many of you guys might only be in need to decompile all the .9`s in com.htc.resources, there is a workaround that allows you to compile these.

Decompile with:

1. java -jar apktool.jar d --keep-broken-res com.htc.resources.apk com.htc.resources-decoded

This ignores all errors and decompiles the apk incl. all patched pngs.

2. Make your changes and copy the changed png`s in any given decompiled apk (I use calendarprovider.apk for this task, very slim apk, compiles fast...) and compile them

I will look into the current state and see, whether I can brute force the apk to build :D
[HTC One X] fisha21:
I know exactly what you mean...I had to go from v0.1 to v2.1 before I had something I was happy to release. Still new to m.10 editing, so I'm not entirely sure what aspects of Sense these control. Hopefully you'll manage to find a workaround for the com.htc.resources issue.

Any ideas how the stock skins are able to change the lockring, but custom skins cannot?

Edit: you posted your workaround while I was typing this...fast work! I will try that out a bit later and let you know how it works. To be honest, I'm prob more keen to get at the xmls in there. Have managed to sort most of the .9.pngs by making the custom skin....a trick I learnt from you, by the way, so thanks for that :D
[HTC One X] he_stheone64:
It`s not only the lockring, same issue with Rosie dock...

You will also have all xml`s decompiled with this workaround, but now compiling them successfully will be a bigger task. In any case now you have a base to start fixing issues, which is more likely then staring at a base of empty folders :D
[HTC One X] chrisch1974:
For fixing the recompiling you first need to fix the *ERR* folders and get their correct names. Or you are maybe going to loose the correct dimension values for your resolution.
[HTC One X] he_stheone64:
Thx chrisch - I certainly did that already and dimens values are just fine in the correct value folders. Can someone upload framework-res.apk from One X ROM? - Edit: got it already...

In any case I can only spend a very limited amount of time on this project (since I use a One S), but using this base I`m sure you have enough good guys here in One X forum to go fo it.
[HTC One X] Scabes24:
Some of the images & colors used for the stock skin.apks are in the m10 files in fusion.apk.

Sent from my HTC One X
[HTC One X] he_stheone64:
chrisch - do you have a clue about the correct names needed for the ERR folders? I was able to track down all errors, but without the correct folder names, these will surely not compile properly.
[HTC One X] chrisch1974:
I'm not sure atm. I was comparing it with a Sense 3.5 GB com.htc.resources and there are some folders missing now like values-w1dp-hdpi, values-w2dp-hdpi, values-w4dp-hdpi and values-w5dp-hdpi. But really not sure which ones are missing too.

I'm also trying to catch them with aapt atm. But looks like a pain.

For the moment you could try to delete the *ERR* folders and try to fix the rest to rebuild it. It will result in a not 100% correct com.htc.resources but it will maybe help until we can fix the rest.
[HTC One X] he_stheone64:
I did that already (that was my first "dirty" attack :D), but then there are multiple errors about missing resources. Everything else is fixed, but renaming these folders is a pain.
[HTC One X] fisha21:
Thanks for spending time on this, considering you don't even have a One X!

Just to confirm, the above approach works for .pngs and .9.pngs, thanks!

Now just trying to work out how to edit colors.xml. Since its in one of the hidden xml folders, I can't just drag and drop a recompiled edited version. I know resources .arsc contains the compiled xmls - is there any way to copy the info from the recompiled resources.arsc into the stock com.htc.resources.apk?
[HTC One X] fernando sor:
Just a reminder the apktool in the op is has the updated smali baksmali properties to decompile systemui. Just as instructed in the op make sure your resources are installed in apktool
[HTC One X] he_stheone64:
That`s not possible, you need to fix the ERR folders first to compile resources.arsc

Anyway - I didn`t want to "highjack" this thread, so back to One S business :D

@ fernando - any positive results with the new merged apktool version (also on framework)?
[HTC One X] fernando sor:
Well I was able to decompile 4.0 sense com.htc.resources and I had not been able to do that with my apktool so huge thanks there. I haven't tried it on framework-res yet but i will today.
[HTC One X] fernando sor:
the framework-res compiled with the same errors minus th plurals errors.
[HTC One X] Rainbowbright081:
Fern do you know what xml file I would need to change to fix the text color and size on my widgets?

The red text, supposed to be white, and smaller... I have looked and looked to no avail... Google not my friend so much right now....
[HTC One X] fernando sor:
Thanks for the donation bro.

I don't work with widgets much but my guess is if you can't find it some text is in m10 files. Hit the link in my sig. Those guys do a lot of widget work
[HTC One X] RegnierD:
Heya Fern! I haven't seen you since the OG DInc! (Back before I even knew what apktool was, lol!)

I've got some issues recompiling the SystemUI.apk from the Evo LTE, and I was wondering if you could provide a little guidance. I've used the resources from your OP, and got these errors when trying to build. (Ubuntu 12.04)

toddrick@Ubi:~/sdk/apktool$ ./apktool b SystemUI
I: Checking whether sources has changed...
I: Smaling...
I: Checking whether resources has changed...
I: Building resources...
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL6421459638993419441.tmp, -I, /home/toddrick/apktool/framework/1.apk, -I, /home/toddrick/apktool/framework/2.apk, -S, /home/toddrick/sdk/apktool/SystemUI/res, -M, /home/toddrick/sdk/apktool/SystemUI/AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:193)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:301)
at brut.androlib.Androlib.buildResources(Androlib.java:248)
at brut.androlib.Androlib.build(Androlib.java:171)
at brut.androlib.Androlib.build(Androlib.java:154)
at brut.apktool.Main.cmdBuild(Main.java:182)
at brut.apktool.Main.main(Main.java:67)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, -F, /tmp/APKTOOL6421459638993419441.tmp, -I, /home/toddrick/apktool/framework/1.apk, -I, /home/toddrick/apktool/framework/2.apk, -S, /home/toddrick/sdk/apktool/SystemUI/res, -M, /home/toddrick/sdk/apktool/SystemUI/AndroidManifest.xml]
at brut.util.OS.exec(OS.java:87)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:191)
... 6 more
Caused by: java.io.IOException: Cannot run program "aapt": java.io.IOException: error=2, No such file or directory
at java.lang.ProcessBuilder.start(ProcessBuilder.java:475)
at java.lang.Runtime.exec(Runtime.java:610)
at java.lang.Runtime.exec(Runtime.java:483)
at brut.util.OS.exec(OS.java:78)
... 7 more
Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
at java.lang.ProcessImpl.start(ProcessImpl.java:81)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:468)
... 10 more

Any suggestions? I'm trying to get rid of the lone menu software key for good, and change the value under home key for multi-press or whatever it's called from false to true, so that long-press home works for recent apps again until I finally decide where I want that to be mapped.
[HTC One X] fernando sor:
Hey regnier what's up ?

I would install resources from the evo rom and also did it decompile ok with no errors?
[HTC One X] RegnierD:
Yup! I did:

apktool if (dir to SystemUI)
apktool if (dir to framework-res.apk)
apktool if (dir to com.htc.resources.apk)
apktool if (dir framework-htc-res.apk) (just in case)

Everything decompiled fine, giving the usual flag errors. I'm giving it a shot on Win7, because it looked like my Ubu terminal was rejecting some commands from apktool (I think because they didn't have ./ in front of the commands).

Edit: It was a no-go. I got apktool to build the apk after I specified a directory, but I had no statusbar after I compiled and pushed.

Is there a step I'm missing after I make the necessary edits to the xml file I'm after?

apktool d (dir to SystemUI)

(my edit to the navbar.xml)

apktool b SystemUI (dir to build)

If you have a spot of time, hit me up on G-Talk.

regnierdehrvand
[HTC One X] fernando sor:
Post your 1 and 2.apk (resource's) and your systemui. Let me rule a few things out first
[HTC One X] RegnierD:
Here ya go!

127 is SysUI
[HTC One X] fernando sor:
The 127 is just the resources.arsc. I need the whole apk
[HTC One X] RegnierD:
Oops, sorry. There ya go.

Tapatalked from my shiny new HTC Evo LTE
[HTC One X] runandhide05:
hey wondering if u wcould check something for me,

im having a compile error.

it points to a line in the rev/value/publix.xml

line reads

<public type="layout" name="keyguard_screen_status_land" id="0x01090054" />

error reads

C:\Users\zach\apktool\framework-res\res\values\public.xml:6939: error: Public sy

mbol layout/pin_keyboard declared here is not defined.
[HTC One X] fernando sor:
check that line in res/values/layout.xml/pin_keyboard.

there is probably where your problem is.
[HTC One X] fernando sor:
i just noticed your a fellow ohioin there reg.

anyways i was ablt to decompile and compile your systemui fine with no errors. on decompile you will get flag errors but as long as all the resources load and values fully decompiles with the apktool.yml you should be fine
[HTC One X] runandhide05:
I think there in lays the problem... there is not pin_keyboard.XML
[HTC One X] fernando sor:
what phone and software are you using?
[HTC One X] runandhide05:
Working on win7 using your apktool from op.

Phones working on is for the HTC evo 4g lte. Using the rom from here

http://xdaforums.com/showthread.php?t=1677823

I've already made all the edits on my apks/folders

I'm familiar with apktool.

Working on a getting the navbar menu gone,

I've already modded the android.policy.jar to add long press home.

And removed the menu but the navbar stays, in the systemui the dimensions point to @Android (which is the framework)

Any help would be great.

I'm uploading my framework-res and files now if u want to browse them, I'll be back link the link as soon as they r up
[HTC One X] fernando sor:
ok your sig confused me. sense 4.0 framework has an xml in values called layout. the pin_keyboard is just a line of code in the layout.xml. did you do the fix for it as i put in the op?
[HTC One X] runandhide05:
I did, but I will double check to ensure that it is correct, thanks

Fyi here is the files

http://db.tt/hVkHWcHn
[HTC One X] fernando sor:
when you say navabar what do you mean can you show a screenshot? and your saying you added a longClickListener to the policy jar? thats the variable for buttons. usually if you are adding a button in that area it would be in systemui. i may not be totally following you tho.
[HTC One X] runandhide05:
OK I'm working blind I do not have the device, and your right normally it would be in the systemui.

However on this device long press is set to only work in the car dock and is used to launch htcspeak( voice command) so the policy had to be changed to allow long press globally ( allow long press everywhere nit just in car dock mode) and then to re define long press home back to its normally mode of launching recent apps.

After doing that, and changing the map of the recent key to act as a menu the on screen menu still pops up when an app calls for it. So what I am attempting to do is change the dip of the navbar to 0.0dip.

The dimensions of the nav bar are in the framework.
[HTC One X] fernando sor:
and when you mod the dimens you get the pin_keyboard error?
[HTC One X] runandhide05:
Damn it. I missed a line in the layout!! Err thanks man I got build !!
[HTC One X] fernando sor:
cool. post a screen when your done im curious how this will look
[HTC One X] runandhide05:
I'll have someone in my thread post a screen shot once done.

All ready have some screen shots I'm the thread if u want to pop in,

http://xdaforums.com/showthread.php?t=1681034
[HTC One X] fernando sor:
Lol link fail
[HTC One X] runandhide05:
Click your quote... lol it works from there

Or

http://xdaforums.com/showthread.php?t=1681034
[HTC One X] runandhide05:
Fyi its all done and there are in depth instructions on that thread on the third post if you r curious.

and thanks again for your help bud
[HTC One X] fernando sor:
I checked it out. Clever mod
[HTC One X] runandhide05:
Thank you
[HTC One X] Tiffany84:
OMG!! Thank you SOOO much for posting this. I've been pulling my hair out trying to get resources to compile for the AT&T One X and after I did what u suggested it compiled without error. Can't thank you enough.
[HTC One X] Sh0X31:
I edit the framework-res from insertcoin v6.4.5.

I edited \framework\res\values\bools.xml. Becouse i want to disable the 360° roating and change

to

I have edited anims.xml, layout.xml, raws.xml, plurals.xml, plurals.xml as in the description of fernando sor. But when I recompiling i get this.
[HTC One X] rayford85:
Just delete that public Id. The apk will build the proper public id. :)
[HTC One X] fernando sor:
ok cool. also you missed pin_keyboard in res/values/layout.xml
[HTC One X] Sh0X31:
where is the id?

how i insert the pin_keyboard in res/values/layout.xml?
[HTC One X] rayford85:
Lol, hard to see it on the xda app:p
[HTC One X] fernando sor:
No I meant he had missed that when he did the fix
[HTC One X] Sh0X31:
How i fix his now? What I must do for recompiling without problems?
[HTC One X] fernando sor:
the directions are in the op
[HTC One X] Sh0X31:
What I would to do?
[HTC One X] he_stheone64:
Exactly what error log and both buddies here told you ;)

Open public.xml, go to line 6981 with pin_keyboard entry, delete this line and save. Then compile and apktool will build this entry fine and you`re all set.
[HTC One X] Sh0X31:
I have delete the line 6981 with pin_keyboard. Now I have a recompiling problem again.

1. Question: If I delete the pin_keyboard entery is that not missing in framework-res.apk?

Can this caused an error?

2. Question: how a make the framework-res.apk to a flashable .zip? :P Can someone tell me please?
[HTC One X] he_stheone64:
You can use an existing update.zip with the correct update-binary for your device as a base. Then your folder structure under your mymodupdate.zip has to be correct

system/framework and / or system/app if you also push an app.

Then you can use this very basic script as updater-script, which works fine for most stuff (don`t know where busybox is on your device, I`m coming from the dark side of the force, the One S) you need to push in data or system:

ui_print("Mod created by $M3RT$");
show_progress(0.500000, 0);

ui_print("Writing System");
run_program("/sbin/busybox", "mount", "/system");
package_extract_dir("system", "/system");
unmount("/system");

ui_print("Writing Data");
run_program("/sbin/busybox", "mount", "/data");
package_extract_dir("data", "/data");
unmount("/data");

ui_print("Finishing Up");
show_progress(0.100000, 0);

In any case I would recommend you also read something like this, to understand what you are doing here:

http://xdaforums.com/showthread.php?t=1265120