-
Install Android Development Kit on your machine (
androidsdk
on nixos). -
Root your OnePlus.
-
Plug your phone into your machine.
-
Open
adb shell
. -
Mount
/system
as read-write,% mount -o remount,rw /system
-
Exit
adb shell
-
Create a file called
hosts
on your machine. -
Add entries of IP address to hostname in that
hosts
file e.g.127.0.0.1 localhost ::1 ip6-localhost
-
Add an entry specifically for
open.oneplus.net
to give this hostname a new address. For example, set the address ofopen.oneplus.net
to the phone itself, so that the network traffic goes nowhere127.0.0.1 open.oneplus.net
-
Copy this file to your phone somehow e.g. using
rsync
or however you copy files to your phone. -
Using
adb
copy this file to the correct place on your phone with this command% cp /path/to/hosts /system/etc
-
Close everything.
-
Unplug everything.
-
Enjoy freedom.
I set the address of open.oneplus.net
to a different location. If you get a terminal to the phone and type cat /system/etc/hosts
, you should see output similar to this: