33

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


29

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


27

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


26

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) NetGuard ...


22

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


14

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


13

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


13

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


12

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


11

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


11

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. R̲e̲qu̲i̲r̲e̲m̲e̲n̲t̲s̲: Linux machine USB cable familiarity with basic commands For Nexus 5 ...


10

In most cases you won't be able to make inbound connection when using Mobile Data because of CGNAT and firewalls at ISP level, as explained by acejavelin in comment. To know the problem in detail and how it can be worked around see How to connect to Android through SSH over 3G/4G public IP? However if you can reach your phone from internet, extending this ...


9

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 Alternatives are: 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 ...


8

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, ...


7

just type netcfg it will lists the interface, and work on any terminal emulator. running on the phone itself, or remotely via adb.


7

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


7

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'...


7

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: getprop net.hostname Your phone will then answer with its hostname.


7

A way to dynamically get the PID of the dhcp process, and kill it altogether, would be to run: su var=$(ps | grep dhcp) kill $(echo -n $var | cut -d " " -f 0) Specifically: 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 ...


7

If you have rooted phone, go for nethogs (for live monitoring) or iptables (to get statistics) commandline tools. Using VPN or Android stats based apps is the only possible non-root solution. Or refer to this answer for a logcat/dumpsys based solution. First of all, tracking a UID or PID of a network stream isn't straight forward because these aren't ...


7

@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 ...


6

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 Unzip it Run the command ...


6

There are some really cool apps that can do it without rooting. Here are two examples: LostNet Firewall Free: (Click image to enlarge) Mobiwol: NoRoot Firewall (Click image to enlarge)


5

I know this is an old post, but thought I would provide an update. It appears some manufacturers and versions of Android now DO allow for the changing of the IP subnet range for the DHCP server through the UI when using WiFi hotspot feature. Here's where to find it on an HTC One M8 running Android 6.0. YMMV. From the Mobile Hotspot screen, click the 3 ...


5

It's simple to share Android files to Windows PC. Install ES File Explorer in Android device. Go to Tools and select Remote Manager then you can see turn on. Press on it. And you will get an address like ftp://192.168.1.24:3721/ enter it on your PC file explorer and you can access to your Android phone from PC. You can change settings of remote manager to ...


5

I managed to make it work. Here is an "OSI-like" diagram of my setup, if it makes sense: ____________________ ______________________________ ____________ | LinuxVM <----+ | | | | | | VirtualBox | | | | | | | Windows7(host) | | | +--> AndroidPhone <--...


5

I managed to solve this without deleting hostapd file (with this method you can easily reactivate hotspot functionality renaming hostapd back to its original name). Root your phone Open up adb connection Enter these commands: su cd system cd bin mount -o rw,remount /system mv hostapd inactive_hostapd mount -o ro,remount /system Reboot your phone and you'...


5

We recently encountered this issue, and we narrowed it to occurring ONLY on devices running Android v5 and newer. Android v4 and all other OS's have no issue. With that tidbit, we determined that Android v5 and newer insists on using IPv6 for DNS name resolution. (Since we've completely disabled IPv6 on our network, this jibes with the issue.) If Android ...


5

I don't think there is a technical difficulty in gathering such information. Lack of such apps is likely because of lack of demand. For an average user, it is not the time that is important but the data used while on a plan or roaming and hence an abundance of such apps I am not aware if the information you seek can be pulled from Android OS requiring ...


Only top voted, non community-wiki answers of a minimum length are eligible