Skip to content

Commit c85485d

Browse files
committed
fix 21.77 support
1 parent ec16257 commit c85485d

File tree

2 files changed

+17
-5
lines changed

2 files changed

+17
-5
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ public synchronized static Method loadHideViewSendReadJob(ClassLoader classLoade
317317
public synchronized static Method loadHideViewInChatMethod(ClassLoader classLoader) throws Exception {
318318
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
319319
Method method = findFirstMethodUsingStrings(classLoader, StringMatchType.Contains, "ReadReceipts/acknowledgeMessageIfNeeded");
320+
if (method == null) method = findFirstMethodUsingStrings(classLoader, StringMatchType.Contains, "ReadReceipts/sendDeliveryReceiptIfNotRetry");
320321
if (method == null) throw new Exception("HideViewInChat method not found");
321322
return method;
322323
});
@@ -1229,6 +1230,8 @@ public synchronized static Method loadOnUpdateStatusChanged(ClassLoader loader)
12291230
var clazzData = dexkit.getClassData(clazz);
12301231
var methodSeduleche = XposedHelpers.findMethodBestMatch(Timer.class, "schedule", TimerTask.class, long.class, long.class);
12311232
var result = dexkit.findMethod(new FindMethod().searchInClass(List.of(clazzData)).matcher(new MethodMatcher().addInvoke(DexSignUtil.getMethodDescriptor(methodSeduleche))));
1233+
if (result.isEmpty())
1234+
result = dexkit.findMethod(new FindMethod().searchInClass(List.of(clazzData)).matcher(new MethodMatcher().addUsingString("UpdatesViewModel/Scheduled updates list refresh")));
12321235
if (result.isEmpty())
12331236
throw new RuntimeException("OnUpdateStatusChanged method not found");
12341237
return result.get(0).getMethodInstance(loader);
@@ -1395,7 +1398,8 @@ public synchronized static Constructor loadStartPrefsConfig(ClassLoader loader)
13951398
}
13961399

13971400
public synchronized static Method loadCheckOnlineMethod(ClassLoader loader) throws Exception {
1398-
var method = findFirstMethodUsingStrings(loader, StringMatchType.Contains, "app/xmpp/recv/handle_available");
1401+
var method = findFirstMethodUsingStrings(loader, StringMatchType.Contains, "MessageHandler/handleConnectionThreadReady connectionready");
1402+
if (method == null) method = findFirstMethodUsingStrings(loader, StringMatchType.Contains, "app/xmpp/recv/handle_available");
13991403
if (method == null) throw new RuntimeException("CheckOnline method not found");
14001404
return method;
14011405
}
@@ -1906,6 +1910,14 @@ public static Class<?> loadFilterItemClass(ClassLoader classLoader) throws Excep
19061910
MethodMatcher.create().addUsingNumber(Utils.getID("invisible_height_placeholder", "id"))
19071911
.addUsingNumber(Utils.getID("container_view", "id"))
19081912
));
1913+
if (methodList.isEmpty()) {
1914+
var applyClazz = findFirstClassUsingStrings(classLoader, StringMatchType.Contains, "has_seen_detected_outcomes_nux");
1915+
if (applyClazz != null) {
1916+
methodList = dexkit.findMethod(FindMethod.create().matcher(
1917+
MethodMatcher.create().paramTypes(View.class, applyClazz)
1918+
));
1919+
}
1920+
}
19091921
if (methodList.isEmpty()) throw new RuntimeException("FilterItemClass Not Found");
19101922
return methodList.get(0).getClassInstance(classLoader);
19111923
});

app/src/main/java/com/wmods/wppenhacer/xposed/features/customization/IGStatus.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import com.wmods.wppenhacer.xposed.utils.Utils;
1717

1818
import java.util.ArrayList;
19+
import java.util.Arrays;
1920
import java.util.List;
2021

2122
import de.robv.android.xposed.XC_MethodHook;
@@ -103,12 +104,11 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
103104
XposedBridge.hookAllConstructors(onStatusListUpdatesClass, new XC_MethodHook() {
104105
@Override
105106
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
106-
var list1 = (List) param.args[2];
107-
var list2 = (List) param.args[3];
107+
final var lists = Arrays.stream(param.args).filter(v -> v instanceof List<?>).toArray();
108108
itens.clear();
109109
itens.add(0, null);
110-
itens.addAll(list1);
111-
itens.addAll(list2);
110+
itens.addAll((List) lists[0]);
111+
itens.addAll((List) lists[1]);
112112
for (var mStatusContainer : mListStatusContainer)
113113
mStatusContainer.updateList();
114114
}

0 commit comments

Comments
 (0)