Compare commits

...
Author SHA1 Message Date
Artur Skubei 801a283280 fixed crash 2024-07-17 13:38:22 +03:00
Artur Skubei 42688b7d0c init 2024-07-17 13:21:38 +03:00
gdlbo 93edbf2d3d Revert "Update ProxyHostChecker.smali"
This reverts commit 5932d6f9dc.
2024-07-06 12:47:28 +03:00
gdlbo f39463f782 fixes 2024-06-22 01:09:54 +03:00
gdlbo 27b07719d9 fix music catalog 2024-06-21 20:59:46 +03:00
Vologhat c6cff1a585 fix #1619 (#1620) 2024-06-21 20:34:37 +03:00
gdlbo 5932d6f9dc Update ProxyHostChecker.smali 2024-04-15 01:42:06 +03:00
gdlbo 15bb5fa469 fixes 2024-04-15 01:39:13 +03:00
gdlbo fd17e2bc8c fixed groups load 2024-04-12 10:24:02 +03:00
gdlbo 4cd94d811c fix #1607 2024-04-12 10:08:57 +03:00
gdlbo f1ea800336 fixed profiles loading 2024-04-12 09:58:44 +03:00
Artur Skubei b20230848b Speedup cache injection (#1597) 2024-03-30 05:54:56 +03:00
19 changed files with 256 additions and 102 deletions
@@ -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<>();
}
}
@@ -4,7 +4,6 @@ import android.util.Log;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import com.vk.core.network.Network;
import com.vk.core.util.DeviceIdProvider;
import okhttp3.Headers;
import okhttp3.Request;
import okhttp3.Response;
import org.json.JSONArray;
@@ -58,7 +57,11 @@ public class CatalogJsonInjector {
if (!MusicCacheImpl.isEmpty() && !LibVKXClient.isIntegrationEnabled()) { // inj in playlist list
var noPlaylists = !json.has("playlists");
PlaylistHelper.addCachedPlaylists(json.optJSONArray("playlists"), noPlaylists);
if (noPlaylists) {
PlaylistHelper.addCachedPlaylists(new JSONArray());
} else {
PlaylistHelper.addCachedPlaylists(json.optJSONArray("playlists"));
}
if (!useOldAppVer || noPlaylists) {
var newBlocks = new JSONArray();
@@ -99,7 +102,11 @@ public class CatalogJsonInjector {
var noPlaylists = !json.has("playlists");
PlaylistHelper.addCachedPlaylists(json.optJSONArray("playlists"), noPlaylists);
if (noPlaylists) {
PlaylistHelper.addCachedPlaylists(new JSONArray());
} else {
PlaylistHelper.addCachedPlaylists(json.optJSONArray("playlists"));
}
if (!useOldAppVer && !noPlaylists) {
var newBlocks = new JSONArray();
@@ -213,10 +220,14 @@ public class CatalogJsonInjector {
}
}
private static void removeUnsupportedLayouts(JSONArray blocks) throws JSONException {
private static void removeUnsupportedLayouts(JSONArray blocks) {
for (int i = blocks.length() - 1; i >= 0; i--) {
JSONObject block = blocks.optJSONObject(i);
if (block == null) continue;
JSONObject layout = block.optJSONObject("layout");
if (layout == null) continue;
String data_type = block.optString("data_type");
if (Objects.equals(data_type, "music_recommended_playlists") || Objects.equals(data_type, "radiostations")) {
@@ -226,8 +237,6 @@ public class CatalogJsonInjector {
continue; // Skip to the next iteration after removing
}
if (layout == null) continue; // Skip to the next iteration if layout is null
String name = layout.optString("name");
if (!name.equals("header_extended")) {
continue; // Skip to the next iteration if not header_extended
@@ -236,11 +245,14 @@ public class CatalogJsonInjector {
if (layout.has("top_title")) {
blocks.remove(i);
}
layout.put("name", "header");
try {
layout.put("name", "header");
} catch (JSONException e) {
e.fillInStackTrace();
}
}
}
private static void setDefaultAudioPage(JSONArray jsonArray, JSONObject catalog) throws JSONException {
for (int i = 0; i < jsonArray.length(); i++) {
var item = jsonArray.optJSONObject(i);
@@ -165,12 +165,12 @@ public class TracklistInjector {
boolean noPlaylists = hasNoPlaylists(blocks);
if (noPlaylists) {
PlaylistHelper.addCachedPlaylists(catalogNode.optJSONArray("playlists"), true);
PlaylistHelper.addCachedPlaylists(new JSONArray());
firstSection.put("blocks", createNewBlocks(blocks));
} else {
try {
PlaylistHelper.addCachedPlaylists(catalogNode.optJSONArray("playlists"), false);
PlaylistHelper.addCachedPlaylists(catalogNode.optJSONArray("playlists"));
updatePlaylistsIds(blocks);
} catch (Exception e) {
@@ -246,7 +246,7 @@ public class TracklistInjector {
.put(getCatalogPlaylist());
}
if (!MusicCacheImpl.getAllOwnTracks().isEmpty()) {
if (!PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
if (MusicCacheImpl.hasPlaylist()) blocks.put(getCatalogSeparator());
blocks.put(getCatalogHeader(AndroidUtils.getString(R.string.cached_tracks_title)))
.put(getShuffleButton())
@@ -270,7 +270,7 @@ public class TracklistInjector {
return new JSONObject()
.put("catalog", catalog)
.put("playlists", addCachedPlaylists(new JSONArray(), false))
.put("playlists", addCachedPlaylists(new JSONArray()))
.put("audios", TracklistHelper.tracksToJsons(tracks));
}
@@ -59,12 +59,12 @@ public class MusicCacheImpl {
}
public static boolean hasPlaylist() {
return PlaylistCacheDbDelegate.getPlaylistsCount(AndroidUtils.getGlobalContext()) != 0; // has playlists or not
return !PlaylistCacheDbDelegate.isPlaylistsDbEmpty(AndroidUtils.getGlobalContext()); // has playlists or not
}
public static long getTracksCount() {
return !LibVKXClient.isIntegrationEnabled()
? MusicCacheDbDelegate.getTracksCount(AndroidUtils.getGlobalContext())
? PlaylistCacheDbDelegate.getTracksCountInPlaylist(AndroidUtils.getGlobalContext(),AccountManagerUtils.getUserId() + "_-1")
: LibVKXClient.getInstance().runOnServiceSync(
new LibVKXClientImpl.LibVKXActionGeneric<Long>() {
@Override
@@ -89,7 +89,7 @@ public class MusicCacheImpl {
}
public static boolean isEmpty() {
return !LibVKXClient.isIntegrationEnabled() && getTracksCount() == 0L;
return !LibVKXClient.isIntegrationEnabled() && MusicCacheDbDelegate.isEmpty(AndroidUtils.getGlobalContext());
}
public static void clear() {
@@ -174,6 +174,15 @@ public class MusicCacheDb extends SQLiteOpenHelper implements AutoCloseable { //
return DatabaseUtils.queryNumEntries(getReadableDatabase(), Constants.TABLE_NAME);
}
public boolean isDatabaseEmpty() {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_NAME + " LIMIT 1)", null);
cursor.moveToFirst();
boolean isEmpty = cursor.getInt(0) == 0;
cursor.close();
return isEmpty;
}
public MusicTrack getTrackById(String trackId) {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query(Constants.TABLE_NAME, null, Constants.COLUMN_TRACK_ID + " = ?", new String[]{trackId}, null, null, null);
@@ -53,8 +53,7 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
Boolean.parseBoolean(cur.getString(cur.getColumnIndex(Constants.COLUMN_IS_EXPLICIT))),
cur.getString(cur.getColumnIndex(Constants.COLUMN_TITLE)),
cur.getString(cur.getColumnIndex(Constants.COLUMN_DESCRIPTION)),
photo,
0);
photo);
Log.d("Playlist", "generated " + Playlist.U.a(playlist).v1());
@@ -170,6 +169,50 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
return playlists;
}
public long getTracksCountInPlaylist(String playlistId) {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query(
Constants.TABLE_PLAYLIST_TRACKS,
new String[]{Constants.COLUMN_TRACK_ID},
Constants.COLUMN_PLAYLIST_ID + " = ?",
new String[]{playlistId},
null, null, null
);
long count = cursor.getCount();
cursor.close();
return count;
}
public List<String> getAllPlaylistIds() {
SQLiteDatabase db = getReadableDatabase();
List<String> playlistIds = new ArrayList<>();
Cursor cursor = db.query(
Constants.TABLE_NAME,
new String[]{Constants.COLUMN_ID, Constants.COLUMN_OWNER_ID},
null, null, null, null, null
);
if (cursor.moveToFirst()) {
do {
String playlistId = cursor.getString(cursor.getColumnIndexOrThrow(Constants.COLUMN_OWNER_ID)) + "_" + cursor.getString(cursor.getColumnIndexOrThrow(Constants.COLUMN_ID));
playlistIds.add(playlistId);
} while (cursor.moveToNext());
}
cursor.close();
return playlistIds;
}
public boolean isPlaylistsDbEmpty() {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_NAME + " LIMIT 1)", null);
cursor.moveToFirst();
boolean isEmpty = cursor.getInt(0) == 0;
cursor.close();
return isEmpty;
}
public void addTrackToPlaylist(String playlistId, String trackId) {
ContentValues values = new ContentValues();
values.put(Constants.COLUMN_PLAYLIST_ID, playlistId);
@@ -181,6 +224,15 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
getWritableDatabase().delete(Constants.TABLE_PLAYLIST_TRACKS, Constants.COLUMN_PLAYLIST_ID + " = ? AND " + Constants.COLUMN_TRACK_ID + " = ?", new String[]{playlistId, trackId});
}
public boolean isPlaylistEmpty(String playlistId) {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_PLAYLIST_TRACKS + " WHERE " + Constants.COLUMN_PLAYLIST_ID + " = ? LIMIT 1)", new String[]{playlistId});
cursor.moveToFirst();
boolean isEmpty = cursor.getInt(0) == 0;
cursor.close();
return isEmpty;
}
public List<MusicTrack> getTracksInPlaylist(String playlistId) {
SQLiteDatabase db = getReadableDatabase();
Cursor cursor = db.query(
@@ -55,6 +55,12 @@ public class MusicCacheDbDelegate {
}
}
public static boolean isEmpty(Context context) {
try (var db = connectToDb(context)) {
return db.isDatabaseEmpty();
}
}
public static boolean isCachedTrack(Context context, String trackId) {
try (var db = connectToDb(context)) {
return db.isCachedTrack(trackId);
@@ -62,6 +62,31 @@ public class PlaylistCacheDbDelegate {
}
}
public static long getTracksCountInPlaylist(Context context, String playlistId) {
try (var db = connectToDb(context)) {
return db.getTracksCountInPlaylist(playlistId);
}
}
public static boolean isPlaylistsDbEmpty(Context context) {
try (var db = connectToDb(context)) {
return db.isPlaylistsDbEmpty();
}
}
public static void removeAllPlaylists(Context context) {
List<String> playlistIds = getAllPlaylistIds(context);
for (String playlistId : playlistIds) {
deletePlaylist(context, playlistId);
}
}
public static List<String> getAllPlaylistIds(Context context) {
try (var db = connectToDb(context)) {
return db.getAllPlaylistIds();
}
}
public static boolean isCachedPlaylist(Context context, String id) {
try (var db = connectToDb(context)) {
String[] parts = id.split("_");
@@ -112,6 +137,12 @@ public class PlaylistCacheDbDelegate {
}
}
public static boolean isPlaylistEmpty(Context context, String playlistId) {
try (var db = connectToDb(context)) {
return db.isPlaylistEmpty(playlistId);
}
}
public static void drop(Context context) {
context.deleteDatabase(PlaylistCacheDb.Constants.DB_NAME);
}
@@ -7,6 +7,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import ru.vtosters.lite.music.cache.MusicCacheImpl;
import ru.vtosters.lite.music.cache.delegate.PlaylistCacheDbDelegate;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.NetworkUtils;
@@ -22,22 +23,18 @@ public class PlaylistHelper {
}
}
public static JSONArray addCachedPlaylists(JSONArray jsonArray, Boolean noPlaylists) {
public static JSONArray addCachedPlaylists(JSONArray jsonArray) {
try {
if (noPlaylists) {
jsonArray.put(new JSONArray().put(getCachedSongsPlaylist()));
} else {
if (!PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
jsonArray.put(getCachedSongsPlaylist());
}
for (Playlist playlist : MusicCacheImpl.getPlaylists()) {
if (noPlaylists) {
jsonArray.put(new JSONArray().put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist), playlist.O)));
} else {
jsonArray.put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist), playlist.O));
}
if (MusicCacheImpl.hasPlaylist()) {
for (Playlist playlist : MusicCacheImpl.getPlaylists()) {
jsonArray.put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist)));
Log.d("PlaylistHelper", "Playlist cache added: " + playlist.a + " " + playlist.b + " " + playlist.C + " " + playlist.g + " " + playlist.B);
Log.d("PlaylistHelper", "Playlist cache added: " + playlist.a + " " + playlist.b + " " + playlist.C + " " + playlist.g + " " + playlist.B);
}
}
} catch (JSONException e) {
e.fillInStackTrace();
@@ -45,7 +42,7 @@ public class PlaylistHelper {
return jsonArray;
}
public static JSONObject generatePlaylist(int id, int owner_id, boolean is_explicit, String title, String description, JSONObject photo, int count) throws JSONException {
public static JSONObject generatePlaylist(int id, int owner_id, boolean is_explicit, String title, String description, JSONObject photo) throws JSONException {
JSONObject playlist = new JSONObject()
.put("id", id)
.put("owner_id", owner_id)
@@ -64,7 +61,7 @@ public class PlaylistHelper {
.put("subtitle", "")
.put("meta", new JSONObject()
.put("view", "compact"))
.put("count", count);
.put("count", 0);
if (photo != null) {
playlist.put("photo", photo);
@@ -101,18 +98,18 @@ public class PlaylistHelper {
.put("height", 600))
.put("meta", new JSONObject()
.put("view", "compact"))
.put("count", MusicCacheImpl.getAllOwnTracks().size());
.put("count", 0);
}
public static JSONArray getCachedPlaylistsIds() {
JSONArray arr = new JSONArray();
if (NetworkUtils.isNetworkConnected() && !MusicCacheImpl.getAllOwnTracks().isEmpty()) {
if (NetworkUtils.isNetworkConnected() && !PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
arr.put(AccountManagerUtils.getUserId() + "_-1");
}
for (var playlist : MusicCacheImpl.getPlaylists()) {
arr.put(playlist.v1());
for (String playlist : PlaylistCacheDbDelegate.getAllPlaylistIds(AndroidUtils.getGlobalContext())) {
arr.put(playlist);
}
return arr;
@@ -28,7 +28,7 @@ public class TracklistHelper {
boolean doNotinvertOrder = Preferences.getBoolValue("invertCachedTracks", false);
if (!doNotinvertOrder) {
if (doNotinvertOrder) {
Collections.reverse(tracks);
}
@@ -20,6 +20,7 @@ import ru.vtosters.lite.music.LastFMScrobbler;
import ru.vtosters.lite.music.cache.MusicCacheImpl;
import ru.vtosters.lite.music.cache.delegate.PlaylistCacheDbDelegate;
import ru.vtosters.lite.ui.PreferenceFragmentUtils;
import ru.vtosters.lite.utils.AccountManagerUtils;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
@@ -55,7 +56,7 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
if (MusicCacheImpl.isEmpty()) {
AndroidUtils.sendToast(requireContext().getString(com.vtosters.lite.R.string.no_cache_error));
} else {
delcache(requireContext());
delcache(requireContext(), false);
}
return true;
}
@@ -73,6 +74,18 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
return true;
}
);
PreferenceFragmentUtils.addPreference(
getPreferenceScreen(),
"cached_playlists",
"Удалить все скачанные плейлисты",
null,
null,
preference -> {
delcache(requireContext(), true);
return true;
}
);
}
PreferenceFragmentUtils.addPreference(
@@ -443,12 +456,18 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
builder.show();
}
private void delcache(Context ctx) {
private void delcache(Context ctx, boolean isPlaylists) {
new VkAlertDialog.Builder(ctx)
.setTitle(com.vtosters.lite.R.string.warning)
.setMessage(com.vtosters.lite.R.string.cached_tracks_remove_confirm)
.setPositiveButton(com.vtosters.lite.R.string.yes, (dialog, which) -> {
executor.submit(MusicCacheImpl::clear);
executor.submit(() -> {
if (isPlaylists) {
PlaylistCacheDbDelegate.removeAllPlaylists(ctx);
} else {
PlaylistCacheDbDelegate.deletePlaylist(ctx, AccountManagerUtils.getUserId() + "_-1");
}
});
findPreference("cached_tracks").setSummary(String.format(requireContext().getString(com.vtosters.lite.R.string.cached_tracks_counter), MusicCacheImpl.getTracksCount()));
})
.setNeutralButton(com.vtosters.lite.R.string.no, (dialog, which) -> dialog.cancel())
View File
View File
@@ -474,7 +474,7 @@
invoke-virtual {p1, v1, v0}, Ljava/net/HttpURLConnection;->setRequestProperty(Ljava/lang/String;Ljava/lang/String;)V
.line 15
const-string v0, "C8EAB7342DA62B4A229E1BFDEB27B029DD6788A1"
const-string v0, "48761EEF50EE53AFC4CC9C5F10E6BDE7F8F5B82F"
const-string v1, "X-Android-Cert"
@@ -175,19 +175,23 @@
const-string v11, "country"
.line 15
invoke-virtual {v9, v11, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
# .line 15
# invoke-virtual {v9, v11, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v12
# move-result v12
const v12, 0x0
iput v12, v10, Lcom/vk/dto/user/UserProfile;->G:I
const-string v12, "city"
.line 16
invoke-virtual {v9, v12, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
# .line 16
# invoke-virtual {v9, v12, v4}, Lorg/json/JSONObject;->optInt(Ljava/lang/String;I)I
move-result v13
# move-result v13
const v13, 0x0
iput v13, v10, Lcom/vk/dto/user/UserProfile;->F:I
@@ -194,6 +194,8 @@
move-result v0
const v0, 0x0
if-eqz v0, :cond_2
const/4 v0, 0x1
@@ -35,7 +35,7 @@
const-string v0, "func_v"
const/16 v1, 0x1b
const/16 v1, 0x25
.line 3
invoke-virtual {p0, v0, v1}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
@@ -39,7 +39,7 @@
.line 3
invoke-virtual {p0, v0, p1}, Lcom/vk/api/base/ApiRequest;->b(Ljava/lang/String;I)Lcom/vk/api/base/ApiRequest;
const/16 v0, 0xb
const/16 v0, 0x17
const-string v1, "func_v"
@@ -476,89 +476,89 @@
invoke-direct {v2}, Landroid/util/SparseArray;-><init>()V
const-string v4, "cities"
# const-string v4, "cities"
.line 20
invoke-virtual {v1, v4}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
# .line 20
# invoke-virtual {v1, v4}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object v4
# move-result-object v4
const/4 v9, 0x0
# const/4 v9, 0x0
.line 21
:goto_3
invoke-virtual {v4}, Lorg/json/JSONArray;->length()I
# .line 21
# :goto_3
# invoke-virtual {v4}, Lorg/json/JSONArray;->length()I
move-result v10
# move-result v10
const-string v11, "title"
if-ge v9, v10, :cond_4
# if-ge v9, v10, :cond_4
.line 22
invoke-virtual {v4, v9}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
# .line 22
# invoke-virtual {v4, v9}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
move-result-object v10
# move-result-object v10
.line 23
invoke-virtual {v10, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
# .line 23
# invoke-virtual {v10, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
move-result v12
# move-result v12
invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
# invoke-virtual {v10, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v10
# move-result-object v10
invoke-virtual {v2, v12, v10}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
# invoke-virtual {v2, v12, v10}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
add-int/lit8 v9, v9, 0x1
# add-int/lit8 v9, v9, 0x1
goto :goto_3
# goto :goto_3
.line 24
:cond_4
new-instance v4, Landroid/util/SparseArray;
# .line 24
# :cond_4
# new-instance v4, Landroid/util/SparseArray;
invoke-direct {v4}, Landroid/util/SparseArray;-><init>()V
# invoke-direct {v4}, Landroid/util/SparseArray;-><init>()V
const-string v9, "cities"
# const-string v9, "cities"
.line 25
invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
# .line 25
# invoke-virtual {v1, v9}, Lorg/json/JSONObject;->getJSONArray(Ljava/lang/String;)Lorg/json/JSONArray;
move-result-object v9
# move-result-object v9
const/4 v10, 0x0
# const/4 v10, 0x0
.line 26
:goto_4
invoke-virtual {v9}, Lorg/json/JSONArray;->length()I
# .line 26
# :goto_4
# invoke-virtual {v9}, Lorg/json/JSONArray;->length()I
move-result v12
# move-result v12
if-ge v10, v12, :cond_5
# if-ge v10, v12, :cond_5
.line 27
invoke-virtual {v9, v10}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
# .line 27
# invoke-virtual {v9, v10}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;
move-result-object v12
# move-result-object v12
.line 28
invoke-virtual {v12, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
# .line 28
# invoke-virtual {v12, v3}, Lorg/json/JSONObject;->getInt(Ljava/lang/String;)I
move-result v13
# move-result v13
invoke-virtual {v12, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
# invoke-virtual {v12, v11}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;
move-result-object v12
# move-result-object v12
invoke-virtual {v4, v13, v12}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
# invoke-virtual {v4, v13, v12}, Landroid/util/SparseArray;->put(ILjava/lang/Object;)V
add-int/lit8 v10, v10, 0x1
# add-int/lit8 v10, v10, 0x1
goto :goto_4
# goto :goto_4
:cond_5
# :cond_5
const-string v4, "can_write_private_message"
.line 29
@@ -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;
@@ -385,6 +386,7 @@
.end annotation
.end param
const/4 v0, 0x0
:try_start_0
@@ -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"