Junior Member

Rank: 1

Credits
20
Device
0
Online time
2 Hours
Send PM

[Tools, Tips & Tutorials] DIY Mi Note Batter Increase (Hardware+Software)

[ Promote]
195 0 |
17:40, Dec-30-2018 | From PC
|
|
Go to reply no.


This is a recent effort to increase the battery capacity of my old Mi Note 3G/64G.
DIY work in both battery hardware and MIUI rom software.


--- Preparation ---

Hardware:
0. Add more battery to your phone, references:
https://t.cj.sina.com.cn/article ... /18c7c74c600100f8n5
http://www.miui.com/thread-7963211-1-1.html

Software:
1. rooted phone
2. installed recovery
3. PC has adb installed
4. apktool installed

--- retrieve and decompile original framework-res.apk ---
//boot into recovery, and load system file system for writing.
* Press down voiceup + power for 7 seconds.
* In recovery menu, load system file system

// download framework-res and supporting resources from phone
adb pull /system/framework/framework-res.apk E:\Softwares\AndroidTool\framework-res.apk
copy framework-res.apk f1.apk   // make a copy

// decompile with apktool
cd E:\Softwares\AndroidTool\apktool
apktool.bat if framework-res.apk -p f1-if          //install framework into f1-if folder
apktool.bat d f1.apk -o f1-d -p f1-if                //decompile f1.apk with above framework, and output to f1-d folder
* There should be NO error.

// modify the power_profile.xml
* launch a proper text editor, e.g., notepad-plus
* open file: f1-d\res\xml\power_profile.xml
* search for:     <item name="battery.capacity">3010</item>
* change the capacity to the new+old battery capacity, e.g. <item name="battery.capacity">13010</item>
* save file

// compile the updated code in f1-d
apktool.bat b -f -p f1-if f1-d  > output.txt 2>&1
* the output.txt contains the output messages.
* there should be no error.
* warning (W) of string does not have translation can be ignored.

// extract the compiled files from the newly compiled apk package:
我们需要把两类文件从编译后framework-res .apk拉到编译前framework-res .apk中替换,
第一类是:刚才反编译后,你所替换过,或者修改过的所有文件
第二类是:resources.arsc这一个文件
所有文件一个都不能替换少了
* source apk: f1-d\dist\f1.apk  // this is the compiled apk
* target apk: framework-res.apk // this is the originally downloaded apk
* file to copy from source apk to target apk:
        * \res\xml\power_profile.xml
        * \resources.arsc
Reference: http://www.miui.com/thread-513527-1-1.html

--- Deploy newly created framework-res.apk ---

//boot into recovery, and load system file system for writing.
* Press down voiceup + power for 7 seconds.
* In recovery menu, load system file system

//backup existing framework resource apk file
adb shell cp /system/framework/framework-res.apk /sdcard/framework-res.apk.orig

//upload new apk file to system
adb push E:\Softwares\AndroidTool\framework-res.apk /system/framework/.

//change permission to 644
adb shell chmod 644 /system/framework/framework-res.apk

//reboot phone
adb reboot

--- Remedy ---
* if reboot into boot loop, double check the above mentioned decompile-compile process.
* It is possible that a wrong version of apktool doesn't work with the MIUI system.
* For my case:
        MIUI9 ROM Global: miui_MINoteGlobal_V9.5.1.0.MXEMIFA_60388fa7fb_6.0
        apktool version 2.3.2.   
                - apktool 2.3.3 and apktool 2.3.4 failed in compiling.
                - apktool 2.3.0 succeed in compiling, but phone boot into bootloop after deployment.

//to recover:
* Boot phone into recovery, and load system file system.
* recover from backup
adb shell cp /sdcard/framework-res.apk.orig /system/framework/framework-res.apk
adb shell chmod 644 /system/framework/framework-res.apk
adb reboot

>>> END>>>

Favorite Share

Credits Management

Quick Reply Top Return to the list