yashsingh1/xdaforums huggingface dataset:
[Android Apps and Games] Mike B.:
What expires is YOUR personal (temporary) Knox key. There's nothing SABS can/should do about that .Samsung will let you know when it's time to renew it and you'll be able to simply enter your new key into SABS without losing any of your settings. You could buy your own permanent key from Samsung if you wanted to become a true Samsung developer but it's not cheap!

Yes, simply select the apps(s) for which you want blocking to be disabled. No need to worry about that too much unless a specific app refuses to run properly. Even Google Music works fine depending on which of its features you use. As mentioned many times: if it works for you, leave it alone! ;)
[Android Apps and Games] NeedleGames:
Use Packet Capture to log where it connects and then block some of them
[Android Apps and Games] NeedleGames:
So the original Adhell worked on your device?
[Android Apps and Games] uoY_redruM:
Oh yeah, wasn't saying the developers should do anything, I was just curious if there was a way to extend the 3-months on the Knox key or if I needed to update it regularly. My last one expired with AdHell and I never got alerted from Samsung it needed to be renewed so it wasn't actually running for the last few weeks. Glad to know it's a simple entry of the key once renewed, I wasn't sure if I'd have to reinstall the app or something.

Thanks for clarifying, I appreciate it! Already seeing all the ads it's blocking and it's wonderful :)
[Android Apps and Games] amaru7:
How does this compare to AdHell 2, is it any better?
[Android Apps and Games] Mike B.:
SABS is the latest incarnation of the AdHell family of Knox firewall front ends, still based on the original source with countless corrections and enhancements by a number of contributors. It includes many new features, a much cleaner UI, and unlike old AdHell/AdHell2 it's actively developed and supported. Read this thread to know more.
[Android Apps and Games] bokusen:
The original AdHell didn't crash or anything, but it had a notice saying that my version of Knox was old and may not work probably. It didn't seem to block any ads.
[Android Apps and Games] djraysr:
Thanks for the response. Yes, was not using pro editor. So, with pro version, was able to change package name. Another stumble further on. I will go through thread and try and solve it.

You don't give us many details, but I suspect that your "on the phone" attempt was made with APK Editor (which cannot edit the package name) instead of the correct APK Editor

PRO

, a common oversight mentioned quite often in this thread. On your "computer method", it's difficult to guess what you did, but at the very least make sure you replace the default "com.layoutxm1.sabs" package name with a valid unique string. Searching the thread will probably answer any questions you may have.[/QUOTE]
[Android Apps and Games] mmotti:
[MENTION=6183103]NeedleGames[/MENTION] - I'm free now for a few days. Only just having a chance to get my laptop out lol.

Very nice work with the turn on / off and use of the loading spinner. Looks very professional.

I'm going to look at what I can do in terms of processing the domains before they are added to the database. I can take some of the regex from my host file script for removing comments etc.
[Android Apps and Games] djraysr:
Okay, I edited the long quote. Sorry about that (and embarrassed too). I followed two paths (computer and phone); both unsuccessful. As for the "on the phone method", I am now using apk editor pro. I selected the APK file 0.0.7.apk. I then closely followed the steps 4 through 8. I changed the package name to djr.9pdbscwyg.5501. I hit save and got a SUCCESS. However, when I hit install I got "there was a problem parsing the packag"e. USB debugging is on as is allowing unknown apps. As an experiment, I ran it through again and simply deleted the last character in the original name (I.e., took off the "s" at the end of the name) so that a change would be noted and a synch required. Under this scenario the process ran through successfully and I have SABS on my phone. I realize this is not really a solution since Samsung is on the prowl. At any rate, this tends to make me think the problem is in my selection of the new name. Your patience is appreciated.

Thanks,

Don
[Android Apps and Games] NeedleGames:
Thank you for comming back and sharing your experience. Somebody may find it useful.
[Android Apps and Games] JimRamse:
Installed 0.0.7 and put in key as instructed. Worked like a charm. But protection won't enable. Just tries for a second, then it still is disabled. Any ideas? Did not have this problem on 0.0.6..........
[Android Apps and Games] mmotti:
Which host files are you using?

------

Added a new pull request to SABS.

Moved domain validation

Domain validation will now take place before the domains are entered into the database.

Improved host file processing

Added regex replacements to remove things like spacing, comments and www. www1. etc. This should further reduce the chance of coming across invalid domains with the use of host files that haven't been built specifically for SABS.
[Android Apps and Games] NeedleGames:
I can't see any changes on 3rd. Commit shows 0 changes.
[Android Apps and Games] JimRamse:
I'm downloading files from your opening post. Editing it with APK Editor Pro and installing it. Works fine. I then enabe adin, submit key and activate. No problems so far. I then press TURN ON, and it tries for 1 second then it just still says SABS is off.
[Android Apps and Games] NeedleGames:
Did you remove the old version?
[Android Apps and Games] mmotti:
Although the modification dates were way off, it does seem that it was already at 5.9 so I removed it from my post :)
[Android Apps and Games] JimRamse:
Yes, but not before I installed. 0.0.7. I thought it would update. Maybe that's where it went wrong. I'll try more tomorrow. It's late here. Time to turn in......
[Android Apps and Games] NeedleGames:
If you had changed it to the same package id, it would have updated. Now there were two SABS installed and they probably had some conflicts especially that they are the same app with the package id changed in one place.
[Android Apps and Games] uoY_redruM:
I've been out for the last few hours so I'm not sure if you've already resolved this but I installed it this morning and I had the exact same issue. I tried three times and it failed. I named mine very similar to yours, using numbers, with no success. I tried 867.jieuhrosn.5309 and similar. Failed. I then just went with something like aij.enidhamen.ihen (no numbers) and it worked first try. I'd suggest that route, if you haven't already.
[Android Apps and Games] thejackalsmark:
+1,000,000?

One of my top 10 biggest pet peeves in forums.
[Android Apps and Games] thejackalsmark:
APK editor Pro can be picky sometimes. Also the signing of the APK can be quirky. I always use zipsigner on any apks that I edit with editor Pro. Never any problems installing after that.
[Android Apps and Games] djraysr:
Thanks. Eliminated numbers in the new name and worked fine. Appreciate your help
[Android Apps and Games] UltraNoob:
Works perfectly on my Canadian S7. Thanks again. I had to find an alternative after factory resetting my phone and finding out that Adhell was no longer supported
[Android Apps and Games] Nastrahl:
To be able to the renamed apk to work/install, what I did was:

- keeping the com. At the beginning

- when changing the name, always keeping the same number of chars (the "layoutxml" part, so 9 chars)

- for the last part, only 4 letters. No numbers, no more than 4 chars.
[Android Apps and Games] amaru7:
works so far so good, really nice new gui, some say devs are bad at designing and vice versa, but you made that well. Thank you for your work. Hope you keep it up!

Is there anything I have to watch for in subscribing lists? I subscribed to three, the standard with 9,5k, easylist with 76k and cookie disabler list with 11k. Is that overkill or alright?
[Android Apps and Games] Mike B.:
Probably gross overkill. Did you actually look at the "easylist" contents? Most entries are not even in the correct format. I don't know which "cookie disabler list" you have but I suggest you look at it also. since even its name sounds very suspicious for something that should be a list of domains to block. Why not start with the default package and see how that works for you?
[Android Apps and Games] pleasetouchmenot:
What host list is better and you'll recommend? The standard package on the app or [MENTION=6150682]mmotti[/MENTION]'s host list? And is it okay to use the 2 host files?
[Android Apps and Games] [TR]Neco:
This app just stock samsung roms or custom roms run?
[Android Apps and Games] Nastrahl:
Only stock, since it uses Knox which runs only on Samsung's ROM.

For custom ones you can uses AdAway for blocking hosts.
[Android Apps and Games] [TR]Neco:
I use AdAway but not enough.
[Android Apps and Games] Nastrahl:
SABS will offer you nothing more, except perhaps regex support.
[Android Apps and Games] mmotti:
You can leave both ticked :)
[Android Apps and Games] fusionjack:
[MENTION=6183103]NeedleGames[/MENTION] i have implemented a support to import a local host file in custom provider. if you are interested, you can port it from my github.
[Android Apps and Games] Mike B.:
The ability to import from "file://" would be nice. In [MENTION=6183103]NeedleGames[/MENTION]' current version, "http://localhost/.." and "http://12.0.0.1/.." are accepted, but the contents are not actually imported. Removing the unnecessary URL protocol check is at least a first step..

---------- Post added at 07:42 AM ---------- Previous post was at 07:23 AM ----------

Please don't confuse SABS (Knox firewall front end for unrooted devices) with AdAway (hosts file manager for rooted devices). If you currently use AdAway, you have a rooted device and Knox won't work right (if at all). If you have an unrooted device, you can't edit the hosts file with AdAway or anything else. For "ad blocking", both use the same strategy: prevent access to specific domains and neither one needs to run in background.
[Android Apps and Games] KBeckett:
I installed via the PC method listed above. When an update is released, would I be able to update without the PC if I follow the steps for the phone version with APK editor pro? Or am I "stuck" to the PC method because I began with it?

I also wanted to ask: will I have to disable/uninstall SABS when I get OTA updates from Samsung?

Thanks!
[Android Apps and Games] mmotti:
You wouldn't be able to uninstall over the top as the signature would be different.

You could potentially make the switch but the first time you did it, you'd have to uninstall the old SABS first. So long as you keep your unique package name when using apk editor from there on out, it should work.

With regards to OTA updates - You shouldn't have to uninstall or disable (providing you aren't blocking the OTA domain, but you may need to enable ad blocking again after the update completes.
[Android Apps and Games] NeedleGames:
I've been trying to make files work but I've run into a lot of problems mainly this one (https://stackoverflow.com/questions...ppcompiledebugjavawithjavac-in-android-studio) and none of the solutions work.
[Android Apps and Games] Mike B.:
If using the "file://" protocol doesn't work, maybe there's a way to simply use "http://localhost/" or "http://127.0.0.1/". Right now, the latter two correctly find local files but can't apparently read their contents (i.e. show count=0).
[Android Apps and Games] fusionjack:
my version is working fine with file://

i'm able to use local host file located at root sdcard with this following url as example:

file:///mnt/sdcard/hosts.txt
[Android Apps and Games] Mike B.:
That's good news. Out of curiosity, is "http://localhost" also working with your version?
[Android Apps and Games] fusionjack:
no, it doesn't work with http://localhost

what does suppose to mean? blocking localhost?
[Android Apps and Games] Mike B.:
No,"http://localhost/sdcard/something,txt" theoretically points to the same thing as "file:///mnt/sdcard/something.txt" and the idea is to use that as the location of input files (much like the current ability to save/restore the disabled apps list). As long as one of those protocols works it matters little which one is used, whichever one is the simplest to implement wins! ;)
[Android Apps and Games] Oops...:
Wouldn't this try connecting to a local webserver, which is (at least normally) not running? This is not a file access..
[Android Apps and Games] Mike B.:
Yes, but that puzzles me a bit is that (with the current SABS) "http://localhost/sdcard/something.txt" is accepted (albeit without accessing contents) when that file exist but triggers an "Invalid URL" when there is no such file. No a big deal if "file://" can work
[Android Apps and Games] fusionjack:
hmm, to my knowledge, i don't think that you can address a local file on sdcard with a http url: http://localhost/sdcard/file.txt

unless you have a webserver on your phone which maps /sdcard to /mnt/sdcard.

otherwise, it should use a file url which begins with file://

of course, there is another way to address a local file by not using url, but e.g. by using java File object programmatically. the input would be just a path, e.g. /mnt/sdcard/file.txt

no, package disabler is using java File object to address a local file. the path is pointed directly by default to the internal storage (sdcard):

File file = new File(Environment.getExternalStorageDirectory(), "adhell_packages.txt");
[Android Apps and Games] Mike B.:
That's why I was wondering why the http URL seems to be accepted in the first place and even somewhat validated (at least for existence of the file). I'm mobile and can't look too closely at [MENTION=6183103]NeedleGames[/MENTION]' code right now. Ignore this old man's ramblings! ;)
[Android Apps and Games] fusionjack:
well, ideally a file chooser should be used in ui to select local host file and then pass it to File object like the way the package disabler does.

since i don't want to spend too much time on ui stuff, i just used the existing orchestration of custom provider which is url based: file url [emoji28]
[Android Apps and Games] NeedleGames:
I'm on my phone as well but last time I checked it removed http before trying to access it so it bypasses url detection and then probably tries to access the file.
[Android Apps and Games] mmotti:
[MENTION=6183103]NeedleGames[/MENTION] following my PM.

