Commit Graph

423 Commits

Author SHA1 Message Date
e9f562a8b7 Fix abuse of fdopendir
After `fdopendir`, the fd is no longer usable. Should dup and
make use of RAII

Co-authored-by: 残页 <31466456+canyie@users.noreply.github.com>
2022-02-04 22:54:34 -08:00
fbe17dde03 Add flag for unloaded Zygisk modules 2022-01-21 05:37:47 -08:00
f443cbaa2b Revert "Always run non disabled module post-fs-data scripts"
This reverts commit 4dfb193d10.
2022-01-18 04:48:47 -08:00
bb7a74e4b4 Add Zygisk API getFlags() 2022-01-17 19:54:33 -08:00
76ddfeb93a Allow modifying denylist without enforcement 2022-01-15 23:46:22 -08:00
c38b826abf Skip overlayfs for post-fs-data mount
adb remount will introduce overlayfs for /system and /vendor, we should
skip mounting as overlayfs. This also helps us support overlayfs Magisk
later.
2022-01-14 03:42:37 -08:00
21d7db0959 Add new Zygisk API to get module dir 2022-01-14 03:10:02 -08:00
880b348ce6 Add an old cgroup path
Fix topjohnwu#5125
cgroup root path might be mem cgroup instead of acct, especially on low-ram devices.
bc131c3244%5E%21/#F0
2021-12-28 17:12:15 -08:00
fef44bd24f Allow boot scripts to know Zygisk status 2021-11-20 13:05:15 -08:00
4dfb193d10 Always run non disabled module post-fs-data scripts 2021-11-16 21:29:13 -08:00
d4ac458d17 Ignore zygisk modules when zygisk is not enabled 2021-11-16 21:14:35 -08:00
8bd0c44e83 Replace module fd with memfd if possible 2021-10-28 00:26:18 -07:00
ea75a09f95 Make zygisk survive zygote restarts
Close #4777
2021-10-27 01:53:16 -07:00
49abfcafed Fix nullptr dereference when env abnormal 2021-10-26 00:40:00 -07:00
2e299b3814 Add an old cgroup v2 path
https://android-review.googlesource.com/c/platform/system/core/+/1324649
2021-10-25 20:54:19 -07:00
4b307cad2c Random minor changes 2021-10-23 22:20:07 -07:00
7496d51580 Make zygiskd ABI aware 2021-10-23 14:38:30 -07:00
8d0dc37ec0 Use SO_PEERSEC to get client secontext 2021-10-19 23:46:38 -07:00
fe41df87bb pthread_cond_signal might wake multiple threads
Close #4759
2021-10-19 21:32:37 -07:00
e184eb4a23 Fix UB of loading modules
- The lambda here infers its return type as `std::string`,
  and since `info` is `const`, the labmda copies `info.name`
  and returns a `std::string&&`. After captured by the
  `std::string_view`, the `std::string&&` return value
  deconstructs and makes `std::string_view` refers to a
  dangling pointer.
2021-10-17 04:38:56 -07:00
6f54c57647 Allow fork in thread pool 2021-10-17 04:24:25 -07:00
b75ec09998 Load Zygisk modules even if no magic mount is needed
Close #4767
2021-10-14 01:35:29 -07:00
c8ac6c07b0 Load Zygisk modules 2021-10-13 04:52:02 -07:00
f59309a445 Minor changes 2021-10-09 11:36:01 -07:00
36765caedc Fix thread pool implementation
Close #4759
2021-10-08 23:28:14 -07:00
ecd332c573 Close fd 2021-09-25 12:07:52 -07:00
73d36fdff0 Riru and its modules are not compatible with zygisk 2021-09-23 23:54:46 -07:00
d20517483e Prevent multiple mounts of devpts 2021-09-23 02:40:24 -07:00
61783ffc82 Prevent original libselinux.so to be unmounted
libselinux.so will be unmounted when magiskd starts. If magiskd restarts (like it died before boot completed), the files we want to unmount is the original files because the modified files is unmounted in previous start, which will causes many crashes due to missing libselinux.so.
2021-09-22 19:34:44 -07:00
f7c0e407ca Fix downgrade database 2021-09-20 05:50:34 -07:00
f1b6c9f4aa Refresh uid_map on package.xml change 2021-09-20 04:42:06 -07:00
0ab31ab0df Fix log writer 2021-09-19 13:41:45 -07:00
3fb72a4d20 Support polling on multiple fds 2021-09-18 14:40:12 -07:00
db590091b3 Propagate Zygisk state to Magisk app 2021-09-18 02:38:53 -07:00
7b25e74418 Simplify get manager app info logic 2021-09-17 02:07:32 -07:00
706a492218 Update denylist config implementation 2021-09-16 05:27:34 -07:00
c0be5383de Support enable/disable Zygisk 2021-09-15 02:49:54 -07:00
3b8ce85092 Enable Zygisk 2021-09-15 01:59:43 -07:00
65b0ea792e MagiskHide is no more 2021-09-12 12:40:34 -07:00
de2306bd12 Proper incremental builds
Auto generate flag.h for precise rebuilding
2021-09-07 19:35:28 -07:00
c0a2e3674c Reset file context from adb_data_file
In some cases (like weird ROMs that allow init to relabel context from system_file), module files will have an incorrent context, which will causes module not working properly.
See https://github.com/RikkaApps/Riru/wiki/Explanation-about-incorrect-SELinux-rules-from-third-party-ROMs-cause-Riru-not-working
2021-09-02 21:55:08 -07:00
f324252681 Use isolated devpts if kernel support
kernel version >= 4.7 or CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
2021-08-29 02:45:49 -07:00
6fe9b69aad Cleanup module.cpp 2021-08-28 10:27:45 -07:00
5d162f81c4 Modernize db.hpp 2021-08-27 01:06:03 -07:00
4771c2810b Significantly better AVD support 2021-08-26 03:09:56 -07:00
0cd99712fa Implement cached thread pool 2021-08-24 02:39:54 -07:00
b591af7803 Minor bug fixes 2021-08-22 03:26:48 -07:00
171d68ca72 Connect to magiskd log daemon 2021-08-22 03:26:48 -07:00
bade4f2c6a Make xhook log as Magisk 2021-08-22 03:26:48 -07:00
ffe47300a1 Update recv/send fd function 2021-08-22 03:26:48 -07:00