Creating your theme for Xiaomi: from sketch to installation on a smartphone

You are tired of the standard topics in MIUI You want to make your smartphone Xiaomi, Redmi or POCO Creating a custom theme is not only a way to stand out, it's also an opportunity to optimize the interface for your needs, from color palettes to animations. Unlike the Themes, the theme allows you to control every pixel, from application icons to system notification fonts.

This article is suitable for both beginners and experienced users, and we will discuss two main approaches: manually creating a theme through editing. APK (For advanced ones, and using themes (beginners), you'll also learn how to get around the limitations. MIUI when installing uncertified themes and what tools will be required to work with graphics and XML-Ready to turn your Xiaomi into a masterpiece!

What to Know Before Creating a Xiaomi Theme

Before getting involved, it is important to understand how the topics are arranged in the MIUI. Unlike standard Android, where theme is often limited to wallpaper and icons, MIUI use full-fledged APK-packets with the.mtz extension (for older versions) or.apk extension (for newer ones:

  • 🎨 Graphic resources: icons, wallpaper, interface elements (buttons, sliders, backgrounds)
  • πŸ“œ XML-files: description of color schemes, fonts, animations
  • πŸ“ Theme Manifesto: Metadata (title, version, version compatibility) MIUI)

Creating a theme from scratch requires basic knowledge in:

  • πŸ–ŒοΈ Work with graphic editors (Adobe Photoshop, GIMP, Figma)
  • πŸ“ Editing XML (Notepad++, Android Studio)
  • πŸ”§ Use of decompilation tools APK (APKTool, JADX)

⚠️ Attention: Themes created for MIUI 12, may not be correctly displayed in MIUI 14 due to changes in system file structure. Always check compatibility on the test device!

If you are not ready to dive into the code, you can use designers such as MIUI Theme Editor or Hex Installer, which allows you to assemble a theme from pre-made elements, but with limited customization.

πŸ“Š What tool do you plan to use to create a theme?
APKTool and Manual Editing
Theme designer (MIUI Theme Editor)
Ready-made templates from the Internet
I haven't decided yet.

Tools and programmes required

To create a theme from scratch, prepare the following:

Tool.AppointmentDownload link
APKToolDecompilation and compilation APK-fileOfficial website
MIUI Theme EditorVisual Theme Editor for BeginnersXDA Developers
GIMP PhotoshopEditing graphics (icons, wallpaper)gimp.org
Android StudioReview and editing XML-filedeveloper.android.com
MT ManagerEditing APK without decompilation (for experienced)XDA Developers

The testing of topics will require:

  • πŸ“± Smartphone Xiaomi/Redmi/POCO with an unlocked loader (for installation through TWRP)
  • πŸ”“ Root rights (optional, but simplifies installation)
  • πŸ’Ύ Backup of the current firmware (in case of failures)

⚠️ Warning: Installing uncertified themes may result in the device being locked during the boot phase if files are corrupted.Always check the theme on a secondary device or via an emulator!

If you are planning to spread your topic, register with the MIUI Theme Store as a developer. It's free, but it requires you to verify your account through your Mi Account.

Step 1: Assembling the structure of the topic

Any topic for MIUI It consists of three key components:

  1. Resources (res/) β€” images, colors, styles
  2. Manifesto (AndroidManifest.xml) β€” metadata
  3. Configuration (theme_values/) β€” compatibility

The easiest way to start is to copy the structure of an existing topic.

  1. Download any free theme from the theme β†’ Online.
  2. Remove the.mtz file (it's renamed.apk) through the archiver.
  3. Decompile. APK using APKTool: apktool d theme.apk -o theme_folder

In the file received theme_folder you will find:

  • πŸ“ res/drawable β€” icons and graphic elements
  • πŸ“ res/values β€” color-schematic (colors.xml)
  • πŸ“„ AndroidManifest.xml β€” information about the topic (title, version, author)

β˜‘οΈ Preparation of the basic structure of the topic

Done: 0 / 5

For convenience, rename the folder and update the data to AndroidManifest.xml:

<manifest android:versionName="1.0" android:versionCode="1" package="com.example.mytheme">


<application android:label= "My Theme" android:icon="@mipmap/ic_launcher">




</application>




</manifest>

Where com.example.mytheme is the unique identifier of your topic (replace it with yours).

Step 2: Designing graphic elements

Graphics are the basis of any topic. MIUI There are over 500 different icons for system and third-party applications, and you don't have to draw them all from scratch, you can modify existing ones or use templates.

The main elements that need to be customized:

  • πŸ“± Application icons (size) 192Γ—192 px, format PNG)
  • πŸŒ„ Wallpaper (permission not less than 2160Γ—3840 px AMOLED-screen)
  • πŸŽ›οΈ Interface elements: buttons, sliders, background notifications
  • πŸ”„ Animation (optional, requires knowledge of Lottie or After Effects)

Design recommendations:

  • 🎨 Use vector icons (format) SVG), avoid pixelation.
  • 🌈 Stick to the same color palette for all elements.
  • πŸ“ Observe the size of the grid: icons should be aligned in the center in the square 192Γ—192 px.

To speed up the process, you can use ready-made sets of icons from:

  • πŸ”— Flaticon (free icons)
  • πŸ”— Material Design Icons (official icons from Google)

⚠️ Note: Icons for system applications (e.g. com.android.settings) must have the exact file name, otherwise they won’t be loaded into the file. MIUI. The list of required icon names can be found in the file theme_values/strings.xml decompiled.

After creating the graphics, save the files to the appropriate folders:

  • res/drawable-xxhdpi/ β€” icons
  • res/drawable-nodpi/ β€” wallpaper

