Skip to content

Instantly share code, notes, and snippets.

@DarkPark
Last active September 14, 2018 11:01
Show Gist options
  • Save DarkPark/9f1a88a52100f73644d8033d1b9967c2 to your computer and use it in GitHub Desktop.
Save DarkPark/9f1a88a52100f73644d8033d1b9967c2 to your computer and use it in GitHub Desktop.
Firmware update instruction
  1. Get Developer Full ROM pack.
  2. Extract and remove all files from root (boot.img, system.patch.dat, and so on).
  3. Remove these files from META-INF/com/google/android/updater-script to get something like this:
getprop("ro.product.device") == "gemini" || abort("E3004: This package is for \"gemini\" devices; this is a \"" + getprop("ro.product.device") + "\".");
ui_print("Target: Xiaomi/gemini/gemini:8.0.0/OPR1.170623.032/8.5.10:user/release-keys");
ui_print("Patch made by DarkPark");
show_progress(0.200000, 10);
ui_print("Patching firmware images from MIUI 8.5.10 dev ...");
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlib");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hyp");
package_extract_file("firmware-update/pmic.elf", "/dev/block/bootdevice/by-name/pmic");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tz");
package_extract_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/aboot");
package_extract_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecapp");
package_extract_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfg");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymaster");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xbl");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpm");
package_extract_file("firmware-update/cmnlib64.mbn", "/dev/block/bootdevice/by-name/cmnlib64bak");
package_extract_file("firmware-update/cmnlib.mbn", "/dev/block/bootdevice/by-name/cmnlibbak");
package_extract_file("firmware-update/hyp.mbn", "/dev/block/bootdevice/by-name/hypbak");
package_extract_file("firmware-update/tz.mbn", "/dev/block/bootdevice/by-name/tzbak");
package_extract_file("firmware-update/emmc_appsboot.mbn", "/dev/block/bootdevice/by-name/abootbak");
package_extract_file("firmware-update/lksecapp.mbn", "/dev/block/bootdevice/by-name/lksecappbak");
package_extract_file("firmware-update/devcfg.mbn", "/dev/block/bootdevice/by-name/devcfgbak");
package_extract_file("firmware-update/keymaster.mbn", "/dev/block/bootdevice/by-name/keymasterbak");
package_extract_file("firmware-update/xbl.elf", "/dev/block/bootdevice/by-name/xblbak");
package_extract_file("firmware-update/rpm.mbn", "/dev/block/bootdevice/by-name/rpmbak");
package_extract_file("firmware-update/splash.img", "/dev/block/bootdevice/by-name/splash");
package_extract_file("firmware-update/NON-HLOS.bin", "/dev/block/bootdevice/by-name/modem");
package_extract_file("firmware-update/logo.img", "/dev/block/bootdevice/by-name/logo");
package_extract_file("firmware-update/adspso.bin", "/dev/block/bootdevice/by-name/dsp");
package_extract_file("firmware-update/BTFM.bin", "/dev/block/bootdevice/by-name/bluetooth");
ui_print("Patching system image is completed.");
set_progress(1.000000);
  1. Archive the folder back to firmware_miui_8.5.10_dev.zip and upload to a device.
  2. Power off the device then press volume up and power buttons to get to TWRP.
  3. Flash the uploaded file.

TWRP update

https://twrp.me/xiaomi/xiaomimi5.html

  1. Download the latest TWRP image file (.img) and boot TWRP.
  2. Go to install and find and select the Images... button.
  3. Browse to the image that you downloaded and select it.
  4. Choose recovery and swipe to flash.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment