Skip to content

Commit 6d8352b

Browse files
committed
Refactor DownloadProfile to utilize WaContactWpp for user Jid retrieval
1 parent ffb6318 commit 6d8352b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import com.wmods.wppenhacer.xposed.core.Feature;
1111
import com.wmods.wppenhacer.xposed.core.WppCore;
1212
import com.wmods.wppenhacer.xposed.core.components.FMessageWpp;
13+
import com.wmods.wppenhacer.xposed.core.components.WaContactWpp;
1314
import com.wmods.wppenhacer.xposed.core.devkit.Unobfuscator;
1415
import com.wmods.wppenhacer.xposed.utils.ReflectionUtils;
1516
import com.wmods.wppenhacer.xposed.utils.ResId;
@@ -45,9 +46,10 @@ protected void afterHookedMethod(MethodHookParam param) throws Throwable {
4546
return true;
4647
}
4748
var field = ReflectionUtils.getFieldByType(subCls, loadProfileInfoField.getDeclaringClass());
48-
var jidObj = ReflectionUtils.getObjectField(loadProfileInfoField, ReflectionUtils.getObjectField(field, param.thisObject));
49-
var userJid = new FMessageWpp.UserJid(jidObj);
50-
var file = WppCore.getContactPhotoFile(userJid.getPhoneRawString());
49+
var fieldObj = ReflectionUtils.getObjectField(field, param.thisObject);
50+
var waContact = new WaContactWpp(fieldObj);
51+
var userJid = waContact.getUserJid();
52+
var file = WppCore.getContactPhotoFile(userJid.getUserRawString());
5153
String destPath;
5254
try {
5355
destPath = Utils.getDestination("Profile Photo");

0 commit comments

Comments
 (0)