If I am not mistaken, the VRTheme engine has been largely outdated since 2011/2012, and that there are a considerable amount of failures when using the engine - some of which include still-unthemed APKs, bootloops, and unzipaligned APKs.
So I've decided to improve a bit on the original VRTheme Engine, and this is the fruit of my work.
EVilTheme (Enhanced VillainROM Theme Engine) is an Android theming platform meant for use with custom Android recoveries which allow replacement of application resources without the need to replace the whole app or use a new ROM. It is based on the original 2011 VRTheme Engine.
The process is as such:
• Mount filesystems
• Extract engine to /tmp
• Extract new files to /system and /data, if any
• Extract theme files to /data/tmp
• Copy the APKs to be themed to a backup folder inside /data/tmp
• Delete specified files inside each APK, if any
• Recurse the corresponding theme files into each APK using ZIP
• Zipalign the themed APKs
• Do a smart Dalvik wipe (detailed below)
• Create a restore ZIP in /data/vrtheme-backup that will restore original, unthemed APKs when flashed
• Unmount filesystems
EVilTheme uses a selective kind of Dalvik wipe. Instead of deleting all .dex entries in /cache and /data, it looks for the themed APKs' specific dex files and deletes them, thereby avoiding longer boot times caused by re-optimization of every single APK.
The specific improvements of EVilTheme upon the original VRTheme Engine are enumerated below:
• Easy restoration of original APKs via flashable ZIP
• Zipalign process follows that on developer.android.com
• Smart Dalvik wiping
• Ability to delete files inside APKs
• APKs are renamed to .zip first so zip can recurse correctly
• Slightly better for-do looping, e.g.
Original VRTheme: busybox mkdir aligned for f in $(ls) do /sdcard/vrtheme/zipalign -f 4 $f # zipalign will also attempt to align the 'aligned' folder done EVilTheme: for f in *.apk; do [ -e $f ] || break /tmp/zipalign -f -v 4 $f ./aligned/$f done
What's in the engine?
• busybox 1.21.1
- Source Code
- The VillainROM team for the original template. (I cleaned up the script but the credits are still there, does that count as being a douche? )
- @Chainfire for his method of printing to recovery UI from shell
• Tested on a Samsung Galaxy Express GT-I8730 running CyanogenMod 11.0 (CWM 188.8.131.52) and a Cherry Mobile One H940 running stock 6.0.1 (TWRP 184.108.40.206).
• DON'T edit anything in the ZIP except the beginning and end of updater-script to avoid code breakage on a per-device basis.