Apktool (4)--Actual combat: Modify Xiaomi Desktop

Source: Internet
Author: User

Preparatory work:

1. Download the corresponding phone model line brush ROM package, enter the Xiaomi official ROM download channel

2. Extract the downloaded ROM package and extract the contents of the file from the system.img with the ROM helper. This article is a lot of articles, please refer to the ROM assistant how to extract img files

3. Find apk--/system/priv-app/miuihome.apk related to Xiaomi Desktop (5.0 and above system is miuihome.apk under Miuihome folder)

Actual Combat article:

1. Try to decompile miuihome.apk, refer to: Apktool (3)

2. Step 1 will prompt you to rely on the framework file, where the dependent file is/system/app/miui.apk

Run: Apktool if miui.apk–t Xiaomi

The command executes only once, and is then re-compiled again to the default path down to the load dependent file. Where the-t parameter is labeled for the dependent file.

3. Decompile miuihome.apk again, run: Apktool d–cf miuihome.apk–t Xiaomi

You will get the Miuihome folder.

4. Modify the Desktop

Although miuihome.apk has been recompiled, but to modify the desktop, you must find a configuration file directly related to Xiaomi desktop. So where is the desktop configuration file?

I introduced the Res directory in Apktool (2) as all the resource files in the program, and obviously we need to look in that directory.

Which configuration file will be loaded when the Xiaomi phone starts for the first time? Conclusion: Res/xml/default_workspace4x5.xml (4 column 5 rows desktop icon)

This directory has so many configuration files, how to know that the boot loaded is the file it? For specific reference: http://forum.xda-developers.com/showpost.php?p=40167735

This leads to the conclusion that if we do not want to load the file when the phone is started, you can modify the config_cell_count_x and config_cell_count_y in the Res/values/integers.xml file.

(not verified, readers can authenticate themselves)

Knowing the key profile that concerns the Xiaomi desktop, we can modify the desktop by modifying the configuration file. (The configuration file section below)

#1. Several key words

Folder stands for folders, and the default desktop has two folders.

Launcher:title is the name of the folder, the front com.miui.home:string/is fixed and tells the system to load the configuration file from that location.

Launcher:screen is the screen number of the desktop, the default first screen launcher:screen=0, and so on.

Launcher:x and launcher:y represent column numbers and line numbers, and by default they are numbered starting at 0, such as the fourth column in the third row, or launcher:x=3,launcher:y=2.

clock2x4 the system clock that is loaded for the system.

Favorite is a shortcut to the program (APK).

Launcher:classname is the class name of the APK and Launcher:packagename is the package name of the APK. For the Get class name and package name, follow Boven Introduction, please pay attention.

#2. modifying favorite

Obviously, we can modify the launcher:x and launcher:y to adjust the location of the APK, Launcher:screen to change which screen the apk should be placed.

#3. Modify Folder folders

Similarly, you can modify the location of the folder by modifying Launcher:x and Launcher:y, launcher:screen to change which screen the folder should be placed in.

It is also necessary to note that:

1) How to define the name of the folder?

The system loaded Chinese name configuration file is Res\values-zh-rcn\string.xml, you can see the system by default loaded two folders named "System Tools" and "recommended".

Therefore, we can modify the folder name here, or add a custom file name.

2) How do I add a program apk to a folder?

Launcher:container is the ID of the folder, which is numbered by default starting at 1.

By observing Launcher:x and launcher:y, we find that Y is fixed, and x is numbered from 0, so that the APK shortcuts added to the folder will be left-to-right and top-to-bottom in order.

#4. Modifying hotseat

Hostseat to APK

To view the configuration file:

You can see that launcher:container is defined as -101,launcher:y fixed, launcher:x numbering starting from 0. It can also be modified accordingly.

5. Compiling

At this point, we modified the Xiaomi desktop by modifying the configuration file.

Finally, we have to decompile the modified file and generate the modified apk.

Run: Apktool b-cf-t Xiaomi Miuihome-o out\miuihome.apk

In this way, we build the modified apk after compiling.

Question: 1. How do I get the APK class name and package name?

2. How to swipe into the modified APK system to the Xiaomi phone?

3. How do I package an img file by system.img, which is unlocked by ROM helper?

Keep your eye on blog updates.

Reference documents:

1.http://forum.xda-developers.com/showpost.php?p=40167735

2.Rom Helper How to extract img Files: http://www.yzmg.com/news/show-89909.html

Apktool (4)--Actual combat: Modify Xiaomi Desktop

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.