• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

AdHell 2 - Rootless Ad Blocking

Status
Not open for further replies.
Search This thread

lahceneamine

Senior Member
Jul 8, 2011
651
267
Algiers
For those who are rooted and want Adhell 2, I found the solution (thanks to my girlfriend) :
You have to put KLMAgent in your system since in most of custom roms devs remove it.
- Uninstall any Adhell copy you may have.
- Put it in system/priv-app/KLMAgent/KLMAgent.apk (give the correct permissions)
- Reboot your phone.
- Follow ops instructions.
- When you click on activate, you should get a window (KLMS Agent terms and contract), accept them then you're ok to go ;)

PS: if it's forbidden to share then i'll remove it
 

Attachments

  • KLMSAgent.apk
    523.9 KB · Views: 68

TheAlmighty

Member
Sep 3, 2005
23
6
I cannot put URL's in the whitelist anymore. In earlier versions there was a button to switch between whitelist and blacklist, but now I can only blacklist an URL (switch button is not visible). Does anyone else has this problem? I'm using a Samsung galaxy Tab S2 9.7 WiFi (SM-810N, Nougat 7.0).
 

greyhulk

Senior Member
Jan 14, 2009
1,314
299
I had this installed on my new Note 8 (received yesterday) and started having problems right away. Apps wouldn't download, I had random reboots, and some apps wouldn't let me log in and no ads were being blocked in the browser.

I loved Adhell on my GS8+. The persistent notification you have on the lock screen and notification shade with VPN adblockers is super annoying. Not sure I would have pulled the trigger on my new Note if I had known about this Adhell drama. Why in the world would Samsung be against a dev utilizing a feature of Knox? It's the ONE time Knox has ever been useful to me.

Anyway, I hope someone finds a solution for the Note 8. I'm using Block This right now and dealing with the extra notification spam.
 

Shadow12347

Senior Member
Oct 26, 2011
79
19
I had this installed on my new Note 8 (received yesterday) and started having problems right away. Apps wouldn't download, I had random reboots, and some apps wouldn't let me log in and no ads were being blocked in the browser.

I loved Adhell on my GS8+. The persistent notification you have on the lock screen and notification shade with VPN adblockers is super annoying. Not sure I would have pulled the trigger on my new Note if I had known about this Adhell drama. Why in the world would Samsung be against a dev utilizing a feature of Knox? It's the ONE time Knox has ever been useful to me.

Anyway, I hope someone finds a solution for the Note 8. I'm using Block This right now and dealing with the extra notification spam.

I can confirm these issues on the Note 8. I am not able to download Play Store apps, run the builtin Software Update, as well as a few other things. Disabling the adblocking for these specific apps did not restore functionality either. It only began working again after turning off adhell 2 and restarting the phone.

Edit: I have also tried changing the DNS to no avail.
 
Last edited:

JHATDROID

Member
Jul 8, 2011
22
4
Does anyone notice that under settings > edit blocked URL's > show custom providers that the number of blocked addresses is always 2718? It was 2718 in the original Adhell, too. The github page mentioned it used a script to pull from two sources for the host file generated, https://adaway.org/hosts.txt and some other source. Pretty sure the hosts.txt from adaway updates like, weekly on my N6P. Shouldn't that mean that we should have more than 2718 blocked for Adhell?

I don't want to add any custom sources and have all the addresses double up, someone was mentioning bigger hosts files slows performance...
 

haksancan

Senior Member
Jun 20, 2013
95
114
Does anyone notice that under settings > edit blocked URL's > show custom providers that the number of blocked addresses is always 2718? It was 2718 in the original Adhell, too. The github page mentioned it used a script to pull from two sources for the host file generated, https://adaway.org/hosts.txt and some other source. Pretty sure the hosts.txt from adaway updates like, weekly on my N6P. Shouldn't that mean that we should have more than 2718 blocked for Adhell?

I don't want to add any custom sources and have all the addresses double up, someone was mentioning bigger hosts files slows performance...

Don't worry about adding other sources because duplicate addresses are added only once
 
  • Like
Reactions: JHATDROID

knopper84

Senior Member
Feb 15, 2011
101
5
Clausthal
so can anyone tell whether it will work on an Galaxy A5 2017 (Nougat and Marshmallow)? Maybe the same dilemma there with newer KNOX-Version?

and second question, how does adhell exactly work? It doesn’t do anything with VPN right? But how then?

Could the KNOX-Framework also access the Android HOSTS-file where you normally need root-access? or how does it block the AD's?
 
Last edited:

moon2eth

Member
Sep 13, 2017
33
13
May I ask if the system changes made by Adhell 2 is persistent through a factory reset? I did not disable or uninstall the app before factory resetting.

Ever since installing Adhell 2 on my Note 8 I've gotten random reboots and severe network connectivity issues. I've reprovisioned the note 8 and factory reset the device through regular and download mode.

I don't want to point fingers so quickly because it might be an issue with network congestion, but it has been an entire day and apps like the playstore still occasionally fail to load. It takes several minutes to get the download started.
 

Dor71

Senior Member
Nov 29, 2014
1,470
523
Cluj Napoca
so can anyone tell whether it will work on an Galaxy A5 2017 (Nougat and Marshmallow)? Maybe the same dilemma there with newer KNOX-Version?

and second question, how does adhell exactly work? It doesn’t do anything with VPN right? But how then?

Could the KNOX-Framework also access the Android HOSTS-file where you normally need root-access? or how does it block the AD's?

Yes, Adhell2 works for me.I have A5 2017 Nougat.
 

FiendFyre

Senior Member
Jul 11, 2012
352
396
May I ask if the system changes made by Adhell 2 is persistent through a factory reset? I did not disable or uninstall the app before factory resetting.

Ever since installing Adhell 2 on my Note 8 I've gotten random reboots and severe network connectivity issues. I've reprovisioned the note 8 and factory reset the device through regular and download mode.

I don't want to point fingers so quickly because it might be an issue with network congestion, but it has been an entire day and apps like the playstore still occasionally fail to load. It takes several minutes to get the download started.

That should not be possible. If you really want to check, re-install the app and enable it, then disable it again, and see if it makes any difference. Someone else a page or two back said it went back to normal after disabling and rebooting.
 

moon2eth

Member
Sep 13, 2017
33
13
That should not be possible. If you really want to check, re-install the app and enable it, then disable it again, and see if it makes any difference. Someone else a page or two back said it went back to normal after disabling and rebooting.

I did that and it saids app cannot be found when I tried to disable it.

Perhaps the app messed with the Knox partition or something and changed a permanent setting in the rom. There's definitely something amiss since installing this app. I got this device less than 24 hours ago from FedEx.

I'm in the process of trying to flash a image via Odin but keeps running into mega transfer caps... urgh.
 

KOLIOSIS

Senior Member
I did that and it saids app cannot be found when I tried to disable it.

Perhaps the app messed with the Knox partition or something and changed a permanent setting in the rom. There's definitely something amiss since installing this app. I got this device less than 24 hours ago from FedEx.

I'm in the process of trying to flash a image via Odin but keeps running into mega transfer caps... urgh.

Issues with the Note 8 have been discussed,it's due to a different version of Knox,the app hasn't been updated yet to address those issues.
Go back about 20-30 posts or so,you'll see where others have mentioned similar issues w/their Note 8's ..................
 
  • Like
Reactions: jkxs

Bobthahog

Senior Member
I just downloaded adhell 2 and it worked perfect the first time. I had created a key for the theme killer for substratum. So I really appreciate this. I had no idea the original adhell had been taken off the Play Store and the issues surrounding it. Found out today and got rid of it. I'm on Galaxy S8 Plus.

Sent from my Sprint Samsung Galaxy S8+ using XDA Labs
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 223
    5aHYJta.png

    AdHell 2

    Code:
    *** Disclamer
    
    I first want to note that the original developer did not help me in any way with this, he did not provide me with the code (it was found from public forks from his Github), nor guidance on modifying the app. I do not want to cause him any further inconvenience or trouble with his job.
    I simply forked the code and made some minor changes, so majority credit goes to the original dev, but as he is now dissociated from the project any other developers (including some of the contributors from the first version) are welcome to help continue. I take no responsibility for any issues this app may cause with your device.

    Introduction
    Hi everyone, since Adhell was removed from the Play Store and the code was taken down from Github, I (not the original developer) got a copy of the publicly available code and made some changes to remove dependence on the original developer's server and removed the subscription on the new permissions feature. It was a very quick and dirty edit, but it was just to ensure the app still works once the original developer takes down everything related from his website, which the app relies on.
    The way this app works was to utilize Samsung's Knox framework which included a Firewall feature that allowed ads to be blocked. The additional features such package disabling and permission blocking were also done through Knox. In order to make a Knox compatible app, a license has to be used, and the only way to get one is from Samsung unfortunately. It is fairly easy to get a "development" key from Samsung which lasts for 1-3 months (I believe) and so I have modified the app to require each user to enter their own key. I know this is not ideal, but it will keep working like this, and it reduces threat of Samsung revoking the license and disabling the app entirely for everyone. If any developer wants to help me rework the app, please let me know, help is definitely appreciated, and my code is still open source and available on Github. I'm a broke college student with very little time to work on this, and am by no means a professional dev, so I apologize in advance for slow updates and probably little in the way of additional features. I will do my best to keep it working.

    Installation instructions
    So to procure your own "developer" license, you need to go to this link, and either register for a Samsung account or sign into your own, and then enroll as a developer. After that proceed to this link and generate a Knox Standard SDK Enterprise license key with a generic "key alias" (I recommend something like "testing", not something like "adhell", just in case). Copy over the key to your device somehow (email, Join, Pushbullet, etc.) as it is pretty long. When you open up the new Adhell 2 app, you will see a popup asking you to enable device admin access, enter a key, and then enable license, do the three steps in that order. If the key is not entered correctly, the license will not activate.

    Download
    This link will randomize the package name to stop Samsung from blocking the app. Every 2 minutes you can rebuild the app, but please only do this if the current version stop working.
    http://adhell.nobelium.xyz

    Changelog
    Code:
    Current changelog: -- 8/27/17
    [note] -- Made all features free
    [changed] -- Changed app to rely on user supplied Knox license

    If anyone wants to donate, it is very much appreciated, and here is a PayPal link - this will go towards funding my college tuition which is too damn expensive.
    The app will be free and I will not be re-enabling the subscription or making any features premium.

    XDA:DevDB Information
    AdHell 2, Device Specific App for the Samsung Galaxy S8

    Contributors
    FiendFyre, Raymonf
    Source Code: https://github.com/MilanParikh/Adhell2


    Version Information
    Status: Beta
    Current Beta Version: 2.2.0
    Beta Release Date: 2017-11-27

    Created 2017-08-27
    Last Updated 2017-11-27
    27
    Maybe you give simple instruction, for correctly build unique personal app on local user machine in Android SDK?

    Manually building a debug APK using Android Studio:
    1. **First installation only: Turn off and delete / uninstall AdHell.
    2. On your phone, enable USB Debugging in Settings --> Developer Options
    3. Open my GitHub page: https://github.com/mmotti/Adhell2
    4. On the right-hand size, select Clone or Download
    5. Choose Download ZIP
    6. Once the download has completed, extract the zip file
    7. Download and install Android Studio (https://developer.android.com/studio/index.html)
    8. Open Android Studio
    9. Select Open an existing Android Studio project
    10. Navigate to your extracted zip file
    11. Select Adhell2-master and press OK
    12. At this point you may need to install SDK / build tools. Follow the onscreen instructions to do so.
    13. Wait until Gradle Build Running finishes (visible at the bottom).
    14. On the left-hand side, select the Gradle Scripts drop down
    15. Double click Build.Gradle (Module:app)
    16. Locate: applicationId "com.fiendfyre.AdHell” and change the digits after AdHell to a random sequence (e.g. “com.fiendfyre.AdHell14342”)
    17. You will see an alert at the top stating that Gradle files have changed. Click Sync Now.
    18. Wait for the Gradle Build process to finish
    19. Connect your phone VIA USB
    20. Press the Play button (triangle) at the top right
    21. Your phone should be visible – Select it and press OK.
    You may need to press allow on your phone at some point, too!

    Adhell2 should then be installed and launched. Enable Admin and activate it as you normally would.

    ** Remember what you set as your applicationId. If you set your unique numbers the same each time, there will be no need to uninstall AdHell… It will simply install the newer APK over the old one.
    26
    Easy (temporary) fix for the recent adblocking issues with Adhell

    I hope this helps everyone who is experiencing the recently surfaced issue with Adhell ad blocking in Chrome. Read on if you have recently started seeing ads in Chrome, while Firefox and other apps are unaffected and blocked.

    The cause of the issue is Chrome itself (not Adhell). It appears that Chrome has a built-in DNS client. Under certain conditions related to the accessibility of certain Google servers, Chrome bypasses the OS DNS client and starts using its own asynchronous DNS client. Thus, even if we are pushing our own hosts file using one of Knox APIs, Chrome (and only Chrome) will retain the ability to resolve the ad servers IPs.

    The current (temporary) fix for that is as follows:

    1. Go to chrome://flags
    2. Search for "dns"
    3. Set the "Async DNS" option to "Disabled". Close tab.
    4. Go to chrome://net-internals
    5. Select the DNS tab, and tap on "Clear Cache"
    6. Restart Chrome

    Voila - Chrome will fall back to the OS DNS client, and ad blocking will be back to normal.

    This is a temporary fix, as undoubtedly our friends at Google will remove the async DNS flag eventually. After all, why even bother to build in a horrible, insecure feature like this other than to fight hosts-based ad blockers? The long-term fix would be to block any and all DNS queries (UDP or TCP port 53) made by Chrome app directly. It really should not be doing that.

    I am contemplating a complete switch to Firefox after this fiasco.
    18
    OK. I have used a script to build 50 unique AdHell2 APKs and then uploaded them to a free web host (excuse the weird domain name – their choice, not mine).

    http://mmotti.epizy.com/

    The page will provide you with a random download link for one of the 50 APKs.

    I could not think of a quicker or simpler solution. As each APK takes between one and two minutes to build and an eternity to upload on my 1Mbps upstream, 50 is as many as my patience will allow for now.

    OP had a good solution in place, but this is simply a temporary measure until he is able to resolve the site issues.

    Edit: Expect slow download speeds.
    16
    I have credited you in a comment on your files and in a comment to the specific commit. How do I also credit you correctly on github? Can't find any option to add contributors or collaborators.
    Thanks, man :)

    If I'm honest, I'm not sure. I'm relatively new to Github myself :silly:

    ---------- Post added at 06:36 PM ---------- Previous post was at 05:54 PM ----------


    Download Adhell 2

    100 unique APKs generated and uploaded to:

    mmotti.epizy.com

    giphy.gif