# Huawei

The implementation of the Huawei device kernel can only load SELinux rules once. Modify SELinux rules is required by Storage Isolation.

# Offical Magisk solution

Magisk has officially supported pre-init custom sepolicy patch.

What you need to do is simple:

  1. Install Magisk v20.2 or above
  2. Use Enhanced mode

# Our solution (outdated)

Unless you have problem using offical Magisk solution, DO NOT try this.

# Principle

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 sepolicy_custom.

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.

# Steps

Although it should not have problems, please be prepared to restore the original Magisk before use.

  1. If you are not using Magisk, please refer to Magisk Official Documentation to install Magisk
  2. Download Our Magisk (based on Magisk v19.4)
  3. Download Storage Isolation Rules Pack
  4. Install the above zips in Magisk Manager using "Modules" - "Install from storage"
  5. If you are an EdXposed user, you can also download and install the EdXposed Rules Pack
  6. The rule packs needs to be reinstalled after updating the system