Block a device from connecting to a specifix router There is an ISP in my town that connects to my phone all the time, but it wants to sign in to be used. It is not my ISP so that all I get is my Wi-Fi blocked. 

There are many spots from the same ISP in town, because a couple of ISP give their customer a router with two Wi-Fi outputs, one private, normal, and another one open for their customers use with their site password wherever they exist. One of them (not my ISP) sticks to the devices, so I get blocked in many areas. 

I have tried to change autojoin=1 to autojoin=0 on /data/misc/wifi/wpa_supplicant.conf, but that didn't do anything. This file also mentions another one, ctrl_interface=/data/misc/wifi/sockets. Will that control I need be here?

I am almost sure there will be a way to disallow a device from connecting to a specific Wi-Fi, but I don't know how. Maybe somebody can help me and teach me how, please.
If you go into Settings and choose the option to Reset Network Data, this will erase the phone's memory of ever connecting to the many millions of these open wifi hotspots that are around. Then just go into Wifi settings and toggle the switch to "disabled" on the option that says "Automatically connect to high quality public networks" and you'll be good to go. I personally do this and it seems to yield results.

OR

If you have root access you can try the following:


Install Termux from Play Store (not some other terminal emulator, must be Termux)
Type apt update &amp;&amp; apt upgrade -y &amp;&amp; apt install nano tsu -y
Become root via tsu
Turn off Wi-Fi
Now you'll be editing a file, which will require the use of arrow keys, theres another app called Hacker Keyboard that has arrow keys you can use. This file may be called something else on older versions of Android, so YMMV.
Type nano /data/misc/wifi/WifiConfigStore.xml
The file contains history of all previously connected Wifi networks. The XML is structured by , so you'll need to scroll through and find the network you don't want your phone connecting to anymore. It will be preceded by a  tag, and will also contain several other  inside of it; just continue scrolling until you find the VERY next occurrence of , signifying the entire configuration for the unwanted network.
Erase the unwanted network configuration by deleting everything from  to , ensuring that you are only removing the configuration for specifically unwanted network.
Now just do a Ctrl+O, [Enter], Ctrl+X to save, confirm, then exit the file.
Type chown $(whoami) /data/misc/wifi/WifiConfigStore.xml to change the owner to root
Type chmod 640 /data/misc/wifi/WifiConfigStore.xml to allow the group member (System) to still have read access to be able to retain normal functionality, but disallow write access to be able to re-write the unwanted wifi configuration back into WifiConfigStore.xml. 


Please note that this will mean you can no longer save any additional wifi networks to be automatically connected, and your device will only remember the networks that you left in the file before running steps 10 &amp; 11. If you ever want to revert the changes and re-allow typical access to the file just undo steps 10 &amp; 11 via the following:


Open adb shell or Termux again
Gain root via su (if adb shell), or tsu (if Termux)
Type chown system /data/misc/wifi/WifiConfigStore.xml
Type chmod 600 /data/misc/wifi/WifiConfigStore.xml


Cheers