From a48a02e5c369815e2586e24d15f34f2ac31e800c Mon Sep 17 00:00:00 2001 From: RevealedSoulEven Date: Tue, 20 Jan 2026 10:03:21 +0530 Subject: [PATCH] Fix Profile Photos not being downloaded Fixed intermittent profile photo lookup failures by always resolving `@lid` to phone JID before file access. Prevents incorrect or missing profile images caused by unstable LID values. --- .../java/com/wmods/wppenhacer/xposed/core/WppCore.java | 9 +++++++++ .../xposed/features/media/DownloadProfile.java | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/wmods/wppenhacer/xposed/core/WppCore.java b/app/src/main/java/com/wmods/wppenhacer/xposed/core/WppCore.java index 4f87d2ff..df96d11d 100644 --- a/app/src/main/java/com/wmods/wppenhacer/xposed/core/WppCore.java +++ b/app/src/main/java/com/wmods/wppenhacer/xposed/core/WppCore.java @@ -523,6 +523,15 @@ public static Drawable getContactPhotoDrawable(String jid) { } public static File getContactPhotoFile(String jid) { + if (jid == null) return null; + + if (jid.contains("@lid")) { + Object phone = getPhoneJidFromUserJid(createUserJid(jid)); + if (phone != null) { + jid = (String) XposedHelpers.callMethod(phone, "getRawString"); + } + } + String datafolder = Utils.getApplication().getCacheDir().getParent() + "/"; File file = new File(datafolder + "/cache/" + "Profile Pictures" + "/" + stripJID(jid) + ".jpg"); if (!file.exists()) diff --git a/app/src/main/java/com/wmods/wppenhacer/xposed/features/media/DownloadProfile.java b/app/src/main/java/com/wmods/wppenhacer/xposed/features/media/DownloadProfile.java index 3108eb52..60cbde52 100644 --- a/app/src/main/java/com/wmods/wppenhacer/xposed/features/media/DownloadProfile.java +++ b/app/src/main/java/com/wmods/wppenhacer/xposed/features/media/DownloadProfile.java @@ -49,7 +49,7 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable { var fieldObj = ReflectionUtils.getObjectField(field, param.thisObject); var waContact = new WaContactWpp(fieldObj); var userJid = waContact.getUserJid(); - var file = WppCore.getContactPhotoFile(userJid.getUserRawString()); + var file = WppCore.getContactPhotoFile(userJid.getPhoneRawString()); String destPath; try { destPath = Utils.getDestination("Profile Photo");