[Google Pixel 2 XL Guides, News, & Discussion] awesomeo3000:
***PIXEL 2XL

ONLY

!!!*** ***PIXEL 2XL

ONLY

!!!*** ***PIXEL 2XL

ONLY

!!!***

Confirmed this works with Android O and P!

UPDATE 3/17/2020: Now confirmed this works with Android Q, but with slight modification!

It took me many hours to piece together the various forums and articles, but these instructions will have you up and running in 30 mins max!

*Below instructions assume brand new phone out of the box, everything stock.

1. Download adb and fastboot on your computer. You don't need the whole SDK and don't need to install anything; Google now provides them in a simple zip file. Get it here for Windows, Linux, Mac. If you're using a Mac, all you have to do is open Terminal, cd into the directory where you unzipped the files, and type ./adb [command] from there. EX: If you downloaded the zip file into your Downloads folder, and extracted the zip also in your Downloads, you'd type the following on a Mac:

cd ~/downloads/extractedfoldername

./adb version

with your phone plugged in via USB to the computer to test adb works. Make sure to enable developer mode on your phone, and also enable USB Debugging. NOTE: For all below references to adb and fastboot, make sure to include the "./" before the command from the extracted directory. EX: "./adb" and "./fastboot"

2. Unlock bootloader. Follow the directions provided here in the "Unlock the bootloader of the Pixel 2 / Pixel 2 XL" section. (Don't waste your time reading the rest of those instructions, since that will confuse you and they don't work anyways.) I did unlock_critical at first, but the bootloader still said it was locked. Then I did "flashing unlock" and that unlocked the bootloader. Make sure device status in fastboot on the phone says "unlocked." Reboot the phone.

3. Download the latest Magisk Manager from here to your computer. I used 5.6.4.

4. Type

./adb push <path_to_file> /sdcard/Download

5. On the phone, go to your Downloads app and install the Magisk Manager apk.

6. Open the manager. Click the Install button. It will ask if you want to "install Magisk-vXX.zip now". Click Install and then select Download Zip Only at the next prompt.

7. Download the TWRP image here to your computer. NOTE: You only need to download the IMG file! Don't need the zip file.

7.5 From your computer, run:

./adb reboot bootloader

8. From your computer, run:

./fastboot boot path/to/twrp.img

9. Once phone boots into TWRP, go to Install. Then go to the MagiskManager directory. In there, you should see the "Magisk-vXX.zip" file you downloaded in Step 6.

10. Now reboot your phone and open up the Magisk app. You should now see it says "Latest Version: vXX.X" and "Installed Version: vXX.x" with green check marks next to the items. Open the Magisk settings (3 bars on the top left) and you should see a bunch of options, one of them says #SuperUser. This means you now have root!!

11. To enable the tethering:

For Android 8 and 9:

./adb shell

su

**(grant permission if phone asks)**

mount -o rw,remount /system

echo "net.tethering.noprovisioning=true" >> /system/build.prop

Very important step! You must reboot for the changes to take effect.

reboot

For Android 10

It seems like you can no longer mount /system as rw. So it's a little more complicated. If you fully installed Magisk (not the way I did it above), then from Magisk Manager, go to Modules and download MagiskHide Props Config and busybox-ndk. Follow the instructions here to run the Props Config.

If you followed my rooting instructions above, running the Props Config won't work, but there is a workaround.

You could still use the module, but instead of using the props command and the terminal UI, you just use the configuration file to set everything up. Download the settings file, extract it from the module zip (in the /common folder) or copy it from the module directory under /data/adb (in the /common folder), add

net.tethering.noprovisioning=true

to the CONFPROPS variable, place it in the root of your internal storage (/sdcard) in /data or in /cache (or /data/cache if you're using an A/B device) and reboot.

Another option is to just use a simple boot script. Put the following in a file (doesn't matter what you name it) in /data/adb/service.d:

#!/system/bin/sh
resetprop net.tethering.noprovisioning true

Give it execution permission (chmod 755 is usually the goto) and then that prop will be set at each boot. If it doesn't seem to work, put the script in /data/adb/post-fs-data.d instead.

Very important step! You must reboot for the changes to take effect.

reboot

DONE!@##

Giant shoutout and thank you to @Didgeridoohan for helping me debug and figuring this out! You're a life saver.

References:

MagiskHide Props Config Documentation thread

MagiskHide Props Config README

Thread where Didgeridoohan explains the process and help me debug