yashsingh1/xdaforums huggingface dataset:
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
No, we have to decrypt. Meaning Format Data in TWRP and flashing something that changes the fstab in the kernel from fileencryptioninline to Encryptable. That removes encryption. Magisk should do that by default.

Check if you can see the contents of internal memory in TWRP (/sdcard or /data). If it can't, you probably have no /data/magisk.img. And it might have installed Magisk to /system.

I played it safe and pre-decrypted my boot image, I will actually check if Magisk does change it. I do know that it changes "forceencrypt", but fileencryptioninline is a Huawei special.

Try downloading Root beer checker from the playstore and see what it finds. It shouldn't find su if it's systemless.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
just checked, i can´t see in twrp /sdcard ...

but i can see /data ... but then i can´t see /data/app for example

But if i go with root explorer ... i can find /data/magisk.img

root beer checker? ... do you mean the root checker app?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Woops, RootBeer Sample
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
ok :victory:

here some screenies
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Ya, you are encrypted. You should see regular things in /sdcard. So you'll have to Format Data in TWRP. I'm concerned though that it still lets you boot. That probably means it Magisk doesn't decrypt when you flash it. I'll check.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
here is the beer :D
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
c636b172
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
here you go ... thats why magisk isnt working ... you need to be at least on B180 (The Kernel source has to be from April or younger)
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
did you get the file?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
No need anymore, I need to rebuild 'magiskboot'... It doesn't change fileencryptioninline, as I suspected.

It only changes forceencrypt and forcefdeorfbe to encryptable.

But I'm not sure if this will actually solve your problem.

The thing is, we have file encryption, and you've successfully installed Magisk to an encrypted partition. So that file, magisk.img, is not touched when Android decrypts and encrypts.

That's probably why your root seems to work, other than Magisk Hide.

Unless you did some modifications to build.prop or anything else?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
i got it :D

The issue is, KernelLogging isnt working! And Hide needs this!

So i activated Logging in the hidden menu *#*#2846579#*#*

To be sure i encreased the logging buffer size in developer settings to 4mb

voila ... kernel logging starts and Hide is working ... just i dont do a reboot with hide enabled cause of the fingerprint
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Nice :)

I will still fix the encryption part though xD
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
sounds good :) ... will wait for it!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Updated to b180 but the phone still reboots when flashing magisk v12 in twrp
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Tkkg1994:
TWRP 3.1.0-1

Changelog TWRP 3.1.0-1

- Added loop support for magisk

- Updated tree to latest 7.1.2 android

- cleaned up github/device tree

- updated kernel to B182

- Added LON devices to supported list

Since most recent kernel can actually handle magisk I thought will do an update myself so you have it here officially, have fun guys!

Download 3.1.0-1
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Finally installed magisk v12 by updating the twrp to 3.1.0-1

Now the SafetyNet fails just like you before. I increased the buffer to 4mb in developer option and enabled logging in hidden menu under "1. background setting" > "3. LOG settings" > checked all 3 boxes "AP log", "charge log", "sleep log" But still no luck even i rebooted.

---------- Post added at 04:31 AM ---------- Previous post was at 04:30 AM ----------

THANKS A LOT from my heart.

Finally installed Magisk

---------- Post added at 05:04 AM ---------- Previous post was at 04:31 AM ----------

Passed the safetynet check finally.

The phone now hangs after reboot, cant go into the phone but not bootloop. Maybe because I setup PIN for my phone. Any solution guys?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Just found that the Magisk Hide must be disabled before turning off the phone. Otherwise the phone cannot go into the system. It has a blank screen after u entered the PIN.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Did you flash back stock boot image before flashing?

Magisk Hide disables fingerprint and stock lockscreen pin for some reason. I'm using Floatify which replaces the stock lockscreen so I get in with pin. I've even tried setting up a new fingerprint but I guess the service isn't even running.

Your only solution is to flash a pre-decrypted boot image. Magisk currently can't change our fstab from fileencryptioninline to encrypted, but I've pushed a commit to Magisk github so it should be there in future releases.

