mirror of
https://github.com/kvorschk/Magisk.git
synced 2026-12-04 19:10:47 -05:00
8903cf7f2261fb60bd2d0b568d6becb2ecf74c3e
Meta Quest (Horizon OS) does not start the zygote the normal way: ro.zygote= zygote64_stub32 launches /system/bin/stub_zygote, which forks a separate app_process64 zygote PER security partition (system/trusted vs untrusted-app), driven by hzos_security_zygote_partitioning_policy. The untrusted-app partition zygote -- the one that forks 3rd-party apps and the Magisk manager -- is spawned LAZILY, after boot-complete. magiskd sets ro.dalvik.vm.native.bridge=libzygisk.so during boot but clears it again at boot-complete (ZygiskState::reset). On a normal device every zygote has already started by then, so clearing it is harmless. On Quest the untrusted-app partition zygote reads the (now cleared) property when it finally execve's app_process64, never loads libzygisk.so, so 3rd-party apps + the Magisk manager are never injected -> "Zygisk: N/A". Fix (daemon.rs): on the boot-complete reset(restore=true) path, reset the crash counter but KEEP native.bridge set (set_prop) instead of clearing it (restore_prop); only the >3-crash rollback path still clears. The lazily-spawned partition zygotes then load the loader when they start. Also (hook.cpp), robustness fixes the loader needs on this device: - Wrap hook_zygote_jni()'s JNI locals in PushLocalFrame(64)/PopLocalFrame so leaking locals can't trip ART's "non-empty local reference table" abort, and bail if GetEnv returns no env. - Make the strdup(ZygoteInit) trigger a substring match + add an idempotency guard so the zygote hooks install exactly once per process. Verified on Quest 3 (Android 14): system_server + every app fork is intercepted and LSPosed loads end-to-end.
This is not an officially supported Google product
Introduction
Magisk is a suite of open source software for customizing Android, supporting devices higher than Android 6.0.
Some highlight features:
- MagiskSU: Provide root access for applications
- Magisk Modules: Modify read-only partitions by installing modules
- MagiskBoot: The most complete tool for unpacking and repacking Android boot images
- Zygisk: Run code in every Android applications' processes
Downloads
Github is the only source where you can get official Magisk information and downloads.
Useful Links
Bug Reports
Only bug reports from Debug builds will be accepted.
For installation issues, upload both boot image and install logs.
For Magisk issues, upload boot logcat or dmesg.
For Magisk app crashes, record and upload the logcat when the crash occurs.
Translation Contributions
Default string resources for the Magisk app and its stub APK are located here:
app/core/src/main/res/values/strings.xmlapp/stub-res/src/main/res/values/strings.xml
Translate each and place them in the respective locations ([module]/src/main/res/values-[lang]/strings.xml).
License
Magisk, including all git submodules are free software:
you can redistribute it and/or modify it under the terms of the
GNU General Public License as published by the Free Software Foundation,
either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Languages
Kotlin
43.7%
Rust
31.2%
C++
17.5%
Shell
3.8%
Python
2.4%
Other
1.3%
