From ed1b991368c2b55f4d645f61fc59c012d9227784 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sun, 6 Oct 2024 20:25:33 +0900 Subject: [PATCH] Fix variable --- .../chipppppppppp/lime/hooks/RemoveAds.java | 20 ++----------------- 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/app/src/main/java/io/github/chipppppppppp/lime/hooks/RemoveAds.java b/app/src/main/java/io/github/chipppppppppp/lime/hooks/RemoveAds.java index 0618d7a3..b4ddeb26 100644 --- a/app/src/main/java/io/github/chipppppppppp/lime/hooks/RemoveAds.java +++ b/app/src/main/java/io/github/chipppppppppp/lime/hooks/RemoveAds.java @@ -16,16 +16,13 @@ import io.github.chipppppppppp.lime.LimeOptions; public class RemoveAds implements IHook { - - static final List adClassNames = new ArrayList<>(List.of( - )); + List adClassNames; @Override public void hook(LimeOptions limeOptions, XC_LoadPackage.LoadPackageParam loadPackageParam) throws Throwable { if (!limeOptions.removeAds.checked) return; - XposedBridge.hookAllMethods( loadPackageParam.classLoader.loadClass(Constants.REQUEST_HOOK.className), Constants.REQUEST_HOOK.methodName, @@ -40,7 +37,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { } ); - XposedHelpers.findAndHookMethod( loadPackageParam.classLoader.loadClass("com.linecorp.line.admolin.smartch.v2.view.SmartChannelViewLayout"), "dispatchDraw", @@ -53,7 +49,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { } ); - XposedHelpers.findAndHookMethod( loadPackageParam.classLoader.loadClass("com.linecorp.line.ladsdk.ui.common.view.lifecycle.LadAdView"), "onAttachedToWindow", @@ -68,7 +63,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { } } ); - XposedHelpers.findAndHookMethod( ViewGroup.class, @@ -79,25 +73,16 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable { @Override protected void afterHookedMethod(MethodHookParam param) throws Throwable { View view = (View) param.args[0]; - String className = view.getClass().getName(); - - + String className = view.getClass().getName(); if (className.contains("Ad") ) { - - - if (!adClassNames.contains(className)) { adClassNames.add(className); - } - - view.setVisibility(View.GONE); } } } ); - for (String adClassName : adClassNames) { XposedBridge.hookAllConstructors( @@ -119,7 +104,6 @@ public void onGlobalLayout() { } ); } - XposedHelpers.findAndHookMethod( loadPackageParam.classLoader.loadClass(Constants.WEBVIEW_CLIENT_HOOK.className),