Remove All Ads from XDA

[Solved]Patching sepolicy issues? On Honor Emui8.0 (Oreo8)

51 posts
Thanks Meter: 8
By dawnc, Member on 8th January 2018, 02:53 PM
Post Reply Email Thread

EMUI8 using split sepolicy, there isn't sepolicy in ramdisk.img, you get get sepolicy from vendor.img /etc/selinux/precompiled_sepolicy and rename it to sepolicy.

when patching sepolicy using supolicy, add --sdk=26 or it won't work.
adb shell
supolicy --file /sdcard/sepolicy/sepolicy /sdcard/sepolicy/sepolicy_out --sdk=26
My model is Honor V10(EMUI8.0 with Oreo8.0)

Since there is not a custom recovery , so i have to make a boot.img with supersu inside to root.
But I came up with two problems:
1. i found no article about how to patch init manually, so i have to get the init from mate 10's root boot.img, but i'd like to learn how to patch the init manually
2. i patch the sepolicy , but it seems not work
the stock vendor.img/etc/selinux/precompiled_sepolicy is here
my patched sepolicy is here.

I will describe all my detail modifications below, please someone point out where i did wrong. Thanks thanks a lot

This is my stock boot.img, i get it from the official full-ota update files
This is my modified boot.img

All i modified is listed below:
1. Unzip the
2. Unpack it with Huawei Update Extrator
3. Extract ramdisk.img, vendor.img, recovery_ramdis.img
4. Unpack ramdisk with bootimg.exe
5. replace init
6. copy res/.su dir
7. copy /sbin/ /sbin/ /sbin/tar
All the files above i get from @mankindtw 's mate 10 's root boot.img)
8. patch sepolicy which i get from vendor.img /etc/selinux/precompiled_sepolicy and recovery_ramdis.img
on a rooted phone (supersu 2.82 sr5) and patch sepolicy follow this guide
9. rename the patched sepolicy to sepolicy and put into initrd(this is bootimg.exe's unpack dir)
10. modify the cpiolist.txt file, add the added dirs and files
11. repack the bootimg with a name boot-root-b122.img
12. fastboot flash ramdisk boot-root-b122.img

But it does not work, i can't get root.
I've tried to replace other's sepolicy , and it can get root right, but have some other issues( Looking at the screen, it will keep turning on does not work)

So anybody can point what should i do ?
How to patch the stock sepolicy right?
How to patch init manually?
Is there any other mistakes i've taken?
10th January 2018, 08:06 AM |#2  
Blackball's Avatar
Senior Member
Thanks Meter: 1,608
Donate to Me
You can take a look at this boot image. Its taken from a KangVip P10 Oreo Rom. He patch his kernel too for rooting.
Maybe it helps.
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes