Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,737,124 Members 43,149 Now Online
XDA Developers Android and Mobile Development Forum

[VRTHEME][TEMPLATE] EVilTheme

Tip us?
 
aureljared
Old
(Last edited by aureljared; 15th July 2014 at 09:54 AM.) Reason: remove version number from title
#1  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
Good day to the whole XDA community!

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.
  • Documentation
    EVilTheme (Enhanced VillainROM Theme Engine) is an Android themeing 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 /sdcard
    Copy the APKs to be themed to /sdcard
    Recurse the corresponding theme files into each APK using ZIP
    Zipalign the themed APKs
    Do a smart Dalvik wipe (detailed below)
    Create a recovery script in /system that will restore original, unthemed APKs when executed
    Alert the user on how to use the script in case of bootloop
    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 it, thereby avoiding longer boot times caused by optimization of all APKs present.

    The specific improvements of EVilTheme upon the original VRTheme Engine is enumerated below:
    Enables easy restoration of original APKs via ADB
    Zipalign process follows that on developer.android.com
    Smart selective Dalvik wiping
    APKs are renamed to .zip first so zip can recurse correctly
    Slightly better for-do looping, e.g.

    Code:
    Select Code
    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 $(ls *.apk)
    do
    /tmp/zipalign -f -v 4 $f ./aligned/$f
    done
    Attempts to 'echo' status to the recovery UI are now done correctly, thanks to a ui_print-like custom-defined method. Now you don't have to wonder what the heck the recovery is doing now!

    What's in the engine?
    busybox 1.21.1
    zip
    zipalign
    installtheme.sh
    cleanup.sh
  • Download
    v1.0: EnhancedVRTheme_template.zip
    v1.1: Link
    Quote:
    What's new?
    - Even smarter Dalvik wiping: delete dex files only for those apps whose classes.dex were changed (thanks @Spannaa)
    - Corrected a typo in the restore script (please delete 'restore-vr' inside your /system/xbin, if any!)
    - Removed unused methods in installtheme.sh
    v1.2: Link
    Quote:
    What's new?
    - Refinements to Smart Dalvik Wipe
    - Switch to Linus Yang's BusyBox 1.21.1, which will hopefully make themeing TouchWiz < 4.2 possible
    - TWRP compatibility: switch to a static zipalign binary, grep method for OUTFD to look for updater binary
    - Cleaner zip hierarchy: new apps to be installed to /system and /data are now in their respective folders in a folder named 'new'
    v1.3: Link
    Quote:
    What's new?
    - Support for KitKat's system apps in priv-app
  • Credits
    Quote:
    - 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
  • Notes
    Tested on a Samsung Galaxy Express GT-I8730 running CyanogenMod 10.1.
    IDK if this will work on non-AOSP / pre-4.2 ROMs, test it out!
    DON'T edit anything in the ZIP except the beginning of updater-script to avoid code breakage on a per-device basis.
Thanks for reading, and don't forget to hit the Thanks :thumbsup: button!

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD
The Following 3 Users Say Thank You to aureljared For This Useful Post: [ Click to Expand ]
 
aureljared
Old
#2  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
If you used this template in your work, be sure to tell me so the link to your thread can be posted in this thread!

Sent from my GT-I8730 using Tapatalk

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD
The Following User Says Thank You to aureljared For This Useful Post: [ Click to Expand ]
 
aureljared
Old
(Last edited by aureljared; 15th July 2014 at 03:12 PM.)
#3  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
As it seems, themeing data apps were and still is broken in VRTheme and EVilTheme, because modifying the contents will break the signature.

Any help regarding this matter would be appreciated. Themers are advised to resort to manually recompiling the APKs until we can work something out.

Sent from my GT-I8730 using Tapatalk

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD
The Following User Says Thank You to aureljared For This Useful Post: [ Click to Expand ]
 
Spannaa
Old
#4  
Spannaa's Avatar
Recognized Themer
Thanks Meter 10878
Posts: 2,963
Join Date: Sep 2010
Location: Cardiff

 
DONATE TO ME
Great work

I particularly like the smart selective dalvik-cache wiping
Maybe it could be even smarter if the script only wipes an apk's dalvik-cache if the apk has had it's classes.dex replaced by the theme...

I'm working on something like this myself but mine is based on the unreleased GS2XFormROM by @hawkerpaul
I'll throw you a link when it's ready
Read first...Then search...Then ask...

My Work, My Dev-Host, My goo.im, My Android File Host
 