That is if you actually were decrypted.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] loka520:
I can flash magisk at SHIELD-Rom V1.1??
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
I think i didnt flash the stock boot image before flashing.

What i did was unlocked bootloader, installed twrp, upgraded to c636b180, then unlock bootloader again, installed twrp, flashed public.zip, hw.zip, and magisk.zip
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Then it should work. Can you check in TWRPs file manager if you can see /data/magisk.img?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Sylphia:
That's great we've got magisk support!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Yes. I see the magisk.img

Now i am not able to set pin, password, not even the pattern lock
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Disable Magisk Hide and reboot.

Magisk Hide works until you reboot, then fingerprint/pin breaks. So just enable it when you need it and disable if you need to reboot.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] st_voss:
S.H.I.E.L.D.-Rom V1.1 ist based on MHA-L29C432B182 so that is recent enough for Magisk.

S.H.I.E.L.D.-Rom V1.1 is pre-rooted but Magisk will try to remove this pre-installed Superuser and install its own Magisksu.

In theory that combination should work but who knows.

Just give it a try and report back!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Thanks for your help. Set the pin after reboot.

Hope magisk can be fixed asap, so the magisk hide doesnt hv to be turned off even for reboot.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Magisk v12 with decryption https://mega.nz/#!U4FRSAwQ!JUk81I-_DYBwa85ajPkYzDNww8tgHuMtdVuWFmBRl60

You must Format Data with this one, unless you're already decrypted. If you try to boot an encrypted /data and kernel isn't decrypting you will bootloop.

And April 2017 kernel only (B182+).

Changes from original Magisk v12:

Added 'fileencryptioninline' in magiskboot.

MagiskHide + reboot still breaks fingerprint/pin (pin works if you use Floatify lockscreen)
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
can i flash this over my setting i have at the moment? Or do i have to start from zero?

Have magisk v13 normal running now!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
You will have to Format Data. But it doesn't matter. Nothing will change except the ability to keep data decrypted :P

That and data backup in TWRP.

So you'd have to start fresh (Format Data wipes /data, and since yore encrypted you can't back up first)
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] MultiCulti:
Ok, thx for the fast answer! :D

So, i´ll wait to the nex update and will do it then!

I´ll anyway try to download Kangvip from chinese forum, cause no custom is to found somewhere else for the LON -.- ... but till now i don´t get it :rolleyes: ... why they just can´t use afh xD
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] calchung:
Does magisk v13 solve the pin/password problem when reboots with magisk hide?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] st_voss:
So if the original Magisk is installed the 'fileencryptioninline' remains in the fstab entry for /data?

And does that means that /data gets encrypted when the device is booted?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Yes. Fileencryptioninline seems to be something Huawei made. It's supposed to be just fileencryption, and Magisk looks for forceencrypt, forcefdeorfbe or fileencryption. Same with SuperSU. Only difference there is that SuperSU has no source available so it can't be changed. And sadly 2.79 won't install anyway with our new loop support and twrp 3.1.0, supolicy fails to apply changes to the kernel.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Sylphia:
Just updated firmware version B213, flash this magisk zip in twrp, but it says Unable to unpack boot image ...
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Might be something different with the AL00 kernels. Could you send me your boot image? Dump in twrp and pm it to me.

Downloaded firmware instead.

Does TWRP give any other errors?

Could you flash zip, then go to Advanced - Copy Log to sd.

And send log to me.

Edit: just tested by flashing the B213 kernel, then flashing magisk. Installs just fine, so it's not the boot image...

Make sure you have TWRP 3.1.0

Send TWRP log anyway.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Sylphia:
file magiskboot
magiskboot: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked (uses shared libs), BuildID[sha1]=dceb8112431e7c22dd31fba05aa6ecd3ae80ad37, stripped

Only magiskboot was a 32-bit image, all other files were 64-bit

Recompiled magisk and replaced magiskboot with new one, flash with success.

But I didn't quite understand the difference between official Magisk v12 and your fork, I had to wipe data to make all things work,
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Official doesn't remove fileencryptioninline from our fstab, mine does.

