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:
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 ...
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 ...
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 ...
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 ...
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
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 ...
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
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
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'...
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 ...
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 ...
@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 ...
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.
There is a long list of Ethernet related questions but none has a comprehensive answer covering all aspects. I'm generalizing your question in order to share my knowledge on this.
This is what you need to do in order to make Ethernet work on Android:
Make sure OTG support is available
Kernel must be built with Ethernet (and USB Ethernet) support
Handle USB ...
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 ...
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 ...
I managed to make it work. Here is an "OSI-like" diagram of my setup, if it makes sense:
____________________ ______________________________ ____________
| LinuxVM <----+ | | | | |
| VirtualBox | | | | | |
| Windows7(host) | | | +--> AndroidPhone <--...
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:
mount -o rw,remount /system
mv hostapd inactive_hostapd
mount -o ro,remount /system
Reboot your phone and you'...
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 ...
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 ...
You can try using ip command.
How it compares to ifconfig
To set up an IP address you can use:
ip address add 192.168.0.77 dev eth0
or the long form
ip addr add 192.168.0.77/24 broadcast 192.168.0.255 dev eth0
look up current config using
ip addr show
I would like to map uid=neo(1000)->root(0) and guid=neo(1000)->sdcard_r(1028) where neo:neo is the user on the server and root:sdcard_r is the user on the phone.
Files ownership root:sdcard_r (0:1028) on Android won't work for apps. It should be root:everybody (0:9997) with mode 0770 for directories and 0660 for files.
HOW TO MAKE NFS WORK WITH ANDROID ...