Skip to content

Commit eecd183

Browse files
committed
Fix NPE in Anti Revoke and Refresh Status Class Not Found
Signed-off-by: Dev4Mod <[email protected]>
1 parent f10464a commit eecd183

File tree

2 files changed

+35
-6
lines changed

2 files changed

+35
-6
lines changed

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

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1963,10 +1963,41 @@ public static Class[] loadProximitySensorListenerClasses(ClassLoader classLoader
19631963

19641964
public static Class<?> loadRefreshStatusClass(ClassLoader classLoader) throws Exception {
19651965
return UnobfuscatorCache.getInstance().getClass(classLoader, () -> {
1966-
MethodDataList methods = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingNumber(8126).addUsingNumber(11917)));
1967-
if (methods.isEmpty())
1968-
throw new Exception("Refresh Status Class Not Found!");
1969-
return methods.get(0).getClassInstance(classLoader);
1966+
var strings = new String[]{"liveStatusUpdatesActive", "Statuses refreshed"};
1967+
for (var s : strings) {
1968+
MethodDataList methods = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString(s, StringMatchType.Contains)));
1969+
if (methods.isEmpty())
1970+
continue;
1971+
return methods.get(0).getClassInstance(classLoader);
1972+
}
1973+
// Let's look for forcibly on WhatsApp Web (very boring this)
1974+
var opcodes = List.of(
1975+
"invoke-static",
1976+
"move-result",
1977+
"if-eqz",
1978+
"iget-object",
1979+
"invoke-static",
1980+
"move-result-object",
1981+
"check-cast",
1982+
"invoke-virtual",
1983+
"move-result",
1984+
"xor-int/lit8",
1985+
"if-eqz",
1986+
"if-eqz",
1987+
"return",
1988+
"const/4",
1989+
"goto",
1990+
"const/4",
1991+
"return"
1992+
);
1993+
1994+
var constant = 0x3684;
1995+
MethodDataList methods = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingNumber(constant).opCodes(
1996+
OpCodesMatcher.create().opNames(opcodes).matchType(OpCodeMatchType.Contains)
1997+
)));
1998+
if (methods.size() == 1)
1999+
return methods.get(0).getClassInstance(classLoader);
2000+
throw new Exception("Refresh Status Class Not Found!");
19702001
});
19712002
}
19722003

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,14 +154,12 @@ private static HashSet<String> getRevokedMessages(FMessageWpp fMessage) {
154154

155155

156156
private void isMRevoked(Object objMessage, TextView dateTextView, String antirevokeType) {
157-
logDebug(dateTextView);
158157
if (dateTextView == null) return;
159158
var fMessage = new FMessageWpp(objMessage);
160159
var key = fMessage.getKey();
161160
var messageRevokedList = getRevokedMessages(fMessage);
162161
var id = fMessage.getRowId();
163162
String keyOrig = null;
164-
logDebug("Message ID: " + id);
165163
if (messageRevokedList.contains(key.messageID) || ((keyOrig = MessageStore.getInstance().getOriginalMessageKey(id)) != null && messageRevokedList.contains(keyOrig))) {
166164
var timestamp = DelMessageStore.getInstance(Utils.getApplication()).getTimestampByMessageId(keyOrig == null ? key.messageID : keyOrig);
167165
if (timestamp > 0) {

0 commit comments

Comments
 (0)