-
Notifications
You must be signed in to change notification settings - Fork 6
Description
I've been looking to use this exploit to unlock my huawei too. Through intial investigation, I've found that all the oem unlock option in settings app does is invoke PersistentDataBlockService 's setoemunlock method to set bootloader unlockable.
However, the services verifies access by only allowing calls from a specific package's uid, which is defined in framwork-res.apk as config_persistentDataPackageName, but its unfortunately set to null by huawei, meaning that nobody could get access to the service.
But, all the service did is writing one byte to the end of frp partition with its path stored in [ro.frp.pst], mine is /dev/block/bootdevice/by-name/frp
Since the service runs on system_server, and system_server is forked from zygote, is there a way to bypass the service and directly write to the device?
the frp device file is owned by system and belongs to system group
brw------- 1 system system u:object_r:frp_block_device:s0 8, 11 2025-04-19 23:10 frp
so it should be easy to get the uid to perform the write operation, but the selinux context prove to be a huge hurdle.
The selinux context it has frp_block_device
only allows
init_30_0 recovery_30_0 update_binary_30_0 shell_30_0 system_server_30_0 ueventd_30_0
to write to it, others have every file operation blocked in selinux policy
so we need to obtain system_server context or shell context(actually adb shell has this, but adb shell have uid 2000 instead of 1000) through zygote
is this possible?