A fork of NPatch allowing to patch API 101 plugins (gkms-localify only)
Go to file
Harshit Shah f23eb7f32c
Handling duplicate System.load calls (#200)
We have seen apps to be crashing due to multiple System.load calls.
As seen from the log lines:
```
06-01 16:43:41.615 I/LSPosed-Bridge(16031): Caused by: java.lang.UnsatisfiedLinkError: Shared library "/data/app/com.example.sample-some_random_string/base.apk!/assets/lspatch/so/arm64-v8a/liblspatch.so" already opened by ClassLoader 0x1c7(dalvik.system.PathClassLoader[DexPathList[[zip file "/data/app/com.example.sample-some_random_string/base.apk"],nativeLibraryDirectories=[/data/app/com.example.sample-some_random_string/lib/arm64, /data/app/com.example.sample-some_random_string/base.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]]); can't open in ClassLoader 0x7ffc869ecc(dalvik.system.PathClassLoader[DexPathList[[zip file "/data/user/0/org.houstonmethodist.methodistmobile.debug/cache/lspatch/origin/4198609975.apk", zip file "/data/app/com.example.sample-some_random_string/base.apk"],nativeLibraryDirectories=[/data/app/com.example.sample-some_random_string/lib/arm64, /data/user/0/org.houstonmethodist.methodistmobile.debug/cache/lspatch/origin/4198609975.apk!/lib/arm64-v8a, /system/lib64, /product/lib64]]])
```
Looks like we are trying to load liblspatch.so file even when it was
loaded earlier by the ClassLoader, due to which it is causing the error.

This is similar to this issue:
https://stackoverflow.com/questions/54155086/preventing-duplicate-system-loadlibrary-calls-when-dynamically-loading-reloading

Have added try ... catch block around `System.load` method to handle
exceptions / error raised from it, and have added log line to debug the
issue in cases of actual errors.
2023-06-05 14:14:22 +08:00
.github [skip ci] Update bugreport template 2023-01-28 17:59:07 +08:00
apkzlib Update proguard 2022-04-06 11:17:19 +08:00
core@5666dca1e3 Update core to 1.8.6 (#168) 2023-01-28 11:54:06 +08:00
gradle/wrapper Update core to 1.8.6 (#168) 2023-01-28 11:54:06 +08:00
jar Support bootstrapping loader dynamically for local mode (#118) 2022-10-21 15:24:16 +08:00
manager Update core to 1.8.6 (#168) 2023-01-28 11:54:06 +08:00
meta-loader Handling duplicate System.load calls (#200) 2023-06-05 14:14:22 +08:00
patch fix: only add QUERY_ALL_PACKAGES permission when useManager is true (#195) 2023-05-10 22:50:51 +08:00
patch-loader Update core to 1.8.6 (#168) 2023-01-28 11:54:06 +08:00
share Fix modules missing after update loader for integrated mode 2022-11-13 22:43:39 +08:00
.gitattributes normalize eol 2021-06-02 17:20:50 +08:00
.gitignore done with project structure refine 2021-04-07 12:06:30 +08:00
.gitmodules Compare AXML attribute name by resource ID 2022-09-04 16:21:08 +08:00
LICENSE Create LICENSE 2021-04-09 11:48:53 +08:00
README.md [skip ci] Update badge 2022-12-19 22:43:17 +08:00
build.gradle.kts Fix core version display 2023-01-28 17:08:26 +08:00
crowdin.yml Create crowdin.yml 2022-03-08 10:54:31 +08:00
gradle.properties Update core to 1.8.6 (#168) 2023-01-28 11:54:06 +08:00
gradlew Update deps 2022-09-22 17:52:59 +08:00
gradlew.bat Update deps 2022-09-22 17:52:59 +08:00
settings.gradle.kts Fixing Manifest Parsing - Shifting from axmlprinter to axmlparser (#180) 2023-04-09 22:58:48 +08:00

README.md

LSPatch Framework

Build Crowdin Download Total

Introduction

Rootless implementation of LSPosed framework, integrating Xposed API by inserting dex and so into the target APK.

Supported Versions

  • Min: Android 9
  • Max: In theory, same with LSPosed

Download

For stable releases, please go to Github Releases page
For canary build, please check Github Actions
Note: debug builds are only available in Github Actions

Usage

  • Through jar
  1. Download lspatch.jar
  2. Run java -jar lspatch.jar
  • Through manager
  1. Download and install manager.apk on an Android device
  2. Follow the instructions of the manager app

Translation Contributing

You can contribute translation here.

Credits

License

LSPatch is licensed under the GNU General Public License v3 (GPL-3) (http://www.gnu.org/copyleft/gpl.html).