Skip to content

Commit

Permalink
workaround for #1619
Browse files Browse the repository at this point in the history
  • Loading branch information
Tahgolov committed Jun 13, 2024
1 parent 5932d6f commit 9179666
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 8 deletions.
16 changes: 16 additions & 0 deletions app/src/main/java/ru/vtosters/hooks/PostTopicsHook.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ru.vtosters.hooks;

import com.vtosters.lite.api.execute.GetWallInfo;

import java.util.ArrayList;

/**
* Since June 12, 2024, there are troubles with API method "execute.getUserInfo" in the old versions of VK Client (<6.16),
* to fix that issue we need to upgrade "execute.getUserInfo" for new API versions
* and implement the new API method "newsfeed.getPostTopics" (TODO)*/
@SuppressWarnings("unused")
public class PostTopicsHook {
public static void hook(final GetWallInfo.a model) throws Exception {
model.f = new ArrayList<>();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@

const-string p1, "func_v"

const/16 v0, 0x15
#upgrade func_v to 0x16 to fix issue related with outdated gettings of post topics
const/16 v0, 0x16

.line 9
invoke-virtual {p0, p1, v0}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
Expand Down Expand Up @@ -385,6 +386,7 @@
.end annotation
.end param


const/4 v0, 0x0

:try_start_0
Expand Down Expand Up @@ -503,18 +505,22 @@

iput-object v1, v3, Lcom/vtosters/lite/api/execute/GetWallInfo$a;->e:Lcom/vk/auth/api/AccountPhoneVerify;

const-string v1, "post_topics"
invoke-static {v3}, Lru/vtosters/hooks/PostTopicsHook;->hook(Lcom/vtosters/lite/api/execute/GetWallInfo$a;)V

.line 17
invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
# const-string v1, "post_topics"

move-result-object v1
# .line 17
# invoke-virtual {p1, v1}, Lorg/json/JSONObject;->optJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;

invoke-static {v1}, Lcom/vk/dto/newsfeed/PostTopic;->a(Lorg/json/JSONArray;)Ljava/util/List;
# move-result-object v1

# invoke-static {v1}, Lcom/vk/dto/newsfeed/PostTopic;->a(Lorg/json/JSONArray;)Ljava/util/List;

# move-result-object v1

# iput-object v1, v3, Lcom/vtosters/lite/api/execute/GetWallInfo$a;->f:Ljava/util/List;

move-result-object v1

iput-object v1, v3, Lcom/vtosters/lite/api/execute/GetWallInfo$a;->f:Ljava/util/List;

const-string v1, "special_events"

Expand Down

0 comments on commit 9179666

Please sign in to comment.