Skip to content

Commit

Permalink
Make codes better
Browse files Browse the repository at this point in the history
  • Loading branch information
Chipppppppppp committed Jan 21, 2024
1 parent 07c4c1f commit c4731e5
Showing 1 changed file with 26 additions and 98 deletions.
124 changes: 26 additions & 98 deletions app/src/main/java/io/github/chipppppppppp/lime/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -82,104 +82,32 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
view.setLayoutParams(layoutParams);
}
});
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 {
((View) param.thisObject).setVisibility(View.GONE);
}
});
hookTarget = lparam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.inventory.home.LadHomeBigBannerImageAdView");
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.LadHomeBigBannerVideoAdView");
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.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 {
((View) param.thisObject).setVisibility(View.GONE);
}
});
String[] adClassNames = {
"com.linecorp.line.ladsdk.ui.inventory.album.LadAlbumImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomeBigBannerImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomeBigBannerVideoAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomeImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomePerformanceAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomeYjBigBannerAdView",
"com.linecorp.line.ladsdk.ui.inventory.home.LadHomeYjImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.openchat.LadOpenChatHeaderAdView",
"com.linecorp.line.ladsdk.ui.inventory.openchat.LadOpenChatImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.timeline.post.LadPostAdView",
"com.linecorp.line.ladsdk.ui.inventory.wallet.LadWalletBigBannerImageAdView",
"com.linecorp.line.ladsdk.ui.inventory.wallet.LadWalletBigBannerVideoAdView",
"com.linecorp.square.v2.view.ad.common.SquareCommonHeaderGoogleBannerAdView",
"com.linecorp.square.v2.view.ad.common.SquareCommonHeaderGoogleNativeAdView",
};

for (String adClassName : adClassNames) {
hookTarget = lparam.classLoader.loadClass(adClassName);
XposedBridge.hookAllConstructors(hookTarget, new XC_MethodHook() {
@Override
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
((View) param.thisObject).setVisibility(View.GONE);
}
});
}
}

if (redirectWebView) {
Expand Down

0 comments on commit c4731e5

Please sign in to comment.