Skip to content

Commit 04d6e3d

Browse files
committed
Fix hide channels
1 parent d344fa2 commit 04d6e3d

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/core/devkit/Unobfuscator.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1534,17 +1534,12 @@ public synchronized static Method loadPlaybackSpeed(ClassLoader classLoader) thr
15341534
// });
15351535
// }
15361536

1537-
public synchronized static Constructor loadListUpdateItemsConstructor(ClassLoader classLoader) throws Exception {
1538-
return UnobfuscatorCache.getInstance().getConstructor(classLoader, () -> {
1539-
var method = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().paramCount(1).returnType(void.class).addParamType(Object.class).addUsingNumber(8686)));
1540-
if (method.isEmpty()) {
1541-
// for 22.xx, use alternative method
1542-
method = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().paramCount(1).returnType(void.class).addUsingString("deleted", StringMatchType.Equals).addUsingString("membership", StringMatchType.Equals)));
1543-
1544-
if (method.isEmpty())
1545-
throw new RuntimeException("ListUpdateItems method not found");
1546-
}
1547-
return method.get(0).getClassInstance(classLoader).getConstructors()[0];
1537+
public synchronized static Method loadListUpdateItems(ClassLoader classLoader) throws Exception {
1538+
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
1539+
var method = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString("Running diff util, updates list size", StringMatchType.Contains)));
1540+
if (method.isEmpty())
1541+
throw new RuntimeException("ListUpdateItems method not found");
1542+
return method.get(0).getMethodInstance(classLoader);
15481543
});
15491544
}
15501545

app/src/main/java/com/wmods/wppenhacer/xposed/features/others/Channels.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -49,19 +49,19 @@ public void doHook() throws Throwable {
4949
log("HeaderChannelItem: " + headerChannelItem);
5050
var listChannelItem = Unobfuscator.loadListChannelItemClass(classLoader);
5151
log("ListChannelItem: " + listChannelItem);
52-
var listUpdateItems = Unobfuscator.loadListUpdateItemsConstructor(classLoader);
53-
log("ListUpdateItems: " + Unobfuscator.getConstructorDescriptor(listUpdateItems));
54-
55-
XposedBridge.hookMethod(listUpdateItems,
56-
new XC_MethodHook() {
57-
@Override
58-
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
59-
var list = ReflectionUtils.findArrayOfType(param.args, ArrayList.class);
60-
if (list.isEmpty()) return;
61-
var arrList = (ArrayList<?>) list.get(0).second;
62-
removeItems(arrList, channels, removechannelRec, headerChannelItem, listChannelItem, removeChannelRecClass);
63-
}
64-
});
52+
var listUpdateItems = Unobfuscator.loadListUpdateItems(classLoader);
53+
log("ListUpdateItems: " + Unobfuscator.getMethodDescriptor(listUpdateItems));
54+
XposedBridge.hookMethod(listUpdateItems, new XC_MethodHook() {
55+
@Override
56+
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
57+
var results = ReflectionUtils.findArrayOfType(param.args, List.class);
58+
if (results.isEmpty()) return;
59+
var list = (List<?>) results.get(0).second;
60+
var arrList = new ArrayList<>(list);
61+
removeItems(arrList, channels, removechannelRec, headerChannelItem, listChannelItem, removeChannelRecClass);
62+
param.args[results.get(0).first] = arrList;
63+
}
64+
});
6565

6666
XposedBridge.hookAllConstructors(removeChannelRecClass, new XC_MethodHook() {
6767
@Override

0 commit comments

Comments
 (0)