Magisk/native/jni/init
topjohnwu 16e4c67992 Significantly broaden sepolicy.rule compatibility
Previously, Magisk uses persist or cache for storing modules' custom
sepolicy rules. In this commit, we significantly broaden its
compatibility and also prevent mounting errors.

The persist partition is non-standard and also critical for Snapdragon
devices, so we prefer not to use it by default.

We will go through the following logic to find the best suitable
non-volatile, writable location to store and load sepolicy.rule files:

Unencrypted data -> FBE data unencrypted dir -> cache -> metadata -> persist

This should cover almost all possible cases: very old devices have
cache partitions; newer devices will use FBE; latest devices will use
metadata FBE (which guarantees a metadata parition); and finally,
all Snapdragon devices have the persist partition (as a last resort).

Fix #3179
2020-11-02 23:20:38 -08:00
..
getinfo.cpp Fix coding errors and minor changes 2020-10-28 04:17:34 -07:00
init.cpp magiskinit code tidy-up 2020-10-26 20:46:15 -07:00
init.hpp Significantly broaden sepolicy.rule compatibility 2020-11-02 23:20:38 -08:00
magiskrc.inc Increase post-fs-data mode to 40 secs 2020-05-18 04:56:51 -07:00
mount.cpp Significantly broaden sepolicy.rule compatibility 2020-11-02 23:20:38 -08:00
raw_data.cpp magiskinit code tidy-up 2020-10-26 20:46:15 -07:00
raw_data.hpp magiskinit code tidy-up 2020-10-26 20:46:15 -07:00
rootdir.cpp Significantly broaden sepolicy.rule compatibility 2020-11-02 23:20:38 -08:00
twostage.cpp Support androidboot.fstab_suffix cmdline flag 2020-10-08 03:04:12 -07:00