Skip to content

Migrate self-hooking VPN hide module to libxposed API 101#58

Open
1392726643 wants to merge 4 commits intoSagerNet:devfrom
1392726643:codex/libxposed-api-101-migration
Open

Migrate self-hooking VPN hide module to libxposed API 101#58
1392726643 wants to merge 4 commits intoSagerNet:devfrom
1392726643:codex/libxposed-api-101-migration

Conversation

@1392726643
Copy link
Copy Markdown

Summary

  • migrate the self-hooking VPN hide module from the vendored libxposed API to official io.github.libxposed:api:101.0.1
  • keep de.robv.android.xposed:api:82 as compileOnly for existing rovo89 compatibility
  • replace old module lifecycle usage with API 101 entry points and remove the vendored hird_party/libxposed-api project

Changes

  • switch the Xposed module dependency from the local vendored project to official libxposed 101.0.1
  • update XposedInit to use XposedModule() + onModuleLoaded + onSystemServerStarting
  • keep module metadata under META-INF/xposed/ and raise minApiVersion / argetApiVersion to 101
  • remove the old system-context-based caller check in IConnectivityManager.onTransact and use UID-to-package lookup instead
  • delete the vendored hird_party/libxposed-api sources and wiring from settings

Validation

  • :app:dependencies --configuration compileOnly resolves both de.robv.android.xposed:api:82 and io.github.libxposed:api:101.0.1
  • :app:assembleOtherDebug passed
  • :app:assembleOtherLegacyDebug passed
  • old API references such as onSystemServerLoaded, SystemServerLoadedParam, and libxposed-api were removed from the Android app project

Device Test Report

Environment:

  • Device: OnePlus PKR110
  • Android: 16 / SDK 36
  • Framework: LSPosed

Observed logs:

  • onModuleLoaded process=system system=true
  • handleSystemServerStarting
  • ConnectivityService registered: android.net.connectivity.com.android.server.ConnectivityService
  • Hooked ConnectivityService (ServiceManager.addService)
  • HookNetworkInterfaceGetName: un1 -> wlan1

Functional result:

  • when sing-box itself was not in the resistance list, framework detection still reported VPN-related signals as expected for an unselected app
  • after adding the sing-box app itself into the resistance list, both the Framework check and the Native check reported
    ot detected
  • this confirms the migrated API 101 entry path still preserves the current hide-VPN behavior on device

Copilot AI review requested due to automatic review settings April 4, 2026 08:32
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the self-hooking VPN-hide Xposed module from a vendored libxposed API copy to the official io.github.libxposed:api:101.0.1, updating module entrypoints and metadata accordingly while removing the in-repo third_party/libxposed-api project.

Changes:

  • Replace the vendored third_party/libxposed-api Gradle module with a Maven compileOnly("io.github.libxposed:api:101.0.1") dependency and remove the settings include.
  • Update the module entry class to use libxposed API 101 lifecycle entry points (XposedModule() + onModuleLoaded + onSystemServerStarting).
  • Raise Xposed module metadata minApiVersion/targetApiVersion to 101 and adjust the caller check in IConnectivityManager.onTransact to use UID→package lookup via VpnAppStore.

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated no comments.

Show a summary per file
File Description
settings.gradle.kts Removes the :libxposed-api included build module wiring.
app/build.gradle.kts Switches Xposed API dependency from the local project to io.github.libxposed:api:101.0.1 (keeps rovo89 API 82 as compileOnly).
app/src/main/resources/META-INF/xposed/module.prop Raises module API compatibility to minApiVersion=101 / targetApiVersion=101.
app/src/main/java/io/nekohasekai/sfa/xposed/XposedInit.kt Migrates module initialization to API 101 callbacks and removes system-context resolution.
app/src/main/java/io/nekohasekai/sfa/xposed/hooks/IConnectivityManager+onTransact.kt Replaces the context-based UID caller check with VpnAppStore.getPackagesForUid(uid).
third_party/libxposed-api/src/main/java/io/github/libxposed/api/XposedModuleInterface.java Deletes vendored libxposed API source (no longer needed after Maven dependency migration).
third_party/libxposed-api/src/main/java/io/github/libxposed/api/XposedModule.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/java/io/github/libxposed/api/XposedInterfaceWrapper.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/java/io/github/libxposed/api/XposedInterface.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/java/io/github/libxposed/api/utils/DexParser.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/java/io/github/libxposed/api/errors/XposedFrameworkError.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/java/io/github/libxposed/api/errors/HookFailedError.java Deletes vendored libxposed API source.
third_party/libxposed-api/src/main/AndroidManifest.xml Deletes the vendored library manifest stub.
third_party/libxposed-api/LICENSE Removes vendored libxposed license file along with vendored source removal.
third_party/libxposed-api/build.gradle.kts Removes the vendored library module Gradle build file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@1392726643 1392726643 force-pushed the codex/libxposed-api-101-migration branch from c203806 to 93927c5 Compare April 8, 2026 13:32
@nekohasekai nekohasekai force-pushed the dev branch 3 times, most recently from 731b2d5 to 6612096 Compare April 14, 2026 07:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants