mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-12-02 22:11:52 +00:00
Misc QoL changes
- su: Preserve correct capacity to avoid vector reallocation - su: Properly format code - daemon: Remove useless `if` - docs: Remove outdated info
This commit is contained in:
@@ -90,11 +90,10 @@ DATABIN=$SECURE_DIR/magisk
|
||||
|
||||
`magiskinit` will replace `init` as the first program to run.
|
||||
|
||||
- Early mount required partitions. On legacy system-as-root devices, we switch root to system; on 2SI devices, we patch fstab and execute the original `init` to mount partitions for us.
|
||||
- Load sepolicy either from `/sepolicy`, precompiled sepolicy in vendor, or compile split sepolicy
|
||||
- Patch sepolicy rules and dump to `/sepolicy` or `/sbin/.se` or `/dev/.se`
|
||||
- Patch `init` or `libselinux.so` to force the system to load the patched policies
|
||||
- Early mount required partitions. On legacy system-as-root devices, we switch root to system; on 2SI devices, we patch the original `init` to redirect the 2nd stage init file to magiskinit and execute it to mount partitions for us.
|
||||
- Inject magisk services into `init.rc`
|
||||
- On devices using monolithic policy, load sepolicy from `/sepolicy`; otherwise we hijack nodes in selinuxfs with FIFO, set `LD_PRELOAD` to hook `security_load_policy` and assist hijacking on 2SI devices, and start a daemon to wait until init tries to load sepolicy.
|
||||
- Patch sepolicy rules. If we are using "hijack" method, load patched sepolicy into kernel, unblock init and exit daemon
|
||||
- Execute the original `init` to continue the boot process
|
||||
|
||||
### post-fs-data
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Magisk Tools
|
||||
|
||||
Magisk comes with a huge collections of tools for installation, daemons, and utilities for developers. This documentation covers the 3 binaries and all included applets. The binaries and applets are shown below:
|
||||
Magisk comes with a huge collections of tools for installation, daemons, and utilities for developers. This documentation covers the 4 binaries and all included applets. The binaries and applets are shown below:
|
||||
|
||||
```
|
||||
magiskboot /* binary */
|
||||
@@ -12,8 +12,6 @@ resetprop -> magisk
|
||||
su -> magisk
|
||||
```
|
||||
|
||||
Note: The Magisk zip you download only contains `magiskboot`, `magiskinit`, and `magiskinit64`. The binary `magisk` is compressed and embedded into `magiskinit(64)`. Push `magiskinit(64)` to your device and run `./magiskinit(64) -x magisk <path>` to extract `magisk` out of the binary.
|
||||
|
||||
### magiskboot
|
||||
|
||||
A tool to unpack / repack boot images, parse / patch / extract cpio, patch dtb, hex patch binaries, and compress / decompress files with multiple algorithms.
|
||||
|
||||
Reference in New Issue
Block a user