Unless you just pulled and compiled then you're not using v12. Commits from April 2nd are v12.

I don't get why only that one is 32-bit, and why it works for me :eek:
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Tkkg1994:
Did you do a pull request on topjohns github?

I'm sure he will apply it when he sees that it's helpful!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Yup, a week ago. It's still pending. But I know v13 will come eventually, so it probably will be added when that comes. Tried a nightly some days ago but it wouldn't even flash.

And getting v12 back took some detective work... It's not tagged as v12, so can't pull it directly. Had to go by commits and change the submodules commits too, then found it at April 2nd. After April 2nd all binaries (all but magiskboot) are packed in a single file (named 'magisk' ) rather than stand alone.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] Sylphia:
I pulled sources from your fork, and checked out your patch branch, then compiled. I just not quite understand "format data with yours", format data means disable encryption right? I directly flashed the zip on first try with no formatting, booted into system after a factory reset, but many function were not working, even factory reset in settings menu. Then I formatted data and flash again, it worked, but not passing safetynet check, cts profile match false.

I wonder if there's a way that I can do OTA after install magisk ...
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Oh, that's probably why. I never meant to fork it. I only changed one thing in magiskboot, as seen in the patch. But I guess it interferes with newer commits. My zip is from April 2nd sources of Magisk, as I couldn't get the newer ones to even flash. So I had to go back on submodules too as those have been updated as well.

It would've been easier if it had a tag for v12, but latest is 11.6.

As for the change I made; by default /data is encrypted with Android 7s File-encryption, which Huawei named fileencryptioninline in our kernels fstab, dunno why they added inline. And Magisk can't remove that as it only looks for 'forceencrypt' and 'forcefdeorfbe'. But to actually remove encryption you have to Format Data in TWRP. If you just flash Magisk, or anything else that removes 'fileencryptioninline', but not Format Data you will bootloop/things will break as you're booting without decrypting /data.

OTA should work fine. Magisk doesnt change anything but /data. You would only need to flash back stock recovery. However, there's a catch!

Bootloader gets locked when you flash a stock firmware. So to unlock it again you get that mandatory wipe... So it doesn't matter if you flash OTA or use Firmware finder or the Force Update thread, you still need to wipe if you want to be rooted/have twrp.

For SafetyNet you need to enable MagiskHide, but currently it interferes with something so Fingerprint/pin stops working after a reboot. If you don't use a stock lockscreen pin should still work. Only way to get them back is to disable MagiskHide.

Actually: Just saw V.12 has a tag, but it didn't a week ago.

And now learned the git command 'git submodule update --recursive', that makes stuff a lot easier xD

Anyway, I guess you meant magiskboot turned out 32-bit when you compiled my fork?

I'm not sure why that happens. It shouldn't as I never changed anything in the fork.

And the magiskboot in my zip turns out to be 64-bit.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] htcdesire-hd:
Hi all!

I update from MHA-L09C43bB156 to B182 and had to re-root my phone.

I tried to use the SuperSU 2.79 file and rooting was succesfully, but i don't have real root access. The SuperSU prompt exist but no App is able to do root operations (like Fingerprint Scanner Tools or Titanium Backup).

So i tried to install magisk (modified version ended with boot image error), which endet up with error 1 (none modified) and it says that i have to flash SuperSU and i did that.

Magisk Manager says i do have Magsik installed and the device is rooted, but it has the same behavior as described above!

What can I do to have real root like before?

Data is encrypted...

Thank you for your help!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] ante0:
Flash back your stock boot image in twrp.

Format Data, flash magisk or SuperSU.

/data re-encrypts when you update, as it boots with stock kernel which encrypts data on first boot.

I'm not sure if B182+ breaks something with SuperSU, as more people had that problem with no su...

Edit: Use this one, https://mega.nz/#!U4FRSAwQ!JUk81I-_DYBwa85ajPkYzDNww8tgHuMtdVuWFmBRl60