After signing the generated apk, it did indeed work.

So to run the script, the user needs PowerShell, java runtime and java SDK.

Runtime is required for apktool and SDK required for running a jarsigner command.

So at the moment the script:

Gets the APK from the input folder

Decompiles it with apk tool

Generates a random package name (or user specified number sequence)

Updates apktool.yml with the customised package name

Rebuilds the APK with apktool

The only outstanding thing at the moment is signing the APK. But not sure how best to do this.. Maybe just including the keystore etc along with the script? I manually signed a generated apk with a debug key and it installed OK and with the new package name.
[Android Apps and Games] mmotti:
I've got a sneaking suspicion that it probably only checks that the URL is a URL.

Some of criteria elsewhere was like: if https://{YOURENTRY} is a valid URL, then proceed.

This would only work if you had a Web server running on your phone and you'd have to navigate to the text file as parsing a html file would most likely break it lol. It's a bit fragile :silly:
[Android Apps and Games] Dor71:
Thank you for your thread.
[Android Apps and Games] NeedleGames:
Can you try closing the application and then enabling blocking just as you open SABS again? I mean not going to other screens like settings or package disabler but just pressing "Enable SABS" the first thing you do when you open the app? Package with domains to block is bigger, there is a wildcard support and port 53 blocking all which inevitably make SABS enabling longer.

By the way, whitelisting domains and apps does not reduce enabling time, quite the contrary - now the app needs to whitelist some things instead of simply blocking everything.
[Android Apps and Games] android_htc:
This seems to be a better method of enabling and disabling SABS.

After closing the app and opening again to disable it... it disables straight away.

Doing the same again to re-enable SABS take up to 45 seconds... this is method is much better than trying to randomly jump about different tabs to see if it has enabled or disabled as it has got more difficult to be honest.
[Android Apps and Games] balistic2:
Thank you for keeping this alive! Got it up and running fine on my GS8.
[Android Apps and Games] SphericalPotatoInVacuum:
Problems with building

Hello guys, I have some problems with building this app with android studio. Every time I try to build it the building fails and I get some errors like "Error: org.gradle.internal.UncheckedException: java.util.concurrent.ExecutionException: java.util.concurrent.ExecutionException: com.android.builder.internal.aapt.v2.Aapt2Exception: AAPT2 error: check logs for details", though I didn't change anything except the package name. What should I do?
[Android Apps and Games] android_htc:
No more annoying ads on Waze :good:
[Android Apps and Games] snk012:
This seems to work better than before. Appreciate the tip ~~ Thank you
[Android Apps and Games] NewWorldOrphan9:
Working fine on my Galaxy S7 (Sprint), used the APK Editor Pro directions. Everything worked fine for me and I am getting domains blocked.
[Android Apps and Games] Mike B.:
Before you spend too much time on this, make sure your copy of Android Studio is up-to-date. Enable automatic updates, let it add/update/sync whatever it tells you it needs, then try building SABS again.
[Android Apps and Games] SphericalPotatoInVacuum:
Thanks, I'll try it
[Android Apps and Games] SphericalPotatoInVacuum:
OK, thanks for response, gonna try it right now)
[Android Apps and Games] NewWorldOrphan9:
There's a button for that... :) hehe
[Android Apps and Games] Oops...:
It's really a good feeling seeing that there are commits on GitHub nearly on daily basis. Thanks [MENTION=6183103]NeedleGames[/MENTION]
[Android Apps and Games] Godmonkey80:
How do your edit to work on S7? I try but not work on s7 active. Please help. Thanks,
[Android Apps and Games] NewWorldOrphan9:
I don't know, I followed the directions and it worked. What's not working?
[Android Apps and Games] Godmonkey80:
SABS not work. I met the problem: my knox version 2.7.1 and key start with KLMxxx. I can't change the key :(.
[Android Apps and Games] NewWorldOrphan9:
Enable Admin, submit Knox key, when activate. You're using the wrong key maybe: DON'T use the key that starts with KLM. Use the Enterprise key.
[Android Apps and Games] NeedleGames:
That means you copied the wrong key. Check out the #1 post and see the instruction on how to get the key. More specifically the picture
[Android Apps and Games] Godmonkey80:
Done. Thanks,
[Android Apps and Games] friscoboi:
Great Work! Running perfectly on A3 2017. Thank you so much!
[Android Apps and Games] Mike B.:
If we had a basic webserver, we could even "hide" the space reserved for ads (much like AdAway), but that's probably not worth the hassle. However, as [MENTION=4343728]Mike B.[/MENTION] always says: KEEP IT SIMPLE! ;)
[Android Apps and Games] NeedleGames:
That's great! Can't test it at the moment. Why is debug key not the best option? I don't want to share the original keystore because I use it's password on some sites :)
[Android Apps and Games] orbitalcomp:
I used to use the Xposed tweak called 'MinMinGuard' on my old rooted phone to hide the blank ad spaces that AdAway would block. This was a great combination, it would be awesome if there was a way to have SABS do this.

