- The ROM can't read /data so it hangs on the boot animation or reboots to recovery, even on a clean flash.
- TWRP won't recognize your PIN/password or "default_password".
- You've tried re-formatting /data from TWRP several times and it doesn't solve your problem.
1. Back up /sdcard to your PC as it will be erased with all of your files, pictures, music, etc.
2. Flash the stock recovery from bootloader.
fastboot flash recovery stock_recovery.img
3. Restore system setting in recovery.
This step is necessary to restore factory formatting and encryption of /data.
If a password/PIN is set, click “I forgot my password.”
Boot into stock recovery. Once there, go to Wipe data and cache > Reset system setting and Erase everything(Music, pics, etc.).
Note: If you don't do the "Erase everything..." option, factory encryption will not be reset.
4. Boot TWRP from bootloader.
You could flash TWRP and reboot to recovery, but TWRP will get overwritten with the stock recovery when OOS boots anyway. It's faster just to boot TWRP from a command prompt. Use the command:
fastboot boot twrp-recovery.img
5. While in TWRP, move “OOS...ROM.zip” to the SD card.
In Windows File Explorer, copy OOS...ROM.zip to the device.
Alternately, you may use the following ADB command from a command prompt
adb push OOS...ROM.zip /sdcard/
6. Flash OOS...ROM.zip from TWRP.
7. Reboot system.
Your device will be formatted, encrypted and loaded with the stock recovery and ROM as it came from the factory. You may need to find the OOS...ROM.zip you pushed to /sdcard and delete it from emulated storage (/storage/emulated) if you don't see it at /sdcard after booting the ROM.
8. Optional: To re-lock your your bootloader, follow these additional steps:
This can only be done from a factory-supplied OOS ROM (including Oreo) with no modifications or the phone will not boot!
- Enable USB debugging under Developer options.
- Reboot to bootloader.
- Unlock the bootloader with the following command:Code:
fastboot oem lock
- Return to Developer options and turn off "OEM unlocking"