Skip to content

feat: support HyperOS Runtime - #973

Open
VeryBaaad wants to merge 3 commits into
JingMatrix:masterfrom
VeryBaaad:feat/znhyos
Open

VeryBaaad wants to merge 3 commits into
JingMatrix:masterfrom
VeryBaaad:feat/znhyos

Conversation

@VeryBaaad

@VeryBaaad VeryBaaad commented Sep 13, 2026 •

Copy link
Copy Markdown

This is an optional feature, and it requires Zygisk Next API support rather than Zygisk API support.

Xiaomi HyperOS's hyos_spawner is built using Rust, making it extremely difficult to hook (for Xposed modules). Consequently, I have updated Vector to function as both a Zygisk module and a ZygiskNext module; this enables the injection of native Xposed hooks into the HyperOS Runtime when using ZygiskNext v1.5.0 or later.

For those who prefer not to use the closed-source ZygiskNext, ZygiskNextNext is an available alternative. Additionally, since this feature is optional, it will automatically disable itself if ZN API support is unavailable.

Tip: LSPosed Internal Test added support for HyperOS Runtime starting with version 7846-it.

@VeryBaaad
VeryBaaad marked this pull request as draft September 13, 2026 17:00
@VeryBaaad

Copy link
Copy Markdown
Author

It's untested, but I don't have the equipment right now, so I can't test it immediately.

@VeryBaaad
VeryBaaad marked this pull request as ready for review September 17, 2026 15:15
rogerwwx pushed a commit to rogerwwx/LSPosed-Irena that referenced this pull request Sep 26, 2026
Port of JingMatrix/Vector#973 (by VeryBaaad), adapted to LSPosed-Irena:

- zygisk: export the Zygisk Next v4 entry points (zn_module /
  zn_companion_module) alongside the Zygisk one, and drive the HyperOS
  Rust Runtime (/system_ext/bin/hyos_spawner) through its Runtime API:
  the spawner gets the do_dlopen hook plus a companion, and each
  specialized child loads the native libraries its scope names from an
  index published by the daemon (hyos_runtime.cpp, zygisk_next_api.h).
- native: make the native module API hook-backend agnostic. Replaces the
  LSPlant DSL in native_api with a direct do_dlopen interception through
  a pluggable backend (SetHookBackend), which lets the HyperOS path hand
  over Zygisk Next's hook engine instead of Dobby; module callbacks now
  run without the registry mutex held.
- daemon: HyosRuntime publishes the per-process index under the misc
  path (pointer file /data/misc/lspd.hyos, magic lspd-hyos 1) and stages
  module native libraries into libhyos/ for the reader to dlopen,
  labeled lsposed_file per this repo's sepolicy; called from
  cacheScopes after the scope swap. Gated on rust.runtime_active /
  rust.runtime_version, and inert without Zygisk Next 1.5.0+.
- magisk module: ship zn_modules.txt declaring the hyos_spawner target.
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.

1 participant