Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
  1. Install Android Development Kit on your machine (androidsdk on nixos).

  2. Root your OnePlus.

  3. Plug your phone into your machine.

  4. Open adb shell.

  5. Mount /system as read-write,

    % mount -o remount,rw /system

  6. Exit adb shell

  7. Create a file called hosts on your machine.

  8. Add entries of IP address to hostname in that hosts file e.g.

     127.0.0.1       localhost
     ::1             ip6-localhost
    
  9. Add an entry specifically for open.oneplus.net to give this hostname a new address. For example, set the address of open.oneplus.net to the phone itself, so that the network traffic goes nowhere

     127.0.0.1       open.oneplus.net
    
  10. Copy this file to your phone somehow e.g. using rsync or however you copy files to your phone.

  11. Using adb copy this file to the correct place on your phone with this command

    % cp /path/to/hosts /system/etc
    
  12. Close everything.

  13. Unplug everything.

  14. 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:

oneplus spy circumvention

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment