[How-To] FIX various compile errors with common Sense 4.0 files -Update apktool 1.4.9

Search This thread

memnoc

Inactive Recognized Developer
Feb 23, 2011
4,542
5,209
This is not about One S files, it´s about the methods to solve compile issues :D

Ohhh, ignore the post then eheh anyway, did u see my guide on Virtuous Ten Manager? I think we should put our guides together, cause yours is propedeutic to mine and viceversa
http://xdaforums.com/showthread.php?t=1632920

Inviato dal mio HTC Sensation Z710e con Tapatalk 2
 
Last edited:

memnoc

Inactive Recognized Developer
Feb 23, 2011
4,542
5,209
Haven`t seen it, but use whatever you need. I will also check out your`s.

Link above ;) let me know if you find it interesting, the program is amazing and of course use apktool and its stuff, diamond and me have fixed some features for sense 4, but errors appear as well so this guide fit perfectly mine, we could make a big thread for an universal use cause vts is really useful when you decompile/compile a lot

Inviato dal mio HTC Sensation Z710e con Tapatalk 2
 

he_stheone64

Senior Member
Aug 1, 2008
5,033
10,991
Düsseldorf
Checked your apktool version and you have forgot to add new ICS smali baksmali properties to apktool. If you need an updated version, just let me know.
 
  • Like
Reactions: memnoc

memnoc

Inactive Recognized Developer
Feb 23, 2011
4,542
5,209
Checked your apktool version and you have forgot to add new ICS smali baksmali properties to apktool. If you need an updated version, just let me know.

I got more than one actually, but yes please would be nice :)

Inviato dal mio HTC Sensation Z710e con Tapatalk 2
 
D

-deuces-

Guest
why does uot kitchen never produce my final file to flash? would this guide help ?
 

he_stheone64

Senior Member
Aug 1, 2008
5,033
10,991
Düsseldorf
I never use UOT, but since everything is automated, I`m sure Sense 4.0 framework will cause errors. What kind of mod are you`re after?
 

Habarug

Senior Member
Feb 23, 2011
1,671
409
Bergen
I'm getting the "can't decode attr value" issue, see a log at page 3. Did any1 ever find the solution? I get it both with the apk manager 5 thingy and the latest apk multi tool :/ I'm using a x64 system if that's the problem
 

Habarug

Senior Member
Feb 23, 2011
1,671
409
Bergen
Code:
mode gjenkjennes ikke som en intern eller ekstern kommando,
kj›rbart program eller satsvis fil.
Undermappen eller filen projects finnes allerede.
Undermappen eller filen place-apk-here-for-modding finnes allerede.
Undermappen eller filen place-ogg-here finnes allerede.
Undermappen eller filen place-apk-here-to-batch-optimize finnes allerede.
Undermappen eller filen place-apk-here-for-signing finnes allerede.
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
remote object 'system/app/systemui.apk' does not exist
3220 KB/s (2526320 bytes in 0.766s)
Systemet finner ikke angitt bane.
Systemet finner ikke angitt bane.
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Håvard\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0x00000000
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x0104040e
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302ee
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0xffffffff
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x020500f0
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginTop, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginBottom, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginTop, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginBottom, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x0205008d
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x02050094
W: Could not decode attr value, using undecoded value instead: ns=android, name=opacity, value=0xfffffffd
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=interpolator, value=0x010c0008
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x010301ea
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b0
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x010102f0
W: Could not decode attr value, using undecoded value instead: ns=android, name=alpha, value=0x3ecccccd
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001401
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001401
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_activated, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=requiresFadingEdge, value=0x00002000
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingTop, value=0x02050059
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=animateLayoutChanges, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=animateLayoutChanges, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=opacity, value=0xfffffffd
W: Could not decode attr value, using undecoded value instead: ns=android, name=requiresFadingEdge, value=0x00002000
W: Could not decode attr value, using undecoded value instead: ns=android, name=src, value=0x010803f4
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x0105000d
	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(ResReferenceValue.java:59)
	at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
	at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)
	at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(ResScalarValue.java:71)
	at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
	at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
	at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:94)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
	at brut.apktool.Main.cmdDecode(Main.java:128)
	at brut.apktool.Main.main(Main.java:65)

