Skip to content

Ads Intrusion Preventing Engine is a simple library to block ads Intrusion in the web data servers. this code is basically stopping the ads and remove the HTML from them and render it again.

Notifications You must be signed in to change notification settings

iAapTeck/Ads-Intrusion-Preventing-Engine

Repository files navigation

Ads Intrusion Preventing Engine Library

Ads Intrusion Preventing Engine is a simple library to block ads Intrusion in web dataserver. this code is basicaly stop the ads and remove the html from it and render it again.

How can you use this to your project?

Step 1

Add it in your root build.gradle at the end of repositories:

	allprojects {
		repositories {
			...
			maven { url 'https://jitpack.io' }
		}
	}

Step 2

Add the dependency in app level build.gradle file

	dependencies {
           implementation 'com.github.iAapTeck:Ads-Intrusion-Preventing-Engine:v1.0.1'
   }

Step 3

Inisialize the webview in your activity where you have the webview.

new AdsIntrusionPreventingEninge.init(this).initializeWebView(webView);

Step 4

Now to block ads intrusion, we need to add this code in the WebViewClient so extentd the WebViewClient for your webview like this and then in the class overide this method.

webView.setWebViewClient(new Browser_home());
private class Browser_home extends WebViewClient {

        Browser_home() {}

        @SuppressWarnings("deprecation")
        @Override
        public WebResourceResponse shouldInterceptRequest(WebView view, String url) {

            return AdsIntrusionPreventingEninge.blockAds(view,url) ? AdsIntrusionPrevention.createEmptyResource() :
                    super.shouldInterceptRequest(view, url);

        }

    }

Now you can run your app to see if the ads instrusion are blocked. You can always use other webview features and add fetures to the webview.

About

Ads Intrusion Preventing Engine is a simple library to block ads Intrusion in the web data servers. this code is basically stopping the ads and remove the HTML from them and render it again.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages