[Android Software/Hacking General [Developers Only]] PiggyFlooper:
These are JustArchi's adblock methods. And his superb haveged- it's adjustable- more battery friendly. I started a project in hopes of helping people with dnsmasq n tethering issues, especially when using CrossBreeder.

Ultimately, the goal here is to be able to use dnsmasq with CrossBreeder or Archidroid dnsmasq and shut it down when tethering starts, instead of manually stopping it and rebooting- which is a super convenient working feature available in AD (Archidroid) Roms. I posted this in my current device's forum. It's working on multiple android versions. I'm wanting help in furthering capabilities and compatibilities and want to get this more attention. Perhaps it isn't proper to post something like this in dev section (I've seen a lot worse) :)

This can be used with or without CrossBreeder. The flashable zip will sense whether or not CB (CrossBreeder) is present, and adjust install accordingly. Some of CrossBreeder's features such as governor and IO tweaks are kept in whichever version you use. If you have trouble with archidroid haveged (such as hovering low entropy), there's a version with CB haveged only. Make sure you don't have sysctl or other script that adjusts write wakeup threshold.

Frandom enforcer is another feature, if your kernel supports it.

When starting IO tweaks, fstrim will also be ran, if your busybox doesn't have it, it's included in CrossBreeder folder.

Edit-

All credit to JustArchi on this, I'm just a bum that has modified a few things. JustArchi's adblocking works effectively and efficiently on devices that it was designed for, it may not work on your device.

THESE ARE WIP's

I welcome any comments, criticisms, help

[ 4.4x kk only ]

In an attempt to offer furthered chance of compatibility, I've put together several versions

THESE FOUR ARE FOR 4.4x kk ONLY

1. full time CB haveged with older JA Adblock ( for those having trouble with JA haveged) https://db.tt/4q1gjb5P

The following have full time JA haveged

2. Older JA Adblock with dnsproxy2

https://db.tt/BiQJ1cCq

3. Newer JA Adblock(don't intermingle with CrossBreeder, not ready yet)- https://db.tt/Ea6eyGlP edit- this one now includes tether monitoring, controlled in CB app

4. A last resort mix https://db.tt/3B7NmIor

Edit ( Apr 6, 2015 )

I highly suggest using these next versions first. It has tether monitoring built in. This is what disables dnsmasq when tethering is started.

It needs some work on your part to function-

The way it works is that it will watch a particular directory to have a file created it in- you need to specify this directory as ADCRON= in /system/xbin/ARCHIDROID_CRON. When the file is sensed, CrossBreeder or JA adblock will shutdown. Then it watches for that file to be deleted (Tethering stopped ). Then Adblock is turned back on.

For me, when using WiFi Tether app, enabling it creates a file ( dnsmasq.leases ) in /data/data/com.googlecode.android.wifi.tether/var. IMPORTANT: If there are any other files in the directory you specify to watch, those other files need to be excluded by @ nameOFfile in ARCHIDROID_CRON. So in my case, there's also a file named tether.log in the /var directory. So It's excluded with @ tether.log ( there's no space in between there ). Do that with any other files in watched directory.

Edit: 7-10-2015

4.0x-4.2x: https://db.tt/ny2VONZZ

4.4x w/ JA haveged: https://db.tt/BiQJ1cCq

4.4x w/ CB haveged: https://db.tt/SQPQRbyI

To help you understand what's going on, many things are logged to /data/*.log and /data/media/0/ArchiDroid/*.log

this is link to CrossBreeder thread- http://xdaforums.com/showthread.php?t=2113150

this is link to my ZCrossBreeder for 4.4.x if you'd like to switch from CB to AD use this version- https://db.tt/UB2hV9TW

And if you'd rather use archidroid_haveged with straight up CB then flash this- https://db.tt/KflO1dIj

DNS 'monitor' logging is added in this at / system/media/0/ArchiDroid/DNS.log

I'll update other versions of CB with this soon

and this is link to AD ROM thread with very helpful section on 'know your Archidroid' in post #4 I believe- http://xdaforums.com/showthread.php?t=2354859

There is a switch in CB app to toggle between AD and CB modes when using in conjunction with CrossBreeder, if you also want to switch back and forth. It will reboot your device. Be careful with that switch.

7-10-15: I've added many many tweaks-for governor, IO, network, swap(if kernel supports), sysctl, and more, enjoy!