GrapheneOS: Revert Back to Stock AOSP ROM
This is a brief tutorial to install a stock Android Open Source Project (AOSP) ROM on a Google Pixel XL smartphone (the first generation)…
Enabling OEM Unlocking
The OEM unlocking needs option needs to be enabled from within the operating system in order to successfully install AOSP. This can be achieved as follows:
- Enabling the Developer settings menu by:
- going to
Settings -> System -> About phone
- and pressing on the build number menu entry until developer mode is enabled.
- going to
- It is also necessary to:
- go to
Settings -> Developer
options, - toggle on the Enable OEM unlocking setting
- and toggle on the USB debugging setting.
- go to
Factory Image Download
The factory image needs to be downloaded from developers.google.com (e.g. it’s marlin
for Pixel XL).
- The downloaded file should be verified and unzipped into a safe directory.
- The device needs to be connected to the computer over USB.
- Booting into the bootloader interface can be achieved after connecting the device to the computer and by:
- turning off the device and then turning it on by holding both the Volume Down and Power buttons,
- or, using the following command:
$ adb reboot bootloader
The bootloader can be unlocked to allow flashing new images as follows:
$ fastboot flashing unlock
The fastboot
command needs to be confirmed on the device. This erases all data on the target device!
Next, the factory image needs to be extracted and flashed into the smartphone in order to install the necessary bootloader, baseband firmware(s), and operating system. The normal process is as follows:
$ cd marlin-*
$ ./flash-all.sh
Once the script finishes, the device reboots shortly.
Locking the Bootloader
Before using the device, the bootloader should be locked again in order to maintain its security feature, as locking wipes the data again. This can be achieved as follows:
- Enabling the Developer settings menu by:
- going to
Settings -> System -> About phone
- and pressing on the build number menu entry until developer mode is enabled.
- going to
- It is also necessary to:
- go to
Settings -> Developer
options, - toggle on the USB debugging setting
- and run:
- go to
$ adb reboot bootloader
$ fastboot flashing lock
A confirmation is needed to be performed on the screen using the side buttons. The device restarts shortly after.
Conclusion
The GrapheneOS and the AOSP are interesting projects, which should definitely get more attention in the future.