Skip to content

Migrate Vector to libxposed API 101 (Modern Interceptor Architecture)#586

Merged
JingMatrix merged 34 commits intomasterfrom
101
Mar 26, 2026
Merged

Migrate Vector to libxposed API 101 (Modern Interceptor Architecture)#586
JingMatrix merged 34 commits intomasterfrom
101

Conversation

@JingMatrix
Copy link
Copy Markdown
Owner

This PR comprehensively upgrades the Vector framework to support the modern libxposed API 101, replacing the legacy before/after callback model with a robust, OkHttp-style interceptor chain architecture.

Moreover, we add serval minor improvements.
@JingMatrix JingMatrix marked this pull request as ready for review March 23, 2026 13:52
@JingMatrix
Copy link
Copy Markdown
Owner Author

JingMatrix commented Mar 23, 2026

@Spontini, @hyplant, @thoitiettxl-cyber, @DarthKnox,
@Fan-Bob, @AbdulrahmanAlamodi, @RinLin-NYA
Please start test the libxposed API 101 implementation of current CI build: https://github.com/JingMatrix/LSPosed/actions/runs/23439889372 [buggy]

And attach logs if it is not working on you device with certain API 101 modules.

@huynhbaman
Copy link
Copy Markdown

@Spontini, @hyplant, @thoitiettxl-cyber, @DarthKnox,
@Fan-Bob, @AbdulrahmanAlamodi, @RinLin-NYA
Please start test the libxposed API 101 implementation of current CI build: https://github.com/JingMatrix/LSPosed/actions/runs/23439889372

And attach logs if it is not working on you device with certain API 101 modules.

Screenshot_20260323_211220_KernelSU-Next.jpg

Zygote crash, I remember it had already happened at the past

@Dev4Mod
Copy link
Copy Markdown

Dev4Mod commented Mar 23, 2026

log.zip

Here are the logs needed to fix the problem.

@Dev4Mod
Copy link
Copy Markdown

Dev4Mod commented Mar 23, 2026

logs.zip

Compatibility with the legacy API has been broken. Another thing I noticed is that API 100 is still displayed in the manager, and I see the incompatibility message with API 101 in the modules.

@AbdulrahmanAlamodi
Copy link
Copy Markdown

@JingMatrix @huynhbaman

Modules with required 101 not working
Using latest build https://github.com/JingMatrix/LSPosed/actions/runs/23443759490

Screenshot_2026-03-23-20-41-12-70_084ab3bc34f7aa7ccff83653f52abafc
LSPosed_2026-03-23T20.zip

@Things22
Copy link
Copy Markdown

Things22 commented Mar 23, 2026

@JingMatrix
android 16 crdroid 12.8 - oneplus9pro
api changed n homepage
modules not working
pls if there is something personal n logs, lemme know or delete this comment, i'm noob 50%🥲

Screenshot_20260323-211310_Shell

dedLSPosed_2026-03-23T21_14_14.546616.zip
verboseLSPosed_2026-03-23T21_16_52.387809.zip

@JingMatrix
Copy link
Copy Markdown
Owner Author

The latest CI build should work now. I tested with Enable Screenshot v5.0.0.

Please continue to test and tell me if modules are working for you.

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.
@JingMatrix
Copy link
Copy Markdown
Owner Author

JingMatrix commented Mar 24, 2026

@AbdulrahmanAlamodi Please test again the module punch-hole-download-progress, I am not sure if it can function for my devices.

If it once worked for you with old versions or LSPosed-it (so that the module itself is good), but not for Vector, please tell us.

Found a bug, fixing...

@Dev4Mod
Copy link
Copy Markdown

Dev4Mod commented Mar 24, 2026

@Things22 io.github.zensu357.camswap(I made a typo) is built with API 100, and API 101 cannot support API 100 modules.
Please avoid pasting AI content, I will use AI if I do need it.

I will investigate more about WppEnhancer error on your device:

[ 2026-03-24T06:29:20.954 10590: 8492: 8492 E/XSharedPreferences ] tryRegisterWatcher: access denied to /data/misc/1cdc73f5-4c90-4458-94cf-6b3c9a393318/prefs/com.wmods.wppenhacer/com.wmods.wppenhacer_preferences.xml

@Dev4Mod Is this log normal for your module ?

This has always appeared but has no impact on the module's operation.

