R0rt1z2/lkpatcher ? reverse-engineered prompt
Reverse engineered prompt
Build me a Python tool that can patch Mediatek LK bootloader images for Android devices like Oppo, Realme, and other MTK phones.
I want it to work from the command line, but also be usable as a Python library. It should be able to open an LK image, list and inspect partitions, dump a partition, add or remove partitions, apply binary patches from a JSON file, and export a default config file. I also want options for dry run, backups, logging, and choosing which patch categories to include or skip.
It should support the common safety and unlock related changes for things like fastboot and dm verity, plus a way to analyze security policies and re sign a patched image when needed. Use a clean JSON based config so I can tweak behavior without changing code. If anything about LK image formats or patching details is unclear, look up current docs online if you need to.
Are you gonna build this?
make sure you review the code using coderabbit