19/04/21:
There is currently a problem with magisk checking safetynet. When you check safetynet in magisk, you get a safetynet API error. Either use an alternative Safetynet app e.g. Safetynet Test or install the magisk canary app. I heard it was fixed there, but don't know for sure.
SafetyNet device compatibility test
play.google.com
I wrote this entire tutorial already in this Thread, but I think it should be separated, so everyone can find it easier:
https://forum.xda-developers.com/showpost.php?p=83736713&postcount=89
This Tutorial descripes 3 Points:
- Unlock Bootloader - which is necessary for root
- Get root via Magisk
- Valid Safetynet
Enable Developer mode in settings
- Open Settings App
- Move to About The Phone
- 7 Taps on the Build-Number
Enable OEM-Unlock in settings
- Go back to Main Menu of Settings
- move to system
- Unfold Extended
- Open Developer options
- Enable OEM-Unlock
If you go further, you should either have a clean phone or backup your data. Because if you unlock the bootloader, the entire phone will be wiped.
Reboot Phone in Fastboot
- Turn off Phone with long press on Power Button and click turn off
- Press Power Button + Lower Volume together for some seconds and you are in fastboot mode
Use Fastboot to unlock Phone
If you don't have it download at first the needed adb and fastboot files for your system:
https://developer.android.com/studio/releases/platform-tools
Extract it to a path where you want it.
- Connect your P5 with your PC with an USB cable
- Open the path where you have extracted the adb tools.
- On Windows press Shift + Right click and in the context menu click on open commandline Window
- If you enter the following console command you should see an listed device about it's serial number:
If you get an empty result, you have to check if P5 is correct connected via usb and p5 is in fastboot mode (you see it onscreen)
It could be that you have to install the usb drivers at first for recognizing it via fastboot.
If a Serial was listed in the Previous step, go further.
Enter the following command to start to unlocking your phone
On your Phone you see a message to "not unlock your phone", with volume up you switch it to "unlock your phone". With the Power Button you accept it.
It will reboot now and at this moment it wipes the entire phone, so you start again from scratch to configure the p5.
if you have a Pixel 5 without the KDDI Version, you can use the following boot image, which is already a prepatched boot image including magisk 21 (Build 21005).
Download it at first:
http://www.mediafire.com/file/8ll4mlzt3l9njph/magisk_patched+Build+21005.img/file
KDDI variant:
http://www.mediafire.com/file/widag4w5s02itq5/magisk_patched+KDDI.img/file
Copy the img-file to the path where you had extracted the adb files.
After you have configured your phone so you can use it, turn off p5 again and go again into fastboot mode.
Ensure your phone is connected via usb to the PC.
In the opened command line Window enter the following command:
Code:
fastboot flash boot "magisk_patched Build 21005.img"
For windows powershell Users check this out, if the above command failed:
After it finished you can reboot your phone into android system and you will see the magisk manager logo.
Open it and you should see magisk 21005 is installed, then you know root access is granted.
For Safetynet you have to do the following steps
- In Magisk Manager open settings gear.
- under Magisk enable MagiskHide
- Above MagiskHide is a menupoint called "Hide Magisk Manager", click on it, give the magisk manager a new name, click ok and wait until it's reopend.
- Go to main menu of the magisk manager. On bottom is a "shield icon" open it.
- Go to "MagiskHide"
- On Top is the item "Google Play Services" unfold it and set every hook on it.
- It's recommended to set the hook on every google Service you find.
- Go Back to main menu of magisk manager
- Download the latest universal safetynet fix for your P5:
Highlights Play Integrity bypass without breaking device checks or causing other issues Disabled use of hardware attestation on Pixel 7 and newer (@anirudhgupta109) Other changes Updated instruc...
github.com
Then in magisk manager under modules click on the "Install from memory" button and then select the zip file you just downloaded and magisk manager will then install the module.
- After finished installation reboot your P5. (1)
After reboot check safetynet state in Magisk Manger, it should be OK.
Now you have a rooted phone and a valid safetynet.