[Android Q&A, Help & Troubleshooting] Soontir Fel:
Hello! I have Huawei U8500 with custom Android 2.2. I wanted to decode framework-res.apk with apktool, change anything and build it again. But I have troubles with it. First of all decoding:

C:\framework>apktool d framework-res.apk
I: Loading resource table...
W: Config flags size > 32. Exceeding bytes: 5500000048030000.
W: Invalid config flags detected. Dropping resources: array-ERR0
W: Config flags size > 32. Exceeding bytes: 7F00000058010000.
W: Invalid config flags detected. Dropping resources: array-ERR1
W: Config flags size > 32. Exceeding bytes: -4CFFFFFF97FF0000.
W: Invalid config flags detected. Dropping resources: array-ERR2
W: Config flags size > 32. Exceeding bytes: -18FCFFFF18FD0000.
W: Invalid config flags detected. Dropping resources: array-ERR3
I: Decoding resources...
I: Copying assets and libs...

C:\framework>

As you can see, it drops some resources. I tried to decode it with "--keep-broken-res":

C:\framework>apktool d --keep-broken-res framework-res.apk
I: Loading resource table...
W: Config flags size > 32. Exceeding bytes: 5500000048030000.
W: Invalid config flags detected: array-ERR0
W: Config flags size > 32. Exceeding bytes: 7F00000058010000.
W: Invalid config flags detected: array-ERR1
W: Config flags size > 32. Exceeding bytes: -4CFFFFFF97FF0000.
W: Invalid config flags detected: array-ERR2
W: Config flags size > 32. Exceeding bytes: -18FCFFFF18FD0000.
W: Invalid config flags detected: array-ERR3
I: Decoding resources...
I: Copying assets and libs...

C:\framework>

The difference is that for the second time in the "res" folder appeared 4 additional folders "values-ERR0", "values-ERR1", "values-ERR2" and "values-ERR3" with "arrays.xml" file in each. And also there is one more string in "public.xml", which was not there for the first time. The string is:

<public type="array" name="default_locales" id="0x01070005" />

Than I tried to build it (without any changes).

When I try to build framework-res, which was decoded without "--keep-broken-res" parameter I get this:

C:\framework>apktool b framework-res1 1.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\framework\framework-res1\res\values\public.xml:2395: error: Public entry iden
tifier 0x107001d entry index is larger than available symbols (index 29, total s
ymbols 29).
C:\framework\framework-res1\res\values\public.xml:2395: error: Public symbol arr
ay/carrier_properties declared here is not defined.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Soontir\AppData\Local\Temp
\APKTOOL5080969896487671571.tmp, -x, -S, C:\framework\framework-res1\res, -M, C:
\framework\framework-res1\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\Soontir\AppData\Local\Temp\APKTOOL5080969896487671571.tmp, -x, -S, C:\frame
work\framework-res1\res, -M, C:\framework\framework-res1\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more

C:\framework>

And when I try to build framework-res, which was decoded with "--keep-broken-res" parameter I get this:

C:\framework>apktool b framework-res 1.apk
W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
invalid resource directory name: C:\framework\framework-res\res/values-ERR0
invalid resource directory name: C:\framework\framework-res\res/values-ERR1
invalid resource directory name: C:\framework\framework-res\res/values-ERR2
invalid resource directory name: C:\framework\framework-res\res/values-ERR3
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutExce
ption: could not exec command: [aapt, p, -F, C:\Users\Soontir\AppData\Local\Temp
\APKTOOL5529805555528398812.tmp, -x, -S, C:\framework\framework-res\res, -M, C:\
framework\framework-res\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\Soontir\AppData\Local\Temp\APKTOOL5529805555528398812.tmp, -x, -S, C:\frame
work\framework-res\res, -M, C:\framework\framework-res\AndroidManifest.xml]
at brut.util.OS.exec(Unknown Source)
... 7 more

C:\framework>

Can someone help me with it, please?

Just in case framework-res.apk is attached.