Finalize verified 2720 Flip release source and untrack image outputs

This commit is contained in:
Luxferre committed 2026-11-09 23:04:13 +02:00
1 parent 2a3078e42c
commit 1c011b360a
121 files changed
+8467 -686

No files matched your search

+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""Produce an unlocked devinfo image from a locked EDL dump.
The stock 2720 aboot is locked (devinfo.is_unlocked=0) and verifies boot
images against Nokia_beatles certificates. Setting byte 13 to 1 makes aboot
skip signed-boot verification. Keep the original dump to relock later.
"""
import argparse
import os
import sys
MAGIC = b"ANDROID-BOOT!"
UNLOCKED_OFFSET = 13
TAMPERED_OFFSET = 14
def main():
parser = argparse.ArgumentParser()
parser.add_argument("locked")
parser.add_argument("unlocked")
args = parser.parse_args()
data = bytearray(open(args.locked, "rb").read())
if bytes(data[:len(MAGIC)]) != MAGIC:
print("FAIL: input is not an ANDROID-BOOT! devinfo image")
return 1
print("locked : is_unlocked=%d is_tampered=%d" %
(data[UNLOCKED_OFFSET], data[TAMPERED_OFFSET]))
data[UNLOCKED_OFFSET] = 1
data[TAMPERED_OFFSET] = 0
with open(args.unlocked, "wb") as handle:
handle.write(data)
print("unlocked: is_unlocked=%d is_tampered=%d -> %s (%d bytes)" %
(data[UNLOCKED_OFFSET], data[TAMPERED_OFFSET], args.unlocked, len(data)))
return 0
if __name__ == "__main__":
sys.exit(main())