Skip to content

Commit 9953532

Browse files
committed
Fix SendReadReceiptJob class loading
1 parent ef223ed commit 9953532

File tree

6 files changed

+18
-9
lines changed

6 files changed

+18
-9
lines changed

app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@
140140
tools:ignore="ExportedReceiver">
141141
<intent-filter>
142142
<action android:name="com.facebook.GET_PHONE_ID" />
143+
<action android:name="android.support.customtabs.action.CustomTabsService"/>
143144
</intent-filter>
144145
</receiver>
145146

app/src/main/java/com/wmods/wppenhacer/xposed/bridge/client/BridgeClient.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,19 @@ public CompletableFuture<Boolean> connect() {
5959
CompletableFuture<Boolean> future = CompletableFuture.supplyAsync(() -> {
6060
try {
6161
Intent intent = new Intent();
62-
intent.setClassName(BuildConfig.APPLICATION_ID, ForceStartActivity.class.getName())
63-
.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
62+
intent.setComponent(new ComponentName(BuildConfig.APPLICATION_ID, ForceStartActivity.class.getName()));
63+
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_MULTIPLE_TASK);
6464
context.startActivity(intent);
65+
} catch (Throwable e) {
66+
XposedBridge.log(e);
67+
}
6568

66-
intent.setClassName(BuildConfig.APPLICATION_ID, BridgeService.class.getName());
69+
try {
6770
if (service != null) {
6871
context.unbindService(this);
6972
}
70-
73+
Intent intent = new Intent();
74+
intent.setClassName(BuildConfig.APPLICATION_ID, BridgeService.class.getName());
7175
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
7276
context.bindService(intent, Context.BIND_AUTO_CREATE, Executors.newSingleThreadExecutor(), this);
7377
} else {

app/src/main/java/com/wmods/wppenhacer/xposed/core/WppCore.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@
2222
import com.wmods.wppenhacer.xposed.core.components.FMessageWpp;
2323
import com.wmods.wppenhacer.xposed.core.devkit.Unobfuscator;
2424
import com.wmods.wppenhacer.xposed.core.devkit.UnobfuscatorCache;
25-
import com.wmods.wppenhacer.xposed.utils.DebugUtils;
2625
import com.wmods.wppenhacer.xposed.utils.ReflectionUtils;
2726
import com.wmods.wppenhacer.xposed.utils.ResId;
2827
import com.wmods.wppenhacer.xposed.utils.Utils;
2928

3029
import org.json.JSONObject;
30+
import org.luckypray.dexkit.query.enums.StringMatchType;
3131

3232
import java.io.File;
3333
import java.lang.reflect.Field;
@@ -74,7 +74,7 @@ public static void Initialize(ClassLoader loader, XSharedPreferences pref) throw
7474
privPrefs = Utils.getApplication().getSharedPreferences("WaGlobal", Context.MODE_PRIVATE);
7575
FMessageWpp.initialize(loader);
7676
// init UserJID
77-
var mSendReadClass = XposedHelpers.findClass("com.whatsapp.jobqueue.job.SendReadReceiptJob", loader);
77+
var mSendReadClass = Unobfuscator.findFirstClassUsingName(loader, StringMatchType.EndsWith,"SendReadReceiptJob");
7878
var subClass = ReflectionUtils.findConstructorUsingFilter(mSendReadClass, (constructor) -> constructor.getParameterCount() == 8).getParameterTypes()[0];
7979
mGenJidClass = ReflectionUtils.findFieldUsingFilter(subClass, (field) -> Modifier.isStatic(field.getModifiers())).getType();
8080
mGenJidMethod = ReflectionUtils.findMethodUsingFilter(mGenJidClass, (method) -> method.getParameterCount() == 1 && !Modifier.isStatic(method.getModifiers()));

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public synchronized static Class<?> loadForwardClassMethod(ClassLoader classLoad
311311
// TODO: Classes and Methods for HideView
312312
public synchronized static Method loadHideViewSendReadJob(ClassLoader classLoader) throws Exception {
313313
return UnobfuscatorCache.getInstance().getMethod(classLoader, () -> {
314-
var classData = dexkit.getClassData(XposedHelpers.findClass("com.whatsapp.jobqueue.job.SendReadReceiptJob", classLoader));
314+
var classData = dexkit.getClassData(findFirstClassUsingName(classLoader, StringMatchType.EndsWith,"SendReadReceiptJob"));
315315
var methodResult = classData.findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("receipt", StringMatchType.Equals)));
316316
if (methodResult.isEmpty()) {
317317
methodResult = classData.getSuperClass().findMethod(new FindMethod().matcher(new MethodMatcher().addUsingString("receipt", StringMatchType.Equals)));

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@
3131
import com.wmods.wppenhacer.xposed.utils.ResId;
3232
import com.wmods.wppenhacer.xposed.utils.Utils;
3333

34+
import org.luckypray.dexkit.query.enums.StringMatchType;
35+
3436
import java.lang.reflect.Method;
3537
import java.util.ArrayList;
3638
import java.util.Arrays;
@@ -87,7 +89,7 @@ public void doHook() throws Throwable {
8789

8890
WaJobManagerMethod = Unobfuscator.loadBlueOnReplayWaJobManagerMethod(classLoader);
8991

90-
mSendReadClass = XposedHelpers.findClass("com.whatsapp.jobqueue.job.SendReadReceiptJob", classLoader);
92+
mSendReadClass = Unobfuscator.findFirstClassUsingName(classLoader, StringMatchType.EndsWith,"SendReadReceiptJob");
9193

9294
// hook instance of WaJobManager;
9395

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
import com.wmods.wppenhacer.xposed.features.customization.HideSeenView;
1111
import com.wmods.wppenhacer.xposed.utils.ReflectionUtils;
1212

13+
import org.luckypray.dexkit.query.enums.StringMatchType;
14+
1315
import java.lang.reflect.Method;
1416
import java.util.Objects;
1517
import java.util.Set;
@@ -30,7 +32,7 @@ public void doHook() throws Exception {
3032

3133

3234
Method SendReadReceiptJobMethod = Unobfuscator.loadHideViewSendReadJob(classLoader);
33-
var sendJob = XposedHelpers.findClass("com.whatsapp.jobqueue.job.SendReadReceiptJob", classLoader);
35+
var sendJob = Unobfuscator.findFirstClassUsingName(classLoader, StringMatchType.EndsWith,"SendReadReceiptJob");
3436
log(Unobfuscator.getMethodDescriptor(SendReadReceiptJobMethod));
3537

3638
var ghostmode = WppCore.getPrivBoolean("ghostmode", false);

0 commit comments

Comments
 (0)