49 Commits
Author SHA1 Message Date
Wang HanandJohn Wu 1b9f69b4b8 Update zygisk sepolicy for A17 QPR1 Beta 4
Mainline kernel starts to use dedicated memfd_file type for memfd,
which makes zygote cannot open memfd created by magiskd.
2026-07-27 18:49:19 -07:00
Wang HanandJohn Wu 14ea5cfb4a Fix sepolicy parsing for hyphenated identifiers 2026-05-05 02:15:16 +08:00
Wang HanandJohn Wu ee25db0627 Add jni hooks signature for nubia 2026-02-22 13:20:08 -08:00
Wang HanandJohn Wu e872fafd8b Update getModuleDir() API doc 2026-02-05 13:12:34 -08:00
Wang HanandJohn Wu e729eec636 Remove unnecessary file system permissions
Removed permissions for mounting loop devices, mirrors, and tmpfs.
2026-02-02 11:15:33 -08:00
Wang HanandJohn Wu a657af5dc9 Refine useLocaleManager with intent check for locales
This fixes https://github.com/topjohnwu/Magisk/issues/9628.
2026-01-31 23:34:03 -08:00
Wang HanandJohn Wu e590ffbdcb Fix formatting and update comments in bootimg.cpp 2026-01-31 13:50:36 -08:00
Wang HanandJohn Wu 97138f1e91 magiskboot: Fix tail offset calculation 2026-01-31 13:50:36 -08:00
Wang HanandJohn Wu 0936cdb192 Update nativeForkAndSpecialize signature for A16 QPR2
https://android.googlesource.com/platform/frameworks/base.git/+/67a4b1b2fee385f798d75ad02d016b80fc79f075
2025-12-07 00:18:50 -08:00
Wang HanandJohn Wu 52d7eff03f Fix splice direction for ptmx out stream 2025-11-19 15:14:59 -08:00
Wang HanandJohn Wu c8d51b38ba Enhance fdt_header validation for empty dtb 2025-11-02 02:42:48 -08:00
Wang HanandJohn Wu f741a4aeb8 Free regex resources in plt_hook_commit
Free regex resources for registered and ignored hooks before clearing the lists.
2025-11-02 01:59:03 -08:00
Wang HanandJohn Wu 470acc93c9 Remove clickable attribute from item_module_md2.xml 2025-10-19 14:02:02 -07:00
Wang HanandJohn Wu 0edb80b10f Set module card as non clickable
It's so easy to mis-click card.
2025-10-19 14:02:02 -07:00
Wang HanandJohn Wu ca2e40593f Make fetchUpdate safe 2025-10-02 04:03:44 -07:00
Wang HanandJohn Wu d60806f429 Only reset NB prop when zygisk is enabled 2025-10-02 03:19:32 -07:00
Wang HanandJohn Wu 8dc23d0ead Avoid triggering magisk --zygote-restart twice
We have already used on restart keyword to inject zygote restart, so
triggering it here on prop is not needed.
2025-08-20 12:34:39 -07:00
Wang HanandJohn Wu 9ca469898c Use worker for replace feature
This fixes https://github.com/topjohnwu/Magisk/issues/9179.
2025-07-18 16:57:20 -07:00
Wang HanandJohn Wu 62e29fee74 Treat bind mount failure same as C++ implementation
This fixes #9139 and #9174.
2025-07-14 00:27:24 -07:00
Wang HanandJohn Wu 7b2d40987c Refactor magisk bins injection logic
Magisk binary mounting logic is not very clear now. In this commit, it
is rewritten in a more robust way. Now it has following cases in mind:
1) Device has a su binary, magisk need to overlay it
2) Choose the PATH with least files to reduce bind mount
3) Filter path which is not suitable
2025-07-01 02:16:16 -07:00
Wang HanandJohn Wu 3a37e8c9c5 Don't clone attributes for magisk symlinks
This avoids use existing attributes for su, which will obviously break
magisk functions.
2025-07-01 02:16:16 -07:00
Wang HanandJohn Wu 810174ef73 Ignore set_context() error if magisktmp is /sbin
recreate_sbin() will bind mount original files in /sbin to tmpfs /sbin,
so we have no choice but just log here to let the loop continue.
2025-06-30 17:39:54 -07:00
Wang HanandJohn Wu 39f2940bd1 Skip symlink in restore_tmpcon()
If magisktmp is /sbin, there may exist files which is symlink to files in
root dir. As root is RO, setcontext will fail and break iterating loop.
2025-06-16 11:09:33 -07:00
Wang HanandJohn Wu 0b494ed7df Avoid throwing error if chmod a symlink
It is possible that we want to clone attributes of a regular file to a
symlink. In this case, we don't need to error out if chmod fails. Just
skip it.
2025-06-06 17:08:34 -07:00
Wang HanandJohn Wu 0e86d4dbcb Fix file pointer leak on error path 2025-06-03 00:34:52 -07:00
Wang HanandJohn Wu 5e050d7456 Check binary existence before injecting zygisk bins 2025-06-03 00:33:40 -07:00
Wang HanandJohn Wu fada8b148a Ensure manager can always bypass su access policy
This fixes https://github.com/topjohnwu/Magisk/issues/9050.
2025-05-21 16:14:46 -07:00
Wang HanandJohn Wu a20a2a8fa0 Recognize Samsung custom policy version path 2025-05-09 11:03:58 -07:00
Wang HanandGitHub 52ef1d1cb2 Simplify matching selinux context of child zygote (#8845) 2025-03-11 01:27:15 -07:00
Wang HanandJohn Wu 8e73536e02 Remove unused hasGMS variable 2025-03-09 00:16:25 -08:00
Wang HanandJohn Wu 442d0b5ddc Delete bootctl binary if execution fails
New devices may use AIDL bootctrl HAL, so if bootctl hal-info fails,
simply remove the temp file and return.
2025-03-01 22:43:55 -08:00
5e35703091 Ensure target path exists before mknod
Co-authored-by: LoveSy <shana@zju.edu.cn>
2025-02-12 01:13:56 +08:00
a14fc90f07 Fix fetching notification settings from db (#8761)
Co-authored-by: LoveSy <shana@zju.edu.cn>
2025-02-04 17:42:21 +08:00
Wang HanandJohn Wu 46980819c0 Expose safe mode option on 28+ 2025-01-31 12:20:02 +08:00
Wang HanandJohn Wu 6ea740b5ab Skip clearing install dir if not needed 2025-01-27 12:14:55 +08:00
23eff70883 Fix repeated binding of first argument
Co-authored-by: LoveSy <shana@zju.edu.cn>
2025-01-19 11:57:09 +08:00
d9c2bffc9f Avoid hardcoding max fd size
Android changed max fd limit to 32768 since Android 9:
https://github.com/aosp-mirror/platform_system_core/commit/cb5fccc83c6c757f25436884e96c318f72743ffd

Co-authored-by: LoveSy <shana@zju.edu.cn>
2025-01-19 11:54:26 +08:00
Wang HanandJohn Wu 7c1d2ec61e zygisk: Let client send arch info 2025-01-11 00:15:10 +08:00
Wang HanandGitHub 53e401fa2d Perform authentication if needed for AutomaticResponse setting 2024-12-27 16:00:02 -08:00
Wang HanandJohn Wu 704541aef2 Use /metadata/watchdog as preinit dir if exists
Since Android 15, all domains are allowed to search /metadata so preinit
dir will be exposed. Use /metadata/watchdog when /metadata is chosen as
preinit device, and the dir is available (since Android 11).
2024-12-27 10:35:05 -08:00
Wang HanandJohn Wu dadba44cf9 Update module installer guide about META-INF 2024-12-17 16:36:40 -08:00
Wang HanandJohn Wu 33f70f8f6d Update zh-rCN strings 2024-09-17 15:01:10 -07:00
Wang HanandJohn Wu 53d7cbc11b Clarify magiskboot requirements for repacking img 2024-09-08 01:13:46 -07:00
Wang HanandJohn Wu 44f005077d Don't copy sepolicy.rule to /persist on boot
* This seems to be a logic that has been abandoned for a
   long time. Now we automatically choose which partition
   to store sepolicy.rule. Furthermore, touching /persist is
   what we should avoid doing whenever possible.
2021-04-15 05:01:03 -07:00
Wang HanandJohn Wu e136fb3a4f Remove outdated sepolicies
* Support deodexed ROM: This should not be done and dexpreopt is mandatory since P
   Xposed: Xposed handles them just fine, at least in the latest version 89.3
   suMiscL6: For whatever audio mods, a leftover of phh time
   Liveboot and suBackL6: Was for CF.lumen and LiveBoot, not needed now

 * Also cleanup binder sepolicies since we allow all binder transactions.
2021-04-09 21:34:51 -07:00
Wang Hanandtopjohnwu 4c7bdbb284 Fix crashing when selecting release notes on some devices 2017-03-26 23:55:11 +08:00
Wang Hanandtopjohnwu 93598d3a51 Fix download button overlay on repo description when expanded 2017-01-06 02:43:16 +08:00
Wang Hanandtopjohnwu 53aebcfb1e Fix MagiskHide Fragment Crash when freshing 2017-01-06 02:43:16 +08:00
Wang Hanandtopjohnwu bb2467d2ac Handle Google API Connection Problems 2017-01-06 02:43:16 +08:00