The Following User Says Thank You to Spannaa For This Useful Post: [ Click to Expand ]
 
hawkerpaul
Old
#5  
hawkerpaul's Avatar
Recognized Contributor
Thanks Meter 5318
Posts: 2,354
Join Date: Sep 2011
Location: UK

 
DONATE TO ME
Quote:
Originally Posted by Spannaa View Post
Great work

I particularly like the smart selective dalvik-cache wiping
Maybe it could be even smarter if the script only wipes an apk's dalvik-cache if the apk has had it's classes.dex replaced by the theme...

I'm working on something like this myself but mine is based on the unreleased GS2XFormROM by @hawkerpaul
I'll throw you a link when it's ready
Let me know if you need any help on the scripting side of things butty.


Sent from my GT-I9505G using XDA Free mobile app
Device: Samsung GT-I9505
My Scripts
My Web Site
The Following User Says Thank You to hawkerpaul For This Useful Post: [ Click to Expand ]
 
Spannaa
Old
#6  
Spannaa's Avatar
Recognized Themer
Thanks Meter 10878
Posts: 2,963
Join Date: Sep 2010
Location: Cardiff

 
DONATE TO ME
Quote:
Originally Posted by hawkerpaul View Post
Let me know if you need any help on the scripting side of things butty.
I will - cheers mate

Got it working but I'm sure you'd do a better job - .sh scripting isn't my thing at all.

Apologies to the OP for the OT...

Sent from my GT-I9300...
Read first...Then search...Then ask...

My Work, My Dev-Host, My goo.im, My Android File Host
 
 
aureljared
Old
#7  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
Quote:
Originally Posted by Spannaa View Post
Great work

I particularly like the smart selective dalvik-cache wiping
Maybe it could be even smarter if the script only wipes an apk's dalvik-cache if the apk has had it's classes.dex replaced by the theme...

I'm working on something like this myself but mine is based on the unreleased GS2XFormROM by @hawkerpaul
I'll throw you a link when it's ready
Hmm, yes I think I'll implement this in v1.1. Thanks for the suggestion!

Sent from my GT-I8730 using Tapatalk

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD
 
aureljared
Old
(Last edited by aureljared; 7th June 2014 at 04:04 AM.)
#8  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
Version 1.1 released!

v1.1: Link
Quote:

What's new?
- Even smarter Dalvik wiping: delete dex files only for those apps whose classes.dex were changed (thanks @Spannaa)
- Corrected a typo in the restore script (please delete 'restore-vr' inside your /system/xbin, if any!)
- Removed unused methods in installtheme.sh

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD
 
Spannaa
Old
#9  
Spannaa's Avatar
Recognized Themer
Thanks Meter 10878
Posts: 2,963
Join Date: Sep 2010
Location: Cardiff

 
DONATE TO ME
Quote:
Originally Posted by aureljared View Post
Version 1.1 released!

v1.1: Link
How about making this TWRP compatible too - then it'd be even more useful

Reference 1
Reference 2
Read first...Then search...Then ask...

My Work, My Dev-Host, My goo.im, My Android File Host
 
 
aureljared
Old
(Last edited by aureljared; 15th July 2014 at 09:50 AM.)
#10  
aureljared's Avatar
Senior Member - OP
Thanks Meter 442
Posts: 664
Join Date: May 2013
Location: Quezon City
Quote:
Originally Posted by Spannaa View Post
How about making this TWRP compatible too - then it'd be even more useful

Reference 1
Reference 2
Version 1.2 released!

v1.2: Link

Quote:
What's new?
- Refinements to Smart Dalvik Wipe
- Switch to Linus Yang's BusyBox 1.21.1, which will hopefully make themeing TouchWiz < 4.2 possible
- TWRP compatibility: switch to a static zipalign binary, grep method for OUTFD to look for updater binary
- Cleaner zip hierarchy: new apps to be installed to /system and /data are now in their respective folders in a folder named 'new'
Sent from my GT-I8730 using Tapatalk

If I helped you in any way, just hit the Thanks button!

---------------------------------------
Samsung Galaxy Express GT-I8730 (CyanogenMod 11 / Android 4.4.4 by szezso)
---------------------------------------
General Development Thread CM Building Tutorial
Sign/Zipalign Script Enhanced VRTheme Template
Project CyanogenMod: GT-I8730 AOSP Icons + 1% Battery MOD

The Following User Says Thank You to aureljared For This Useful Post: [ Click to Expand ]
Tags
eviltheme, vrtheme template
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes