yashsingh1/xdaforums huggingface dataset:
[Galaxy S 4 i9505 Android Development] hawkerpaul:
Ok. For whatever reason, I cannot get wget to resolve a url via resolv.conf, even tho the bugger is pingable.

Therefore I've circumvented the problem.

The script now attempts a usual domain name wget.

If it cannot be resolved, the ip address for the domain is extracted, and temporarily added to the hosts file, and a re-attempt made.

This always seems to work for me.

Hope this helps.

Download AdBlocker.sh

[MENTION=3306843]kantjer[/MENTION]

I'm wondering for handsets that the resolv.conf file actually works on, what impact leaving those nameservers in would have on this adblocking.

ie. addresses that should be blocked by the hosts file may actually get resolved by resolv.conf, thereby counteracting the affect of the adblock.

I've not done so, but you may want to delete /system/etc/resolv.conf at the end of the script.
[Galaxy S 4 i9505 Android Development] Zoot Allures:
Hi,

Thanks for your help,

And there's something that buggers me, every time I edit the /res/customconfig/actions/push-actions/ad_update file, it get back on its previous state, the automatic bak file created by RootExplorer text editor disappears (in fact, all the /push-actions content is restored).

I've maybe missed something because it is stated in Kantjer's github linked file there is "ramdisk" and I find no such file nor directory directory (even if I saw that sometime during SSK flashing).

I cut and pasted your former script, it almost worked beginning to seek something then again, tells there is no connection, whether I am on LTE or WiFi. I thought there was something bad in my local connection but I see you found it too. :)

I second you (if I may) when pasting your new script, then, without rebooting, clicking on STweaks button, it launches then the thing can't resolve something...
[Galaxy S 4 i9505 Android Development] John_wba:
Use other ROMs if you can't wait, the theme engine is buggy as f**k anyway, while I was on cm it would make its own mind up what theme it would use lol and my opinion didn't matter to it lmao.

---------- Post added at 11:56 PM ---------- Previous post was at 11:12 PM ----------

First full day back on SSK and I've hit 6 hours screen on already, with my heaviest use yet. :D with light usage I think 7 hours would be possible (maybe 6 and half). ;) I'm gunna try tomorrow :p
[Galaxy S 4 i9505 Android Development] kantjer:
Thanks, for this, I'm currently building the kernel with the script in it. Let see what it does in real life :fingers-crossed:

I have been using my phone yesterday with the resolv.conf in there and haven't found any sign off adds peeping through. So it doesn't seem to interfere.
[Galaxy S 4 i9505 Android Development] hawkerpaul:
No worries at all mate.

:)
[Galaxy S 4 i9505 Android Development] kantjer:
The script needs to be changed in the Kernel's Ramdisk and compiled in the kernel.

Otherwise the kernel overwrites your changes.
[Galaxy S 4 i9505 Android Development] kantjer:
Still no luck
[Galaxy S 4 i9505 Android Development] hawkerpaul:
By the way mate.

I forgot to put this line at the end of the script:

rm -f $ERRFILE 2>/dev/null

Either edit manually, or re-download.

---------- Post added at 07:51 AM ---------- Previous post was at 07:47 AM ----------

its working for me in adb

what happens if you ping www.win2002help.mvps.org at an adb prompt?

I can ping it ok. As long as it pings, the script should get around the problem
[Galaxy S 4 i9505 Android Development] hawkerpaul:
Scratch that, its not www.win2002help.mvps.org but www.winhelp2002.mvps.org!

at an adb, what does this return:

ping -c 1 www.winhelp2002.mvps.org

then

ping -c 1 www.winhelp2002.mvps.org | sed -n 's@^.*(\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$@\1@p' | head -1

should return just the ip-address and nothing else

so its all working as expected.

Its worth you re-downloading the script again anyway, as I've put in a few display tweaks.
[Galaxy S 4 i9505 Android Development] kantjer:
I will try in an hour, have to take care of some personal stuff now.
[Galaxy S 4 i9505 Android Development] David_cole:
Is this a rom thread or a ad-blocking thread? Any new user of this rom will think they are in the wrong thread and won't have a clue what's going on.... Shouldn't the discussion take place in the alucard thread?
[Galaxy S 4 i9505 Android Development] FlanjeUK:
Alucard is part of kantjer's ROM...
[Galaxy S 4 i9505 Android Development] kantjer:
And this is a development thread, I see no reason why this can't be discussed here.

A short update on the topic [MENTION=4272718]hawkerpaul[/MENTION] is been working on it for a large part of the morning (and still is) and it looks he found the cause.

