From 8566f40e1081c257fbf06cd78b6ee15d994081db Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Thu, 22 Jan 2026 00:58:51 +0100 Subject: [PATCH 1/2] Centralize dependencies and migrate to submodules Move `apache` and `axml` modules to a unified `external` directory and migrate libxposed API and service interfaces from Maven dependencies to Git submodules. Included changes: - Updated .gitmodules with new paths. - Simplified core.yml CI workflow. - Updated Gradle project references to use the new directory structure. - Added documentation for external components. --- .github/workflows/core.yml | 25 ---------------- .gitignore | 3 +- .gitmodules | 20 ++++++++----- apache/commons-lang | 1 - axml/.gitignore | 1 - axml/libs/manifest-editor | 1 - core/build.gradle.kts | 7 ++--- daemon/build.gradle.kts | 3 +- external/CMakeLists.txt | 14 ++++----- external/README.md | 30 +++++++++++++++++++ external/apache/.gitignore | 1 + {apache => external/apache}/build.gradle.kts | 0 external/apache/commons-lang | 1 + .../apache}/local/MemberUtilsX.java | 0 {axml => external/axml}/build.gradle.kts | 4 +-- external/axml/manifest-editor | 1 + gradle/libs.versions.toml | 4 --- services/daemon-service/build.gradle.kts | 8 +++++ services/libxposed | 1 + settings.gradle.kts | 12 ++------ xposed/build.gradle.kts | 7 ++++- xposed/libxposed | 1 + 22 files changed, 77 insertions(+), 68 deletions(-) delete mode 160000 apache/commons-lang delete mode 100644 axml/.gitignore delete mode 160000 axml/libs/manifest-editor create mode 100644 external/README.md create mode 100644 external/apache/.gitignore rename {apache => external/apache}/build.gradle.kts (100%) create mode 160000 external/apache/commons-lang rename {apache => external/apache}/local/MemberUtilsX.java (100%) rename {axml => external/axml}/build.gradle.kts (71%) create mode 160000 external/axml/manifest-editor create mode 160000 services/libxposed create mode 160000 xposed/libxposed diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index c648e7187..5ba6d05ab 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -40,19 +40,6 @@ jobs: echo ${{ secrets.KEY_STORE }} | base64 --decode > key.jks fi - - name: Checkout libxposed/api - uses: actions/checkout@v6 - with: - repository: libxposed/api - path: libxposed/api - ref: 54582730315ba4a3d7cfaf9baf9d23c419e07006 - - - name: Checkout libxposed/service - uses: actions/checkout@v6 - with: - repository: libxposed/service - path: libxposed/service - - name: Setup Java uses: actions/setup-java@v5 with: @@ -84,18 +71,6 @@ jobs: shell: bash run: rm -rf $ANDROID_HOME/cmake - - name: Build dependencies - working-directory: libxposed - run: | - echo 'org.gradle.caching=true' >> ~/.gradle/gradle.properties - echo 'org.gradle.parallel=true' >> ~/.gradle/gradle.properties - echo 'org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 -XX:+UseParallelGC' >> ~/.gradle/gradle.properties - echo 'android.native.buildOutput=verbose' >> ~/.gradle/gradle.properties - cd api - ./gradlew publishToMavenLocal - cd ../service - ./gradlew publishToMavenLocal - - name: Build with Gradle run: | ./gradlew zipAll diff --git a/.gitignore b/.gitignore index 643c3054e..0022083f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -apache/local/generated .project .settings .cache @@ -7,6 +6,6 @@ apache/local/generated /local.properties /.idea .DS_Store -/build +build /captures bin/ diff --git a/.gitmodules b/.gitmodules index 0ef33e53d..e6d674228 100644 --- a/.gitmodules +++ b/.gitmodules @@ -7,15 +7,21 @@ [submodule "external/fmt"] path = external/fmt url = https://github.com/fmtlib/fmt.git -[submodule "patch/libs/manifest-editor"] - path = axml/libs/manifest-editor - url = https://github.com/JingMatrix/ManifestEditor.git [submodule "external/xz-embedded"] path = external/xz-embedded - url = https://github.com/tukaani-project/xz-embedded -[submodule "apache/commons-lang"] - path = apache/commons-lang - url = https://github.com/apache/commons-lang + url = https://github.com/tukaani-project/xz-embedded.git [submodule "external/lsplt"] path = external/lsplt url = https://github.com/JingMatrix/LSPlt +[submodule "services/libxposed"] + path = services/libxposed + url = https://github.com/libxposed/service.git +[submodule "xposed/libxposed"] + path = xposed/libxposed + url = https://github.com/libxposed/api.git +[submodule "external/apache/commons-lang"] + path = external/apache/commons-lang + url = https://github.com/apache/commons-lang.git +[submodule "external/axml/manifest-editor"] + path = external/axml/manifest-editor + url = https://github.com/JingMatrix/ManifestEditor.git diff --git a/apache/commons-lang b/apache/commons-lang deleted file mode 160000 index 623235ebc..000000000 --- a/apache/commons-lang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 623235ebca46bea1a6e8cc02b7d7084c1698ab80 diff --git a/axml/.gitignore b/axml/.gitignore deleted file mode 100644 index 42afabfd2..000000000 --- a/axml/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/build \ No newline at end of file diff --git a/axml/libs/manifest-editor b/axml/libs/manifest-editor deleted file mode 160000 index c40dc842a..000000000 --- a/axml/libs/manifest-editor +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c40dc842a3e3ec23ec77b08d638671af0d9062d3 diff --git a/core/build.gradle.kts b/core/build.gradle.kts index 75f2c421f..213108021 100644 --- a/core/build.gradle.kts +++ b/core/build.gradle.kts @@ -56,13 +56,12 @@ copy { } dependencies { - api(libs.libxposed.api) - implementation(projects.apache) - implementation(projects.axml) + api(projects.xposed) + implementation(projects.external.apache) + implementation(projects.external.axml) implementation(projects.hiddenapi.bridge) implementation(projects.services.daemonService) implementation(projects.services.managerService) - implementation(projects.xposed) compileOnly(libs.androidx.annotation) compileOnly(projects.hiddenapi.stubs) } diff --git a/daemon/build.gradle.kts b/daemon/build.gradle.kts index 3514b4f5a..b54617cc7 100644 --- a/daemon/build.gradle.kts +++ b/daemon/build.gradle.kts @@ -114,9 +114,8 @@ android.applicationVariants.all { } dependencies { - implementation(libs.libxposed.`interface`) implementation(libs.agp.apksig) - implementation(projects.apache) + implementation(projects.external.apache) implementation(projects.hiddenapi.bridge) implementation(projects.services.daemonService) implementation(projects.services.managerService) diff --git a/external/CMakeLists.txt b/external/CMakeLists.txt index bf0d4b404..75a4b4c06 100644 --- a/external/CMakeLists.txt +++ b/external/CMakeLists.txt @@ -1,11 +1,6 @@ -project(external) - -macro(SET_OPTION option value) - set(${option} ${value} CACHE INTERNAL "" FORCE) -endmacro() +cmake_minimum_required(VERSION 3.10) -SET_OPTION(Plugin.SymbolResolver OFF) -SET_OPTION(FMT_INSTALL OFF) +project(external) set(XZ_SOURCES xz_crc32.c @@ -19,7 +14,10 @@ add_library(xz_static STATIC ${XZ_SOURCES}) target_compile_options(xz_static PRIVATE -DXZ_USE_CRC64) target_include_directories(xz_static PRIVATE ${XZ_INCLUDES}) -OPTION(LSPLANT_BUILD_SHARED OFF) +option(LSPLANT_BUILD_SHARED OFF) +option(Plugin.SymbolResolver OFF) +option(FMT_INSTALL OFF) + add_subdirectory(dobby) add_subdirectory(fmt) add_subdirectory(lsplant/lsplant/src/main/jni) diff --git a/external/README.md b/external/README.md new file mode 100644 index 000000000..0326325fa --- /dev/null +++ b/external/README.md @@ -0,0 +1,30 @@ +# External Dependencies + +This directory contains all the external dependencies required to build the Vector framework. +They are included as git submodules to ensure version consistency and timely updating. + +## Native dependencies + +- [Dobby](https://github.com/JingMatrix/Dobby): + A lightweight, multi-platform inline hooking framework. It serves as the backend for all native function hooking (`HookInline`). + +- [fmt](https://github.com/fmtlib/fmt): + A modern formatting library used for high-performance, type-safe logging throughout the native code. + +- [LSPlant](https://github.com/JingMatrix/LSPlant): + A hooking framework for the Android Runtime (ART). It provides the core functionality for intercepting and modifying Java methods. + +- [xz-embedded](https://github.com/tukaani-project/xz-embedded): + A lightweight data compression library with a small footprint. It is used by the ELF parser to decompress the `.gnu_debugdata` section of stripped native libraries. + +- [LSPlt](https://github.com/JingMatrix/LSPlt): + A library for PLT (Procedure Linkage Table) hooking. It is used in the `dex2oat` sub-project to bypass a detection point. **Note:** This is included as a submodule for project convenience but is not compiled into the `external` C++ library itself. + +## Java libraries + +- [apache/commons-lang](https://github.com/apache/commons-lang): + A package of Java utility classes for the classes that are in java.lang's hierarchy. Some classes are renamed and then used to implement the `XposedHelpers` API. + +- [axml/manifest-editor](https://github.com/JingMatrix/ManifestEditor): + A a tool used to modify Android Manifest binary file. It is to parse manifestation files of Xposed modules. + diff --git a/external/apache/.gitignore b/external/apache/.gitignore new file mode 100644 index 000000000..2653dcb1b --- /dev/null +++ b/external/apache/.gitignore @@ -0,0 +1 @@ +local/generated diff --git a/apache/build.gradle.kts b/external/apache/build.gradle.kts similarity index 100% rename from apache/build.gradle.kts rename to external/apache/build.gradle.kts diff --git a/external/apache/commons-lang b/external/apache/commons-lang new file mode 160000 index 000000000..675ab08d0 --- /dev/null +++ b/external/apache/commons-lang @@ -0,0 +1 @@ +Subproject commit 675ab08d0eb62b7d2edd43fe42512c896e84bcd6 diff --git a/apache/local/MemberUtilsX.java b/external/apache/local/MemberUtilsX.java similarity index 100% rename from apache/local/MemberUtilsX.java rename to external/apache/local/MemberUtilsX.java diff --git a/axml/build.gradle.kts b/external/axml/build.gradle.kts similarity index 71% rename from axml/build.gradle.kts rename to external/axml/build.gradle.kts index ca3c8958b..a650b878f 100644 --- a/axml/build.gradle.kts +++ b/external/axml/build.gradle.kts @@ -10,8 +10,8 @@ java { targetCompatibility = androidTargetCompatibility sourceSets { main { - java.srcDirs("libs/manifest-editor/lib/src/main/java") - resources.srcDirs("libs/manifest-editor/lib/src/main") + java.srcDirs("manifest-editor/lib/src/main/java") + resources.srcDirs("manifest-editor/lib/src/main") } } } diff --git a/external/axml/manifest-editor b/external/axml/manifest-editor new file mode 160000 index 000000000..e79724341 --- /dev/null +++ b/external/axml/manifest-editor @@ -0,0 +1 @@ +Subproject commit e79724341b797e5ad51f89e14ddb50b4bbba70db diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f47205974..6faa2f4fc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -3,7 +3,6 @@ agp = "8.13.1" kotlin = "2.2.21" nav = "2.9.6" appcenter = "5.0.5" -libxposed = "100" glide = "5.0.5" okhttp = "5.3.2" ktfmt = "0.25.0" @@ -59,6 +58,3 @@ gson = { module = "com.google.code.gson:gson", version = "2.13.2" } hiddenapibypass = { module = "org.lsposed.hiddenapibypass:hiddenapibypass", version = "6.1" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" } kotlinx-coroutines-core = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.10.2" } - -libxposed-api = { group = "io.github.libxposed", name = "api", version.ref = "libxposed" } -libxposed-interface = { group = "io.github.libxposed", name = "interface", version.ref = "libxposed" } diff --git a/services/daemon-service/build.gradle.kts b/services/daemon-service/build.gradle.kts index 4c399d77a..1b0c0f96b 100644 --- a/services/daemon-service/build.gradle.kts +++ b/services/daemon-service/build.gradle.kts @@ -36,11 +36,19 @@ android { } } + sourceSets { + named("main") { + java.srcDirs("src/main/java", "../libxposed/service/src/main") + aidl.srcDirs("src/main/aidl", "../libxposed/interface/src/main/aidl") + } + } + aidlPackagedList += "org/lsposed/lspd/models/Module.aidl" aidlPackagedList += "org/lsposed/lspd/models/PreloadedApk.aidl" namespace = "org.lsposed.lspd.daemonservice" } dependencies { + compileOnly(libs.androidx.annotation) compileOnly(projects.hiddenapi.stubs) } diff --git a/services/libxposed b/services/libxposed new file mode 160000 index 000000000..496b76fa3 --- /dev/null +++ b/services/libxposed @@ -0,0 +1 @@ +Subproject commit 496b76fa3e5af87958ebef97bd160319e05da79b diff --git a/settings.gradle.kts b/settings.gradle.kts index 6d05f2544..fcb822daf 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -13,25 +13,17 @@ dependencyResolutionManagement { repositories { google() mavenCentral() - mavenLocal { - content { - includeGroup("io.github.libxposed") - } - } - } - versionCatalogs { - create("libs") } } rootProject.name = "LSPosed" include( - ":apache", ":app", - ":axml", ":core", ":daemon", ":dex2oat", + ":external:axml", + ":external:apache", ":hiddenapi:stubs", ":hiddenapi:bridge", ":magisk-loader", diff --git a/xposed/build.gradle.kts b/xposed/build.gradle.kts index 099944bcc..5ffe8a57d 100644 --- a/xposed/build.gradle.kts +++ b/xposed/build.gradle.kts @@ -13,9 +13,14 @@ android { namespace = "org.matrix.vector.xposed" buildFeatures { androidResources { enable = false } } + + sourceSets { + named("main") { + java.srcDirs("src/main/kotlin", "libxposed/api/src/main/java") + } + } } dependencies { - api(libs.libxposed.api) compileOnly(libs.androidx.annotation) } diff --git a/xposed/libxposed b/xposed/libxposed new file mode 160000 index 000000000..545827303 --- /dev/null +++ b/xposed/libxposed @@ -0,0 +1 @@ +Subproject commit 54582730315ba4a3d7cfaf9baf9d23c419e07006 From 04c261b102b38c0a128595b059c9dacd67307fba Mon Sep 17 00:00:00 2001 From: JingMatrix Date: Thu, 22 Jan 2026 09:37:28 +0100 Subject: [PATCH 2/2] Remove unused variables --- xposed/build.gradle.kts | 3 --- 1 file changed, 3 deletions(-) diff --git a/xposed/build.gradle.kts b/xposed/build.gradle.kts index 5ffe8a57d..9b2ea6edf 100644 --- a/xposed/build.gradle.kts +++ b/xposed/build.gradle.kts @@ -6,9 +6,6 @@ plugins { ktfmt { kotlinLangStyle() } -val versionCodeProvider: Provider by rootProject.extra -val versionNameProvider: Provider by rootProject.extra - android { namespace = "org.matrix.vector.xposed"