[3.0.0 beta] EVilTheme: VRTheme Reborn

Search This thread

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
About
Eviltheme (Enhanced VillainROM Theme Engine) is an Android system modification platform meant for use with custom Android recoveries.
It allows modification of application resources without the need to replace the whole app or install a new operating system.
Eviltheme is based on the VRTheme Engine from 2011, though versions 3.x.x and up heavily differ from the original VillainROM code.

Disclaimer
Eviltheme is provided to you without warranty. You are free to try it on your device, but you are doing so at your own risk. I will not be responsible for bricked devices, wiped devices, etc.

Features
  • Automatic systemless mode with version 3.x.x+ (Magisk required, version 13.1+ recommended)
  • System mode fallback in case Magisk is not present
  • Supports both Dalvik and ART platforms
  • Smart bytecode refresh (delete classes.dex/classes.art only if it is replaced by the theme)
  • Easy uninstallation via automatically generated flashable ZIP or through Magisk Manager (if installed systemlessly)
  • Delete files (even inside APKs)
  • Support for pre/post-(un)installation scripts
  • Support for dual /system partitions

Downloads
Latest beta: 3.0.0-beta4
Last 2.x release (no systemless support): 2.0.6

Changelogs
GitHub

Documentation
Second post

Help
Third post

Credits

Source code (GPLv3)
Eviltheme main repo
Eviltheme restore ZIP repo
 
Last edited:

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
Documentation

Things to remember
  • Compile your res/smali/etc files first before you put them in your theme! You can use APKtool for that, then just extract the files from the resulting APK.
  • Theming user apps is not supported, because modifying the contents breaks the signature.
  • Remember to properly edit .9.png files, or else you might get a bootloop!
  • You do not need to put theme files in a subfolder inside the main APK folder, e.g. /system/priv-app/SystemUI/SystemUI.apk. EVilTheme automatically does that for you.

Do I need to download the official Magisk module template?​
Nope! EVilTheme includes post-fs-data.sh, service.sh, and system.prop. Look for them in META-INF/tk/aureljared/magisk-common and edit them to your liking. The module.prop is automatically generated from information you put in eviltheme.prop.
In the event that the official module template is updated, I will update EVilTheme to ensure compatibility as soon as I can.

How do I theme an app (or apps) using EVilTheme?​
Inside the ZIP, there are three folders that you can modify as needed; namely, data, system, and vrtheme.
Your patches/theme files go in vrtheme, while APK files that you want to install onto the device go in data and system.

For example, you want to theme Settings.apk, which is located in /system/priv-app.
Let's say your theme replaces res/drawable-hdpi/battery_icon_50.png in the APK, and also replaces classes.dex because you changed some smali files.
These are the steps you need to follow to make a flashable theme ZIP:
  1. Ensure you've downloaded the appropriate template ZIP. Make a folder somewhere you can remember and extract the ZIP there.
  2. The folder should now contain the folders META-INF, data, system, vrtheme, and a file called eviltheme.prop.
  3. Open eviltheme.prop in a text editor (please use Notepad++ if you are on Windows!) and add your theme information there.
  4. In the vrtheme folder, go to system and make a new folder called priv-app. Inside it, make another folder called Settings.apk. Make sure you capitalized correctly!
  5. Now make folders as necessary, according to the location of the files you want to theme. For example, battery_icon_50.png is located in res/drawable-hdpi, so make a folder named res inside Settings.apk. Inside it, create a folder named drawable-hdpi, then paste your new battery_icon_50.png inside.
  6. Repeat step 5 until you've placed your theme files in their appropriate locations.
  7. When you're done, go back to the root folder of the theme (the one that contains new, vrtheme, etc.) and put all 5 objects in a ZIP file. You should use Deflate compression method only. Any compression level will work.[/u]
  8. If the recovery that the theme is intended to be used with requires signing, sign the ZIP now.
  9. Test your theme! :victory:

