From b9443f0d786764bf4989d952efc4ce4d0549511d Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Mon, 27 Jun 2022 16:47:41 +0300 Subject: [PATCH] covbar inj test --- .../ru/vtosters/lite/utils/JsonInjectors.java | 29 +++++++++++++++---- .../api_parsers/ConversationParser$a.smali | 5 +--- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java b/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java index 491fe2aa8..f75ff1cb4 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java +++ b/app/src/main/java/ru/vtosters/lite/utils/JsonInjectors.java @@ -1,26 +1,45 @@ package ru.vtosters.lite.utils; import static ru.vtosters.lite.f0x1d.VTVerifications.decode; +import static ru.vtosters.lite.f0x1d.VTVerifications.hasPrometheus; +import static ru.vtosters.lite.f0x1d.VTVerifications.isDeveloper; +import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified; import static ru.vtosters.lite.utils.Preferences.hasVerification; import org.json.JSONException; import org.json.JSONObject; +import java.util.Objects; import java.util.Random; public class JsonInjectors{ public static JSONObject profileButton(JSONObject orig) throws JSONException{ if(haveDonateButton()) return orig; - String pic = "https:\\/\\/sun1-18.userapi.com\\/NLd_rNpGuSaBnPV6O-j5mqCGZk8BK8drAMd2LQ\\/5R-DEF37PFs.png"; - String title = "Помоги проекту донатом и получи бонус!"; - String link = "https:\\/\\/vk.com\\/vtosters_official"; - String text_color = "2D81E0"; + var pic = "https:\\/\\/sun1-18.userapi.com\\/NLd_rNpGuSaBnPV6O-j5mqCGZk8BK8drAMd2LQ\\/5R-DEF37PFs.png"; + var title = "Помоги проекту донатом и получи бонус!"; + var link = "https:\\/\\/vk.com\\/vtosters_official"; + var text_color = "2D81E0"; - // new JSONObject("{\"title\":\"" + title + "\",\"description\":\"" + desc + "\",\"text_color\":\"#" + text_color + "\",\"image\":[{\"url\":\"" + smallimg + "\",\"width\":72,\"height\":72},{\"url\":\"" + smallimg + "\",\"width\":108,\"height\":108},{\"url\":\"" + smallimg + "\",\"width\":144,\"height\":144},{\"url\":\"" + smallimg + "\",\"width\":216,\"height\":216},{\"url\":\"" + smallimg + "\",\"width\":288,\"height\":288}],\"background\":[{\"url\":\"" + background + "\",\"width\":344,\"height\":215},{\"url\":\"" + background + "\",\"width\":516,\"height\":323},{\"url\":\"" + background + "\",\"width\":680,\"height\":426},{\"url\":\"" + background + "\",\"width\":1032,\"height\":645},{\"url\":\"" + background + "\",\"width\":1376,\"height\":860}]}"); return new JSONObject(decode("eyJhY3Rpb24iOnsidGFyZ2V0IjoiaW50ZXJuYWwiLCJ0eXBlIjoib3Blbl91cmwiLCJ1cmwiOiI=") + link + decode("In0sInRpdGxlIjoi") + title + decode("IiwiaWNvbnMiOlt7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjIwLCJoZWlnaHQiOjIwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjQwLCJoZWlnaHQiOjQwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjYwLCJoZWlnaHQiOjYwfSx7InVybCI6Ig==") + pic + decode("Iiwid2lkdGgiOjgwLCJoZWlnaHQiOjgwfV0sInRleHRfY29sb3IiOiI=") + text_color + decode("In0=")); } + public static JSONObject convBar(JSONObject orig) throws JSONException{ + var textverif = "Я не загрузил данные (9(9(("; + + var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id"); + + if(isVerified(peerid)) textverif = "Я купил VTosters Premium"; + + if(hasPrometheus(peerid)) textverif = "Я купил VTosters Premium Gold Prime Pro Plus"; + + if(isDeveloper(peerid)) textverif = "Я создал говно"; + + if(!isVerified(peerid)) return orig.optJSONObject("conversation_bar"); + + return new JSONObject("{\"name\":\"group_admin_welcome\",\"text\":\"" + textverif + "\",\"buttons\":[]}"); + } + public static boolean haveDonateButton(){ int randomshower = new Random().nextInt(6); diff --git a/smali/smali_classes3/com/vk/im/engine/internal/api_parsers/ConversationParser$a.smali b/smali/smali_classes3/com/vk/im/engine/internal/api_parsers/ConversationParser$a.smali index e0274a257..562640c37 100644 --- a/smali/smali_classes3/com/vk/im/engine/internal/api_parsers/ConversationParser$a.smali +++ b/smali/smali_classes3/com/vk/im/engine/internal/api_parsers/ConversationParser$a.smali @@ -622,10 +622,7 @@ move-result-object v4 - const-string v6, "conversation_bar" - - .line 8 - invoke-virtual {v1, v6}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject; + invoke-static {v1}, Lru/vtosters/lite/utils/JsonInjectors;->convBar(Lorg/json/JSONObject;)Lorg/json/JSONObject; move-result-object v6