He is still tweaking the script (perfectionist ;)) but I have done a few tests over adb and that looks promising :fingers-crossed:
[Galaxy S 4 i9505 Android Development] feelpt:
anyone having issues with rom roolbox? it's FCing on me, no matter what i do...

about the ad blocking thing....maybe i'm not getting all this fuzz, but i have a modded hosts file that i normally put in the rom zip (in proper etc folder, in place of the existing one) before i flash it and it does the job ... no ads on this side
[Galaxy S 4 i9505 Android Development] FlanjeUK:
ROM Toolbox (free) works fine here, I use it all the time, do you use SuperSU?
[Galaxy S 4 i9505 Android Development] feelpt:
no supersu...stock superuser... i use pro version of rom toolbox... weird
[Galaxy S 4 i9505 Android Development] brunodu91:
What rom toolbox is useful?

Envoyé de mon S4, via tapatalk 4 .

Slimsaberkat 4.4.4 released, alucard Kernel , buzz launcher , modem ET bootloader NC4.
[Galaxy S 4 i9505 Android Development] WickedSS2005:
Thank you for the newest update. The 0711 version seemed to be lagging, but now with 0714 it's back to being snappy and a few app updates that would reboot the phone before finishing the install is resolved.

Still working on getting my STweaks settings to how I want them. I have one simple question that eludes me.... What settings in the stock messenger app will allow it to not be restricted to 160 characters? I've turned on and off the options in the messenger settings to no avail. /annoyed/ Surely there is something simple I'm just overlooking.
[Galaxy S 4 i9505 Android Development] Bejda:
Will you take time to share details later please?Even very briefly what the issue finally was,what fixed it..

I understand nothing to these servers and dns stuffs (I've been spotted already? Really?) but it's interesting.

Thank you.
[Galaxy S 4 i9505 Android Development] fivecheebs:
Try installing SuperSU, many people report its more reliable than stock superuser.
[Galaxy S 4 i9505 Android Development] kantjer:
It's fixed in adb, now building a kernel with the new script in it.
[Galaxy S 4 i9505 Android Development] kantjer:
Huge thanks to [MENTION=4272718]hawkerpaul[/MENTION] for fixing the script (it has taken him hours to fix)

I have included the updated ad-block script in the kernel and everything is working now.

hawkerpaul built in a fall-back in case the url could not be resolved via the DNS by using a ping command to get the url's IP address.

The problem turned out to be a busybox issue. And was solved by reference every command in the script through busybox.

For those who are interested, this is what the ad-block script now looks like.

https://github.com/kantjer/Ramdisk/blob/aosp-4.4/res/customconfig/actions/push-actions/ad_update
[Galaxy S 4 i9505 Android Development] hawkerpaul:
My pleasure mate.

The problem was with the busybox version of the ping command which proved to be the needle in the haystack.

Actually the script just dives in and adds the ip address of the adblock site to the hosts file straight away. This way the wget command is only run once so it should be more efficient.
[Galaxy S 4 i9505 Android Development] gaww:
I have been using AdAway as a workaround, so also no problems with adds, but I appreciate the development being done on the problem, as it is part of the ROM.
[Galaxy S 4 i9505 Android Development] kantjer:
I'm obsessive about this, if a feature is in the ROM or kernel it should work (when possible of course)

Not all will use it but I'm not the "I don't use so why should I care" ROM builder". If that was true we wouldn't have a working ART implementation (I'm not using ART)
[Galaxy S 4 i9505 Android Development] kantjer:
Because of the app's youtube review on GPlay :p
[Galaxy S 4 i9505 Android Development] giodeluigi:
Don't know if already posted but I found this:

Under Security - Menu unlock: pressing the menu button unlocks the device.

Selected or unselected is the same.

It makes no difference here.
[Galaxy S 4 i9505 Android Development] Mistertac:
Works fine for me.

Maybe xposed getting in your way possibly?
[Galaxy S 4 i9505 Android Development] kantjer:
For those who want to test the kernel with the updated and now working ad-block script, you can download it here

I have also send a pull request to [MENTION=4899086]alucard_24[/MENTION], hopefully we will also see it back in the official kernel soon.

EDIT: alucard has added the commit to his git, so the official kernel will also have the updated script soon :good:
[Galaxy S 4 i9505 Android Development] Jsilver73:
Do you use xposed, if so try disabling it and see if you still get fc with ROM toolbox, I have been having similar issues on other ROMs with apps (usually app settings fcing)

Please could you give a link to your modified hosts file, I have other ROMs I may like to try it in :D
[Galaxy S 4 i9505 Android Development] John_wba:
Thanks for this and thanks to hawkerpaul :) I asked about it in the alucard thread 2 months ago, but nothing came of it, I'm glad you fixed it :)
[Galaxy S 4 i9505 Android Development] kantjer:
If you have a ROM where you use an ad-blocker like AdAway or the now working kernel script. Just update the ad-block definitions and use the "system/etc/hosts" file from that ROM and copy it to the other ROM you want to use it in.
[Galaxy S 4 i9505 Android Development] John_wba:
If we are on the subject of fixing stweaks lol, Zipalign and database optimisation don't work in the other tab, zipalign will always report that all app have already been done even if they haven't and database optimisation doesn't do anything.
[Galaxy S 4 i9505 Android Development] kantjer:
Al apps are zip aligned, it's done as part of the ROM build.
[Galaxy S 4 i9505 Android Development] John_wba:
User apps are installed after you flash a ROM tho, so how could it do it before they even got installed? I clean flashed slim after a full wipe and then installed apps.
[Galaxy S 4 i9505 Android Development] feelpt:
i don't use xposed... found out the cause... was still on dalvik afeter flashing rom... when i changed to art it worked... must be an art exclusive release or something

try here for the file :

https://drive.google.com/file/d/0BwQihDPP3Ki-cDNmRXR6dXlXMk0/edit?usp=sharing
[Galaxy S 4 i9505 Android Development] Zoot Allures:
IT WORKS! Congrats, mates!

Many thanks to you and HawkerPaul for the time spent on this...
[Galaxy S 4 i9505 Android Development] kantjer:
Fair point, don't know if there are app developers that don't zipalign there creation.
[Galaxy S 4 i9505 Android Development] kantjer:
Database optimization isn't working because the script is missing in the source, nothing is called when you touch that button.

I will add this and see we can get it working :fingers-crossed:
[Galaxy S 4 i9505 Android Development] John_wba:
Thank you for taking the time to look in to it.
[Galaxy S 4 i9505 Android Development] Nutterpc:
Kantjer I can also confirm the test script you put in the kernel works fine, downloaded it a few minutes ago and am running it as we speak.

Tried the update ad-b, went through without an issue :)
[Galaxy S 4 i9505 Android Development] UniqueFreak:
+1 worked a treat great job and amazing ROM
[Galaxy S 4 i9505 Android Development] Jsilver73:
Strange, maybe I missed something but when I update adblock I get a message saying no internet connection even though I have, I thought it might be adaway blocking adblock so I disabled it but still no luck.

Maybe it is something to do with my dual boot set up but that doesn't really make sense because adaway installs perfect?
[Galaxy S 4 i9505 Android Development] kantjer:
did you flash the kernel I posted here
[Galaxy S 4 i9505 Android Development] Jsilver73:
Yep, I mean I think so, it's build date is 16 July 14:38?

You only posted that one yesterday didn't you?

---------- Post added at 09:20 AM ---------- Previous post was at 09:17 AM ----------

BTW I have some nice ROMs all set up in the same way now, ssk performs noticeably faster though IMO :good:
[Galaxy S 4 i9505 Android Development] kantjer:
Thats, the one.

I have received an updated script from [MENTION=4272718]hawkerpaul[/MENTION] yesterday evening, making it even more robust.

I haven't tried it yet but I will do it later today.

I'm now testing a few additional build optimization flags for the ROM :fingers-crossed:
[Galaxy S 4 i9505 Android Development] hawkerpaul:
go to an adb su prompt (so you have a "#")

what does this this return:

ping -c1 www.winhelp2002.mvps.org

then try this:

busybox ping -c1 www.winhelp2002.mvps.org

/system/bin/ping -c1 www.winhelp2002.mvps.org

if they all return a "bad address" error then something is blocking your access to this site.

double check the domain has not been restricted in /system/etc/hosts

Can also try doing the same tests for www.google.com
[Galaxy S 4 i9505 Android Development] kantjer:
FYI,

I have done the same tests yesterday with a clean (stock) host file.

EDIT: building the kernel now with the updated adbloker script (yesterdays evening version)
[Galaxy S 4 i9505 Android Development] hawkerpaul:
Just had another idea to make it more robust.

Give me 2 mins and re-download
[Galaxy S 4 i9505 Android Development] Mistertac:
I'm with you Jimsilver... I play around with another rom as well from time to time. One that's supposedly optimized for speed etc... And this ROM Kantjer has is definitely noticeably faster and the battery life is definitely better.

I set them all up the same way... Manage my wake locks and SSK is the winner every time [emoji106]
[Galaxy S 4 i9505 Android Development] hawkerpaul:
[MENTION=3306843]kantjer[/MENTION]

