upgraded convBar ext + added debug link

This commit is contained in:
gdlbo
2022-07-05 14:51:44 +03:00
parent 782ff2bb66
commit ed6244919d
4 changed files with 77 additions and 15 deletions
@@ -154,7 +154,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{
return true;
});
if(Build.VERSION.SDK_INT >= 28 && false){ // TODO refactoring systen theme
if(Build.VERSION.SDK_INT >= 28 && false){ // TODO refactoring system theme
PreferencesUtil.addMaterialSwitchPreference(this, "systemtheme", Globals.getString("appearance_theme_use_system"), Globals.getString("appearance_theme_use_system_summary"), !milkshake() ? "ic_recent_24" : "ic_recent_outline_28", true, (preference, o) -> {
boolean value = (boolean) o;
@@ -3,6 +3,7 @@ package ru.vtosters.lite.utils;
import static ru.vtosters.lite.f0x1d.VTVerifications.isDeveloper;
import static ru.vtosters.lite.f0x1d.VTVerifications.isPrometheus;
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
import static ru.vtosters.lite.utils.Preferences.dev;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.hasVerification;
@@ -33,24 +34,36 @@ public class JsonInjectors{
}
public static JSONObject convBar(JSONObject orig) throws JSONException{
var pic = "https://nyaa.shikimori.one/system/users/x160/277870.png";
var textverif = "Я не загрузил данные (9(9((";
if(!dev()) return orig;
var peerid = Objects.requireNonNull(orig.optJSONObject("peer")).optInt("id");
if(isVerified(peerid)) textverif = "Я купил VTosters Premium";
var pic = "https://image.pngaaa.com/641/326641-middle.png"; // can be null
var text = "Я не загрузил данные (9(9((";
var link = "https://vtosters.app"; // can be null
var linktitle = "Test button"; // can be null
if(isPrometheus(peerid)) textverif = "Я купил VTosters Premium Gold Prime Pro Plus";
var hasIcon = true; // !pic.isEmpty();
var hasButton = true; // !buttons.isEmpty();
var isPicture = pic.endsWith(".png") || pic.endsWith(".jpg") || pic.endsWith(".jpeg") || pic.endsWith(".webp");
if(isDeveloper(peerid)) textverif = "Я создал говно";
var buttons = "{\"layout\":\"tertiary\",\"text\":\"" + linktitle + "\",\"type\":\"link\",\"link\":\"" + link + "\"}";
var icon = Base64Utils.decode("LCJpY29uIjoi") + pic + Base64Utils.decode("Ig==");
if(!isVerified(peerid)) return orig.optJSONObject("conversation_bar");
if(!isPicture) hasIcon = false;
if(!hasIcon) icon = "";
if(!hasButton) buttons = "";
if(isVerified(peerid)) text = "Я купил VTosters Premium";
if(isPrometheus(peerid)) text = "Я купил VTosters Premium Gold Prime Pro Plus";
if(isDeveloper(peerid)) text = "Я создал говно";
if(!isVerified(peerid) || text.equals("")) return orig.optJSONObject("conversation_bar");
// JSONObject("{\"name\":\"group_admin_welcome\",\"text\":\"" + textverif + "\",\"buttons\":[],\"icon\":\"" + pic + "\"}");
return new JSONObject(Base64Utils.decode("eyJuYW1lIjoiZ3JvdXBfYWRtaW5fd2VsY29tZSIsInRleHQiOiI=")
+ textverif + Base64Utils.decode("IiwiYnV0dG9ucyI6W10sImljb24iOiI=")
+ pic + Base64Utils.decode("In0="));
+ text + Base64Utils.decode("IiwiYnV0dG9ucyI6Ww==")
+ buttons + Base64Utils.decode("XQ==")
+ icon
+ Base64Utils.decode("fQ=="));
}
public static JSONObject menu(JSONObject orig) throws JSONException{
@@ -4,6 +4,7 @@ import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.f0x1d.VTVerifications.isPrometheus;
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
import static ru.vtosters.lite.utils.CacheUtils.getInstance;
import static ru.vtosters.lite.utils.DeletedMessagesHandler.*;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.fixGapps;
import static ru.vtosters.lite.utils.Globals.getContext;
@@ -32,7 +33,6 @@ import java.security.NoSuchAlgorithmException;
import ru.vtosters.lite.ui.fragments.VTSettings;
public class Preferences{
static final boolean isDebug = Debug.isDebuggerConnected();
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
public static String VERSIONNAME = "Beta";
@@ -40,7 +40,7 @@ public class Preferences{
setupFilters();
fixGapps();
setProxy();
DeletedMessagesHandler.reloadMessagesList();
reloadMessagesList();
registerActivities(application);
if(dev()){
LoadLibrary("vkopustest");
@@ -52,7 +52,6 @@ public class Preferences{
public static void forceOffline(){
setupFilters();
getInstance().autoCleaningCache();
edit().putBoolean("isdark", isDarkTheme()).commit();
if(setoffline() && offline()){
@@ -169,7 +168,7 @@ public class Preferences{
}
public static boolean devmenu(){
return true; //getBoolValue("devmenu", false);
return getBoolValue("devmenu", false);
}
public static boolean dnr(){
@@ -6048,6 +6048,56 @@
:cond_238
new-instance v12, Lkotlin/text/Regex;
const-string v11, "/vt/debug?.*"
invoke-direct {v12, v11}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V
const/4 v13, 0x0
const/4 v14, 0x0
const/4 v15, 0x0
const/16 v16, 0xe
const/16 v17, 0x0
move-object v11, v0
invoke-static/range {v11 .. v17}, Lcom/vk/common/links/UriWrapper;->a(Lcom/vk/common/links/UriWrapper;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/text/Regex;IILjava/lang/Object;)Z
move-result v11
if-eqz v11, :cond_260
invoke-static {}, Lru/vtosters/lite/utils/Globals;->getContext()Landroid/content/Context;
move-result-object v1
new-instance v8, Lcom/vk/navigation/Navigator;
const-class v0, Lcom/vtosters/lite/fragments/n2/SettingsDebugFragment;
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
goto/16 :goto_d
.line 187
:cond_260
new-instance v12, Lkotlin/text/Regex;
const-string v11, "/vtlite?.*"
invoke-direct {v12, v11}, Lkotlin/text/Regex;-><init>(Ljava/lang/String;)V