It's the SystemUI, with or without classes.dex, doesn't matter
 

itsmikeramsay

Senior Member
Mar 25, 2009
5,343
12,239
Atlanta
Code:
mode gjenkjennes ikke som en intern eller ekstern kommando,
kj›rbart program eller satsvis fil.
Undermappen eller filen projects finnes allerede.
Undermappen eller filen place-apk-here-for-modding finnes allerede.
Undermappen eller filen place-ogg-here finnes allerede.
Undermappen eller filen place-apk-here-to-batch-optimize finnes allerede.
Undermappen eller filen place-apk-here-for-signing finnes allerede.
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
remote object 'system/app/systemui.apk' does not exist
3220 KB/s (2526320 bytes in 0.766s)
Systemet finner ikke angitt bane.
Systemet finner ikke angitt bane.
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Håvard\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0x00000000
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x0104040e
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302ee
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=theme, value=0x010302fc
W: Could not decode attr value, using undecoded value instead: ns=android, name=hardwareAccelerated, value=0xffffffff
I: Decoding file-resources...
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x020500f0
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginTop, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginBottom, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginTop, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=layout_marginBottom, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x0205008d
W: Could not decode attr value, using undecoded value instead: ns=android, name=textSize, value=0x02050094
W: Could not decode attr value, using undecoded value instead: ns=android, name=opacity, value=0xfffffffd
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=interpolator, value=0x010c0008
W: Could not decode attr value, using undecoded value instead: ns=android, name=textAppearance, value=0x010301ea
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b0
W: Could not decode attr value, using undecoded value instead: ns=android, name=drawable, value=0x010804b4
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x020500f1
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x010102f0
W: Could not decode attr value, using undecoded value instead: ns=android, name=alpha, value=0x3ecccccd
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001601
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001401
W: Could not decode attr value, using undecoded value instead: ns=android, name=baseline, value=0x00001401
W: Could not decode attr value, using undecoded value instead: ns=android, name=state_activated, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=requiresFadingEdge, value=0x00002000
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingTop, value=0x02050059
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=background, value=0x0101030e
W: Could not decode attr value, using undecoded value instead: ns=android, name=animateLayoutChanges, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=animateLayoutChanges, value=0xffffffff
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050057
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingRight, value=0x02050058
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingBottom, value=0x0205005a
W: Could not decode attr value, using undecoded value instead: ns=android, name=paddingLeft, value=0x02050001
W: Could not decode attr value, using undecoded value instead: ns=android, name=exitFadeDuration, value=0x010e0001
W: Could not decode attr value, using undecoded value instead: ns=android, name=opacity, value=0xfffffffd
W: Could not decode attr value, using undecoded value instead: ns=android, name=requiresFadingEdge, value=0x00002000
W: Could not decode attr value, using undecoded value instead: ns=android, name=src, value=0x010803f4
I: Decoding values*/* XMLs...
Exception in thread "main" brut.androlib.err.UndefinedResObject: resource spec: 0x0105000d
	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(ResReferenceValue.java:59)
	at brut.androlib.res.data.value.ResReferenceValue.encodeAsResXml(ResReferenceValue.java:46)
	at brut.androlib.res.data.value.ResScalarValue.encodeAsResXmlValue(ResScalarValue.java:54)
	at brut.androlib.res.data.value.ResScalarValue.serializeToResValuesXml(ResScalarValue.java:71)
	at brut.androlib.res.AndrolibResources.generateValuesFile(AndrolibResources.java:264)
	at brut.androlib.res.AndrolibResources.decode(AndrolibResources.java:137)
	at brut.androlib.Androlib.decodeResourcesFull(Androlib.java:94)
	at brut.androlib.ApkDecoder.decode(ApkDecoder.java:101)
	at brut.apktool.Main.cmdDecode(Main.java:128)
	at brut.apktool.Main.main(Main.java:65)

It's the SystemUI, with or without classes.dex, doesn't matter

I experience the same thing. I try to stay away from SystemUI lol

Posted using HTC One S using TapaTalk...
 

Habarug

Senior Member
Feb 23, 2011
1,671
409
Bergen
...but i dont want to stay away from the Systemui :p

Sent from my HTC One S using XDA

Edit: Finally got a charger for my x86 laptop, and this can compile and decompile perfectly :)
 
Last edited:

benko286

Retired Forum Moderator
Aug 2, 2008
2,663
103
Croatia, Zagreb
I am getting errors for any apk I try, the apk's are from One X

java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)
'adb' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find C:\Users\Benko\Desktop\apk_manager_5.0\place-apk-here-for-modding\../place-apk-here-for-modding/signedContactsProvider+CRC_VIE_EVA_ENR_PRO_S40.apk
Could Not Find C:\Users\Benko\Desktop\apk_manager_5.0\place-apk-here-for-modding\../place-apk-here-for-modding/unsignedContactsProvider+CRC_VIE_EVA_ENR_PRO_S40.apk
I: Baksmaling...
I: Loading resource table...
I: Loaded.
I: Loading resource table from file: C:\Users\Benko\apktool\framework\1.apk
I: Loaded.
W: Could not decode attr value, using undecoded value instead: ns=android, name=label, value=0x020402b5
I: Decoding file-resources...
I: Decoding values*/* XMLs...
I: Done.