It removes encryption in fstab so you need to Format Data in TWRP. If you want to stay encrypted you can flash the official Magisk v12 zip (but no /data backup for you :P)

The one in my earlier post had a malfunctioning binary (Sorry [MENTION=2846568]Sylphia[/MENTION]).

Edit 2: Regular SuperSU won't flash either, it cant apply sepolicy modifications to the kernel.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] htcdesire-hd:
Thank you very much for your help!

I will try the steps mentioned by you. Where can i download the not regular SuperSU? :D

Staying encrypted does not make sense for me :P
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] duraaraa:
He is asking if it's possible to root WITHOUT unlocking BL. There is no exploit to attain root right now, so it's not possible.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] oF2pks:
http://m.huawei.com/enmobile/consumer/support/downloads/index.htm

search for mate (and wait...)

I just download mate 8 to have a look and 2015-12-01 6.0 looks "full".

Remember that mate9 is announced on first 4.1 kernel ever!

If you bring us twrp/multirom I'll buy it next day!
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] 5[Strogino]:
Bro, if you did not find exploit, so it is not "impossible" situation :)

I told, that there are too few owners, to say "impossible". We need look widely, to other Huawei's models.

And now (at this moment only) i agreed with you: owner should unlock bootloader to get root.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] duraaraa:
Perhaps I use the word 'impossible' incorrectly, but the point is, there is no solution to do this right now. I'm not looking for an exploit, because I think it's not so hard to unlock BL.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
Ehm? They get root easy flash phh su

---------- Post added at 04:39 PM ---------- Previous post was at 04:35 PM ----------

True. We could used similar exploit to dirty cow but uh enforcing block it ?

What u need this for if it's for m?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] oF2pks:
They probably proceed like last year: "full" kernel will be out by mid ~20 January; it's still interesting to check 8mm' "quality" if you hope for 9n . Also the consumer/download link will be the same.

You need these when you look which phone to buy ?

Thx to OP, twrp is best step to heaven.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
Eh wouldn't that be breaking the GPL? They shouldn't remove old source code . . ?

also what's wrong with aroma?
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
If anyone can upload stock recovery and stock N boot ill try fix mtp
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] syeanwoo:
Thanks a lot! I flashed the recovery, and rooted my MHA-AL00, but I have to use "adb reboot recovery" command while my PC and phone connected instead of pressing VolUp+VolDown+Power buttons to launch TWRP, and even I launched it, it couldn't backup the Data partion, and report 255-error.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] opasha:
In order to reboot to TWRP recovery, the OP's instructions aren't correct (at least for the Mate 9, Nexus 6P, and P8Max in my experience - sorry [MENTION=5899304]Tkkg1994[/MENTION] :angel:). Do the following to reboot into TWRP:

1) USB cable must not be plugged in.

2) Make sure phone is off, then hold POWER + VOLUME UP until you see TWRP SCREEN (while holding, you'll see the Huawei boot symbol followed by the bootloader unlocked boot screen in orange letters...keep holding during these until you see TWRP screen, then let go of the buttons).

I'm not sure why you couldn't back that up, but try doing it again without the usb cable being plugged in. Also, make sure to go to Mount and make sure "Data" is selected in there and press back to go back to the main screen.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] petchgoodguy:
Did anyone enable root with permissive option. How to do that?

My application required root with permissive.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] syeanwoo:
Thanks! Rebooting to TWRP is OK!

Thanks! Reboot to TWRP successfully by holding POWER+VolUP.

