Skip to content

Commit

Permalink
Update ad-blocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Jan 21, 2024
1 parent bf6f363 commit 8b9e6a1
Showing 1 changed file with 75 additions and 3 deletions.
78 changes: 75 additions & 3 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package io.github.chipppppppppp.lime;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.graphics.Canvas;
import android.net.Uri;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import androidx.browser.customtabs.CustomTabsIntent;

Expand Down Expand Up @@ -78,7 +78,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomeImageAdView");
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.album.LadAlbumImageAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Expand All @@ -99,7 +99,77 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.album.LadAlbumImageAdView");
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomeImageAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomePerformanceAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomeYjBigBannerAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomeYjImageAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.openchat.LadOpenChatHeaderAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.openchat.LadOpenChatImageAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.timeline.post.LadPostAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.wallet.LadWalletBigBannerImageAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.wallet.LadWalletBigBannerVideoAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.square.v2.view.ad.common.SquareCommonHeaderGoogleBannerAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.square.v2.view.ad.common.SquareCommonHeaderGoogleNativeAdView");
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
Expand All @@ -114,6 +184,8 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
WebView webView = (WebView) param.thisObject;
Context context = webView.getContext();
if (!(context instanceof Activity)) return;
Activity activity = (Activity) webView.getContext();
if (!activity.getClass().getName().equals("jp.naver.line.android.activity.iab.InAppBrowserActivity")) return;
webView.setVisibility(View.GONE);
Expand Down

0 comments on commit 8b9e6a1

Please sign in to comment.