Remove All Ads from XDA
Find Your Device:
Or Continue to Thread: [MOD][Xposed][4.3+] hosts Enab…
30th August 2014, 10:21 PM |#1  
DavisNT's Avatar
OP Recognized Developer
Flag Riga
Thanks Meter: 557
Donate to Me
This mod allows to use /system/etc/hosts file on configurations/ROMs (mostly symlinked hosts file on Android 4.4+) where it is ignored.
Hosts file usually gets ignored on some ROMs due to SELinux restrictions if it is a symlink to file on different partition.

Technically it works by attaching to all packages/apps and hooking DNS resolution API. On first name resolution API call hosts file is read and stored in memory (in HPPC OpenHashMap structure).

Additional features of hosts file:
  • use of IP address allows to fail name resolution of associated hosts
  • use of DNS names instead of IP addresses (these DNS names are passed directly to DNS resolver - they are not looked up in hosts file recursively)

Known limitations:
  • JNI libraries are not affected (some applications may still ignore hosts file)
  • hosts file is read in memory of each application when it makes first DNS query (time and memory used depends on size of hosts file; time is logged in logcat with tag "hostsEnabler")

hosts Enabler uses HPPC: High Performance Primitive Collections for Java library which is distributed under Apache License 2.0.

This mod requires Xposed framework to be set up and hosts Enabler enabled as Xposed module.
Disclaimer: I am not responsible for anything that may happen as a result of using this mod.

Xposed Module Repository page:

For changelog see next post, for download links see downloads section.

XDA:DevDB Information
hosts Enabler, Xposed for all devices (see above for details)

Xposed Package Name:

Version Information
Status: Stable
Current Stable Version: 1.0
Stable Release Date: 2014-08-30

Created 2014-08-30
Last Updated 2014-08-31
The Following 3 Users Say Thank You to DavisNT For This Useful Post: [ View ]