From 45f7cc44841017d439b1ffab1659d5692b06a5a5 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Wed, 13 Dec 2023 21:23:31 +0300 Subject: [PATCH] fixed friends recomms issue --- .../lite/api/execute/GetFullUserProfile.java | 21 ++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/vtosters/lite/api/execute/GetFullUserProfile.java b/app/src/main/java/com/vtosters/lite/api/execute/GetFullUserProfile.java index 912ec28d6..a99ef2ba5 100644 --- a/app/src/main/java/com/vtosters/lite/api/execute/GetFullUserProfile.java +++ b/app/src/main/java/com/vtosters/lite/api/execute/GetFullUserProfile.java @@ -4,7 +4,6 @@ import android.annotation.SuppressLint; import android.graphics.RectF; import android.text.TextUtils; import android.util.Log; -import android.util.Pair; import android.util.SparseArray; import com.vk.api.base.utils.ApiUtils; import com.vk.core.network.Network; @@ -13,6 +12,7 @@ import com.vk.core.util.Screen; import com.vk.dto.common.data.VKList; import com.vk.dto.gift.GiftItem; import com.vk.dto.group.Group; +import com.vk.dto.newsfeed.entries.ProfilesRecommendations; import com.vk.dto.photo.Photo; import com.vk.dto.user.UserProfile; import com.vk.dto.user.deactivation.UserDeactivation; @@ -33,6 +33,7 @@ import ru.vtosters.lite.proxy.ProxyUtils; import ru.vtosters.lite.utils.AccountManagerUtils; import java.io.IOException; +import java.lang.reflect.Method; import java.util.ArrayList; import java.util.List; @@ -482,10 +483,20 @@ public class GetFullUserProfile extends GetFullProfile { } extendedUserProfile.u1 = onlineHook.getBoolean("all_photos_are_hidden"); -// JSONObject optJSONObject4 = onlineHook.optJSONObject("friends_recommendations"); -// if (optJSONObject4 != null) { -// extendedUserProfile.J = ProfilesRecommendations.b(optJSONObject4); -// } + JSONObject optJSONObject4 = onlineHook.optJSONObject("friends_recommendations"); + if (optJSONObject4 != null) { + extendedUserProfile.J = getFriendsRecomms(optJSONObject4); + } + } + + public ProfilesRecommendations getFriendsRecomms(JSONObject json) { + try { + Method method = ProfilesRecommendations.class.getDeclaredMethod("b", JSONObject.class); + return (ProfilesRecommendations) method.invoke(null, json); + } catch (Exception e) { + Log.d(this.getClass().getSimpleName(), e.toString()); + return null; + } } public GetFullProfile.a a(JSONObject jSONObject) {