[Android Software Development] GroovyGeek:
Can't get Sense 4.1 to work

OK, so I downloaded the latest version of apktool (1.5.0) and am still having issues decompiling Rosie.apk from Sense 4.1 which I did not have with Sense 4.0.4. The sequence of events

1) Download the relevant apks from the phone, goes off without a hitch

adb pull /system/app/Rosie.apk
adb pull /system/framework/framework-res.apk
adb pull /system/framework/com.htc.resources.apk

2) Install framework goes without issues

apktool if framework-res.apk

which only issues an info message

I: Framework installed to: C:\Users\xxx\apktool\framework\1.apk

3) Install com.hts.resources.apk

apktool if com.htc.resources.apk

which returns all sorts of "config flag size > 36" warning messages as documented by others in this thread

W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: dimen-mdpi-ERR0
...
W: Config flags size > 36. Exceeding bytes: 0x6000000.
W: Invalid config flags detected: integer-xhdpi-ERR59
I: Framework installed to: C:\Users\xxx\apktool\framework\2.apk

4) decompile Rosie.apk which duplicates the above warnings but seems to go through OK

I: Loading resource table...
I: Loaded.
I: Decoding AndroidManifest.xml with resources...
I: Loading resource table from file: C:\Users\xxx\apktool\framework\1.apk
I: Loaded.
I: Loading resource table from file: C:\Users\xxx\apktool\framework\2.apk
W: Config flags size > 36. Exceeding bytes: 0x2000000.
W: Invalid config flags detected: dimen-mdpi-ERR0
...
W: Config flags size > 36. Exceeding bytes: 0x6000000.
W: Invalid config flags detected: integer-xhdpi-ERR59
I: Loaded.
I: Decoding file-resources...
I: Decoding values */* XMLs...
I: Done.
I: Copying assets and libs...

5) recompile Rosie.apk without changing anything just as a test

apktool b Rosie Rosie1.apk

This is where the fun starts

W: Could not find sources
I: Checking whether resources has changed...
I: Building resources...
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values\styles.xml:6: error: Error retrieving parent for item: No resource found that matches the gi
ven name '@*android:style/Theme.Wallpaper'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values-normal\styles.xml:6: error: Error retrieving parent for item: No resource found that matches
the given name '@*android:style/Theme.DeviceDefault.NoActionBar'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values-large\styles.xml:6: error: Error retrieving parent for item: No resource found that matches
the given name '@*android:style/Theme.DeviceDefault'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values-xlarge\styles.xml:6: error: Error retrieving parent for item: No resource found that matches
the given name '@*android:style/Theme.DeviceDefault'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values\styles.xml:15: error: Error retrieving parent for item: No resource found that matches the g
iven name '@*android:style/Theme.DeviceDefault'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values\styles.xml:75: error: Error retrieving parent for item: No resource found that matches the g
iven name '@*android:style/Widget.Button.Small'.
C:\Users\xxx\Documents\Android\apktool\Rosie\res\values-normal\styles.xml:36: error: Error retrieving parent for item: No resource found that matche
s the given name '@*android:style/Animation.Activity'.
Exception in thread "main" brut.androlib.AndrolibException: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, -F, C:
\Users\xxx\AppData\Local\Temp\APKTOOL9059171924998470098.tmp, -I, C:\Users\xxx\apktool\framework\1.apk, -I, C:\Users\xxx\apktool\framework\2.apk
, -S, C:\Users\xxx\Documents\Android\apktool\Rosie\res, -M, C:\Users\xxx\Documents\Android\apktool\Rosie\AndroidManifest.xml]
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:255)
at brut.androlib.Androlib.buildResourcesFull(Androlib.java:324)
at brut.androlib.Androlib.buildResources(Androlib.java:269)
at brut.androlib.Androlib.build(Androlib.java:192)
at brut.androlib.Androlib.build(Androlib.java:174)
at brut.apktool.Main.cmdBuild(Main.java:188)
at brut.apktool.Main.main(Main.java:70)
Caused by: brut.common.BrutException: could not exec command: [aapt, p, --min-sdk-version, 15, -F, C:\Users\xxx\AppData\Local\Temp\APKTOOL9059171924
998470098.tmp, -I, C:\Users\xxx\apktool\framework\1.apk, -I, C:\Users\xxx\apktool\framework\2.apk, -S, C:\Users\xxx\Documents\Android\apktool\Ro
sie\res, -M, C:\Users\xxx\Documents\Android\apktool\Rosie\AndroidManifest.xml]
at brut.util.OS.exec(OS.java:83)
at brut.androlib.res.AndrolibResources.aaptPackage(AndrolibResources.java:253)
... 6 more

At this point I am completely lost. Any ideas? I can email the offending .apk file(s) if someone else is willing to give it a go.

Thanks