Skip to content

Commit 4ef7a6e

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 25704f8 + 8b584ae commit 4ef7a6e

File tree

4 files changed

+36
-20
lines changed

4 files changed

+36
-20
lines changed

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

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ public synchronized static Method loadPinnedLimitMethod(ClassLoader loader) thro
875875

876876
public synchronized static Method loadPinnedHashSetMethod(ClassLoader loader) throws Exception {
877877
return UnobfuscatorCache.getInstance().getMethod(loader, () -> {
878-
var clazz = findFirstClassUsingStrings(loader, StringMatchType.Contains, "SELECT jid, pinned_time FROM settings");
878+
var clazz = findFirstClassUsingStrings(loader, StringMatchType.Contains, "getPinnedJids/QUERY_CHAT_SETTINGS");
879879
if (clazz == null) throw new Exception("PinnedList class not found");
880880
var method = Arrays.stream(clazz.getDeclaredMethods()).filter(m -> m.getReturnType().equals(Set.class)).findFirst().orElse(null);
881881
if (method == null) throw new Exception("PinnedHashSet method not found");
@@ -967,6 +967,14 @@ public synchronized static Method loadNewMessageMethod(ClassLoader loader) throw
967967
var field = clazzMessage.getDeclaredField("A02");
968968
methodData = clazzData.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingField(DexSignUtil.getFieldDescriptor(field)).returnType(String.class)));
969969
}
970+
if (methodData.isEmpty()) {
971+
var csClazzData = dexkit.findClass(FindClass.create().matcher(ClassMatcher.create().addUsingString("FMessageSystemScheduledCallStart/setData index out of bounds: "))).singleOrNull();
972+
if (csClazzData != null) {
973+
var csClazz = csClazzData.getInstance(loader);
974+
var field = csClazz.getDeclaredField("A02");
975+
methodData = clazzData.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingField(DexSignUtil.getFieldDescriptor(field)).returnType(String.class)));
976+
}
977+
}
970978
if (methodData.isEmpty()) throw new RuntimeException("NewMessage method not found");
971979
return methodData.get(0).getMethodInstance(loader);
972980
});
@@ -1013,7 +1021,8 @@ public synchronized static Method loadGetEditMessageMethod(ClassLoader loader) t
10131021
}
10141022

