Skip to content

Commit

Permalink
README.md: Split setting ANDROID_PRODUCT_OUT env var to separate step
Browse files Browse the repository at this point in the history
Also add examples for powershell and cmd instead of assuming bash
syntax.

Fixes: #340

Signed-off-by: Andrew Gunnerson <[email protected]>
  • Loading branch information
chenxiaolong committed Aug 30, 2024
1 parent dfbc2f8 commit 8ca1a28
Showing 1 changed file with 26 additions and 6 deletions.
32 changes: 26 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,25 +161,45 @@ If you lose your AVB or OTA signing key, you will no longer be able to sign new

If you prefer to extract and flash all OS partitions just to be safe, pass in `--all`.

5. Flash the partition images that were extracted.
5. Set the `ANDROID_PRODUCT_OUT` environment variable to the directory containing the extracted files.

For sh/bash/zsh (Linux, macOS, WSL):

```bash
export ANDROID_PRODUCT_OUT=extracted
```

For PowerShell (Windows):

```powershell
$env:ANDROID_PRODUCT_OUT = "extracted"
```

For cmd (Windows):

```bat
set ANDROID_PRODUCT_OUT=extracted
```

6. Flash the partition images that were extracted.

```bash
ANDROID_PRODUCT_OUT=extracted fastboot flashall --skip-reboot
fastboot flashall --skip-reboot
```

Note that this only flashes the OS partitions. The bootloader and modem/radio partitions are left untouched due to fastboot limitations. If they are not already up to date or if unsure, after fastboot completes, follow the steps in the [updates section](#updates) to sideload the patched OTA once. Sideloading OTAs always ensures that all partitions are up to date.

Alternatively, for Pixel devices, running `flash-base.sh` from the factory image will also update the bootloader and modem.

6. Set up the custom AVB public key in the bootloader after rebooting from fastbootd to bootloader.
7. Set up the custom AVB public key in the bootloader after rebooting from fastbootd to bootloader.

```bash
fastboot reboot-bootloader
fastboot erase avb_custom_key
fastboot flash avb_custom_key /path/to/avb_pkmd.bin
```

7. **[Optional]** Before locking the bootloader, reboot into Android once to confirm that everything is properly signed.
8. **[Optional]** Before locking the bootloader, reboot into Android once to confirm that everything is properly signed.

Install the Magisk or KernelSU app and run the following command:

Expand All @@ -193,7 +213,7 @@ If you lose your AVB or OTA signing key, you will no longer be able to sign new
init: [libfs_avb]Returning avb_handle with status: Success
```

8. Reboot back into fastboot and lock the bootloader. This will trigger a data wipe again.
9. Reboot back into fastboot and lock the bootloader. This will trigger a data wipe again.

```bash
fastboot flashing lock
Expand All @@ -205,7 +225,7 @@ If you lose your AVB or OTA signing key, you will no longer be able to sign new

**WARNING**: If you are flashing CalyxOS, the setup wizard will [automatically turn off the `OEM unlocking` switch](https://github.com/CalyxOS/platform_packages_apps_SetupWizard/blob/7d2df25cedcbff83ddb608e628f9d97b38259c26/src/org/lineageos/setupwizard/SetupWizardApp.java#L135-L140). Make sure to manually reenable it again from Android's developer settings. Consider using the [`OEMUnlockOnBoot` module](https://github.com/chenxiaolong/OEMUnlockOnBoot) to automatically ensure OEM unlocking is enabled on every boot.
9. That's it! To install future OS, Magisk, or KernelSU updates, see the [next section](#updates).
10. That's it! To install future OS, Magisk, or KernelSU updates, see the [next section](#updates).

## Updates

Expand Down

0 comments on commit 8ca1a28

Please sign in to comment.