[Xiaomi Mi Note Pro] Aqq123:
Modifying the Theme Settings

MIUI allows a lot of theme customization. Fortunately, this part is relatively well-documented elsewhere, and I'm not writing this to repeat something that is already well-known but rather to contribute something new. Thus, unlike the other sections, here I will just briefly go through some of the possibilities.

Note that the *.mrc and *.mtz files, as well as most of the files with no extension, are in fact ZIP archives that can be unpacked and repacked again. The *.mrm files are directly editable text files. If you make some edits to a gadget, you might need to update its size and change the hash value in the corresponding .mrm file. The latter is just the MD5 sum of the file.

Themes are part of the System partition image, which was already discussed above; its only split into a separate section for the sake of organization.

Gadgets & Translations

/system/media/theme/.data/meta/

/system/media/theme/default/gadgets/

/system/media/theme/default/keyguardmusicview

/system/media/theme/default/powermenu

These files are responsible for the gadget layout as well as some of the translations. The layout seems to change relatively often with the stock China Developer ROM, which however does not include translations to Western languages. On the other hand, Xiaomi.eu's rom, while including the translations, seems to be based on an outdated layout in some places. Further, MIUI Pro includes some gadgets not available in any of the two, most likely coming from an earlier stock version.

The version posted as an attachment below, which I prepared for my own use, is a hybrid made in the following way:

Start with the China Developer ROM.

Port the translations from Xiaomi.eu, while keeping the stock translations for the other (Asian) languages as well, which Xiaomi.eu seems to delete.

Port some of the Xiaomi.eu's changes, where it makes sense to do so (the China version is supposed to show the Air Quality Index but this only works within China, and is reported as 0 for international locations, so it's been hidden).

Port some of the enhancements from MIUI Pro (two additional Music widgets and some modifications of default icons for Google services).

The result is yours to download and modify further.

MIUI-Themed App Icons

/system/media/theme/miui_mod_icons/<AppPackageName>.png

Icons put in this directory will replace the default app icons. The format is 192x192 px PNG-24. To find out the app package name, run:

adb shell pm list packages

The stock ROM includes just a couple of themed icons. Xiaomi.eu and MIUI Pro both have a considerable collection, although the latter is about three times larger than the former. I have merged the icons from all the three sources and they are available for download below, along with a dozen or so icons I designed myself for some niché apps I use.

The selection is somehow arbitrary, as the icons overlap for about 100 apps between Xiaomi.eu and MIUI Pro, so if you don't like the choice I made, download each of the ROMs and go through the icons yourself, choosing the ones according to your preference.

Note that after you change the icons, you need to re-apply the default theme (using the Themes app). It is not necessary to reboot your device.

MIUI Default Wallpapers

/system/media/theme/lock_wallpaper

If you want to change the default lockscreen and desktop wallpapers, notice that they are set to the following files:

/system/media/lockscreen/lockscreen_000.jpg

/system/media/wallpaper/wallpaper_000.jpg

Alternatively, you can change these paths in:

/system/media/theme/.data/meta/lockscreen/default.mrm

/system/media/theme/.data/meta/wallpaper/default.mrm

Per-Application Theming

/system/media/theme/<AppPackageName>

This is a really great feature of MIUI that gives endless possibilities of adjusting the appearance of an application. The file (no extension) is in fact a ZIP archive whose structure mimics that of the corresponding APK, and any files present in this archive (such as resources) will replace those placed inside the original APK. Also, the special file called theme_values.xml can be used to replace any strings inside.

One most straightforward way to employ the above is to rename an application. Generally, the application names are hard-coded inside the APK under the constant app_name. Thus, the theme_values.xml inside the <AppPackageName> could look like that:

<?xml version="1.0" encoding="utf-8" ?>
<MIUI_Theme_Values>
<string name="app_name">New Name</string>
</MIUI_Theme_Values>

For some APKs, the variable that stores the name might be different, in which case you can take a look inside with APK Tool, using the method described in the previous post. To conclude with an example, the attached file changes the names of "SIM Toolkit" and "SIM Toolkit2" into "SIM1 Toolkit" and "SIM2 Toolkit" respectively. In this case, the relevant theme_values.xml are:

<?xml version="1.0" encoding="utf-8" ?>
<MIUI_Theme_Values>
<string name="app_name">SIM1 Toolkit</string>
<string name="app_name2">SIM2 Toolkit</string>
<string name="app_name3">SIM3 Toolkit</string>
</MIUI_Theme_Values>