But I still can't backup the Data partition, even though I mounted it. The TWRP reports "creatTarFork() process ended with ERROR: 255".
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] opasha:
You are most welcome. You'll have to wait on [MENTION=5899304]Tkkg1994[/MENTION], [MENTION=4572798]duraaraa[/MENTION], or some of the other intelligent guys in this thread. I'm not 100% sure why that is happening. Sorry :(.

EDIT: quick google search led me here: http://xdaforums.com/nexus-6/help/e-createtarfork-process-error255-t3302462/page2

Do this: adb pull /tmp/recovery.log c:/recovery.log

Another guy said to "disable compression" on page 3: http://xdaforums.com/nexus-6/help/e-createtarfork-process-error255-t3302462/page3 (this seems like the universal solution)

EDIT 2: Based on what [MENTION=4435346]LastStandingDroid[/MENTION] (thanks for the info) said below, disregard the above solution. Just another waiting game with Nougat :(.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] oF2pks:
Maybe because mate9' data & cache are f2fs
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
No its due to encryption. This Twrp version and the others released for N atm can't decrypt the storage. There for it gives that error.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
Also tkgg sent me files I need to help you with MTP ill fix it later today and ill be needing a tester for it you can reply here or pm me. But it'll be a test version this evening.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
If someone is willing to try https://mega.nz/#!jk5jHIrZ!3d3iYKjBI7R1vr7GDMwykvt_IhZSXpnrYObG9So59QU

Modified init.rc added missing files in sbin revoked init.recovery.usb.rc

Uses stock boot image uses stock sepolicy file. Please report back. I've done this trough phone so I can have missed something
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] hackslash:
Well, everyone here is thankful to your efforts but it is better to tell what you actually did so that it helps a greater audience who are seeking to build TWRP.

Anyways, I'll think of a more universal solution, like why use Huawei binaries when you can directly modify the source. It is difficult but it opens up support for many devices which uses the new 'configfs' thing. I have something in mind
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
Yes but I will write down it later I need to get info if it works or not.

---------- Post added at 07:54 PM ---------- Previous post was at 07:08 PM ----------

Ok so here's what I did.

In a few easy steps I guess

Download winmerge (or any diff tool)

unpack recovery.img and diff default.prop and and merge check if your sys.usb.controller= matches the one in recovery (for Honor 8 it didn't because it didn't exist before)

if you have /dev/block/dm-0 in /etc/twrp.fstab & recovery.fstab replace it with /dev/block/platform/******/by-name if you're unsure check your fstab.hi****.rc for userdata path

you can add the other lines above BOOTIMAGE_BUILD_PROPERTIES however this shouldn't be needed.

Now open init.rc and check on fs delete the lines related to usb and add the lines from stock recovery in my case

M recovery

on fs
mount pstore pstore /sys/fs/pstore

mkdir /dev/usb-ffs 0770 shell shell
mkdir /dev/usb-ffs/adb 0770 shell shell
mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000

on fs with on fs && property:sys.usb.configfs=0 and add the following lines below which is something like

# mkdir /dev/usb-ffs 0770 shell shell
# mkdir /dev/usb-ffs/adb 0770 shell shell
# mount functionfs adb /dev/usb-ffs/adb uid=2000,gid=2000
mount pstore pstore /sys/fs/pstore
write /sys/class/android_usb/android0/enable 0
write /sys/class/android_usb/android0/idVendor 18D1
write /sys/class/android_usb/android0/idProduct D001
# write /sys/class/android_usb/android0/f_ffs/aliases adb
write /sys/class/android_usb/android0/functions adb
write /sys/class/android_usb/android0/iManufacturer ${ro.product.manufacturer}
write /sys/class/android_usb/android0/iProduct ${ro.product.model}
write /sys/class/android_usb/android0/iSerial ${ro.serialno}

copy libcutils.so from recovery to twrp since if you don't twrp will auto unmount data after some seconds ...

from boot

Decompile boot

Copy Kernel+Sepolicy from from boot

Open init.usb.rc and copy ALL Lines from init.usb.rc to init.recovery.usb.rc

navigate to sbin and copy all files from boot > twrp sbin but DO NOT REPLACE ANYTHING

*Optional* replace all files in /system/bin from recovery > twrp

replace all files in /system/lib64

replace files in sbin except recovery, teecd and voldisnotd makes twrp work without issues for now.
[Huawei Mate 9 ROMs, Kernels, Recoveries, & Other D] :
[MENTION=6435663]hackslash[/MENTION] updated the post

No one is willing to test the recovery image?

It should be able to format your internal storage as well so it can be used in twrp.