Skip to content

Instantly share code, notes, and snippets.

@luca020400
Last active September 9, 2020 19:37
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save luca020400/b67edb8d27b2094fd0918560d8c2073e to your computer and use it in GitHub Desktop.
Save luca020400/b67edb8d27b2094fd0918560d8c2073e to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
with open("vbmeta.img", "rb+") as vbmeta:
# Get current flags
vbmeta.seek(123)
flags = int.from_bytes(vbmeta.read(1), byteorder='big')
# Disable verity
flags |= 0x01
# Disable verification
flags |= 0x02
# Write the new flags
vbmeta.seek(123)
vbmeta.write(flags.to_bytes(1, byteorder='big'))
#!/usr/bin/env python3
with open("vbmeta.img", "rb+") as vbmeta:
# Get current flags
vbmeta.seek(123)
flags = int.from_bytes(vbmeta.read(1), byteorder='big')
# Enable verity
flags &= ~0x01
# Enable verification
flags &= ~0x02
# Write the new flags
vbmeta.seek(123)
vbmeta.write(flags.to_bytes(1, byteorder='big'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment