Skip to content

Bootloader unlock

The stock Android 10 boot loader on the XP8800 has no fastboot flashing commands. It also does not keep its lock state in the devinfo partition (devinfo is 4 KiB of zeros on stock). The unlock method uses two items together: a userdebug boot loader and a flag byte in the frp partition.

WARNING: Make a verified full backup before you unlock the boot loader. The unlock wipes userdata and permanently changes the trust model of the device. If you write the incorrect partitions, the phone can hard-brick. Do this only on a device that you own. The behavior can change between builds. See NV partitions and backup.

Why the obvious path is blocked

Blocker Why it does not stop this method
Developer Options “OEM unlocking” is grey (sys.oem_unlock_allowed=0) You do the unlock from EDL and fastboot, not from Android
Stock Android 10 ABL has no fastboot flashing commands The AT&T 8.1 userdebug ABL has them and also boots stock Android 10
Carrier SIM lock or activation lock This lock is in the encrypted modem NV. The bootloader lock is a different lock
Profile-owner or supervised account restrictions These restrictions do not apply to the EDL and fastboot path

The two ingredients

  1. An ABL that can unlock. The AT&T Android 8.1 userdebug abl.elf (110,592 bytes) has fastboot flashing get_unlock_ability and unlock. It boots the stock Android 10 system. It has the same root certificate and HW_ID (3007…) as stock. Its SW_ID image type is 0x1C and its anti-rollback version is 0. Secure boot is expected to accept it.
  2. The frp unlock flag. fastboot flashing get_unlock_ability reads the last byte of the frp partition (offset 524287). When you set this byte to 0x01, the check passes.

The mechanism

flowchart TB
  EDL["EDL session"] --> W1["Write userdebug ABL into abl_a"]
  EDL --> W2["Set frp byte 524287 = 0x01"]
  W2 --> CK{"Magic 0x19901873<br/>at frp bytes 32..36?"}
  CK -->|yes| SUM["Recompute frp[0:32] = sha256(0x00*32 ++ frp[32:])"]
  CK -->|no| READY
  SUM --> READY["Reboot"]
  W1 --> READY
  READY --> FASTBOOT["fastboot flashing get_unlock_ability → 1"]
  FASTBOOT --> UNLOCK["fastboot flashing unlock"]
  UNLOCK --> WIPE["ABL writes recovery --wipe_data to misc,<br/>wipes userdata, sets unlocked state"]

WARNING: Make sure that you have a verified full backup before you do these steps. Steps 1, 3, and 5 write partitions. Incorrect writes can hard-brick the phone. Step 8 wipes all user data.

  1. In one EDL session, write the userdebug ABL into abl_a. Zero-pad the ABL to 1 MiB first.

    WARNING: Write only to abl_a. A write to a different partition can hard-brick the phone.

  2. Read abl_a back to verify the write.

  3. Set frp[524287] = 0x01.

    WARNING: Write only to frp. Do not write to modemst1, modemst2, fsg, fsc, or persist. These partitions hold per-unit data that you cannot recover.

  4. If the big-endian magic 0x19901873 is at bytes 32..36 of frp, recompute the frp SHA-256 checksum over 0x00 × 32 || frp[32:].

  5. Write the checksum to frp[0:32].

  6. Reboot the phone.

  7. Make sure that fastboot flashing get_unlock_ability gives 1.

  8. Use fastboot flashing unlock.

    WARNING: Do not use this command if you did not make a backup. The command wipes userdata.

    The ABL writes recovery --wipe_data --reason=MasterClearConfirm --locale=en_US to misc. Then it does the userdata wipe.

  9. Let the one-time stock recovery format finish.

  10. Boot the phone cleanly one time. Then the active slot stays marked successful.

The procedure writes only abl_a and frp. abl_b stays unchanged as a stock fallback for the boot loader.

What the decompiled ABL shows

Static analysis of the userdebug ABL (an AArch64 UEFI LinuxLoader) confirms the mechanism:

Function Role
Unlock setter Writes the persistent unlock flag (param 0 = normal, 1 = critical). Emits the recovery --wipe_data command
Unlock gate Allows a state change only if param_2 == 0 (lock) or IsAllowUnlock != 0
Fastboot init Finds the partition named frp, reads it, and sets IsAllowUnlock = frp[partitionsize-1] & 1
State getters unlocked, unlock_critical, and verity mode. oem device-info prints all of them
Boot verify “Device is unlocked, Skipping boot verification”. Sets the verified-boot state

Strings in the payload include “By unlocking the bootloader…”, “Creating unlock keys detect event”, “Device unlocked”, and “flashing get_unlock_ability”.

Risks and gotchas

  • Anti-rollback fuse. The userdebug ABL has rollback version 0. A subsequent OTA can make the vendor ARB fuse higher. Then secure boot rejects abl_a and the phone shows a black screen. XBL does not use abl_b as a fallback. To recover, write stock abl_a back over EDL. You can get to EDL with the keys from any software state, unless the early boot firmware or the hardware is damaged.
  • userdata wipe. The unlock always wipes the user data.
  • Slot _b is a trap for custom images. The stock abl_b has no flash or set_active.
  • Hard-brick profile. Do not write keymaster*, xbl*, tz*, rpm*, hyp*, pmic*, keystore, devcfg*, cmnlib*, or devinfo.
  • Carrier lock stays. The unlock of the boot loader does not remove a carrier SIM lock. The carrier SIM lock is in the encrypted modem NV.

Re-locking

WARNING: Do not re-lock the boot loader without a reviewed procedure for your device. An incompatible re-lock can prevent the phone from booting.

A re-lock is a high-risk task. Treat the re-lock as a different restoration procedure for one device only. The procedure has these steps:

  1. Make sure that the userdebug ABL stays in abl_a.
  2. Use fastboot flashing lock.
  3. Over EDL, write stock abl_a and abl_b, a frp of zeros, and a misc recovery-wipe request.