Any help guys :confused:
 

Habarug

Senior Member
Feb 23, 2011
1,671
409
Bergen
It looks like the same issue as I had. Check if have a 64bit system. If you don't know how to do it, google it :)

Plus you havent added adb to your path... To add path find the path to adb, mine is C:\sdk\platform-tools. Then open my computer, click systemproperties (or whatever it's called in english :p ) at the top of the window, and go to advanced settings. At the bottom there, there is a button which should be called environment variables or something like that. Hit it and scroll down to PATH in the second window. Click it and press edit. Scroll to the end of the line, put a semicolon first then your path, like this: ;C:\sdk\platform-tools . Now press OK and adb is set up :)

Sent from my HTC One S using XDA
 
Last edited:

benko286

Retired Forum Moderator
Aug 2, 2008
2,663
103
Croatia, Zagreb
It looks like the same issue as I had. Check if have a 64bit system. If you don't know how to do it, google it :)

Plus you havent added adb to your path... To add path find the path to adb, mine is C:\sdk\platform-tools. Then open my computer, click systemproperties (or whatever it's called in english :p ) at the top of the window, and go to advanced settings. At the bottom there, there is a button which should be called environment variables or something like that. Hit it and scroll down to PATH in the second window. Click it and press edit. Scroll to the end of the line, put a semicolon first then your path, like this: ;C:\sdk\platform-tools . Now press OK and adb is set up :)

Sent from my HTC One S using XDA
Yes, I do have 64bit system, do you have solution for that ? :)
 

Habarug

Senior Member
Feb 23, 2011
1,671
409
Bergen
Not without having to buy a new comp :p I luckily had a x86 comp avaible. There should be a way, though, I'm just not skilled enough ;)

Sent from my HTC One S using XDA
 

Top Liked Posts

  • There are no posts matching your filters.
  • 39
    This guide assumes you already know how to use apktool and / or apkmanager. If you don`t, there are plenty of guides already on XDA.

    Latest Sense 4.0 and apktool are not great friends. The 3 most important files framework-res.apk, com.htc.resources.apk and systemui.apk all create fatal errors, when using latest apktool 1.43 version. Apktool`s error log is always a big help to solve compile issues, but you need a bit of compile and coding experience to finally solve these. After I stumbled about many people having Sense 4.0 compile issues, I decided to post this guide. Hopefully this will encourage more guys to add mods to One S, after they might have hit a wall before.

    Credits:

    • brut for his awesome apktool
    • daneshm for original apkmanager

    Known issues: ATM com.htc.resources fix does not work with One X


    1. Framework-res.apk

    a) Since ICS apktool creates multiple plurals errors, but you can easily fix these by using a custom version of apktool. Now updated incl. latest smali baksmali properties for ICS (thx fernando)

    Custom ICS apktool version - http://minus.com/mIA3OFkYq/19

    b) if you get tag errors like these

    anims.xml:3: error: Found tag anim where item is expected
    layouts.xml:3: error: Found tag layout where item is expected
    raws.xml:3: error: Found tag raw where item is expected

    Replace all tags in layouts.xml in values folder with:

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


    Replace all tags in anims.xml in values folder with:

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


    Replace all tags in raw.xml in values folder with:

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


    2. Systemui.apk

    When trying to decompile systemui, you will get bad magic value errors. Solution is to decompile without classes, as long as you don`t need to edit smali code. Even if you need to do that, you can still decompile classes.dex separately with smali baksmali.

    a) Use -s switch when decompiling to copy classes.dex instead of decompiling it

    java -jar apktool.jar d -s systemui.apk systemui-decoded

    b) If you are using apkmanager, you can just export classes.dex, then delete classes inside the apk. Then decompile, edit, compile and add classes.dex back when ready.

    EDIT: with updated apktool version systemui now compiles fine incl. classes.dex


    3. com.htc.resources.apk

    Here you get nice layouts tag errors and public entry issues. Again there`s an easy fix for that.

    a) Replace all tags in layouts.xml in values folder with:

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

    PHP:
    <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>

    b) Delete entry "zero_dummy_dimen" in public.xml - it will be created correctly again during compile


    In case you still have issues, here is my apkmanager build environment, that works fine with all these fixes.

    http://minus.com/mIA3OFkYq/20


    Hex editing solution for latest com.htc - thx to tbonanno231 - http://xdaforums.com/showpost.php?p=32222697&postcount=112


    Latest apktool version 1.4.9 from ibotpeaches

    Big thx to ibotpeaches for the tremendous follow up on apktool

    • Fixes plural errors
    • Fixes item tag errors
    • Fixes bad magic value errors
    • Adds ICS smali properties (compared to latest official version from brutall)
    • Fixes unknown folder issues (only with patched aapt.exe)

    Download apktool 1.4.9:

    http://sdrv.ms/T0LpzK


    Download patched aapt.exe

    http://sdrv.ms/Mfrkaa


    c) Workaround for One X ROM´s

    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
    7
    Updated with new custom apktool version, that includes latest smali baksmali properties to properly decompile ICS Java code.
    6
    I wanted to report back and share with you guys what I ended up doing to solve this. It's not elegant, but it works.

    1. I yanked all edited XML and 9 patch images from my recompiled com.htc.resources.apk.
    2. Compared edited 9 patch images with those from the original com.htc.resources.apk to see if any were repeatable 9 patch (*.r.9.png) before the decompile.
    3. Hex-edited resources.arsc to change references to the names of all edited repeatable 9 patch image files to regular 9 patch file names (from *.r.9.png to *.9.png).
    4. Hex-edited resources.arsc from the original working com.htc.resources.apk in order to make the edits to the colors in both colors.xml and styles.xml. (Yes this was a royal pain in the a$$.)
    5. Copied the edited compiled XML files, 9 patch images, and the hex-edited resources.arsc into the original working com.htc.resources.apk.
    6. Zipaligned and installed.

    The hex editing of resources.arsc is tricky. The color pairs in the hex are reversed, so instead of AC RR GG BB, it is BB GG RR AC (AC is for alpha channel). And the only way to know which colors are which is by relativity to other colors. Yes... lots of fun. :eek:

    So far, I cannot reproduce those bugs and everything seems to be in order. I'll report back if I see any anomalies.

    Thanks for everyone's help.
    4
    Updated with new section b), that explains how to fix tag errors with latest 1.78 framework-res.apk
    3
    Added latest unofficial apktool 1.4.9 from ibotpeaches to OP, for those who don`t know him yet. Fixes a lot of the current compiling issues (even if we had our workarounds...). See changelog in OP.