Created
April 20, 2020 21:47
-
-
Save pookjw/e87c0d3dfeed3d70c9bc412e54c316b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Configurations... | |
FASTBOOT_PATH="/Users/pook/Library/Android/sdk/platform-tools/fastboot" | |
LATEST_MATA_PATH="/Users/pook/Downloads/PH1-Images-QQ1A.200105.032" | |
MATA_PIE_180610_091_PATH="/Users/pook/Downloads/PH1-Images-PPR1.180610.091" # PATH OF PH1-Images-PPR1.180610.091 that supports touch feature on TWRP-3.2.3-0... | |
TWRP_IMG_PATH="/Users/pook/Downloads/twrp-3.2.3-0-mata.img" | |
ANDROID_11_GSI_IMAGE_PATH="/Users/pook/Downloads/gsi_gms_arm64-exp-RPP2.200227.014-6343719/system.img" | |
ANDROID_11_PATCHED_BOOT_IMAGE_PATH="/Users/pook/Downloads/unsigned-new.img" | |
VENDOR_IMG_PATH="/Users/pook/Downloads/vendor-QQ1A.200105.088.img" | |
if [[ ! -f "${FASTBOOT_PATH}" || ! -d "${LATEST_MATA_PATH}" || ! -d "${MATA_PIE_180610_091_PATH}" || ! -f "${TWRP_IMG_PATH}" || ! -f "${ANDROID_11_GSI_IMAGE_PATH}" || ! -f "${ANDROID_11_PATCHED_BOOT_IMAGE_PATH}" || ! -f "${VENDOR_IMG_PATH}" ]]; then | |
echo "Does not exist!" | |
exit 1 | |
fi | |
# Erase all partitions... | |
"${FASTBOOT_PATH}" erase nvdef_a | |
"${FASTBOOT_PATH}" erase nvdef_b | |
"${FASTBOOT_PATH}" erase boot_a | |
"${FASTBOOT_PATH}" erase boot_b | |
"${FASTBOOT_PATH}" erase system_a | |
"${FASTBOOT_PATH}" erase system_b | |
"${FASTBOOT_PATH}" erase bluetooth_a | |
"${FASTBOOT_PATH}" erase bluetooth_b | |
"${FASTBOOT_PATH}" erase xbl_a | |
"${FASTBOOT_PATH}" erase xbl_b | |
"${FASTBOOT_PATH}" erase abl_a | |
"${FASTBOOT_PATH}" erase abl_b | |
"${FASTBOOT_PATH}" erase dsp_a | |
"${FASTBOOT_PATH}" erase dsp_b | |
"${FASTBOOT_PATH}" erase modem_a | |
"${FASTBOOT_PATH}" erase modem_b | |
"${FASTBOOT_PATH}" erase vendor_a | |
"${FASTBOOT_PATH}" erase vendor_b | |
"${FASTBOOT_PATH}" erase keymaster_a | |
"${FASTBOOT_PATH}" erase keymaster_b | |
"${FASTBOOT_PATH}" erase cmnlib_a | |
"${FASTBOOT_PATH}" erase cmnlib_b | |
"${FASTBOOT_PATH}" erase cmnlib64_a | |
"${FASTBOOT_PATH}" erase cmnlib64_b | |
"${FASTBOOT_PATH}" erase tz_a | |
"${FASTBOOT_PATH}" erase tz_b | |
"${FASTBOOT_PATH}" erase hyp_a | |
"${FASTBOOT_PATH}" erase hyp_b | |
"${FASTBOOT_PATH}" erase rpm_a | |
"${FASTBOOT_PATH}" erase rpm_b | |
# Flash the latest ROM to partition A... | |
cd "${LATEST_MATA_PATH}" | |
"${FASTBOOT_PATH}" flash nvdef_a nvdef.img | |
#"${FASTBOOT_PATH}" flash boot_a boot.img | |
#"${FASTBOOT_PATH}" flash system_a system.img | |
"${FASTBOOT_PATH}" flash bluetooth_a bluetooth.img | |
"${FASTBOOT_PATH}" flash xbl_a xbl.img | |
"${FASTBOOT_PATH}" flash abl_a abl.img | |
"${FASTBOOT_PATH}" flash dsp_a dsp.img | |
"${FASTBOOT_PATH}" flash modem_a modem.img | |
#"${FASTBOOT_PATH}" flash vendor_a vendor.img | |
"${FASTBOOT_PATH}" flash keymaster_a keymaster.mbn | |
"${FASTBOOT_PATH}" flash cmnlib_a cmnlib.mbn | |
"${FASTBOOT_PATH}" flash cmnlib64_a cmnlib64.mbn | |
"${FASTBOOT_PATH}" flash tz_a tz.mbn | |
"${FASTBOOT_PATH}" flash hyp_a hyp.mbn | |
"${FASTBOOT_PATH}" flash rpm_a rpm.mbn | |
# Flash the PH1-Images-PPR1.180610.091 to partition B... | |
cd "${MATA_PIE_180610_091_PATH}" | |
"${FASTBOOT_PATH}" flash nvdef_b nvdef.img | |
#"${FASTBOOT_PATH}" flash boot_b boot.img | |
"${FASTBOOT_PATH}" flash system_b system.img | |
"${FASTBOOT_PATH}" flash bluetooth_b bluetooth.img | |
"${FASTBOOT_PATH}" flash xbl_b xbl.img | |
"${FASTBOOT_PATH}" flash abl_b abl.img | |
"${FASTBOOT_PATH}" flash dsp_b dsp.img | |
"${FASTBOOT_PATH}" flash modem_b modem.img | |
"${FASTBOOT_PATH}" flash vendor_b vendor.img | |
#"${FASTBOOT_PATH}" flash keymaster_b keymaster.mbn | |
"${FASTBOOT_PATH}" flash cmnlib_b cmnlib.mbn | |
"${FASTBOOT_PATH}" flash cmnlib64_b cmnlib64.mbn | |
"${FASTBOOT_PATH}" flash tz_b tz.mbn | |
"${FASTBOOT_PATH}" flash hyp_b hyp.mbn | |
"${FASTBOOT_PATH}" flash rpm_b rpm.mbn | |
# Flash TWRP to partition B... | |
"${FASTBOOT_PATH}" flash boot_b "${TWRP_IMG_PATH}" | |
# Flash Android 11 to partition A... | |
"${FASTBOOT_PATH}" flash system_a "${ANDROID_11_GSI_IMAGE_PATH}" | |
"${FASTBOOT_PATH}" flash vendor_a "${VENDOR_IMG_PATH}" | |
"${FASTBOOT_PATH}" flash boot_a "${ANDROID_11_PATCHED_BOOT_IMAGE_PATH}" | |
# Set boot partition... | |
"${FASTBOOT_PATH}" --set-active=a | |
# Wipe data... | |
"${FASTBOOT_PATH}" -w | |
# Reboot... | |
"${FASTBOOT_PATH}" reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment