Update

This is no longer a viable solution IMHO, and I've resorted to using Blokada instead on my non-rooted mobile devices.

https://blokada.org/index.html

 

Intro

Normally I root my mobile phones routinely to be able to install and run an adblocker, eg Adaway. Adaway is a system-wide solution that just works, but requires a rooted phone.

More about Adaway here; https://adaway.org.

Rooting a work phone is however not always ideal or even allowed bu the exployer, so it lead me to investigate how to work around not rooting and still block ads effectively.

A normal non-rooted phone user may use eg Blokada. It's a VPN-solution that works very well. It is however a hindrance if you ever need to use your work's VPN-solution to do, you know, actual work when out of office. For me Blokada works, but not good enough on my work-phone.

See more about Blokada here; https://blokada.org/index.html.

 

Update

I switched phone brand to Oneplus. Knox doesn't work there obviously, så resorted to Blokada at first.
Had vague issues with Blokada's adblocking sometimes working, sometimes not, so tried out DNS66 instead, and that's where I'm at now.

 

Samsung, SABS and Knox

While researching the issues about adblocking on non-rooted phones, I came upon SABS.

SABS is short for Simple Ad-Blocker for Samsung, and is a frontend for Samsung's Knox-system.
In the words of SacredDeviL666 of XDA-Developers; "SABS is an open source tool that shows how to use Samsung Knox SDK without root. It lets developers see how various features work and test them. Some of the features are: system-wide domain blocker, package disabler, permission manager, apps force stopper (examples include theme store), system-wide or app-specific port 53 blocker and more."

Now this sounds interesting, doesn't it?!

The install and setup is a bit complicated, but well worth the hassle.

In it's simpletst configuration, SABS installs as regular APK's and ties in seamlessly to Knox.

 

Guide

There are a few prerequisites to be done first, before actually installing and run the whole shebang.

Please read through the entire guide once to get a feel for the steps. Then re-read them. It will save you time.

The documented steps worked for me, with a Samsung Galaxy S9 (SM-G960F/DS) and Android 8.0.

The guide assumes you don't already have a Knox-based adblocker installed. Examples are Adhell, Adhell3 and Disconnect Pro. If you do have these installed, uninstall them before proceeding.

 

Software

Get the needed software.

notSABS APK

APK Editor Pro

 

 

The Samsung License key

To use SABS you need a Samsung license key. This is how to get it.

  1. Create a Samsung account on your phone, if you don't already have one.

  2. Go to https://seap.samsung.com/enrollment and sign in with your (newly created) Samsung account.

  3. Go to https://seap.samsung.com/license-keys/create#section-samsung-edu-sdk.

  4. Find Samsung EDU SDK. Check this pic for reference; https://imgur.com/v7zcsxb.

  5. Go to Samsung Standard SDK.

  6. Select a Enterprise license key.

  7. Enter a suitable name in the Alias field.

  8. Click Generate license. You should get a license key starting with ELM
    If you didn't, re-read the steps again and repeat the procedure.

  9. Copy the key, paste it into an empty file and save it using your favourite editor, you'll need it for later.
    Another good idea is to mail the key to yourself, to have it available on your phone.

 

Hacking the notSABS APK

Before you can install the notSABS apk-file, it must have its name changed. This is done with APK Editor Pro.

Get the APK Editor and notSABS APK-install files to your phone. If you downloaded from your phone, they should be in your Downloads folder.

 

Installing APK Editor Pro and notSABS

  1. Go to your file manager and browse to your Downloads folder.

  2. Touch the APK Editor Pro installer to install it.
    You may need to allow installing from unknown locations, meaning from your phone's Downloads folder. It will ask for permission to do so.

  3. Open the app when the installation is done.

  4. In the editor, browse for your notSABS-file.

  5. Select Common edit.

  6. Edit the name in the Package name field.
    Do not edit anything else!

  7. Change the name from com.layoutxml.sabs to eg com.sorinsrbu.sabs.
    The important thing is to keep the number of characters the same, ie three-characters.nine-characters.four-characters, you get the idea.

  8. Select Direct rename and Rename the package name in resources.arsc.
    Do not select anything else!

  9. Press Save.

  10. Press Install and then Install once more.

  11. NotSABS will now show up on your phone as a regular app in the Apps drawer.

  12. Find it in the apps drawer and start it. Instructions will appear, follow them.
    When it asks for the license key, paste it from the file you emailed to yourself earlier.

  13. You're done.

  14. Familiarize yourself with the GUI before adding blocklists and disable apps etc.

 

Notes

In no particular order.

  • After adding a blocklist, turn off and on SABS to activate the list/s.
  • According to the interweb SABS can handle blocklists with a total number of entries of 15000. Anything over that will slow down the phone mpst noticably and may even break SABS, ie it won't turn on at all.
  • Ads are not blocked in Youtube. Google serves its ads from the same domains as the videos. If you block those ads, you won't see any videos. In short, there's no blocking ads on Youtube.
  • If you find that any of your apps won't work as expected, unblock them in Blocker/Settings/Manage blocking in apps.
  • If you find that any of your websites won't work as expected, whitelist them in Blocker/Settings/Manage blocked domains/Whitelist domains.
    Just enter the site name and press Allow to let them trough. No need to turn SABS off and on.
  • Blocklists. There are plenty on the web, search for them and choose a likely one or two.
    I use the below four lists, for a total of about 6000 entries. Together they block most of the bovine manure flying around on the internets.

    https://pgl.yoyo.org/as/serverlist.php 

    https://adaway.org/hosts.txt

    https://pgl.yoyo.org/as/serverlist.php?hostformat=adblock&showintro=0&mimetype=plaintext
    https://www.fanboy.co.nz/fanboy-swedish.txt

  • The Disabler part of SABS can be used to hide the pesky bloat-apps in the apps drawer. Since your phone isn't rooted, this is the second best way to not see them anymore.
  • All disabled apps can be exported to a file, and reimported to a new phone.
  • Use this list as a guide to which apps you can disable and hide; https://gist.github.com/baszoetekouw/550e6e47edf9663e52ad7648c7eab83b.
    Don't go overboard though, try a few at a time...
  • SABS can only handle hostname lists. Lists with other contents than actual site names or IP-adddress is likely to break it. Hostname lists are sometimes called raw or unix hosts lists.

 

 

 

Sources

https://forum.xda-developers.com/android/apps-games/app-sabs-simple-adblocker-samsung-t3751722

https://www.xda-developers.com/sabs-ad-blocker-samsung-galaxy-phones/

https://www.androidsage.com/2018/03/29/download-install-sabs-simple-ad-blocker-for-samsung/

https://github.com/GoldenKappa/notSABS

https://gist.github.com/baszoetekouw/550e6e47edf9663e52ad7648c7eab83b

https://forum.xda-developers.com/galaxy-s9-plus/how-to/s9-s9-bloatware-removal-thread-g960u-t3817810

https://blokada.org/index.html

 

 

 

 

 

 

 

 

 

Stop Spam Harvesters, Join Project Honey Pot

 

Get a free SSL certificate!

 

The leading nonprofit defending digital privacy, free speech, and innovation.

 

The Linux Foundation provides a neutral, trusted hub for developers and organizations to code, manage, and scale open technology projects and ecosystems.

 

Kubuntu is an operating system built by a worldwide community of developers, testers, supporters and translators.

 

 43ef5c89 CanonicalUbuntudarktext