How to change battery Icons (High Risk - do at your own risk)

Overview How to change battery Icons (High Risk - do at your own risk)

Today I will share more extreme tutorial, hopefully this article can be more useful for those who want to learn to be android developer. I will also discuss this tutorials with more careful so that this tutorial can be used also by those who just know the android. Previously I would show the results obtained after running the tutorial above. look at screen shots 

Screen Shot

Before Edited                                                        After Edited
before_edit after_edit

Look at battery icon ? i change it. if you interest in how to do it continued reading this tutorial if not then you can close this tutorial.

Requirement

  1. Android SDK (Windows) or Android SDK (Linux)
  2. ApkTool (Windows) or ApkTool (Linux)
  3. Icon & Xml file
  4. 7zip (windows)
  5. Installed JDK

How To

  1. Install Android SDK. I am not going to show you how. I think you can already do. open SDK Manager, Udate / Install Android-Platform SDK Tools
    android_SDK
  2. Extract ApkTool to C:\ApkTool\ or /home/ApkTool
    Apk_tool
  3. Now you must pull framework-res.apk from your device and place it to your save place for backup. before do it test your adb command first by typing adb devices . if it show your devices then you can type adb pull /system/framework/framework-res.apk /home/backup/ or C:\adb.exe pull /system/framework/framework-res.apk C:\backup
    adb_devices


    adb_pull
  4. Now copy framework-res.apk to APKTool Folder, remember copy don't move cause we still need backup.
  5. Next, de compile framework-res.apk using APKTool. type this command
    • sh apktool if framework-res.apk
    • sh apktool d framework-res.apk
    • sh apktool if framework-res.apk

    if you using windows, please use windows command and change the folder
    apktool_decompile
  6. Look to your APKTool Folder, de compile command will create new folder called framework-res/, now you will need to extract icon & xml file. copy all image in the battery folder paste it to /home/APKTool/framework-res/res/drawable-mdpi/. replace it if there is any warning. drawable-mdpi it depend on your smartphone sometime it can be drawable-hdpi or drawable-ldpi
    apktool_copy
  7. Next step we need copy stat_sys_battery.xml and stat_sys_battery_charge.xml from extracted icon and xml file to /home/APKTool/framework-res/drawable/ if any warning just replace it.
    apktool_batteray_copy
  8. After step 1-7 done, now time to compile our framework-res folder so we can use it to our smartphone. type this command sh apktool b framework-res
    apktool_compile
  9. It will create 2 folder on framework-res, dist and build. create folder RESULT on your home directory, separate it for your workspace folder. follow below step :
    • copy all icon that you get from icon&xml.zip to this folder.
      apktool_all_icon
    • copy /framework-res/build/apk/resources.arsc to this folder
      apktool_resources
    • copy /framework-res/build/apk/res/drawable/stat_sys_battery.xml and /framework-res/build/apk/res/drawable/stat_sys_battery_charge.xml to this folder
      apktool_battery
    • copy /home/backup/framework-res.apk to this folder
      apktool_framework-res
  10. Open framework-res.apk in result folder using ark or file roller if you using linux or open it with 7zip if you using window. follow below step :
    • drag and drop all icon from result folder to /res/drawable-mdpi/
      apktool_move_all_icon
    • drag and drop stat_sys_battery.xml and stat_sys_battery_charge.xml from result folder to /res/drawable/ 
      apktool_move_stat_battery
    • drag and drop resources.arsc from result folder to /
      apktool_move_resource
  11. Now use adb to push framework-res.apk in result folder to your smartphone. follow below command :
    • adb push /home/Result/framework-res.apk /mnt/sdcard/
    • adb shell
      • su
      • mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
      • cp /mnt/sdcard/framework-res.apk /system/framework/framework-res.apk
      • chmod 644 /system/framework/framework-res.apk
      • reboot

      adb_command
  12. Your smartphone will reboot after you run above command, congratulations you've been able to make modifications to the framework-res.apk
  13. Finish. 
NOTE: 
in this tutorial I only teach how to replace the battery icon with the icon have been provided, on another occasion I'll show you how to replace the icon you want. This tutorial is very dangerous and can lead to bootloop smartphone. so do at your own risk
How to change battery Icons (High Risk - do at your own risk) | AS | 5