From ab857adef959e872a70cbc39329fd2793d18ceb6 Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Tue, 24 Mar 2026 10:17:57 +0100 Subject: [PATCH 1/2] Skip slicer processing for unmodified DEX files Slicer's `CreateFullIr` and `CreateImage` operations are highly CPU-intensive and cause significant load latency for large DEX files. We hence introduce a fast-path optimization using `memmem` to perform a raw binary scan of the DEX buffer for target signatures prior to processing. If no matching signatures are found, the expensive IR parsing and image rebuilding phases are bypassed entirely, and the original file descriptor is safely returned. Moreover, we update the logging tag to `VectorDaemon`. --- daemon/src/main/jni/logging.h | 2 +- daemon/src/main/jni/obfuscation.cpp | 20 ++++++++++++++++++++ services/libxposed | 2 +- xposed/libxposed | 2 +- 4 files changed, 23 insertions(+), 3 deletions(-) diff --git a/daemon/src/main/jni/logging.h b/daemon/src/main/jni/logging.h index 86a7220ac..ca9e36e06 100644 --- a/daemon/src/main/jni/logging.h +++ b/daemon/src/main/jni/logging.h @@ -25,7 +25,7 @@ #include #ifndef LOG_TAG -#define LOG_TAG "LSPosed" +#define LOG_TAG "VectorDaemon" #endif #ifdef LOG_DISABLED diff --git a/daemon/src/main/jni/obfuscation.cpp b/daemon/src/main/jni/obfuscation.cpp index 96d7c2048..9965f42f1 100644 --- a/daemon/src/main/jni/obfuscation.cpp +++ b/daemon/src/main/jni/obfuscation.cpp @@ -221,6 +221,26 @@ extern "C" JNIEXPORT jobject JNICALL Java_org_lsposed_lspd_service_ObfuscationMa return nullptr; } + bool needs_obfuscation = false; + for (const auto &sig : signatures) { + if (memmem(mem, size, sig.first.c_str(), sig.first.length()) != nullptr) { + needs_obfuscation = true; + break; + } + } + + if (!needs_obfuscation) { + LOGD("No target signatures found in fd=%d, skipping slicer.", fd); + munmap(mem, size); + + // Wrap the duplicated FD into Java objects and return instantly + auto java_fd = + lsplant::JNI_NewObject(env, class_file_descriptor, method_file_descriptor_ctor, fd); + auto java_sm = + lsplant::JNI_NewObject(env, class_shared_memory, method_shared_memory_ctor, java_fd); + return java_sm.release(); + } + // Process the DEX and obtain a new file descriptor for the output int new_fd = obfuscateDexBuffer(mem, size); diff --git a/services/libxposed b/services/libxposed index 496b76fa3..11f8945de 160000 --- a/services/libxposed +++ b/services/libxposed @@ -1 +1 @@ -Subproject commit 496b76fa3e5af87958ebef97bd160319e05da79b +Subproject commit 11f8945de4e24efc0eb0e2e87a2dd8284d8f7b66 diff --git a/xposed/libxposed b/xposed/libxposed index 88cc0781e..eb63ec2c4 160000 --- a/xposed/libxposed +++ b/xposed/libxposed @@ -1 +1 @@ -Subproject commit 88cc0781e1138477c6b2a6570a0a27692f91f175 +Subproject commit eb63ec2c49a34a9c3cd08a7eee2b5cd8332f46d2 From 27190facc6e0693b147bd42aebe759e36b4a982f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Mar 2026 09:22:05 +0000 Subject: [PATCH 2/2] Bump the submodule group across 1 directory with 2 updates Bumps the submodule group with 2 updates in the / directory: [external/fmt](https://github.com/fmtlib/fmt) and [external/apache/commons-lang](https://github.com/apache/commons-lang). Updates `external/fmt` from `0e078f6` to `dc05bee` - [Release notes](https://github.com/fmtlib/fmt/releases) - [Commits](https://github.com/fmtlib/fmt/compare/0e078f6ed0624be8babc43bd145371d9f3a08aab...dc05bee30755bb993add7ed90845d87c2315f9c6) Updates `external/apache/commons-lang` from `675ab08` to `422ab63` - [Commits](https://github.com/apache/commons-lang/compare/675ab08d0eb62b7d2edd43fe42512c896e84bcd6...422ab637736e06076c04a768ce03ecc2e5344937) --- updated-dependencies: - dependency-name: external/fmt dependency-version: dc05bee30755bb993add7ed90845d87c2315f9c6 dependency-type: direct:production dependency-group: submodule - dependency-name: external/apache/commons-lang dependency-version: 422ab637736e06076c04a768ce03ecc2e5344937 dependency-type: direct:production dependency-group: submodule ... Signed-off-by: dependabot[bot] --- external/apache/commons-lang | 2 +- external/fmt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/external/apache/commons-lang b/external/apache/commons-lang index 675ab08d0..422ab6377 160000 --- a/external/apache/commons-lang +++ b/external/apache/commons-lang @@ -1 +1 @@ -Subproject commit 675ab08d0eb62b7d2edd43fe42512c896e84bcd6 +Subproject commit 422ab637736e06076c04a768ce03ecc2e5344937 diff --git a/external/fmt b/external/fmt index 0e078f6ed..dc05bee30 160000 --- a/external/fmt +++ b/external/fmt @@ -1 +1 @@ -Subproject commit 0e078f6ed0624be8babc43bd145371d9f3a08aab +Subproject commit dc05bee30755bb993add7ed90845d87c2315f9c6