If I remember correctly, AdAway would block the ads and MMG would also block some additional in-app ads, plus hide the blank space system-wide.
[Android Apps and Games] Mike B.:
If you want more than domain blocking, look at Samsung's new "Samsung Max" (yet another VPN, basically the old Opera Max rebranded). Way too intrusive for my taste, but it's an option.
[Android Apps and Games] mmotti:
Not your personal one :)

It sounds as though everyone is resigning anyway so we don't need to worry too much about integrity. I was just wondering whether we include a dummy key store / key within the generator to sign the package with.
[Android Apps and Games] Mike B.:
PowerShell again? Plus Java runtime + java SDK + apktools ? That sounds a lot more complicated than an APK Editor Pro patch (works great when used correctly) or a quick Android Studio recompile. Also remember that some people use real Operating Systems! ;)
[Android Apps and Games] 8139david:
Is that useful for security and privacy protection when using a public wifi?
[Android Apps and Games] Tacoo:
So I added other filters like adaway and followed the instructions to turn off SABS, check the boxes in the filters, and then turn the app back on. But doing so, it hangs on "Enabling SABS". If I tab to something else, it goes back to off. I've waited upwards of 10 minutes or more.

Is it supposed to take this long when adding new filters?
[Android Apps and Games] NeedleGames:
Quit the app and press enable immediately. This bug is already fixed but not released if you have downloaded an apk
[Android Apps and Games] Tacoo:
Thanks!
[Android Apps and Games] friscoboi:
Thanks for The Update! I Chose Same Package Name as before in Android Studio and Just installed over The old one. Worked perfectly!
[Android Apps and Games] mmotti:
I have some time free today so will look at the locally stored host files if this hasn't already been sorted.
[Android Apps and Games] andiling:
Thank you for providing this new app and your efforts.

What I noticed is that if I add individual links for host files the enabling process takes much longer (with less additional hosts included) or even gets stuck at "Enabling SABS." (with more hosts included). I did not experience that issue before with AdHell(2). Just fyi...

I use an Exynos Galaxy S8+ with Oreo and have the latest version of SABS installed.
[Android Apps and Games] Mike B.:
In general, the more input files you use, the longer it'll take to process. You didn't mention which AdHell2 you had, but older versions simply ignored everything after reaching the 15K limit. With the current SABS (25-Feb or newer, with the "enabling" spinner), enabling should take 1 to 2 minutes at the very most, but the real issue is that there is no need to use more than a couple of input files. Do yourself a favor, try using solely the standard+mmotti's packages at most and see if you truly need much more. Remember that you can always blacklist a domain or two if necessary.
[Android Apps and Games] andiling:
I think I used the latest version of AdHell2 (I downloaded it Dec, 20th). With 500 hosts around it takes several minutes (but works eventually) and with 2500 hosts I did not get it work within 20 minutes. It is not a big issue but I just wanted to mention it (that's why I wrote 'fyi').

What's the link of mmotti's package? Thank you.
[Android Apps and Games] mmotti:
[MENTION=6183103]NeedleGames[/MENTION]

Closs to getting this working. Just need to change the fileinputstream a little and we'll have local host file support.

Current requirements:

Host text file placed in SDCARD/SABS/Hosts/

E.g /storage/emulated/0/SABS/Hosts/hosts.txt

The user must enter the file name in the URL field (e.g. Hosts.txt)

Will update soon when I've fixed the processing.