Refactor native modules and migrate to new Zygisk architecture#550
Refactor native modules and migrate to new Zygisk architecture#550JingMatrix merged 24 commits intomasterfrom
Conversation
|
@Dev4Mod, @Stillhard, @ale5000-git, please test this refactor build and have a look at the code documentation I added. Leave your comments if you spot errors, or current docs / codes are still unclear for you. |
|
It seems to be a symbol resolution problem. Please test the latest CI again and upload logs. |
This comment was marked as outdated.
This comment was marked as outdated.
|
Crash zygisk bro |
|
@huynhbaman If you can, please provide logs as described in #123. |
|
|
@Dev4Mod @huynhbaman Please test again the latest CI buid: https://github.com/JingMatrix/LSPosed/actions/runs/22737067570 |
|
Vector has now started normally, however there is a problem with my WAEnhancer module which uses XC_InitPackageResources to obtain resources. |
|
|
@Dev4Mod Please test https://github.com/JingMatrix/LSPosed/actions/runs/22758702203 and upload logs if anything abnormal is observed. |
|
It's working fine now, with no error logs in Vector. |
Note that the signature of rewriteXmlReferencesNative is changed to separate sub-projects xposed and core.
Better to change it after database is redesigned
Java string created via NewStringUTF is detectable by searching the JVM heap. Renaming `LSPosed` to another string, is stupid but can defeat detectors such as https://github.com/RiRiRawrZ615/Known-Root-Detectors/blob/main/Risk%20Detector_1.6.apk Of course, there are plenty of robust solutions to overcome this detection point. This commit is just for fun, in the process of refactoring LSPosed into Vector.
Add more comments and simplify logic
1. Avoid hard-coding transaction codes for maintance convience. 2. No need to enforce descriptor, which only introduce detection point.
However, we should keep the file `zygisk.json` for smooth updating experience.
This part is replaced by the native module
Using bias_ comparison could be buggy
The Android dynamic linker (Bionic) restricts loading libraries from unauthorized paths via LD_PRELOAD. This causes the linker to reject the hook library with a "not accessible for the namespace" fatal error. To bypass this restriction, we exploit a fallback in Bionic that explicitly skips the namespace accessibility check for files located on tmpfs. We use `memfd_create` to create an anonymous tmpfs-backed file descriptor, copy the library into it using `sendfile`, and pass the new memfd to LD_PRELOAD instead. Reference: function `load_library` in https://cs.android.com/android/platform/superproject/main/+/main:bionic/linker/linker.cpp
Correct bugs in dynamical construction of XResources methods.


We replace the legacy magisk-loader and core JNI with a rewritten Zygisk module and a centralized native library.
Major changes: