[Android Themes] gregpilot:
Android O, deodexing, Janus "vuln", signatures, SystemUI.apk

Hello All:

I have been trying to change my statusbar icons, from white to another color, maybe change the design also.

Android 8.1, HTC one M9, AICP (aosp) rom.

Have been able to decompile SystemUI.apk and framework-res.apk with apktool, and from TMA. Thats about it.

I previously hired a developer to work with me, he was not successful. I have some questions if anyone can help:

My attempt at recompiling SystemUI.apk, without changes, using TMA and several versions of apktool had errors:

From History.txt, Win7

java -jar user_files\APKTOOL\apktool_2.4.1.jar b --copy-original --no-crunch --force-all --use-aapt2 --frame-path _WorkArea1\Frameworks _WorkArea1\_working\framework-res.apk -o _WorkArea1\_out\framework-res.apk)

C:\TMA\TickleMyAndroid\_WorkArea1\_working\framework-res.apk\res\values\attrs.xml:2487: error: invalid value for type 'attr'. Expected a reference.

******several lines snipped*******

brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\XXXX\AppData\Local\Temp\brut_util_Jar_5036440080483370809.tmp, compile, --dir, C:\TMA\TickleMyAndroid\_WorkArea1\_working\framework-res.apk\res, --legacy, -o, C:\TMA\TickleMyAndroid\_WorkArea1\_working\framework-res.apk\build\resources.zip, --no-crunch].

and

java -jar user_files\APKTOOL\apktool_2.4.1.jar b --force-all --use-aapt2 --frame-path _WorkArea1\Frameworks _WorkArea1\_working\SystemUI.apk -o _WorkArea1\_out\SystemUI.apk)

I: Using Apktool 2.4.1

I: Smaling smali folder into classes.dex...

I: Building resources...

W: C:\TMA\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\res\values\public.xml:2178: error: resource 'drawable/$recents_locked_dark__0' has invalid entry name '$recents_locked_dark__0'. Invalid character '$recents_locked_dark__0'.

W: C:\TMA\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\res\values\public.xml:2179: error: resource 'drawable/$recents_locked_dark__1' has invalid entry name '$recents_locked_dark__1'. Invalid character '$recents_locked_dark__1'.

***************several lines snipped about resources not found**************

brut.androlib.AndrolibException: brut.common.BrutException: could not exec (exit code = 1): [C:\Users\XXXX\AppData\Local\Temp\brut_util_Jar_4692797315079755925.tmp, link, -o, C:\Users\XXXX\AppData\Local\Temp\APKTOOL523248044320084983.tmp, --package-id, 127, --min-sdk-version, 27, --target-sdk-version, 27, --version-code, 27, --version-name, 8.1.0, --no-auto-version, --no-version-vectors, --no-version-transitions, --no-resource-deduping, -e, C:\Users\XXXX\AppData\Local\Temp\APKTOOL725868104865079970.tmp, -0, arsc, -I, _WorkArea1\Frameworks\1.apk, --manifest, C:\TMA\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\AndroidManifest.xml, C:\TMA\TickleMyAndroid\_WorkArea1\_working\SystemUI.apk\build\resources.zip]

Before I get too deep into this (I have an understanding of this but an not a developer), can anyone answer some questions?

My attempting at hiring someone was not successful because the recompiled SystemUI.apk would not run. Its in /system/priv-app/SystemUI/ and was replaced from adbshell from within recovery, not from the live system. The phone would boot with no statusbar or navbar.

I found a lot of discussions re: signatures. The apk would have to be signed with the signature used for the original rom. Attempts to replace the original signature within the "meta-inf" folder, in older Android, would work, however recently this "Janus vulnerability" has been patched. In earlier android you could re-use the original signature, the byte count or checksum or whatever is examined in SystemUI.apk would not be verifed, hence the "vulnerability".

Does the meta-inf signature copy still work??

Can someone explain how de-odexing affects this, or not??

Someone had posted about some obfuscating code which points to non-existing resources, therefore the errors????

Has anyone been successful at changing the statusbar icons/colors on 8.1?????

I am still willing to hire the right developer to help, I understand this would not be a trivial cost, if anyone is interested.

Thanks!!