Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
feat: remove h5 pop-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
mkx173 committed Mar 16, 2024
1 parent 9fdba41 commit 00f4cee
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions app/src/main/java/gm/tieba/tabswitch/hooker/eliminate/Purge.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public List<? extends Matcher> matchers() {
new StringMatcher("top_level_navi"),
new StringMatcher("index_tab_info"),
new SmaliMatcher("Lcom/baidu/tbadk/coreExtra/floatCardView/AlaLiveTipView;-><init>(Landroid/content/Context;)V"),
new SmaliMatcher("Lcom/baidu/tbadk/editortools/meme/pan/SpriteMemePan;-><init>(Landroid/content/Context;)V")
new SmaliMatcher("Lcom/baidu/tbadk/editortools/meme/pan/SpriteMemePan;-><init>(Landroid/content/Context;)V"),
new StringMatcher("h5_pop_ups_config")
);
}

Expand Down Expand Up @@ -101,7 +102,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
JSONObject syncData = (JSONObject) ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
syncData.put("bottom_bubble_config", null);
}
});
Expand All @@ -112,7 +113,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
JSONObject syncData = (JSONObject) ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
syncData.put("top_level_navi", null);
}
});
Expand All @@ -123,7 +124,7 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
JSONObject syncData = (JSONObject) ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
JSONArray indexTabInfo = syncData.getJSONArray("index_tab_info");
JSONArray newIndexTabInfo = new JSONArray();
for (int i = 0; i < indexTabInfo.length(); i++) {
Expand All @@ -145,6 +146,18 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, "android.content.Context",
XC_MethodReplacement.returnConstant(null));
break;
case "h5_pop_ups_config": // 各种云控弹窗
if (method.equals("invoke")) {
XposedHelpers.findAndHookMethod(clazz, sClassLoader, method, new XC_MethodHook() {
@Override
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
JSONObject syncData = ReflectUtils.getObjectField(param.thisObject, JSONObject.class);
syncData.put("h5_pop_ups", null);
syncData.put("h5_pop_ups_config", null);
}
});
}
break;
}
});
// 启动广告
Expand Down

0 comments on commit 00f4cee

Please sign in to comment.