You're good to download from the usual link mate.

this build does a /system/bin/ping, and if that fails, it will attempt a busybox ping just in case.

if both fail. it will still attempt a wget, just in case the dns lets it through
[Galaxy S 4 i9505 Android Development] kantjer:
Thanks, Have to go out for about hour. I will rebuild the kernel later.

Good news, today's ROM build with a few new optimizations is running perfect.
[Galaxy S 4 i9505 Android Development] Bejda:
Well i just tried latest Alucard and now i get the "no connection" error :o

To summarize the STweaks option wasn't working for me at first (just like everyone else then?) but,still don't know why ,worked after i updated from 07/11 to 07/14 rom build.

Since then i couldn't reproduce the connection error.

I just tried again to see better before i test new script/kernel (replaced hosts file by original one + deleted resolv.conf) and it was still working.

Replaced hosts by original one again/deleted resolv.conf again > flashed "new" (the released one) script/kernel and now i only get "no connection" output.

As Jimsilver I'm also multibooting,sorry if unexpected behaviors (works "when it shouldn't"/doesn't works "when it should") are only on our side but i can't see where it might interferes.

The ping commands give me this (the fist command gave me 100% packet loss at first but this happened only 1 time out of maybe 10 tries,you can see i launch it again right after and it's ok,maybe a simple network story at this very moment dunno..)

View attachment 2856270

[MENTION=3306843]kantjer[/MENTION]

If it happens that you occasionally have to test some ramdisk edits but only your phone at hand the android tool here works perfect :good:

http://xdaforums.com/showthread.php?t=2073775
[Galaxy S 4 i9505 Android Development] kantjer:
New kernel is being build
[Galaxy S 4 i9505 Android Development] kantjer:
build SlimSaberKat-jflte-4.4.4-20140717 is uploaded

change log:

New build optimizations added, except for the exFAT drivers the whole ROM is now build with O3 optimization

New bootanimation thanks to [MENTION=4885924]DJDobermann[/MENTION]

Changed default screen DPI to 420 (will only affect clean installs)

kernel updates

Fixed ad-blocker script in STweaks, thanks to [MENTION=4272718]hawkerpaul[/MENTION]

Fixed database optimization script in STweaks

EDIT: forgot one change, ROM is now based on the Android 4.4.4_r2 (KTU84P) source, released 2 days ago for the Google Nexus 5.
[Galaxy S 4 i9505 Android Development] munichsfinest:
[MENTION=3306843]kantjer[/MENTION]: Just wanted to tell you what you have done: You have built a ROM so good that I, having been flashing another ROM approximately once a day for some months, stick to it for roundabout 2 months now :D:highfive::fingers-crossed:

Oh, just in time for a new build :)

And you did choose to have my favourite DPI built in^^ Don't find the upload yet though.
[Galaxy S 4 i9505 Android Development] s3icc0:
Upload, upload, upload !!! :cowboy::good:
[Galaxy S 4 i9505 Android Development] kantjer:
My bad, uploaded it to the wrong folder :o

It will be there in a few minutes, sorry guys.

EDIT: try again (I love my new upload speed)
[Galaxy S 4 i9505 Android Development] John_wba:
Idiot question here, what permissions do I set with the "my settings" addon.d script? I only ask because some scripts in there have different permissions.
[Galaxy S 4 i9505 Android Development] kantjer:
Al the scripts in there should have the same permissions.
[Galaxy S 4 i9505 Android Development] s3icc0:
love the possibility to enter permisions in the octal form with root explorer :)
[Galaxy S 4 i9505 Android Development] John_wba:
The best just got better. I thank you for all the time you spend making this the best ROM. Nice one :)
[Galaxy S 4 i9505 Android Development] FlanjeUK:
Thanks for the update [MENTION=3306843]kantjer[/MENTION] :D

New boot animation is definitely an improvement :P
[Galaxy S 4 i9505 Android Development] kantjer:
Thanks, I like the bootanimation like this. I asked [MENTION=4885924]DJDobermann[/MENTION] to make it like this and use only the Nexus colours. Luckily he immediately understood what I wanted :good:
[Galaxy S 4 i9505 Android Development] John_wba:
Found it lol
[Galaxy S 4 i9505 Android Development] kantjer:
The part that wasn't fully optimized in the built until now was the HWcomposer, compiling it with O3 was causing the built to exit with errors.

The only way I found until recent was to compile the ROM with O3 but disabling it for the HWcomposer part.

A few days ago [MENTION=1249390]DJLamontagneIII[/MENTION] came up with a solution and was so kind to let me know :good:

