Support hex digits in projid

Most of the deviceconfig keys have only 0-9 digits, however the format
is actually hex, as evidenced by a handful of entries (for example: OP9
Pro TMO / "2085A").
This commit is contained in:
Michael Kropat 2024-05-22 23:12:11 -04:00
parent 8573eba1b5
commit 6e8f1cf7e6

View file

@ -149,7 +149,7 @@ class oneplus(metaclass=LogBase):
data = self.fh.cmd_read_buffer(lun, rpartition.sector, 1, False)
value = data.data[24:24 + 5]
try:
test = int(value.decode('utf-8'))
test = int(value.decode('utf-8'), 16)
self.info("Oneplus protection with prjid %d detected" % test)
projid = value.decode('utf-8')
except: