# Huawei (Unable to dynamically modify SELinux rules)
The implementation of the Huawei device kernel can only load SELinux rules once. Modify SELinux rules is required by Storage Redirect.
# Offical Magisk solution
Magisk has officially supported pre-init custom sepolicy patch.
What you need to do is simple:
# Our solution (outdated)
Unless you have problem using offical Magisk solution, DO NOT try this.
In short, our solution does not add rules directly, but instead adds the logic to load
sepolicy_custom directly if there is a
sepolicy_custom file. The only remaining work is to generate
This part of the work has done by modified Magisk installation zip, we call it the rules pack. You can find the template at here. When multiple rules packs are installed, the rules pack installed later will be based on the results of the previous installation, avoiding the problems mentioned at the beginning.
Although it should not have problems, please be prepared to restore the original Magisk before use.
- If you are not using Magisk, please refer to Magisk Official Documentation to install Magisk
- Download Our Magisk
- Download Storage Redirect Rules Pack
- Install the above zips in Magisk Manager using "Modules" - "Install from storage"
- If you are an EdXposed user, you can also download and install the EdXposed Rules Pack
- The rule packs needs to be reinstalled after updating the system