Flashing Image
Flashing Image¶
Setup Device¶
Turn on the Device and hold the power and Down Button. This will put the device in to fastboot mode which is used to make changes to the OS and Boot properties.
Check to make sure that the device is in fastboot mode:
>>> sudo fastboot devices
025c3fc9679cb8f0 fastboot
Unlock the OEM if not already done:
>>> sudo fastboot oem unlock
FAILED (remote: Already unlocked)
Finished. Total time: 0.047s
Setting Up Pixel 3a¶
sudo fastboot boot magisk_patched.img
Flashing Device¶
Flash the Main OS Partitions. Factory Nexus 5X Image
>>> sudo fastboot flash bootloader bootloader-bullhead-bhz11m.img
target reported max download size of 536870912 bytes
Sending 'bootloader' (4616 KB)...
OKAY [ 0.217s]
Writing 'bootloader'...
OKAY [ 0.149s]
Finished. Total time: 0.450s
>>> unzip image-bullhead-n2g48c.zip
>>> sudo fastboot flash boot boot.img
target reported max download size of 536870912 bytes
Sending 'boot' (12045 KB)...
OKAY [ 0.448s]
Writing 'boot'...
OKAY [ 0.120s]
Finished. Total time: 0.657s
>>> sudo fastboot flash system system.img
target reported max download size of 536870912 bytes
Erasing 'system'...
OKAY [ 0.572s]
[...]
>>> sudo fastboot flash vendor vendor.img
target reported max download size of 536870912 bytes
Erasing 'system'...
OKAY [ 0.572s]
[...]
Flash the Recovery partition and use TWRP
>>> sudo fastboot flash recovery ../twrp-3.2.3-0-bullhead.img
target reported max download size of 536870912 bytes
Sending 'recovery' (16289 KB)...
OKAY [ 0.543s]
Writing 'recovery'...
OKAY [ 0.155s]
Finished. Total time: 0.780s
Recovery partition reverts at reboot¶
TODO Check which one
1:
The system overrides stock recovery with a service in init on every system boot, 'service flash_recovery /system/bin/install-recovery.sh'
You can avoid it by deleting/renaming the install-recovery.sh present in /system/bin/ when you install oos via twrp before booting into system.
2:
dm-verity (a.k.a verified boot) checks certain places to make sure they haven't been tampered with. So if it detects a recovery image it doesn't expect, it restores the original. That's what you're seeing.
Try flashing magisk, as it disables dm-verity. If that doesn't work and you're on custom roms and kernels then maybe ask in those threads to see if people face that issue.
Root the device with SuperSU¶
Rooting the device can be done through the recovery menu.
- Boot into the Recovery partition by either holding both the Power and Down Button or
adb reboot recovery
- Click on the Advanced Button
- Click on the ADB Sideload Button
- Run
adb sideload ../UPDATE-SuperSU-v2.82-20170528234214.zip
- Click the Reboot System Button
Root the Device with Magisk¶
- Download the Magisk Manager
- Download the Zip installer
- Reboot into Recovery Mode
- Install the Zip
- Reboot into normal mode
Enable Developer Mode¶
- Launch the setting application
- Click the About Phone Button
- Click on the Build Number Button 7 times
- Click the back button
- Click on the Developer Options Button
- Click on the USB debugging Button to enable USB debugging
- Connect the USB to your computer
- In the menu bar click the Bottom button
- Change the USB option to Transfer files
- Connect using
adb devices
- Click Trust on the popup.
Changing setting¶
Setting the Default USB to File Transfer¶
- Unplug the device from USB
- GO to Settings App -> Developer Options -> Select USB Configuration
- Set to MTP
Back Up Android Image¶
Nandroid and EFS Backups:
- From the bootloader screen, use the volume keys to select the "Recovery" option
- From the TWRP home screen, select the "Backup" option
- Select ONLY the data, system and boot checkboxes
- Rename the backup to Nandroid-Backup-[Append date/timestamp]
- Swipe to perform the backup
- Upon completion, go back to the "Backup" screen
- Select ONLY the EFS checkbox
- Rename the backup to EFS-Backup-[Append date/timestamp]
- Swipe to perform the backup
- Return to the bootloader screen by issuing the following command
Backup Current User Data:
adb backup -all -apk -shared
Use a backup from another Phone:¶
https://forum.xda-developers.com/motorola-one/how-to/twrp-similar-device-t3873875/page6
- Get the backup from another phone
- Make a Folder with the DeviceID
- Restore the Phone
Get the Device ID:
>>> adb shell
shell@bullhead:/ $ getprop ro.serialno
02593b6f4eacaca6
shell@bullhead:/ $ cd sdcard/TWRP/BACKUPS/
shell@bullhead:/sdcard/TWRP/BACKUPS $ ls
02593b6f4eacaca6
shell@bullhead:/sdcard/TWRP/BACKUPS $
Currently Fails