Skip to content

Commit

Permalink
Fix variable
Browse files Browse the repository at this point in the history
  • Loading branch information
s1204IT authored Oct 6, 2024
1 parent 050f9ff commit ed1b991
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,13 @@
import io.github.chipppppppppp.lime.LimeOptions;

public class RemoveAds implements IHook {

static final List<String> adClassNames = new ArrayList<>(List.of(

));
List<String> 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,
Expand All @@ -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",
Expand All @@ -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",
Expand All @@ -68,7 +63,6 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
}
}
);


XposedHelpers.findAndHookMethod(
ViewGroup.class,
Expand All @@ -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(
Expand All @@ -119,7 +104,6 @@ public void onGlobalLayout() {
}
);
}


XposedHelpers.findAndHookMethod(
loadPackageParam.classLoader.loadClass(Constants.WEBVIEW_CLIENT_HOOK.className),
Expand Down

0 comments on commit ed1b991

Please sign in to comment.