update README

This commit is contained in:
327135569 2021-04-24 15:04:15 +08:00
parent bc84cd5add
commit 00deb174fd
1 changed files with 17 additions and 4 deletions

View File

@ -12,18 +12,31 @@ LSPatch provides a way to insert dex and so into the target APK by repackaging.
## Usage ## Usage
1. download the artifact 1. download the artifact
1. run `java -jar mmpatch.jar` 1. run `java -jar lspatch.jar`
## Build ## Build
``` ```
gradle build[Debug|Release] gradlew build[Debug|Release]
``` ```
## Supported Android Versions
Same with [LSPosed](
https://github.com/LSPosed/LSPosed#supported-versions)
## Principle ## Principle
LSPatch modifies the app property of AndroidManifest.xml in the target APK, changing it to the Application class in the inserted dex. Then it initializes LSPosed, and loads the Xposed module installed in the system. 1. Decompress target APK.
1. Patch the app property of AndroidManifest.xml in the target APK, changing it to the Application class in the inserted dex.
1. Copy all files in `list-so`, `list-assets`, `list-dex` into target APK.
1. Package and sign target APK.
Running Stage:
1. Inserted dex initializes LSPosed
1. New ClassLoader from `assets/lsploader.dex`.
1. Loads the Xposed module installed in the system with new ClassLoader.
## Known issues ## Known issues
Can't solve the signature verification issue perfectly 1. Can't solve the signature verification issue perfectly
1. If you use under Windows, you need open `CMD/Powershell` with `Run as Administrator`, See [Code](https://github.com/LSPosed/LSPatch/blob/ab1a213161f90ec7ac604df47434201170b92b9a/patch/src/main/java/org/lsposed/patch/util/FileUtils.java#L67-L70).