Update:
Solved.
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.
Code:
adb shell
su
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:good::good::good:
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 update.zip
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/fbe_bypass.sh /sbin/launch_daemonsu.sh /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?
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.
https://www.androidfilehost.com/?fid=745849072291699627
I know how to root with magisk and enable camera2api module. (by flashing patched_boot.img) but then , phone wont update, it shows up error. Is there a way to have google camera working and OTA enabled? many thanks
djavo22 said:
I know how to root with magisk and enable camera2api module. (by flashing patched_boot.img) but then , phone wont update, it shows up error. Is there a way to have google camera working and OTA enabled? many thanks
Click to expand...
Click to collapse
No you temporarily have to flash stock boot, do the update, flash patched boot image and enable camera2api again
If you wish to install root just to enable camera2 api, do it via adb shell.
Then uninstall magisk, flash stock boot on partition a, check the camera2 api is it still enabled, it should be.
Do not change any other setting to the system or system files, just enable camera2 api via adb shell, and after root is gone, when you uninstall it, the OTA will work.
Mine is working, I updated last OTA with no problems, so I'm talking in first hand here.
O yeah, and mine camera2 api stayed enabled after OTA update.
minnuss said:
If you wish to install root just to enable camera2 api, do it via adb shell.
Then uninstall magisk, flash stock boot on partition a, check the camera2 api is it still enabled, it should be.
Do not change any other setting to the system or system files, just enable camera2 api via adb shell, and after root is gone, when you uninstall it, the OTA will work.
Mine is working, I updated last OTA with no problems, so I'm talking in first hand here.
O yeah, and mine camera2 api stayed enabled after OTA update.
Click to expand...
Click to collapse
Did you relock bootloder or get the ota with unlock bootloader?
minnuss said:
If you wish to install root just to enable camera2 api, do it via adb shell.
Then uninstall magisk, flash stock boot on partition a, check the camera2 api is it still enabled, it should be.
Do not change any other setting to the system or system files, just enable camera2 api via adb shell, and after root is gone, when you uninstall it, the OTA will work.
Mine is working, I updated last OTA with no problems, so I'm talking in first hand here.
O yeah, and mine camera2 api stayed enabled after OTA update.
Click to expand...
Click to collapse
can you please post further instructions step by step?
ki69 said:
Did you relock bootloder or get the ota with unlock bootloader?
Click to expand...
Click to collapse
Not needed.
minnuss said:
If you wish to install root just to enable camera2 api, do it via adb shell.
Then uninstall magisk, flash stock boot on partition a, check the camera2 api is it still enabled, it should be.
Do not change any other setting to the system or system files, just enable camera2 api via adb shell, and after root is gone, when you uninstall it, the OTA will work.
Mine is working, I updated last OTA with no problems, so I'm talking in first hand here.
O yeah, and mine camera2 api stayed enabled after OTA update.
Click to expand...
Click to collapse
Bro can u shw us step by step process !!
Sid.Boi said:
Bro can u shw us step by step process !!
Click to expand...
Click to collapse
X2
Sid.Boi said:
Bro can u shw us step by step process !!
Click to expand...
Click to collapse
Follow what he said, it's not hard and all the information can be found easily.
Can any of you that have enabled Cam2API tell us, does it make a difference in the OEM Cam app? I know it allows a GCam port to work, which is awesome, but any difference in OEM app?
thnx
You can all do it if you are still in software version 9.6.10.0 (Android One August update), or if you knew how to root your phone on the version that you have right now.
Go to this tool, https://forum.xda-developers.com/mi-a2/how-to/mi-a2-toolkit-unlock-bootloader-root-t3834585
Then follow this steps.
https://forum.xda-developers.com/showpost.php?p=77611720&postcount=51
I edited this quote for all of you for better understanding.
"Then I tried to use number 7. enable camera2 api, and the problem is that it did not install root correctly, when phone reboots, the user must download full magisk, then the proper root will function.
After enabling camera2 api, which i did manually with adb shell, it will pop up on screen to allow access with root privileges.
adb shell
su
When you enter su, it will pop up on phone screen to allow access with root privileges, allow it for one time, if it is not pop upping on the phone for root, then the root on the phone is not properly installed.
And then type
setprop persist.camera.HAL3.enabled 1
After that, complete uninstall of magisk from option within magisk itself, and when magisk reboot the phone in the process of uninstalling, quickly hold power and down volume button, go to fastboot and flash on both partitions stock boot.img.
Put the stock boot.img of the version of the phone you currently have to adb folder.
fastboot flash boot_a boot.img
fastboot flash boot_b boot.img
Check is the camera2 api enabled after the restart.
That was the correct steps for me."
For me I used MagiskHide props config module to enable camera2
you don't need to fully uninstall magisk to receive otas, just restore images from magisk, receive the update and then install magisk to the inactive slot and use the reboot option in magisk (don't reboot normally)
Does anybody know if the Video is also improved when using Gcam apk?
I can't find any online samples.
Nebrassy said:
For me I used MagiskHide props config module to enable camera2
you don't need to fully uninstall magisk to receive otas, just restore images from magisk, receive the update and then install magisk to the inactive slot and use the reboot option in magisk (don't reboot normally)
Click to expand...
Click to collapse
Can You Please Tell Me The Proper Proceedure. .
I Don't want my phone bricked.
I'm in august patch and having magisk installed with some system changes.
---------- Post added at 09:24 AM ---------- Previous post was at 09:21 AM ----------
Nebrassy said:
For me I used MagiskHide props config module to enable camera2
you don't need to fully uninstall magisk to receive otas, just restore images from magisk, receive the update and then install magisk to the inactive slot and use the reboot option in magisk (don't reboot normally)
Click to expand...
Click to collapse
Can U Please Tell The Steps Broadly?
rafihasan710 said:
Can You Please Tell Me The Proper Proceedure. .
I Don't want my phone bricked.
I'm in august patch and having magisk installed with some system changes.
---------- Post added at 09:24 AM ---------- Previous post was at 09:21 AM ----------
Can U Please Tell The Steps Broadly?
Click to expand...
Click to collapse
If you only used magisk modules and didn't touch /system, just follow the instructions here
https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md
If you made any modifications to /system or just mounted it writable, you need to re flash the system image
Get the august fastboot image, unpack and flash system.img to your current slot, then follow the guide i linked
And don't worry you won't brick it, the update will just fail if you did anything wrong
Nebrassy said:
If you only used magisk modules and didn't touch /system, just follow the instructions here
https://github.com/topjohnwu/Magisk/blob/master/docs/tips.md
If you made any modifications to /system or just mounted it writable, you need to re flash the system image
Get the august fastboot image, unpack and flash system.img to your current slot, then follow the guide i linked
And don't worry you won't brick it, the update will just fail if you did anything wrong
Click to expand...
Click to collapse
Thank You For The Instruction..
I've modified the system like camera2api and some magisk module....
If i flash the system.img what will change?
And how to do that?
How to flash system.img in current slot?
rafihasan710 said:
Thank You For The Instruction..
I've modified the system like camera2api and some magisk module....
If i flash the system.img what will change?
And how to do that?
How to flash system.img in current slot?
Click to expand...
Click to collapse
That restores the system to stock without modifications
Alternatively, you can just download the latest fastboot image and just flash the whole thing so you won't need to update after that
If you want to just flash system.img and then let your phone update, download the image I linked, extract it, open the images folder, it has system.img
open cmd/terminal, type fastboot getvar current-slot
if the current slot is a, then fastboot flash system_a <path to system.img>
like fastboot flash system_a D:\images\system.img
if the slot is b then use system_b
If you decide to just download the latest image instead, use miflash, instructions are on miui website, just be careful not to wipe data or lock the bootloader (it does that by default)
Nebrassy said:
That restores the system to stock without modifications
Alternatively, you can just download the latest fastboot image and just flash the whole thing so you won't need to update after that
If you want to just flash system.img and then let your phone update, download the image I linked, extract it, open the images folder, it has system.img
open cmd/terminal, type fastboot getvar current-slot
if the current slot is a, then fastboot flash system_a <path to system.img>
like fastboot flash system_a D:\images\system.img
if the slot is b then use system_b
If you decide to just download the latest image instead, use miflash, instructions are on miui website, just be careful not to wipe data or lock the bootloader (it does that by default)
Click to expand...
Click to collapse
Thanks.....
Can You Give The Download Link Of August System.img file.
Jeez what a nightmare... I'm not able to flash the system image at all, fastboot keeps giving random errors on both linux and windows.
rafihasan710 said:
Thanks.....
Can You Give The Download Link Of August System.img file.
Click to expand...
Click to collapse
extract from this
http://bigota.d.miui.com/V9.6.10.0....0.ODIMIFE_20180731.0000.00_8.1_2aeda83301.tgz
[UPDATE/KEEP ROOT GUIDE] OCT 2020 (RP1A.201005.004) "FLAME" Magisk/Stock Boot Images
IF YOU ARE STILL ON AUGUST (ANDROID 10/Q) BUILD, PLEASE FOLLOW THE SEPTEMBER GUIDE (click here) FIRST! AND READ ALL WARNINGS AND ADDITIONAL INFO IN FIRST 2 POSTS!
PLEASE NOTE: I STILL HAVE NOT UPDATED TO ANDROID 11 YET, SO PLEASE FLASH AT YOUR OWN RISK AS ASSISTANCE FROM ME WILL BE VERY LIMITED. PLEASE BE KIND TO ONE ANOTHER AND HELP EACH OTHER OUT!
PLEASE DROP A THANKS IF YOU STILL FIND THESE GUIDES HELPFUL! :good:
IMPORTANT!! THESE FILES / THIS THREAD IS FOR PIXEL 4 "FLAME" ONLY, NOT PIXEL 4 XL "CORAL"!!
**IT IS HIGHLY RECOMMENDED TO PATCH THE STOCK BOOT IMAGE YOURSELF, FROM YOUR OWN DEVICE, USING MAGISK MANAGER. WHILE THERE'S A GOOD CHANCE THE FILE I PROVIDED BELOW WILL BE IDENTICAL (USE A FILE HASH CHECKSUM TOOL IF YOU'RE CURIOUS), THERE IS ALSO A CHANCE THEY MAY HAVE SMALL, BUT SIGNIFICANT, VARIANCES**
Thanks for the info and link, @wrongway213
Link to @topjohnwu's post: https://twitter.com/topjohnwu/status/1272136975022084097?s=19
ALL FILES BELOW ARE FOR "RP1A.201005.004, Oct 2020"!
Magisk Canary v21.0 Patched Boot Image: https://www.androidfilehost.com/?fid=10763459528675562385
Factory Untouched Boot Image: https://www.androidfilehost.com/?fid=10763459528675562112
Factory Untouched DTBO Image: https://www.androidfilehost.com/?fid=10763459528675562113
[SAFETYNET INFO]: Again, I'm not updating myself yet, so I'm not sure about this. I will update this info as others report back. On Android 10, using the MagiskHide Props Config module (or an alternate module created by Displax, though I prefer Didgeridoohan's module) and choosing option 2 - Force BASIC key attestation would force BASIC HW attestation and allow SafetyNet to pass again. This works perfectly for me, and I even run additional mods including EdXposed. I'm not sure if this works on Android 11, and I won't be able to confirm myself for a while. If anybody tries it, please let me know and I'll update this section. The module and info on using it can be found here: https://forum.xda-developers.com/ap...just search for it in the Magisk Manager app.
EASY UPDATE / SEAMLESS KEEP-ROOT UPDATE PROCESS (using a PC - a very intuitive, effective, and relatively safe method).
** You can only follow this guide verbatim if coming EXACTLY from build "11.0.0 (RP1A.200720.009, Sep 2020)". But the general idea is the same for other builds, you just need the correct files for your device.
flame-rp1a.200720.009-factory-dtbo.img: https://www.androidfilehost.com/?fid=10763459528675562111
flame-rp1a.200720.009-factory-boot.img: https://www.androidfilehost.com/?fid=10763459528675562110
September 2020 sideload OTA zip: https://dl.google.com/dl/android/aosp/flame-ota-rp1a.201005.004-9e17c7b4.zip
DO NOT BOOT BACK INTO O/S UNTIL ALL STEPS ARE COMPLETED - THIS ENSURES EVERYTHING BOOTS BACK UP WITH MAGISK / EDXPOSED ALL RUNNING PROPERLY RIGHT AWAY
1. boot into bootloader
----------------
** I was on custom kernel, so I needed to flash BOTH the stock boot and dtbo images
2. fastboot flash boot flame-rp1a.200720.009-factory-boot.img
3. fastboot flash dtbo flame-rp1a.200720.009-factory-dtbo.img
......* these steps to restore stock recovery; dtbo.img also necessary for some kernel installations.
......* won't hurt to flash both anyway, so if you're unsure, go ahead and do both.
-----------------
4. use volume keys to change selection to boot to Recovery Mode
......- when you reach the android symbol with No Command, hold power button, tap volume up, in case you've forgotten
5. choose option "Apply update from ADB"
6. adb sideload flame-ota-rp1a.201005.004-9e17c7b4.zip
7. Once the OTA sideload is done, Reboot to bootloader (you'll also notice it's now on the other slot after OTA flashed)
8. fastboot flash boot flame-rp1a.201005.004-magisk_patched-21.0.img
9. done, start the phone
(Optional - Flash custom kernel. If you had a custom kernel, you need to re-flash it)
This is a 100% seamless update that requires no additional / re-setup of any of my Magisk or EdXposed setups. All of the factory files can be found here https://developers.google.com/android/images. boot.img and dtbo.img are in their corresponding full Factory Image zips, and the ota zip is under Full OTA Images.
-------------------
Issues after updating?
If you end up unable to boot or bootlooping afterwards, you most likely have an old Magisk module that isn't playing nice with the new build. There are 2 main things you can do:
1. Flash the new factory untouched boot image. You will of course lose root, and all modules will be disabled. However, it should at least get you able to boot back up quickly and have a working phone if you're in a bind.
2. I would recommend checking Tulsadiver's thread: https://forum.xda-developers.com/pixel-4/how-to/magisk-modules-disabler-booting-magisk-t3991739
Instead of reverting to stock boot image, fastboot boot (NOT FLASH) Tulsadiver's boot image. This will boot your phone in Magisk Core-Only Mode, with all modules disabled but root retained. From here you can open Magisk Manager and disable suspect modules. Before rebooting, go to Magisk Manager's settings and disable Magisk Core-Only Mode. Once you disable the incompatible module, the phone should boot back up.
- See this post (or thread) for more tips / context / an example: https://forum.xda-developers.com/showpost.php?p=82509691&postcount=16
just want to report happily that i waas able to update to october with no problems using your guide. followed your september guide yesterday and then october today. no problems at all, buttery smooth mate! thanx..!
The instructions are great as a reminder,
I only work on the console every month or two and without the bullet points I wouldn't always be able to finish the update so quickly.
Thank you very much ?
So.. I've rooted and taken OTA's and rerooted dozens of times.. But I finally got around to factory resetting now stable is here. On OCT build, i flash the patched boot img and upon rebooting, Magisk shows I'm still not rooted. Any advice?
Update: Flashed canary debug apk. patched stock boot img, and flashed. now rooted. wierd
What about if I'm not rooted and on the October update for Android 11? I've tried a couple different times to root and I always get a fail when I try to flash the patched boot image.
Hey,
here is a quick guide:
=== you need these websites ===
https://developers.google.com/android/images
https://developers.google.com/android/ota
https://github.com/topjohnwu/magisk_files/tree/canary
step by step
1. download https://github.com/topjohnwu/magisk_files/archive/canary.zip
that's Magisk
2. copy app-debug.apk on your Pixel 4 (XL) and install the app
3. Open an Image (NOT OTA!) with 7-zip, there is another big zip-file inside, extract boot.img and dtbo.img
4. Copy boot.img on your Phone, download-folder, just like Magisk.apk
5. Open Magisk and Patch boot.img -> magisk-patched.img
6. Copy magisk-patched.img on your PC
7. now simply proceed as described in the instructions above.
Nothing can go wrong with these self-patched files
i5lee8bit said:
8. fastboot flash boot flame-rp1a.201005.004-magisk_patched-21.0.img
Click to expand...
Click to collapse
Hey guys, novice rooter here:
Can someone explain this step to me? Where do I get this file from if im on the beta version of Magisk?
Fwaiiiz said:
Hey guys, novice rooter here:
Can someone explain this step to me? Where do I get this file from if im on the beta version of Magisk?
Click to expand...
Click to collapse
load canary magisk apk: https://github.com/topjohnwu/magisk_files/blob/canary/app-debug.apk and install, then update magisk in the app
go to: https://developers.google.com/android/images
read
and download factory image for your pixel phone - 11.0.0 (RP1A.201105.002, Nov 2020) is last image for flame https://dl.google.com/dl/android/aosp/flame-rp1a.201105.002-factory-351561c6.zip
unzip the image, and you get another zip file: image-flame-rp1a.201105.002.zip
unzip image-flame-rp1a.201105.002.zip and you get a file named boot.img
copy boot image to your phone
patch boot image with magisk - you have made the magisk patch yourself ? now copy the magisk-patched.img from your phone to your pc, that's the file you ask for, but for the November Update
I hope you can now Update all you want