Skip to content

Commit ffb6318

Browse files
committed
Fix SeenTick and HideSeen features
1 parent cbf85bc commit ffb6318

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/features/general/SeenTick.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,7 +472,7 @@ private void sendBlueTickMedia(FMessageWpp fMessage) {
472472
if (userJid.isGroup()) {
473473
participant = fMessage.getUserJid().userJid;
474474
}
475-
var sendPlayerClass = XposedHelpers.findClass("com.whatsapp.jobqueue.job.SendPlayedReceiptJobV2", classLoader);
475+
var sendPlayerClass = Unobfuscator.findFirstClassUsingName(classLoader,StringMatchType.Contains,"SendPlayedReceiptJob");
476476
var constructor = sendPlayerClass.getDeclaredConstructors()[0];
477477
var classParticipantInfo = constructor.getParameterTypes()[0];
478478
var rowsId = new Long[]{fMessage.getRowId()};

app/src/main/java/com/wmods/wppenhacer/xposed/features/privacy/HideSeen.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,21 +96,14 @@ protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
9696
Method ReceiptMethod = Unobfuscator.loadReceiptMethod(classLoader);
9797
logDebug(Unobfuscator.getMethodDescriptor(ReceiptMethod));
9898

99-
Method hideViewInChatMethod = Unobfuscator.loadHideViewInChatMethod(classLoader);
100-
logDebug("Inside Chat", Unobfuscator.getMethodDescriptor(hideViewInChatMethod));
101-
102-
var outsideMethod = Unobfuscator.loadReceiptOutsideChat(classLoader);
103-
logDebug("Outside Chat", Unobfuscator.getMethodDescriptor(outsideMethod));
104-
105-
10699
XposedBridge.hookMethod(ReceiptMethod, new XC_MethodHook() {
107100
@Override
108101
protected void beforeHookedMethod(MethodHookParam param) throws Throwable {
109-
if (ReflectionUtils.isCalledFromMethod(outsideMethod) || !ReflectionUtils.isCalledFromMethod(hideViewInChatMethod))
110-
return;
102+
var userJid = ReflectionUtils.getArg(param.args, classLoader.loadClass("com.whatsapp.jid.Jid"), 0);
103+
if (userJid == null) return;
111104
var msgTypeIdx = ReflectionUtils.findIndexOfType(((Method) param.method).getParameterTypes(), String.class);
112105
if (!Objects.equals("read", param.args[msgTypeIdx])) return;
113-
var currentUserJid = WppCore.getCurrentUserJid();
106+
var currentUserJid = new FMessageWpp.UserJid(userJid);
114107
var privacy = CustomPrivacy.getJSON(currentUserJid.getPhoneNumber());
115108
var customHideRead = privacy.optBoolean("HideSeen", hideread);
116109
if (currentUserJid.isGroup()) {

app/src/main/java/com/wmods/wppenhacer/xposed/utils/ReflectionUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public static List<Field> getFieldsByType(Class<?> cls, Class<?> type) {
148148
public static Field getFieldByExtendType(Class<?> cls, String className) {
149149
if (cls == null) return null;
150150
if (className == null) return null;
151-
return getFieldByExtendType(cls, findClass(className,cls.getClassLoader()));
151+
return getFieldByExtendType(cls, findClass(className, cls.getClassLoader()));
152152
}
153153

154154
public static Field getFieldByExtendType(Class<?> cls, Class<?> type) {
@@ -181,7 +181,7 @@ public static Field getFieldByExtendType(Class<?> cls, Class<?> type) {
181181
public static Field getFieldByType(Class<?> cls, String className) {
182182
if (cls == null) return null;
183183
if (className == null) return null;
184-
return getFieldByType(cls, findClass(className,cls.getClassLoader()));
184+
return getFieldByType(cls, findClass(className, cls.getClassLoader()));
185185
}
186186

187187

@@ -333,7 +333,7 @@ public synchronized static boolean isCalledFromMethod(Method method) {
333333

334334
public static <T> T getArg(Object[] args, Class<T> typeClass, int i) {
335335
var list = findArrayOfType(args, typeClass);
336-
if (list.size() <= i) throw new IllegalArgumentException("Index out of bounds for args");
336+
if (list.size() <= i) return null;
337337
return typeClass.cast(list.get(i).second);
338338
}
339339

0 commit comments

Comments
 (0)