The HWcomposer enables the UserInterface (UI) rendering via GPU, so an important part for the user experience.
[Galaxy S 4 i9505 Android Development] Bejda:
STweaks ad-block gives me this now:

View attachment 2856499

I made same process before i tried (replace original hosts file/remove resolv.conf).

Hosts file looks like this after (same thing when i had connection error with previously released script/kernel):

View attachment 2856500

Is it ok for others?
[Galaxy S 4 i9505 Android Development] fivecheebs:
Ahh!! LOL! Another new bootanimation? Typically ive just spent most of my day playing with a new bootanimation as i have had a very quiet day at work today and fancied playing with PS a little... Anyway, I havent seen the new bundled one yet (downloading now), but this is the one i have made (the looping settings are slightly different in the actual version, just the final stage loops with the word sabre fading in and out. If you're interested, look here.

Thanks again for an effing fantastic ROM Kantjer, and for giving me some motivation to have a little tinker myself (albeit only a bootanimation lol)
[Galaxy S 4 i9505 Android Development] hawkerpaul:
have you installed a 3rd-party busybox or something?
[Galaxy S 4 i9505 Android Development] kantjer:
Very nice bootanimation, now it getting difficult which to make the default SSK one ?

But this the most Saberisted one :good:

I'm not 100% convinced about the glow around the Saber part, I would need to see how that plays out on the phone itself.
[Galaxy S 4 i9505 Android Development] Bejda:
No,at least nothing that I'm aware and by habit i never install 3rd-party busybox solutions.

But well let's see if it's ok for everyone else now,if it's only me or maybe only multiboot users i'll keep quiet with it and keep searching a little on my side.

Thank you.
[Galaxy S 4 i9505 Android Development] kantjer:
Could it be that because you are using a multiboot environment the ROM is using an other busybox?
[Galaxy S 4 i9505 Android Development] fivecheebs:
Thanks mate :D

No, I know what you mean... I'm not sure about the glow either. I am no expert with PS, and anything more graphical would be beyond me (I am no good at drawing from scratch), but if you have a request or suggestion ill have a go when i get some time.

I'm just trying to figure out how to create a flashable zip, but so you dont have to wait you can grab the bootanimation.zip from here if you want to see it on the phone. I used this to help me and push it to my phone.
[Galaxy S 4 i9505 Android Development] kantjer:
Making a flashable zip is easy, just grab the stockbootanimation.zip I uploaded from the downloads section in this threads top bar and replace the bootanimation.zip using 7-Zip.

If you have time can have a go a toning down the glow that would be great :victory:

EDIT: zip attached
[Galaxy S 4 i9505 Android Development] John_wba:
GPS isn't working with the latest version for me, it reports I'm over 10miles away from where I'm actually sitting lol.

Tried all settings in stweaks and that doesn't help, nor does toggling gps on/off :(
[Galaxy S 4 i9505 Android Development] kantjer:
And now for something completely different (been looking for excuse to use this one :D)

With today's build I also flashed the 157 mini beta gapps and for the first time in months G-Play is auto updating my apps again :victory:
[Galaxy S 4 i9505 Android Development] kantjer:
Maps is placing me nicely behind my desk
[Galaxy S 4 i9505 Android Development] Bejda:
No, what i love with this multiboot solution is that it's very non-intrusive if i can say. A ****ing great tool for testers or even for a Dev that would maintain more than one rom for same device,we use the recovery we want etc..it's "all about" kernels ramdisk edits,scripts,regain the wasted space we have under the big /cache and /system partitions Samsung graciously offered us and an amazing cleverness (yeah I'm in love and i want the world to knows it lol).

We start messing a little with apk's sharing recently though but i don't think it could interferes here.

Maybe the ramdisk part we could think (for instance if you remember we once noticed on SlimKat thread that i was the only one having permissive SELinux) but for now,except for that SELinux story, i never noticed anything behaving differently than others users on any of the many roms i use and test.

Anyway I'll keep monitoring others reports and if indeed it's only me i'll keep searching out of curiosity and report by here if i find what's up just for the record.

What i really don't get is why the original STweaks implementation suddenly worked for after i updated from 07/11 to 07/14 build.

I'll do a factory reset very soon and see first if it brings me back to the common situation.
[Galaxy S 4 i9505 Android Development] John_wba:
For me I'm a very long walk away from where a should be lol, the weather app is now reporting a completely different area code too.
[Galaxy S 4 i9505 Android Development] Bejda:
:laugh: :good:
[Galaxy S 4 i9505 Android Development] Mistertac:
GPS is working good for me as well. Been using it most the day again.