Skip to content

Commit de24aa5

Browse files
committed
Refactor UpdateChecker and Unobfuscator for AlertDialogWpp and Dexkit API
Signed-off-by: Dev4Mod <[email protected]>
1 parent 0131c44 commit de24aa5

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

app/src/main/java/com/wmods/wppenhacer/UpdateChecker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package com.wmods.wppenhacer;
22

33
import android.app.Activity;
4-
import android.app.AlertDialog;
54
import android.text.Html;
65

76
import com.wmods.wppenhacer.xposed.core.WppCore;
7+
import com.wmods.wppenhacer.xposed.core.components.AlertDialogWpp;
88
import com.wmods.wppenhacer.xposed.utils.Utils;
99

1010
import java.util.Objects;
@@ -42,7 +42,7 @@ public void run() {
4242
var changelogText = content.substring(changelogIndex, closeTag + 6);
4343
var changelog = Html.fromHtml(changelogText, Html.FROM_HTML_MODE_COMPACT).toString();
4444
mActivity.runOnUiThread(() -> {
45-
AlertDialog.Builder dialog = new AlertDialog.Builder(mActivity);
45+
var dialog = new AlertDialogWpp(mActivity);
4646
dialog.setTitle("WAE - New version available!");
4747
dialog.setMessage("Changelog:\n\n" + changelog);
4848
dialog.setNegativeButton("Ignore", (dialog1, which) -> {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ public synchronized static Method loadReceiptOutsideChat(ClassLoader classLoader
232232
public synchronized static Method loadReceiptInChat(ClassLoader classLoader) throws Exception {
233233
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
234234
var method = loadReceiptMethod(classLoader);
235-
var methodDataList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("callCreatorJid").addUsingString("reject").addInvoke(DexSignUtil.getMethodDescriptor(method))));
235+
var methodDataList = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString("callCreatorJid").addUsingString("reject").addInvoke(DexSignUtil.getMethodDescriptor(method))));
236236
if (methodDataList.isEmpty()) throw new Exception("Receipt method not found");
237237
return methodDataList.get(0).getMethodInstance(classLoader);
238238
});
@@ -243,7 +243,7 @@ public synchronized static Method loadReceiptInChat(ClassLoader classLoader) thr
243243
public synchronized static Method loadForwardTagMethod(ClassLoader classLoader) throws Exception {
244244
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
245245
Class<?> messageInfoClass = loadFMessageClass(classLoader);
246-
var methodList = dexkit.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("chatInfo/incrementUnseenImportantMessageCount")));
246+
var methodList = dexkit.findMethod(FindMethod.create().matcher(MethodMatcher.create().addUsingString("chatInfo/incrementUnseenImportantMessageCount")));
247247
if (methodList.isEmpty()) throw new Exception("ForwardTag method support not found");
248248
var invokes = methodList.get(0).getInvokes();
249249
for (var invoke : invokes) {

0 commit comments

Comments
 (0)