#!/usr/bin/env python3 import struct, sys, zipfile def dec_len8(b, o): n = b[o]; o += 1 if n & 0x80: n = ((n & 0x7f) << 8) | b[o]; o += 1 return n, o def dec_len16(b, o): n = struct.unpack_from('> 8), n & 0xff]) def enc_len16(n): return struct.pack('> 16), n & 0xffff) def rewrite(axml, repl): ftype, fhs = struct.unpack_from('