Skip to content

Commit 386db82

Browse files
committed
Refactor ViewProfilePhoto class finder
1 parent 28d5d45 commit 386db82

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/src/main/java/com/wmods/wppenhacer/xposed/features/media/DownloadProfile.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
import com.wmods.wppenhacer.xposed.utils.ResId;
1515
import com.wmods.wppenhacer.xposed.utils.Utils;
1616

17+
import org.luckypray.dexkit.query.enums.StringMatchType;
18+
1719
import de.robv.android.xposed.XC_MethodHook;
1820
import de.robv.android.xposed.XSharedPreferences;
1921
import de.robv.android.xposed.XposedHelpers;
@@ -27,7 +29,8 @@ public DownloadProfile(@NonNull ClassLoader classLoader, @NonNull XSharedPrefere
2729
@Override
2830
public void doHook() throws Throwable {
2931
var loadProfileInfoField = Unobfuscator.loadProfileInfoField(classLoader);
30-
XposedHelpers.findAndHookMethod("com.whatsapp.profile.ViewProfilePhoto", classLoader, "onCreateOptionsMenu", Menu.class, new XC_MethodHook() {
32+
var profileClass = Unobfuscator.findFirstClassUsingName(classLoader, StringMatchType.EndsWith, "ViewProfilePhoto");
33+
XposedHelpers.findAndHookMethod(profileClass, "onCreateOptionsMenu", Menu.class, new XC_MethodHook() {
3134
@Override
3235
protected void afterHookedMethod(MethodHookParam param) throws Throwable {
3336
var menu = (Menu) param.args[0];

0 commit comments

Comments
 (0)