- Split classloader hooking to correctly implement API 101 lifecycle phases and prevent AppComponentFactory <clinit> evasion.
- Hook LoadedApk.createAppFactory to dispatch onPackageLoaded immediately before factory instantiation (API 29+).
- Hook LoadedApk.createOrUpdateClassLoaderLocked to dispatch onPackageReady after the custom classloader is fully initialized.
- Cache reflection targets using lazy delegates to eliminate redundant lookups during classloader updates.
@AbdulrahmanAlamodi
Copy link
Copy Markdown

@JingMatrix everything works fine now on the latest build

These are additional logs if needed
working logs.zip

It is said as we have spent time to improve it.

Now it is better to use third party library for module developers
@CoelacanthusHex
Copy link
Copy Markdown

Does it no longer support legacy modules? I try to install from CI, all api 101 modules I used work well, but the legacy module https://github.com/RichardLuo0/global-icon-pack-android does not work.

@JingMatrix
Copy link
Copy Markdown
Owner Author

@CoelacanthusHex No, legacy APIs will always be supported, please upload your debug logs to help locating the issue.

@JingMatrix
Copy link
Copy Markdown
Owner Author

JingMatrix commented Mar 24, 2026

Confirm that release build is not working, while debug build works. Fixed now

@CoelacanthusHex
Copy link
Copy Markdown

Vector seems will stuck in infinitely recursive,

03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.connect(VectorURLStreamHandler.kt:67)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.getJarFile(VectorURLStreamHandler.kt:75)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.connect(VectorURLStreamHandler.kt:67)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.getJarFile(VectorURLStreamHandler.kt:75)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.connect(VectorURLStreamHandler.kt:67)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.getJarFile(VectorURLStreamHandler.kt:75)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.connect(VectorURLStreamHandler.kt:67)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.getJarFile(VectorURLStreamHandler.kt:75)
03-25 17:07:55.940  6897  6897 E Vector  :  at org.matrix.vector.impl.utils.VectorURLStreamHandler$ClassPathURLConnection.connect(VectorURLStreamHandler.kt:67)
  1. Something function calls ClassPathURLConnection.connect().
  2. In ClassPathURLConnection.connect(), jarFile resolves to this.getJarFile() (the abstract getter from java.net.JarURLConnection, implemented by ClassPathURLConnection)
  3. ClassPathURLConnection.getJarFile() calls connect()
  4. In connect(), connected is still false (not yet set) → calls jarFile -> getJarFile() again
  5. drop into infinite loop

Comment on lines +63 to +72
override fun connect() {
check(!isClosed) { "JarURLConnection has been closed" }
if (!connected) {
jarEntry =
jarFile.getEntry(entryName)
?: throw FileNotFoundException("URL=$url, zipfile=${jarFile.name}")
connected = true
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
override fun connect() {
check(!isClosed) { "JarURLConnection has been closed" }
if (!connected) {
jarEntry =
jarFile.getEntry(entryName)
?: throw FileNotFoundException("URL=$url, zipfile=${jarFile.name}")
connected = true
}
}
override fun connect() {
check(!isClosed) { "JarURLConnection has been closed" }
if (!connected) {
jarEntry =
this@VectorURLStreamHandler.jarFile.getEntry(entryName)
?: throw FileNotFoundException("URL=$url, zipfile=${this@VectorURLStreamHandler.jarFile.name}")
connected = true
}
}

Maybe we can let connect() access VectorURLStreamHandler.jarFile directly, just like the way in getJarFile(), so we can bypass the connect() call when accessing it through getJarFile() to avoid infinite recursion. I tested it on my device, and the issue disappeared.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

That is correct, thanks for the suggestion !

@Things22
Copy link
Copy Markdown

hi @JingMatrix
thanox not working
logs:

thanoxLSPosed_2026-03-26T12_34_18.631214.zip

thanks

@JingMatrix
Copy link
Copy Markdown
Owner Author

@Things22 Thanox is not written in API 101.

@Things22
Copy link
Copy Markdown

@Things22 Thanox is not written in API 101.

oh, ok, but i didnt see any warining n vector manager
also, i thought both 100&101 are supported idk
thank u for the info

@JingMatrix
Copy link
Copy Markdown
Owner Author

@Things22 See my explanation here #587 (comment)

@JingMatrix JingMatrix merged commit a7d97a6 into master Mar 26, 2026
@lsfqxd2006
Copy link
Copy Markdown

XposedSmsCode Release: v3.2.4 api101
Hide My Applist v3.6.1 r462 leagey
上述两个模块不起作用
Uploading LSPosed_2026-03-28T23_15_28.180358.zip…

@JingMatrix JingMatrix mentioned this pull request Mar 29, 2026
1 task
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.

7 participants