Skip to content

Commit 8f1d194

Browse files
committed
feat: add method to load and hook StatusStyle method for WhatsApp
1 parent 898306b commit 8f1d194

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2711,4 +2711,13 @@ public static Class<?> loadMediaDataVideoConfigurationClass(ClassLoader classLoa
27112711
return UnobfuscatorCache.getInstance().getClass(classLoader, () -> findFirstClassUsingStrings(classLoader, StringMatchType.Contains, "MediaDataVideoConfiguration("));
27122712
}
27132713

2714+
public static Method loadStatusStyleMethod(ClassLoader classLoader) throws Exception {
2715+
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
2716+
var method = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingNumber(8522).returnType(int.class))).singleOrNull();
2717+
if (method == null)
2718+
throw new NoSuchMethodException("StatusStyle method not found");
2719+
return method.getMethodInstance(classLoader);
2720+
});
2721+
}
2722+
27142723
}

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ public void doHook() throws Exception {
186186
}
187187

188188
// Whatsapp Status Style
189+
var retStatusStyle = Unobfuscator.loadStatusStyleMethod(classLoader);
190+
XposedBridge.hookMethod(retStatusStyle, XC_MethodReplacement.returnConstant(status_style));
189191
status_style = oldStatus ? 0 : status_style;
190192
propsInteger.put(9973, 1);
191193
propsBoolean.put(6285, true);

0 commit comments

Comments
 (0)