Magisk/native/jni/core
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
..
applet_stub.cpp Fix compilation of single applets 2020-06-19 02:45:57 -07:00
applets.cpp Small native code reorganization 2020-03-09 01:50:30 -07:00
bootstages.cpp Significantly broaden sepolicy.rule compatibility 2020-11-02 23:20:38 -08:00
daemon.cpp Update --remove-modules implementation 2020-10-11 18:30:03 -07:00
db.cpp Add com.android.i18n to apex path 2020-10-12 01:59:41 -07:00
magisk.cpp Add new --install-module command 2020-09-26 16:50:41 -07:00
module.cpp Minor renames 2020-10-25 21:41:14 -07:00
restorecon.cpp Update Android 11 emulator support 2020-07-27 03:33:11 -07:00
scripting.cpp Add new --install-module command 2020-09-26 16:50:41 -07:00
socket.cpp Use FIFO for su request communication 2020-09-10 00:38:29 -07:00