10151023
// 21.xx+ method (static)
1016-
if (Modifier.isStatic(invoke.getMethodInstance(loader).getModifiers()) && Objects.equals(invoke.getParamTypes().get(0), methodData.getParamTypes().get(0))) {
1024+
// 25.xx+ added additional type check
1025+
if (Modifier.isStatic(invoke.getMethodInstance(loader).getModifiers()) && Objects.equals(invoke.getParamTypes().get(0), methodData.getParamTypes().get(0)) && !Objects.equals(invoke.getParamTypes().get(0), invoke.getDeclaredClass())) {
10171026
return invoke.getMethodInstance(loader);
10181027
}
10191028
}
@@ -1209,10 +1218,11 @@ public synchronized static Constructor loadSeeMoreConstructor(ClassLoader loader
12091218
var clazzData = classList.get(0);
12101219
XposedBridge.log(clazzData.toString());
12111220
for (var method : clazzData.getMethods()) {
1212-
if (method.getParamCount() == 2 && method.isConstructor() && method.getParamTypes().get(0).getName().equals(int.class.getName()) && method.getParamTypes().get(1).getName().equals(int.class.getName())) {
1221+
if (Arrays.asList(2, 3).contains(method.getParamCount()) && method.isConstructor() && method.getParamTypes().stream().allMatch(c -> c.getName().equals(int.class.getName()))) {
12131222
return method.getConstructorInstance(loader);
12141223
}
12151224
}
1225+
12161226
throw new RuntimeException("SeeMore constructor 2 not found");
12171227
});
12181228
}
@@ -1549,20 +1559,24 @@ public synchronized static Method loadTextStatusComposer2(ClassLoader classLoade
15491559
addMethod(MethodMatcher.create().paramCount(1).addParamType(TextDataClass))
15501560
));
15511561
if (result.isEmpty()) {
1552-
result = dexkit.findClass(FindClass.create().matcher(
1553-
ClassMatcher.create().addUsingString("ViewOnce messages can not be forwarded").
1554-
addMethod(MethodMatcher.create().paramCount(1).addParamType(TextDataClass))
1555-
));
1556-
if (result.isEmpty()) {
1557-
throw new RuntimeException("TextStatusComposer2 class not found");
1562+
var tscClazzData = dexkit.getClassData("com.whatsapp.statuscomposer.composer.TextStatusComposerFragment");
1563+
if (tscClazzData != null) {
1564+
for (var method : tscClazzData.getMethods()) {
1565+
var tdMethod = method.getInvokes().stream().filter(m -> m.isMethod() && m.getParamCount() == 1 && m.getParamTypes().get(0).equals(dexkit.getClassData(TextDataClass))).findFirst();
1566+
if (tdMethod.isPresent()) {
1567+
return tdMethod.get().getMethodInstance(classLoader);
1568+
}
1569+
}
15581570
}
1571+
1572+
throw new RuntimeException("TextStatusComposer2 class not found 1");
15591573
}
15601574

15611575
var foundClass = result.get(0).getInstance(classLoader);
15621576
var resultMethod = ReflectionUtils.findMethodUsingFilter(foundClass, method -> method.getParameterCount() == 1 && method.getParameterTypes()[0] == TextDataClass);
15631577
if (resultMethod != null)
15641578
return resultMethod;
1565-
throw new RuntimeException("TextStatusComposer2 method not found");
1579+
throw new RuntimeException("TextStatusComposer2 method not found 2");
15661580
});
15671581
}
15681582

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,21 @@ public void doHook() throws Throwable {
3636
@SuppressLint("ResourceType")
3737
@Override
3838
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
39-
var fMessage = XposedHelpers.callMethod(param.thisObject, "getFMessage");
39+
var targetObj = param.thisObject != null
40+
? param.thisObject
41+
: param.args[1];
42+
43+
var fMessage = XposedHelpers.callMethod(targetObj, "getFMessage");
4044
var userJidClass = XposedHelpers.findClass("com.whatsapp.jid.UserJid", classLoader);
4145
var methodResult = ReflectionUtils.findMethodUsingFilter(fMessage.getClass(), method -> method.getReturnType() == userJidClass && method.getParameterCount() == 0);
4246
var userJid = ReflectionUtils.callMethod(methodResult, fMessage);
4347
var chatCurrentJid = WppCore.getCurrentRawJID();
4448
if (!WppCore.isGroup(chatCurrentJid)) return;
45-
var field = ReflectionUtils.getFieldByType(param.thisObject.getClass(), grpcheckAdmin.getDeclaringClass());
46-
var grpParticipants = field.get(param.thisObject);
49+
var field = ReflectionUtils.getFieldByType(targetObj.getClass(), grpcheckAdmin.getDeclaringClass());
50+
var grpParticipants = field.get(targetObj);
4751
var jidGrp = jidFactory.invoke(null, chatCurrentJid);
4852
var result = ReflectionUtils.callMethod(grpcheckAdmin, grpParticipants, jidGrp, userJid);
49-
var view = (View) param.thisObject;
53+
var view = (View) targetObj;
5054
var context = view.getContext();
5155
ImageView iconAdmin;
5256
if ((iconAdmin = view.findViewById(0x7fff0010)) == null) {

app/src/main/res/values/arrays.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@
120120
<item>2.24.23.xx</item>
121121
<item>2.24.24.xx</item>
122122
<item>2.24.25.xx</item>
123+
<item>2.24.26.xx</item>
123124
</string-array>
124125
<string-array name="supported_versions_business">
125126
<item>2.24.20.xx</item>
@@ -128,6 +129,7 @@
128129
<item>2.24.23.xx</item>
129130
<item>2.24.24.xx</item>
130131
<item>2.24.25.xx</item>
132+
<item>2.24.26.xx</item>
131133
</string-array>
132134
<string-array name="image_picker">
133135
<item>image/*</item>

changelog.txt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,2 @@
1-
[FIXES]
2-
* Fixed the bug in WhatsApp Business that prevented sending media
3-
* Fixed the bug in WhatsApp Beta 2.24.25.12 that prevented showing Online/Recent contacts on the home screen
4-
5-
[FEATURES]
6-
* Added IGStatus for WhatsApp Business.
1+
[WHATSAPP]
2+
* Added compatibility with version 2.24.26.xx by frknkrc44

0 commit comments

Comments
 (0)