How do I uninstall a theme?​
If the theme was installed systemlessly, remove it in Magisk Manager.
Otherwise, flash the relevant zip in /data/eviltheme-backup.

How do I delete files inside APKs to be themed?​
To delete files, add the filenames to a text file named "delete.list" inside the APK theme folder.
This is an example of a delete.list:
Code:
res/drawable-hdpi/ic-launcher.png
res/drawable-xxhdpi/battery_full.9.png

How do I delete files that aren't inside APKs?​
You will also need a "delete.list". Remember to use full paths:
Code:
/system/app/Bloatware/Bloatware.apk
/system/etc/hosts
Put that in the "vrtheme" folder.

How can I exclude deleted files from being backed up?​
Eviltheme versions 3 and up will automatically back up files that your theme deletes (in non-systemless mode).
To exclude a file, add "no-backup" to the end of the corresponding line in vrtheme/delete.list.
Code:
/system/app/Bloatware/Bloatware.apk [B]no-backup[/B]

How do I force installation on /system?​
Eviltheme versions 3 and up will automatically install in systemless mode with Magisk 13.1+, but if you want to force your theme to install to /system, create a file named .eviltheme-force-system (notice the preceding dot) in /sdcard before installing.

I need to execute some commands during the theme (un)installation.​
Inside META-INF/tk/aureljared/eviltheme, there are files named "pre-install.sh-example", "post-install.sh-example", "pre-uninstall.sh-example", and "post-uninstall.sh-example". Remove the "-example" part from the file name of your desired script, and edit that file in the text editor (please please please use Notepad++ if you're on Windows).
Use the comments in that file as a guide.
 
Last edited:

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
Help section

The theme wasn't successful, and I believe that the problem lies in the engine itself.​
Post here describing the problem. Be as descriptive as possible. I will ignore all bug reports without an attached logcat dump and/or recovery.log. I'll try to look into the problem when time permits. :cowboy:
I am just a student, not a full-time developer. I may not be able to provide a fix for some bugs, so feel free to help me and everyone else out. If you know how to work with Git, an upstream patch to the project would be highly appreciated :good:


The theme was / wasn't successful, but I am stuck in a bootloop.​
Try wiping your Dalvik cache. If the problem is still there, uninstall the theme and post a bug report in this thread. Include the relevant /cache/recovery.log and the theme you installed.


The theme was successful, but the app I was theming does not reflect my changes.​
This is a tough one to solve. Try recompiling the APK itself with your theme files. If it works, it's either the problem lies in how you put the theme files in the ZIP, or maybe it's the script that's buggy. Try to make a ZIP again, following the instructions to the letter. If it still doesn't work, you can file a bug report here and attach your logcat dump, recovery.log, and (if you want) the themed APK.


The theme was successful, and now I'm ready to release my theme to the public.​
All I ask for is some credit and a link back to this thread. :fingers-crossed:


The theme wasn't successful, and I found a problem in your engine script(s).​
If you're familiar with Git, you can make a pull request to the EVilTheme repository.
If you don't know how to use Git, you can just edit the script(s) you need and send me a PM containing the fixed script(s). I'll add you to the credits list in the first post if your bugfix is effective!
 
Last edited:

Spannaa

Recognized Contributor / Themer
Sep 13, 2010
7,420
16,766
Cardiff
Google Pixel 5
Google Pixel 6
Great work :good:

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 ;)
 
  • Like
Reactions: aureljared

hawkerpaul

Senior Member
Sep 25, 2011
3,305
6,242
UK
www.practicenet.co.uk
Great work :good:

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
 
  • Like
Reactions: Spannaa

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
Great work :good:

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
 

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
Version 1.1 released!

v1.1: Link
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
 
Last edited:

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
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

What's new?
- Refinements to Smart Dalvik Wipe
- Switch to Linus Yang's BusyBox 1.21.1, which will hopefully make theming 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
 
Last edited:
  • Like
Reactions: Spannaa

deuce_biggins

Senior Member
Mar 14, 2014
1,006
2,192
Detroit
Version 1.2 released!

