doc:appunti:hardware:xiaomi_mi_a1
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
doc:appunti:hardware:xiaomi_mi_a1 [2019/11/09 06:53] – [Fastboot Mode] niccolo | doc:appunti:hardware:xiaomi_mi_a1 [2020/09/23 16:38] – [August 2020 security update] niccolo | ||
---|---|---|---|
Line 10: | Line 10: | ||
^ Internal Memory | ^ Internal Memory | ||
^ CPU | Qualcomm Snapdragon 625 2.0GHz 8-core | ^ CPU | Qualcomm Snapdragon 625 2.0GHz 8-core | ||
+ | ^ Architecture | ||
^ Screen | ^ Screen | ||
^ Connector | ^ Connector | ||
Line 124: | Line 125: | ||
* **Do not swap Slot A and Slot B**. Some recipes found on the internet say to do that in TWRP (it is from the Reboot menu). I tried it and it was a nightmare! The Reboot menu was stating that the Slot B were active, so I switched to Slot A and installed TWRP. At the next reboot I got a non-working environment: | * **Do not swap Slot A and Slot B**. Some recipes found on the internet say to do that in TWRP (it is from the Reboot menu). I tried it and it was a nightmare! The Reboot menu was stating that the Slot B were active, so I switched to Slot A and installed TWRP. At the next reboot I got a non-working environment: | ||
* **Do not veryfy the ZIP archive**. The archive does not have the required info to check. | * **Do not veryfy the ZIP archive**. The archive does not have the required info to check. | ||
- | * **Do not wipe the Dalvik cache after the install**. Don't know if it was the culprit, but after installing TWRP, I clicked the button to wipe Dalvik cache, at the next reboot I had a damaged system. The **home button did not work**, the Developer options were no longer availables (// | + | * **Do not wipe the Dalvik cache after the install**. Don't know if it was the culprit, but after installing TWRP, I clicked the button to wipe Dalvik cache, at the next reboot I had a damaged system. The **home button did not work**, the Developer options were no longer availables (// |
==== Install Magisk, the SuperUser Tool ==== | ==== Install Magisk, the SuperUser Tool ==== | ||
Line 150: | Line 151: | ||
When an app requires root privileges, the Magisk management app will show a pop-up on the phone, allowing to grant or deny the permission, so be sure that the phone is not in screen-locked mode. | When an app requires root privileges, the Magisk management app will show a pop-up on the phone, allowing to grant or deny the permission, so be sure that the phone is not in screen-locked mode. | ||
===== Recovery Mode ===== | ===== Recovery Mode ===== | ||
+ | |||
+ | Android devices have a feature called **Android Recovery Mode**, which allows users to fix some problems. Technically, | ||
+ | |||
+ | To enter the Recover mode you can follow one of this ways: | ||
* **Power Off** the phone. | * **Power Off** the phone. | ||
* Press **VolumeUp + Power**, wait about 3 seconds for the Mi logo screen. | * Press **VolumeUp + Power**, wait about 3 seconds for the Mi logo screen. | ||
- | | + | |
+ | If you have installed the TWRP Recovery, its main screen will appear. If you have the stock ROM Recovery you have to: | ||
+ | |||
+ | | ||
* Press **Power + VolumeUp** shortly, the Recovery menu will appear. | * Press **Power + VolumeUp** shortly, the Recovery menu will appear. | ||
{{.: | {{.: | ||
{{.: | {{.: | ||
+ | |||
+ | When the phone is booted in normal system, you can reboot in Recovery mode by issuing the following command from an attached PC: | ||
+ | |||
+ | < | ||
+ | adb reboot recovery | ||
+ | </ | ||
+ | |||
===== Fastboot Mode ===== | ===== Fastboot Mode ===== | ||
Line 165: | Line 180: | ||
You can start fastboot mode in severl ways: | You can start fastboot mode in severl ways: | ||
- | * Power off the phone, then press **VolDown | + | * Power off the phone, then press **VolumeDown |
* Executing the **adb reboot bootloader** command on a PC when the phone is booted normally and connected via the USB cable. It is required to enable //USB debugging// on the phone and to authorize the PC on the phone pop-up, once connected. | * Executing the **adb reboot bootloader** command on a PC when the phone is booted normally and connected via the USB cable. It is required to enable //USB debugging// on the phone and to authorize the PC on the phone pop-up, once connected. | ||
* From the **stock Recovery** menu, choosing the entry **Reboot to bootloader**. | * From the **stock Recovery** menu, choosing the entry **Reboot to bootloader**. | ||
Line 273: | Line 288: | ||
The phone automatically warns about the availability of an **OTA (On The Air) Upgrade**. You can also check for upgrades availability by tapping // | The phone automatically warns about the availability of an **OTA (On The Air) Upgrade**. You can also check for upgrades availability by tapping // | ||
- | If you allow downloading and installing the upgrade, a check will be performed about the **integrity** of the **boot image** and the **system image**, before the actual install. The check will fail and the upgrade will be aborted if one of this condition | + | If you allow downloading and installing the upgrade, a check will be performed about the **integrity** of the **boot image** and the **system image**, before the actual install. The check will fail and the upgrade will be aborted if one or both of these two conditions |
- You have installed **Magisk SU** or **TWRP Recovery**. These software are installed into the boot partition, either **boot_a** or **boot_b** partition. The installation of Magisk patches only the active boot partition, whereas TWRP will patches (install itself) both boot partitions. | - You have installed **Magisk SU** or **TWRP Recovery**. These software are installed into the boot partition, either **boot_a** or **boot_b** partition. The installation of Magisk patches only the active boot partition, whereas TWRP will patches (install itself) both boot partitions. | ||
Line 280: | Line 295: | ||
The upgrade process will fail with a warning message **Couldn’t update - Installation problem** (in Italian: // | The upgrade process will fail with a warning message **Couldn’t update - Installation problem** (in Italian: // | ||
- | To rescue | + | To escape |
< | < | ||
Line 288: | Line 303: | ||
</ | </ | ||
- | Allow upgrading | + | Allowing automatic OTA upgrade |
+ | Once you extracted the system.img file from the archive, boot in fastboot mode and execute the following from an attached PC (once again your **active partition is B**): | ||
+ | |||
+ | < | ||
+ | fastboot flash system_b system.img | ||
+ | fastboot reboot | ||
+ | </ | ||
==== The OTA Update ==== | ==== The OTA Update ==== | ||
Line 303: | Line 324: | ||
The main content is a **payload.bin**, | The main content is a **payload.bin**, | ||
+ | |||
+ | ===== March 2020 security update ===== | ||
+ | |||
+ | In March 2020 Xiaomi released a new security update, according to this post **[[https:// | ||
+ | |||
+ | I performed the upgrade re-installing **TWRP** and **Magisk** afterward. The starting conditions were: | ||
+ | |||
+ | * A/B System Updates status: **Current Slot: B** (checked via TWRP => Reboot screen). | ||
+ | * Bootloader is **unlocked**. | ||
+ | * Installed O.S.: Android: 9, Build number: **PKQ1.180917.001.V10.0.14.0.PDHMIXM** (check from Impostazioni => Sistema => Informazioni sul telefono). | ||
+ | * From // | ||
+ | * **Magisk** v20.1 and **TWRP** 3.3.0 were installed into **boot partition** (Slot B). | ||
+ | * **System partition** was the stock one: root privileges were never used to tamper the **/system** hierarchy. | ||
+ | |||
+ | The system upgrade will **verify** the **boot** and the **system** partitions before attempting the installation, | ||
+ | |||
+ | I restored the stock **boot_b.img** image (saved before TWRP and Magisk), using the ADB commands from a connected PC: | ||
+ | |||
+ | < | ||
+ | adb reboot bootloader | ||
+ | fastboot flash boot_b boot_b.img | ||
+ | fastboot reboot | ||
+ | </ | ||
+ | |||
+ | I got **a problem** during this step: may be the **boot_b.img** was saved from version **9.6.8.0**, | ||
+ | |||
+ | < | ||
+ | android.hardware.wifi@1.0-service: | ||
+ | android.hardware.wifi@1.0-service: | ||
+ | android.hardware.wifi@1.0-service: | ||
+ | android.hardware.wifi@1.0-service: | ||
+ | </ | ||
+ | |||
+ | I proceeded with the standard upgrade path, trusting that the boot partition would be recognized as original and therefore upgraded to the new one. Remember: the update ZIP archive were already downloaded into the phone, so I just launched the **reboot and install** action. After some minutes and a few reboots, the system was upgraded to **Android v.9** build number **PKQ1.180917.001.V10.0.19.0.PDHMIXM**. Fortunately enough the WiFi were recovered. | ||
+ | |||
+ | To complete the upgrade: | ||
+ | |||
+ | - Copy **twrp-installer-3.3.0-2-tissot.zip** and **Magisk-v20.1.zip** into the phone internal storage. | ||
+ | - Backup the stock boot partitions. | ||
+ | - Reinstall TWRP. | ||
+ | - Reinstall Magisk. | ||
+ | - Backup the rooted boot partitions. | ||
+ | |||
+ | First of all **run the TWRP** recovery // | ||
+ | |||
+ | < | ||
+ | adb reboot bootloader | ||
+ | fastboot boot twrp-3.3.0-2-tissot.img | ||
+ | </ | ||
+ | |||
+ | From //TWRP// => //Reboot// menu, I verified that the **Current Slot** is **A**: it is normal that the upgrade procedure swaps the boot partition during the upgrade. Using ADB from the connected PC, I backed up the stock boot images: | ||
+ | |||
+ | < | ||
+ | adb pull / | ||
+ | adb pull / | ||
+ | </ | ||
+ | |||
+ | Now I installed the TWRP recovery into the boot partitions: from //TWRP// => //Install// => **twrp-installer-3.3.0-2-tissot.zip**. The installation warns about //Running boot image patcher on slot// A and B, and spit some harmless warnings about the **/vendor** mounting point. It is necessary to install TWRP before Magisk, otherwise TWRP will unroot the phone during its install. | ||
+ | |||
+ | After a system reboot, and another boot into Recovery, I did //TWRP// => //Install// => **Magisk-v20.1.zip**. This will install //root// on the phone(the **su** program). Once again I got some harmless warnings about the /vendor mounting point. | ||
+ | |||
+ | Finally I repeated the procedure to **backup** the patched **boot_a** and **boot_b** partitions. | ||
+ | |||
+ | **NOTICE**: the ADB client required to perform the '' | ||
+ | |||
+ | Once rebooted the phone into normal system, I installed the root permissions manager: **MagiskManager-v7.5.1.apk**. | ||
+ | |||
+ | ===== August 2020 security update ===== | ||
+ | |||
+ | This is a new update from Xiaomi, still featuring **AndroidOne v.9** relase, build **PKQ1.180917.001.V10.0.24.0.PDHMIXM**. The upgrade was downloaded nightly over the WiFi. It seems impossibile to prevent such automatic download: I did not find any settings to prevent automatic upgrade download. After downloading, | ||
+ | |||
+ | The starting conditions were: | ||
+ | |||
+ | * A/B System Updates status: **Current Slot: ?** (checked via TWRP => Reboot screen). | ||
+ | * Bootloader is **unlocked**. | ||
+ | * FIXME **Magisk** v20.1 and **TWRP** 3.3.0 installed? Into **which partition**? | ||
+ | * **System partition** was the stock one: root privileges were never used to tamper the **/system** hierarchy. | ||
+ | |||
+ | After the upgrade, I did the following to get **root again**: | ||
+ | |||
+ | * adb reboot bootloader | ||
+ | * fastboot boot twrp-3.3.0-2-tissot.img | ||
+ | * Verified from TWRP => Reboot: **Current slot: B** | ||
+ | * adb pull / | ||
+ | * adb pull / | ||
+ | * TWRP ⇒ Install ⇒ twrp-installer-3.3.0-2-tissot.zip | ||
+ | * system reboot | ||
+ | * adb reboot bootloader | ||
+ | * fastboot boot twrp-3.3.0-2-tissot.img | ||
+ | * TWRP ⇒ Install ⇒ Magisk-v20.3.zip | ||
===== Web References ===== | ===== Web References ===== |
doc/appunti/hardware/xiaomi_mi_a1.txt · Last modified: 2020/09/23 17:06 by niccolo