Commit Graph
25 Commits
Author SHA1 Message Date
topjohnwu c86a8776ce Remove stub embedding from native and scripts
Remove stub.apk and stub.xz extraction, compression,
ramdisk embedding, and daemon auto-installation from native
components (magiskinit, magiskd, scripting), installation
scripts, MagiskInstaller, and build.py.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu ea16c8141e Fix package management and user targeting on HSUM
- Use --user current for pm install, adb install, and appops set across
  install_script, adb_pm_install, and test/setup scripts.
- Skip headless user 0 in get_users() on HSUM devices.
- Use --user current in app_notify for non-app UIDs instead of calling
  content call against all users.
- Clear path buffer on each iteration in setup_magisk_env.
- Use --user current for am instrument in app migration tests.

Assisted-by: Gemini 4 Argon
2026-10-22 14:06:48 -07:00
topjohnwu 8f0cc199e7 core: resolve user 0 assumptions for HSUM
On Headless System User Mode (HSUM) devices, user 0 is headless while
human users operate under secondary user IDs. Eliminate residual
assumptions in core native components where user 0 was presumed to be
the sole or active manager user:

- In setup_magisk_env, scan all existing users via get_users() to check
  if the app-local binary install directory exists.
- In ensure_manager, check all users before falling back to stub install
  so an already-installed manager on a secondary user is recognized.
- Pass --user all to pm install, pm uninstall, and appops set in package
  management scripts to handle manager lifecycle device-wide.

Assisted-by: Gemini 3.8 Flash
2026-10-05 18:20:32 -07:00
topjohnwu 33d09a2aff Expose xpipe2 as symbol 2026-10-02 17:17:48 -07:00
topjohnwu b76d674a60 Move daemon utilities from base to core
Move utilities that are exclusively used by the daemon (core module)
from base to core:
- fork_dont_care, fork_no_orphan, new_daemon_thread, init_argv0,
  set_nice_name, and switch_mnt_ns into utils.cpp
- exec_command* functions and exec_t into scripting.cpp as static
  functions, as scripting is their sole consumer

Also remove the unused exec_command_sync overload.

Assisted-by: Gemini 3.8 Flash
2026-10-02 17:17:48 -07:00
topjohnwu 8b7d1ffcdd Migrate magisk_main to Rust 2025-09-18 03:22:44 -07:00
topjohnwu 2e4fa6864c Make Utf8CStr a first class citizen in C++ codebase
Utf8CStr is in many cases a better string view class than
std::string_view, because it provides "view" access to a string buffer
that is guaranteed to be null terminated. It also has the additional
benefit of being UTF-8 verified and can seemlessly cross FFI boundaries.

We would want to start use more Utf8CStr in our existing C++ codebase.
2025-08-27 22:48:48 -07:00
topjohnwu 73840f8721 Migrate selinux.cpp to selinux.rs 2025-04-28 17:22:14 -07:00
topjohnwu 59622d1688 Use static methods in cxx-rs 2025-02-02 02:46:33 +08:00
topjohnwu b25aa8295a Move bootstage into Rust 2025-01-31 02:52:27 +08:00
topjohnwu 15a605765c Fully implement daemon side of Zygisk in Rust 2025-01-31 02:52:27 +08:00
topjohnwu 0d8d6290a3 Move module list into MagiskD 2025-01-31 02:52:27 +08:00
topjohnwu 5637a258fc Migrate package detection to Rust 2025-01-11 00:11:48 +08:00
vvb2060 c512496847 install_module: simplify script 2024-12-12 10:08:09 -08:00
vvb2060 2d341863f5 set MAGISKTMP 2024-08-12 02:05:58 -07:00
LoveSy 97705704e2 install or uninstall apk asynchronously 2024-01-11 16:16:36 -08:00
topjohnwu 49f241b77c Allow running scripts with incomplete env 2023-11-10 00:55:05 -08:00
topjohnwu 65c18f9c09 Restructure project files 2023-11-08 01:46:02 -08:00
topjohnwu 16ae4aedf1 Remove usage of MAGISKTMP 2023-11-02 15:50:36 -07:00
vvb2060 69529ac59c Fix restorecon 2023-04-04 02:34:16 -07:00
topjohnwu a66a3b7438 Make sure logs are always ended with newline 2022-09-09 04:29:50 -07:00
vvb2060 77d8445bfd Avoid hardcode package name 2022-08-24 03:18:55 -07:00
topjohnwu a54114f149 Pre-grant permissions if possible 2022-08-23 05:09:50 -07:00
vvb2060 c2f96975ce Pre grant as much as possible 2022-08-23 01:33:10 -07:00
topjohnwu b9e89a1a2d Restructure the native module
Consolidate all code into the src folder
2022-07-23 13:51:56 -07:00