It's simple. In the terminal (requires root), or in adb shell (does not require root), issue the command
settings put global captive_portal_detection_enabled 0
and reboot. It should be disabled. The existing state can also be verified via the command
settings get global captive_portal_detection_enabled
A response of "null" indicates the global key value ...
You won't be able to achieve success through the native mechanism of Android.
Cody Toombs at Android Police has very well pointed this out in the article: Android M Will Never Ask Users For Permission To Use The Internet, And That's Probably Okay.
In the section Normal and Dangerous Permissions of the document Permissions Overview, Google has noted:
Unfortunately, there is no way to change the IP address range for the builtin tethering support, even in CyanogenMod. The Wi-Fi hotspot IP is hardcoded in android.net.wifi.WifiStateMachine.startTethering(); the USB tethering IP is hardcoded in com.android.server.connectivity.Tethering.
However, if your phone is rooted, you can try using third-party apps for ...
You could use NetGuard (see my list of Internet Firewalls for other alternatives), which works without root and lets you block internet access for apps selectively (WiFi or mobile data, and even always or only if screen is off). It's from the dev of XPrivacy, so it has to be good ;)
NetGuard (source: Google Play; click images for larger variants)
The Android builtin wifi tethering is designed to use 192.168.43.1/24 as the server, with netd handling the tethering, using dnsmasq. First DNS range is 192.168.42.1-254 and and 2nd DNS range is 192.168.43.1-254.
Netd is not easy to change. It requires a socket to communicate with it, and that socket is taken when android starts tethering. But going through ...
At first, I thought this was most likely an instance of Android cloud to device messaging, but it can't be: WhatsApp doesn't declare the necessary permissions, and it works in Eclair (Android 2.1), while cloud to device messaging (and its replacement, Google Cloud Messaging) require at least Froyo (Android 2.2).
However, it is most likely some sort of push ...
OS Monitor lists network connections by app:
OS Monitor and Connection Tracker listing connections (source: Google Play; click image to enlarge)
As you can see, OS Monitor lists up all connections, and lists the corresponding app "owning" this connection along. This should enable you to see all servers your suspicious app connects to. There are other ...
ifconfig and ip Android 7
adb shell ifconfig
adb shell ip address show
ifconfig was an annoying implementation that did not show all versions by default on earlier versions as explained below, but now it works fine.
netcfg Android 5.1.1
This tool was removed in later Android, and ifconfig was made more decent and shows all interfaces by default, thus ...
In the Android M Developer Preview for Shamu (Nexus 6), and possibly other builds of this OS, the captive_portal_server global is used by the OS regardless of the state of captive_portal_detection_enabled in order to determine health of a WiFi network.
For WiFi networks, it will not only draw an exclamation mark on the strength icon, it will blacklist that ...
Configuring captive portal behaviour
captive_portal_detection_enabled (<= Android 7.1.1)
works as described in question body
captive_portal_mode (>= Android 7.1.2)
works as described in question body
Setting captive portal URL(s)
captive_portal_server (<= Android 6.0.1)
The server that holds a generate_204 page, used to internally craft a URL ...
According to Steve Kondik, this is essentially old code that is leftover from older versions of CyanogenMod:
This was only here for apps that were statically linked against uclibc in old CM versions. It can likely just be removed.
However, he also goes on to note:
Also, this file is NOT written when connecting to a network as /system is readonly. The ...
Any android device
Cyanogenmod provides you with an option to build your own Cyanogen-build and integrated kernel building. With this you can compile an compatible kernel for your phone with desirable features. Here's a post that walks you through the process.
familiarity with basic commands
For Nexus 5
I have been using Packet Capture app, which for me is simpler than setting-up "wireshark" on Android.
The app is free, doesn't require root access, but may request to install user certificate to decrypt SSL connection (it's using MITM technique, as mentioned on its app page; you don't need to install it if you don't want to know the content of SSL ...
The easiest way is using a tool like e.g. OS Monitor, which shows you (amongst others) also a lot of network details:
OS Monitor showing network interface details (source: Google Play; click image to enlarge)
As the screenshot shows, this app reveals for each network interface:
IPv4 IP address assigned (if 0.0.0.0, this interface is ...
If you have a working SSH server running on Android device, you can connect to it on local/private network without any issues (after proper authentication setup obviously). Same may hold true for public network (internet) if your phone has a true public IP address (I don't think that happens on earth). However, when you need to cross networks i.e. traversing ...
I am certainly sure that WhatsApp does NOT open any listening ports. most ISPs block incoming requests, that would not work.
WhatsApp has a service. Basically that means that technically you never quit WhatsApp. So, the way you receive messages while you're "not running" WhatsApp is the exact same way you receive them when you're running it.
The client, ...
A good application to do that is the Samba Filesharing. It shares your sdcard, making it easy to transfer files from/to your phone.
After installing the application from Google Play, open it and fill a password by touching the password menu. The default username is SDCARD and the default Workgroup is WORKGROUP. You can leave it that way or change it ...
On some devices which do support WiFi-Direct, the corresponding binaries come pre-installed (e.g. the wpa_cli command; see also How can I install wpa_cli on my rooted device?). If you have those ready, you can use them on your Android device as you would do on a Linux machine (find a closer description e.g. in the blog post How To : Use wpa_cli To Connect To ...
When the data indicator is orange (on Kit kat ; grey on older versions), this means that the device is unable to receive a response from GCM (Google Cloud Messaging, the framework that handles push notifications). This traffic is sent through ports 5228, 5229, and 5230. If the AP is blocking or interfering with traffic on those ports, push notifications won'...
There's a way to retrieve your device's hostname, but you'll have to meet one requirement, which is to have a Terminal Emulator installed on your device.
Once you have one, just open an instance of the emulator and issue the following command, followed by Enter:
Your phone will then answer with its hostname.
@res/xml/network_security_config means that the file containing the network security configuration is included as file into the APK. If you open the APK file using a ZIP tool you will find the file in the path /res/xml/network_security_config.xml.
If you use a decompiler like Jadx you can open the item /Resources/res/xml/network_security_config to see the ...
I know this is an even later answer, but it is worth mentioning it.
No rooting needed!
No app installation needed!* Which is not even possible if you do not have some other internet connection.
There is a project called gnirehtet.
Install adb on to the host PC (Windows/Linux/Mac)
Download the gnirehtet zip-file to the host
Run the command
As you might imagine, Google is pretty quiet with regard to its implementation details. So I'll just describe this in the general case and in a very basic form.
The way push is done is that the client (i.e. the phone) opens a TCP connection to the messaging server (e.g. Google). This connection is meant to remain open for as long as the phone is turned on. ...
Regardless whether you're connected to your local network via WiFi and DHCP is in use, Android always seems to override its DNS entries using Google's servers. It's somewhat hidden, but easy to change – provided you have your own DNS running (a lot of routers offer that already).
To do so, go to your list of WiFi networks in Settings, long-press your WiFi's ...
You cannot simply edit the hosts file on Android, as it resides on a read-only file system: /system/etc/hosts, see:
How to edit etc/hosts file
How to change the hosts file on android
use a DNS server like DNSMasq in your local network to take care for that "centrally"
use "root powers" to force-edit the system file as described above
A way to dynamically get the PID of the dhcp process, and kill it altogether, would be to run:
var=$(ps | grep dhcp)
kill $(echo -n $var | cut -d " " -f 0)
line 1 asks for root permissions;
line 2 assigns the output of ps (which lists the active processes), filtered by grep with the keyword dhcp, to the variable var;
line 3 calls kill to ...