podcasts are dead + returned old vk pay

This commit is contained in:
gdlbo
2022-07-27 18:03:45 +03:00
parent c9c5c96d63
commit 3fea0e9c40
7 changed files with 58 additions and 22 deletions
@@ -23,6 +23,7 @@ import static ru.vtosters.lite.utils.Preferences.friendsblock;
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.hasVerification;
import static ru.vtosters.lite.utils.Preferences.podcastcatalog;
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import android.net.Uri;
@@ -465,7 +466,23 @@ public class JsonInjectors{
oldItems = catalog.optJSONArray("sections");
}
if (oldItems != null) {
if (podcastcatalog()) {
var podcasts = fetchCatalogPodcast();
if (podcasts != null) {
var catalogarr = podcasts.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
var title = catalogarr.optString("title");
var id = catalogarr.optString("id");
var url = catalogarr.optString("url");
if (dev()) Log.d("VKMusic", "Added " + title + " in music sections");
oldItems.put(new JSONObject().put("id", id).put("title", title).put("url", url));
}
}
var playlists = fetchCatalogId("https://vk.com/audio?section=my_playlists");
if (playlists != null) {
var catalogarr = playlists.optJSONObject("catalog").optJSONArray("sections").optJSONObject(0);
@@ -550,6 +567,28 @@ public class JsonInjectors{
return null;
}
public static JSONObject fetchCatalogPodcast(){
var request = new Request.a()
.b("https://api.vk.com/method/catalog.getPodcasts"
+ "?v=5.119"
+ "&https=1"
+ "&need_blocks=1"
+ "&lang="
+ getLocale()
+ "&device_id="
+ DeviceIdProvider.d(getContext())
+ "&access_token="
+ getUserToken())
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
try {
return new JSONObject(mClient.a(request).execute().a().g()).getJSONObject("response");
} catch (JSONException | IOException e) {
Log.d("VTLMusic", "Error: " + e.getMessage());
}
return null;
}
public static JSONObject friends(JSONObject json) throws JSONException{
JSONObject catalog = json;
boolean sectionexecute = true;
@@ -319,6 +319,10 @@ public class Preferences{
return getBoolValue("vkme_notifs", false);
}
public static boolean podcastcatalog(){
return getBoolValue("podcastcatalog", false);
}
public static boolean checkupdates(){
return getBoolValue("checkupdates", true) && isValidSignature();
}
+4
View File
@@ -26,6 +26,10 @@
android:defaultValue="true"
android:key="newadblock"
android:title="Использовать новый AdBlock (Beta)" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="podcastcatalog"
android:title="Add catalog podcast" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="vksans"
@@ -5616,6 +5616,8 @@
move-result v0
const v0, 0x0
return v0
.end method
@@ -853,7 +853,7 @@
.line 72
sget-object p2, Lcom/vk/menu/MenuUtils;->c:Lcom/vk/menu/MenuUtils;
const-class v5, Lru/vtosters/lite/ui/fragments/VKPayFragment;
const-class v5, Lcom/vk/webapp/fragments/VkPayFragment;
const-string v1, "vk_pay"
@@ -2543,7 +2543,7 @@
invoke-virtual {v0, p1, v1}, Landroid/os/Bundle;->putInt(Ljava/lang/String;I)V
.line 27
const-class p1, Lru/vtosters/lite/ui/fragments/VKPayFragment;
const-class p1, Lcom/vk/webapp/fragments/VkPayFragment;
invoke-static {v0, p1}, Lkotlin/Tuples;->a(Ljava/lang/Object;Ljava/lang/Object;)Lkotlin/Pair;
@@ -312,7 +312,7 @@
.end method
.method private T(Ljava/lang/String;)V
.locals 9
.locals 1
.line 1
invoke-static {p1}, Lcom/vk/webapp/fragments/VkPayFragment;->P(Ljava/lang/String;)Z
@@ -339,27 +339,14 @@
if-eqz v0, :cond_1
invoke-static {}, Lru/vtosters/lite/utils/Globals;->getContext()Landroid/content/Context;
.line 3
new-instance v0, Lcom/vk/webapp/fragments/VkPayFragment$a;
move-result-object v1
invoke-direct {v0, p1}, Lcom/vk/webapp/fragments/VkPayFragment$a;-><init>(Ljava/lang/String;)V
new-instance v8, Lcom/vk/navigation/Navigator;
const/16 p1, 0x66
const-class v0, Lru/vtosters/lite/ui/fragments/VKPayFragment;
invoke-direct {v8, v0}, Lcom/vk/navigation/Navigator;-><init>(Ljava/lang/Class;)V
invoke-virtual {v8, v1}, Lcom/vk/navigation/Navigator;->b(Landroid/content/Context;)Landroid/content/Intent;
move-result-object v8
const/high16 v0, 0x10000000
.line 15
invoke-virtual {v8, v0}, Landroid/content/Intent;->addFlags(I)Landroid/content/Intent;
.line 16
invoke-virtual {v1, v8}, Landroid/content/Context;->startActivity(Landroid/content/Intent;)V
invoke-virtual {v0, p0, p1}, Lcom/vk/navigation/Navigator;->a(Lcom/vk/core/fragments/FragmentImpl;I)V
:cond_1
return-void
@@ -1985,7 +1985,7 @@
.line 34
:cond_11
instance-of v2, v0, Lru/vtosters/lite/ui/fragments/VKPayFragment;
instance-of v2, v0, Lcom/vk/webapp/fragments/VkPayFragment;
if-eqz v2, :cond_12