Step 3: Editing Colors and Styles

The color scheme of the theme is determined in files colors.xml and styles.xml, file res/values/. Here's the color set for:

  • πŸ“± System window background
  • πŸ“ Text of notifications and menus
  • πŸ”˜ Buttons and switches
  • πŸ“Š Charts in Battery and Storage

Example of structure colors.xml:

<resources>


<color name="miui_color_primary">#FF5722</color>




<color name="miui_color_secondary">#FF9800</color>




<color name="miui_color_text_primary">#212121</color>




<color name="miui_color_background">#FFFFFF</color>




</resources>

To change the fonts, edit the file fonts.xml (If you have one, add your fonts to the res/font/. MIUI Supports.ttf and.otf formats.

Tip: Use contrasting colors for text and background to keep the theme readable in bright sunshine. Check the pairings through the WebAIM Contrast Checker tool.

πŸ’‘

To quickly pick up a palette, use Coolors. Generate a scheme and export colors to the HEX-format colors.xml.

Step 4: Compilation and signature of the theme

After editing all files, you need to compile the theme back to the APK. For that:

  1. Open the terminal in the folder with APKTool and execute the command: apktool b theme_folder -o mytheme.apk
  2. Sign the result. APK via Uber APK Signer or Java Keytool: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykey.keystore mytheme.apk alias_name (Replace mykey.keystore and alias_name data).

If you don’t want to get a signature, you can use it. MT Manager:

  1. Open the compiled APK into MT Manager.
  2. Choose Sign. APK and confirm the action.

File ready. mytheme.apk You can rename it mytheme.mtz (for compatibility with older versions). MIUI) and load it into the device.

⚠️ Note: Unsigned themes will not be installed through a standard Theme Installer. TWRP or ADB.

Step 5: Installing a theme on Xiaomi

There are three ways to set a custom theme:

  1. Through TWRP (recommended for power users: Copy.mtz or.apk to a memory card. TWRP (Loudness up + Select Install. β†’ Select a theme file β†’ Swipe to confirm.
  2. Through ADB (without root: adb install mytheme.apk Then apply the theme to Settings β†’ Topics β†’ Local.
  3. Through MIUI Theme Editor (the easiest way): Open up MIUI Theme Editor on PC. Import a theme folder. Export to.mtz and send it to your phone.

If the topic does not apply:

  • πŸ”„ Check compatibility with your version MIUI (indicated theme_values/config.xml).
  • πŸ“‹ Make sure that all the resources are available in XML correctly.
  • πŸ”§ Try to clear the theme app cache (Settings) β†’ Annexes β†’ Application management β†’ Topics β†’ Clear the cache).

πŸ’‘

Installation through TWRP β€” It's the most reliable way, but it requires an unlocked bootloader. ADB or MIUI Theme Editor.

Distribution and monetization of your topic

If you want to share your topic with other users, there are a few ways to do this:

  • 🌍 MIUI Theme Store: Register as a developer on the official website. Download the.mtz file and fill out the description. Wait for moderation (may take up to 7 days).

⚠️ Note: Xiaomi charges 30% commission on the sales of themes. Free themes are distributed without restrictions.

Own website or Telegram channel

  • πŸ“Œ Post the theme on GitHub, 4PDA or in Telegram-chats on customization.
  • πŸ’³ Use Donation Alerts or Boosty to monetize.

Platforms for custom themes

  • πŸ”— XDA Developers
  • πŸ”— Theme section for Xiaomi

To make your topic popular:

  • πŸ“Έ Take high-quality screenshots on different devices.
  • πŸ“ Write a detailed description with the supported versions MIUI.
  • πŸ”„ Update theme regularly, adding support for new devices.
How to get around restrictions MIUI Theme Store?
Some topics are blocked by moderators because of "non-conformity with design standards." To increase the chances of approval: - Use minimalist design without aggressive colors. - Avoid pirated resources (icons, copyrighted wallpaper). Test the theme on at least 3 devices with different versions MIUI.

FAQ: Frequent questions about creating themes for Xiaomi

Can you create a theme without knowing programming?
Yes, use it. MIUI Theme Editor or Hex Installer – they allow you to collect themes from pre-made elements without editing the code. However, deep customization (for example, changing animations) will require knowledge. XML Java.
Why is my theme not installed through a standard installer?
Probable causes: πŸ”Ή Theme not signed (use Uber) APK Signer). πŸ”Ή Incompatibility with the version MIUI (check theme_values/config.xml). πŸ”Ή Damaged resources (check the paths to the files in the XML). Try to install through TWRP or ADB.
How to add your fonts to the topic?
Place font files (.ttf or.otf) in the folder res/font/ and update the links in styles.xml: <style name="Theme.Font"> <item name="android:fontFamily">@font/my_custom_font</item> </style> Make sure that the font name in font/ is consistent with what is indicated in XML.
Can I port a theme from one Xiaomi device to another?
Yes, but there may be problems with: πŸ”Ή Screen resolutions (icons may look blurry). πŸ”Ή Absent resources (some devices have unique system icons). theme_values/config.xml, Support for additional models: <string name="supported_models">lmi,alioth,phoenix</string> (where lmi, alioth are the code names of the devices).
How to protect your topic from theft?
Unfortunately, APK-files are easy to decompile to make things more difficult: πŸ”Ή Use code obfuscation (ProGuard tool). πŸ”Ή Add watermarks to graphic resources. πŸ”Ή Spread the topic to closed communities (e.g., through a patreon) without full protection, but these measures will discourage the desire of most borrowers".