v1.2: Link



Sent from my GT-I8730 using Tapatalk

Very good job on this...one thing, in kitkat 4.4.2 touchwiz roms half of the apps that need to be themed are in /system/priv-app. This folder location does not seem to be in your installtheme.sh script. I can manually change everything myself but if you would like other users to take advantage of your work, you may want to consider updating for these users.
 
  • Like
Reactions: aureljared

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
Very good job on this...one thing, in kitkat 4.4.2 touchwiz roms half of the apps that need to be themed are in /system/priv-app. This folder location does not seem to be in your installtheme.sh script. I can manually change everything myself but if you would like other users to take advantage of your work, you may want to consider updating for these users.
Oh right... How could I forget :( Am working on this now.

Thanks for the heads-up!
 
  • Like
Reactions: deuce_biggins

cerj

Recognized Themer
Nov 1, 2012
6,266
12,090
NOLA
Google Pixel 7 Pro
Google Pixel 8 Pro
I tried to vrt a data/app, and it may have broke the signature.. It did theme the app, but it was no longer visible/available in my app drawer.. I could see the themed icon in data/app tho.. I don't think the original VRT could theme in data/app either... I did use your new version 1.3 with twrp on my Galaxy Tab 3, so that is good news.. It also made two folders on my internal sd, one was for data/app and one for system/app.. It did make a copy of the apk it themed in data/app, and placed it in the folder on my internal sd . I will test this on my Note 3 with twrp later..Thank you
 
  • Like
Reactions: aureljared

deuce_biggins

Senior Member
Mar 14, 2014
1,006
2,192
Detroit
Version 1.3 released!

v1.3: Link

Silly me, forgetting this while using a KitKat ROM :p

I tried to vrt a data/app, and it may have broke the signature.. It did theme the app, but it was no longer visible/available in my app drawer.. I could see the themed icon in data/app tho.. I don't think the original VRT could theme in data/app either... I did use your new version 1.3 with twrp on my Galaxy Tab 3, so that is good news.. It also made two folders on my internal sd, one was for data/app and one for system/app.. It did make a copy of the apk it themed in data/app, and placed it in the folder on my internal sd . I will test this on my Note 3 with twrp later..Thank you

@aureljared, just curous...to follow up on with what cerj said, have you ever successfully themed an app inside of /data/app with your VRT? Seems to kill the app every time, your thoughts?
 
  • Like
Reactions: cerj

aureljared

Senior Member
May 2, 2013
970
671
dantis.me
Redmi Note 11
@aureljared, just curous...to follow up on with what cerj said, have you ever successfully themed an app inside of /data/app with your VRT? Seems to kill the app every time, your thoughts?
No, I only tried it with the old VRTheme, and it didn't work either (no icon in drawer). I don't think it'll work on EVilTheme either as I haven't changed the process of /data/app.
 
  • Like
Reactions: cerj

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    About
    Eviltheme (Enhanced VillainROM Theme Engine) is an Android system modification platform meant for use with custom Android recoveries.
    It allows modification of application resources without the need to replace the whole app or install a new operating system.
    Eviltheme is based on the VRTheme Engine from 2011, though versions 3.x.x and up heavily differ from the original VillainROM code.

    Disclaimer
    Eviltheme is provided to you without warranty. You are free to try it on your device, but you are doing so at your own risk. I will not be responsible for bricked devices, wiped devices, etc.

    Features
    • Automatic systemless mode with version 3.x.x+ (Magisk required, version 13.1+ recommended)
    • System mode fallback in case Magisk is not present
    • Supports both Dalvik and ART platforms
    • Smart bytecode refresh (delete classes.dex/classes.art only if it is replaced by the theme)
    • Easy uninstallation via automatically generated flashable ZIP or through Magisk Manager (if installed systemlessly)
    • Delete files (even inside APKs)
    • Support for pre/post-(un)installation scripts
    • Support for dual /system partitions

    Downloads
    Latest beta: 3.0.0-beta4
    Last 2.x release (no systemless support): 2.0.6

    Changelogs
    GitHub

    Documentation
    Second post

    Help
    Third post

    Credits

    Source code (GPLv3)
    Eviltheme main repo
    Eviltheme restore ZIP repo
    7
    Documentation

    Things to remember
    • Compile your res/smali/etc files first before you put them in your theme! You can use APKtool for that, then just extract the files from the resulting APK.
    • Theming user apps is not supported, because modifying the contents breaks the signature.
    • Remember to properly edit .9.png files, or else you might get a bootloop!
    • You do not need to put theme files in a subfolder inside the main APK folder, e.g. /system/priv-app/SystemUI/SystemUI.apk. EVilTheme automatically does that for you.

    Do I need to download the official Magisk module template?​
    Nope! EVilTheme includes post-fs-data.sh, service.sh, and system.prop. Look for them in META-INF/tk/aureljared/magisk-common and edit them to your liking. The module.prop is automatically generated from information you put in eviltheme.prop.
    In the event that the official module template is updated, I will update EVilTheme to ensure compatibility as soon as I can.

    How do I theme an app (or apps) using EVilTheme?​
    Inside the ZIP, there are three folders that you can modify as needed; namely, data, system, and vrtheme.
    Your patches/theme files go in vrtheme, while APK files that you want to install onto the device go in data and system.

    For example, you want to theme Settings.apk, which is located in /system/priv-app.
    Let's say your theme replaces res/drawable-hdpi/battery_icon_50.png in the APK, and also replaces classes.dex because you changed some smali files.
    These are the steps you need to follow to make a flashable theme ZIP:
    1. Ensure you've downloaded the appropriate template ZIP. Make a folder somewhere you can remember and extract the ZIP there.
    2. The folder should now contain the folders META-INF, data, system, vrtheme, and a file called eviltheme.prop.
    3. Open eviltheme.prop in a text editor (please use Notepad++ if you are on Windows!) and add your theme information there.
    4. In the vrtheme folder, go to system and make a new folder called priv-app. Inside it, make another folder called Settings.apk. Make sure you capitalized correctly!
    5. Now make folders as necessary, according to the location of the files you want to theme. For example, battery_icon_50.png is located in res/drawable-hdpi, so make a folder named res inside Settings.apk. Inside it, create a folder named drawable-hdpi, then paste your new battery_icon_50.png inside.
    6. Repeat step 5 until you've placed your theme files in their appropriate locations.
    7. When you're done, go back to the root folder of the theme (the one that contains new, vrtheme, etc.) and put all 5 objects in a ZIP file. You should use Deflate compression method only. Any compression level will work.[/u]
    8. If the recovery that the theme is intended to be used with requires signing, sign the ZIP now.
    9. Test your theme! :victory:

    How do I uninstall a theme?​
    If the theme was installed systemlessly, remove it in Magisk Manager.
    Otherwise, flash the relevant zip in /data/eviltheme-backup.

    How do I delete files inside APKs to be themed?​
    To delete files, add the filenames to a text file named "delete.list" inside the APK theme folder.
    This is an example of a delete.list:
    Code:
    res/drawable-hdpi/ic-launcher.png
    res/drawable-xxhdpi/battery_full.9.png

    How do I delete files that aren't inside APKs?​
    You will also need a "delete.list". Remember to use full paths:
    Code:
    /system/app/Bloatware/Bloatware.apk
    /system/etc/hosts
    Put that in the "vrtheme" folder.

    How can I exclude deleted files from being backed up?​
    Eviltheme versions 3 and up will automatically back up files that your theme deletes (in non-systemless mode).
    To exclude a file, add "no-backup" to the end of the corresponding line in vrtheme/delete.list.
    Code:
    /system/app/Bloatware/Bloatware.apk [B]no-backup[/B]

    How do I force installation on /system?​
    Eviltheme versions 3 and up will automatically install in systemless mode with Magisk 13.1+, but if you want to force your theme to install to /system, create a file named .eviltheme-force-system (notice the preceding dot) in /sdcard before installing.

    I need to execute some commands during the theme (un)installation.​
    Inside META-INF/tk/aureljared/eviltheme, there are files named "pre-install.sh-example", "post-install.sh-example", "pre-uninstall.sh-example", and "post-uninstall.sh-example". Remove the "-example" part from the file name of your desired script, and edit that file in the text editor (please please please use Notepad++ if you're on Windows).
    Use the comments in that file as a guide.
    4
    Help section

    The theme wasn't successful, and I believe that the problem lies in the engine itself.​
    Post here describing the problem. Be as descriptive as possible. I will ignore all bug reports without an attached logcat dump and/or recovery.log. I'll try to look into the problem when time permits. :cowboy:
    I am just a student, not a full-time developer. I may not be able to provide a fix for some bugs, so feel free to help me and everyone else out. If you know how to work with Git, an upstream patch to the project would be highly appreciated :good:


    The theme was / wasn't successful, but I am stuck in a bootloop.​
    Try wiping your Dalvik cache. If the problem is still there, uninstall the theme and post a bug report in this thread. Include the relevant /cache/recovery.log and the theme you installed.


    The theme was successful, but the app I was theming does not reflect my changes.​
    This is a tough one to solve. Try recompiling the APK itself with your theme files. If it works, it's either the problem lies in how you put the theme files in the ZIP, or maybe it's the script that's buggy. Try to make a ZIP again, following the instructions to the letter. If it still doesn't work, you can file a bug report here and attach your logcat dump, recovery.log, and (if you want) the themed APK.


    The theme was successful, and now I'm ready to release my theme to the public.​
    All I ask for is some credit and a link back to this thread. :fingers-crossed:


    The theme wasn't successful, and I found a problem in your engine script(s).​
    If you're familiar with Git, you can make a pull request to the EVilTheme repository.
    If you don't know how to use Git, you can just edit the script(s) you need and send me a PM containing the fixed script(s). I'll add you to the credits list in the first post if your bugfix is effective!
    4
    I'll make a video over the next day or two on how to pack a vrtheme and all the business that goes along with it.

    Sent from my HTC One_M8 using XDA Free mobile app
    3
    Well, tried it again and it didn't work. Same result as before (systemui was basically gone). Had to clean flash the rom again to get it working. I decompiled all the apps again and basically copied the different files through winmerge, so I'm sure I'm not missing anything.

    Here was my test zip and here is my recovery log.

    Unfortunately, I seem to get errors with the regular zips sometimes as well, so I'm not completely sure what the issue it. I build and sign the apps with a debug key, and don't sign the zip afterwards, as I believe it is not necessary.

    P.S. This is built for Terminus. If anyone can get this working on their phone, I'd love to get some feedback on how to fix it.

    Send me your theme zip by PM, please.

    Sent from my HTC One_M8 using XDA Free mobile app

    ---------- Post added at 02:08 AM ---------- Previous post was at 01:23 AM ----------

    Well, tried it again and it didn't work. Same result as before (systemui was basically gone). Had to clean flash the rom again to get it working. I decompiled all the apps again and basically copied the different files through winmerge, so I'm sure I'm not missing anything.

    Here was my test zip and here is my recovery log.

    Unfortunately, I seem to get errors with the regular zips sometimes as well, so I'm not completely sure what the issue it. I build and sign the apps with a debug key, and don't sign the zip afterwards, as I believe it is not necessary.

    P.S. This is built for Terminus. If anyone can get this working on their phone, I'd love to get some feedback on how to fix it.

    Ok, I see your issue.

    First of all, you packed your theme in the new folder of the vrtheme. All of your theme needs to go into the correspondent folders inside the vrtheme folder. As well, I noticed some 9.png that still have patches. You'll need to patch those before making your theme. I'll send you a sample of your theme by zip in a few minutes. You can have a look at it and complete it accordingly.