Theme Overlay Mods

jajk

Senior Member
Jul 18, 2014
1,489
1,629
143
Any settings made in the value files found within framework-res.apk can be overlaid with new values if an archive called framework-res is placed in /system/media/theme/default.
The framework-res archive is just a zip file without the .zip extention and must contain a file called theme_values.xml
The format of the contents of theme_values.xml is critical and all value entries placed in the <MIUI_Theme_Values> section:
Code:
<?xml version="1.0" encoding="utf-8"?>
<MIUI_Theme_Values>
    inset lines here
    inset lines here
    inset lines here
</MIUI_Theme_Values>
If you already have a framework-res file in /system/media/theme/default, this means you already have some overlaid settings. Just merge your wanted settings into the same file being careful not to contradict existing lines.
I have attached the decompiled value files that contain the majority of what you may wish to play with. Copy and paste lines from these files into theme_values.xml with your edited values.
The value files come from 6.12.29 but are almost universal across all MIUI8 ROMs.
I have also included a file called framework_tweaks.xml which is my quick reference for useful tweaks - it is by no means exhaustive. Remove my comments from lines if you copy directly from this file.

The big advantage in modding this way is that it is very easy to re-edit the mod and easily reversed by simply deleting the file. This is much easier than decompiling and recompiling the parent file every time you want to change something. Furthermore, some files simply will not recompile successfully.

Other overlay files that can be created and placed in /system/media/theme/default
com.miui.home
values from MiuiHome.apk
Commonly used to change grid size for launcher

com.android.systemui
values from MiuiSystemUI.apk
Commonly used to change Status bar and toggles grid

framework-miui-res
values from framework-ext-res.apk
Commonly used to set toggles grid columns
 

Attachments

ugene1980

Senior Member
Dec 18, 2012
119
137
0
This is amazing!!!

After trying so hard to decompile/recompile/package/sign etc the framework-res.apk just to change two values in dimens.xml AND FAILLING

This is SOOOO much easier!

THANK YOU SO MUCH FOR THIS!
 

jajk

Senior Member
Jul 18, 2014
1,489
1,629
143
@ugene1980 Download TickleMyAndroid from its XDA Thread for decompile/recompile apks - it will do everything you need. Don't re-sign framework files or system apps.
Note that the full complement of framework files consist of the following:
  • framework-ext-res.apk
  • mediatek-res.apk
  • framework-res.apk
  • miui.apk - rename this to miui-res.apk to be recognized as a framework file
  • miuisystem.apk - rename this to miusystem-res.apk to be recognized as a framework file
 

ugene1980

Senior Member
Dec 18, 2012
119
137
0
@ugene1980 Download TickleMyAndroid from its XDA Thread for decompile/recompile apks - it will do everything you need. Don't re-sign framework files or system apps.
Note that the full complement of framework files consist of the following:
  • framework-ext-res.apk
  • mediatek-res.apk
  • framework-res.apk
  • miui.apk - rename this to miui-res.apk to be recognized as a framework file
  • miuisystem.apk - rename this to miusystem-res.apk to be recognized as a framework file

Nice, i'll give it a try, hope it works for miui 9.

I'm assuming mediatek-res.apk won't be needed if the device uses a SD835 instead of a mediatek processor?
 

waigyi

Member
Jun 25, 2016
8
2
0
Can I use this mod to create AMOLED theme? And which app will be themed?
Coz MIUI theme manager failed to theme other than icon and wallpaper on MIUI 9 (Marshmallow).

Thanks.
 

Huexxx

Senior Member
Jul 21, 2009
1,698
4,846
153
43
Madrid
Hi, thanks so much for your hints.

I've created two mods for MIUI9 on MiMix2 8.1.26 Beta rom, com.miui.home and framework-miui-res.

The mods flaulessly work, but only if the phone is rooted.

- Firstly rooting was needed because I had to put the files on /system and change permissions... but once checked I created a flashable zip that makes the work from TWRP.
- Once created the flashable .zip... rooting is not needed to modify system partition... but it doesn't work without root.
- Looking at same files but inside /data/system/theme (files created by themes app) I discovered some things to try:
-- Put 0755 permission with 9801 owner and group
-- Make framework-miui-res with the same structure... with filters.xml and framework-miui folder
- No way... I cannot make it work without root... and all the attempts worked very well if the phone is rooted.

Do you know how to make it work withour rooting?

Best regards.

---------- Post added at 04:06 PM ---------- Previous post was at 04:04 PM ----------

@ugene1980 Download TickleMyAndroid from its XDA Thread for decompile/recompile apks - it will do everything you need. Don't re-sign framework files or system apps.
Note that the full complement of framework files consist of the following:
  • framework-ext-res.apk
  • mediatek-res.apk
  • framework-res.apk
  • miui.apk - rename this to miui-res.apk to be recognized as a framework file
  • miuisystem.apk - rename this to miusystem-res.apk to be recognized as a framework file
Only to get your attention ;)
 
  • Like
Reactions: vaselor

jajk

Senior Member
Jul 18, 2014
1,489
1,629
143
@Huexxx It could be an sepolicy issue. What version Android and what version security update will determine how hard it is to get something foreign in System to execute.
 
  • Like
Reactions: Huexxx

Huexxx

Senior Member
Jul 21, 2009
1,698
4,846
153
43
Madrid
@Huexxx It could be an sepolicy issue. What version Android and what version security update will determine how hard it is to get something foreign in System to execute.
Alright, I'll look deeper inside the logs.

Thanks for the point.

Enviado desde mi Mi MIX 2 mediante Tapatalk