Skip to content

Commit

Permalink
Merge pull request #1292 from hitori1403/main
Browse files Browse the repository at this point in the history
Fix partition slot handling in vbmeta patching for non-A/B devices
  • Loading branch information
bkerler authored Dec 12, 2024
2 parents e5524aa + 2475888 commit e80f288
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion mtkclient/Library/DA/mtk_da_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def da_read_partition(self, partitionname, parttype="user"):
length=rpartition.sectors * self.config.pagesize,
filename="", parttype=parttype)
return data
return None
return b""

def da_write_partition(self, partitionname, data:bytes=None, parttype="user"):
rpartition = None
Expand Down Expand Up @@ -677,6 +677,8 @@ def get_current_slot(self):
tmp = self.da_read_partition("para")
if tmp != b"":
slot = tmp[0x800:0x802].decode('utf-8')
if slot == "\x00\x00":
slot = ""
else:
slot = ""
return slot
Expand Down

0 comments on commit e80f288

Please sign in to comment.