Translate

LKPatcher - A Powerful Web Tool for Patching LK Images

LKPatcher - A Powerful Web Tool for Patching LK Images

To modify and patch LK (Little Kernel) images, the Python tool and module LKPatcher were created. It offers adjusting and a simple-to-use API. Use of the library needs Python 3.11 or later. Alternatively, the tool is available as a web version at https://lkpatcher.r0rt1z2.com/, which is not open-source but offers the same functionality and has a GUI.

LKPatcher - A Powerful Web Tool for Patching LK Images 2023

Important notes

  • To successfully boot patched images, it is a prerequisite to unlock seccfg, which can be accomplished using mtkclient.
  • It is recommended to create backups of your existing images prior to the patching process. The responsibility for any damage inflicted upon your device is solely your own.
  • If your device does not boot (even) after unlocking it with mtkclient, it most likely uses SBC, and, therefore, is not supported by this tool.
  • If you are running into issues and need to debug, dump the expdb partition using mtkclient and open a new issue here with the dump attached.
  • To request device-specific patches, please open a new issue and attach both your LK image and the image.txt file generated by the tool.
  • The patches.json file has sample patches applicable to various devices.

Getting started

To use LKPatcher, you can either install the Python library or use the web version.

If you are using the Python library, you will first need to install it. To do this, run the following command:

pip install lkpatcher

Once the library is installed, you can import it into your Python script and start patching LK images.

If you are using the web version, simply navigate to https://lkpatcher.r0rt1z2.com/ and upload your LK image. rgb(255, 195, 134);">An image.txt file containing details about your image, including the supported patches, will then be created by the tool. You can then select the patches you want to apply and click the "Patch" button.

Patching LK images

Once you have imported the LKPatcher library or uploaded your LK image to the web version, you can start patching your images.

To patch an LK image using the Python library, use the following syntax:

Python

import lkpatcher

# Load the LK image
lk_image = lkpatcher.LKImage("lk.img")

# Apply the desired patches
lk_image.patch([lkpatcher.Patch.DISABLE_VERITY])

# Save the patched LK image
lk_image.save("lk-patched.img")

To patch an LK image using the web version, simply select the patches you want to apply and click the "Patch" button. 

Post a Comment

0 Comments