Added donate banners lmao
This commit is contained in:
@@ -14,7 +14,6 @@ import android.view.ViewGroup;
|
||||
import android.widget.Button;
|
||||
import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
import ru.vtosters.lite.R;
|
||||
|
||||
import me.grishka.appkit.fragments.ToolbarFragment;
|
||||
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.hasVerification;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
public class JsonInjectors {
|
||||
public static JSONObject profileButton() throws JSONException {
|
||||
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";
|
||||
|
||||
JSONObject jsonObj = new JSONObject("{\"action\":{\"target\":\"internal\",\"type\":\"open_url\",\"url\":\"" + link + "\"},\"title\":\"" + title + "\",\"icons\":[{\"url\":\"" + pic + "\",\"width\":20,\"height\":20},{\"url\":\"" + pic + "\",\"width\":40,\"height\":40},{\"url\":\"" + pic + "\",\"width\":60,\"height\":60},{\"url\":\"" + pic + "\",\"width\":80,\"height\":80}],\"text_color\":\"" + text_color + "\"}");
|
||||
return jsonObj;
|
||||
}
|
||||
|
||||
public static JSONObject discoverBanner() throws JSONException {
|
||||
String smallimg = "https:\\/\\/cdn0.iconfinder.com\\/data\\/icons\\/user-interface-vol-5-4\\/66\\/29-512.png";
|
||||
String background = "https:\\/\\/webmaestroblog.ru\\/wp-content\\/uploads\\/2017\\/12\\/af667fe2b7e451ffb6d7939ca82d5ac81.png";
|
||||
String title = "Задонать";
|
||||
String desc = "Помоги проекту донатом и получи приятные бонусы на аккаунт";
|
||||
String text_color = "FFFFFF";
|
||||
|
||||
JSONObject jsonObj = 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 jsonObj;
|
||||
}
|
||||
|
||||
public static JSONObject discoverBannerButton() throws JSONException {
|
||||
String link = "vk.com\\/vtosters_official";
|
||||
|
||||
JSONObject jsonObj = new JSONObject("{\"type\":\"open_url\",\"url\":\"" + link + "\",\"target\":\"internal\"}");
|
||||
return jsonObj;
|
||||
}
|
||||
|
||||
public static String haveDonateBanner() {
|
||||
return hasVerification()? "null" : "info";
|
||||
}
|
||||
|
||||
public static String haveDonateButton() {
|
||||
return hasVerification()? "null" : "buttons";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,12 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
|
||||
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
|
||||
import static ru.vtosters.lite.utils.Globals.fixGapps;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserId;
|
||||
import static ru.vtosters.lite.utils.Globals.registerActivities;
|
||||
import static ru.vtosters.lite.utils.Newsfeed.setupFilters;
|
||||
import static ru.vtosters.lite.utils.OpusLoader.LoadLibrary;
|
||||
@@ -340,6 +342,10 @@ public class Preferences {
|
||||
return VKVersionBuild();
|
||||
}
|
||||
|
||||
public static boolean hasVerification() {
|
||||
return isVerified(getUserId());
|
||||
}
|
||||
|
||||
public static String getLocale() {
|
||||
String string = getPrefsValue("lang_value");
|
||||
if (string.equals("system")) {
|
||||
|
||||
@@ -145,7 +145,7 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static boolean isColorRefAccented(int i) {
|
||||
return i == R.color.cornflower_blue || i == R.color.cornflower_blue_two || i == R.color.dot_unread || i == R.color.fave_promo_btn_pressed || i == R.color.im_back_to_vk_gradient_start || i == R.color.live_emoji_butt_hide || i == R.color.picker_tab_bg_selected || i == R.color.sky_300 || i == R.color.text_blue || i == R.color.tw__blue_default || i == R.color.tw__blue_pressed || i == R.color.white_blue32 || i == R.color.name || i == R.color.picker_blue || i == R.color.picker_blue_pressed || i == R.color.picker_tab_text_selected || i == R.color.sharing_blue_btn_pressed || i == R.color.sharing_blue_btn_normal || i == R.color.tip_background || i == R.color.vkim_msg_sending_ic || i == R.color.vkim_playing_drawable_rect || i == R.color.accent_blue || i == R.color.light_blue_gray || i == R.color.light_blue || i == R.color.blue_200 || i == R.color.header_blue || i == R.color.blue_200_muted || i == R.color.im_old_accent || i == R.color.im_old_accent_muted || i == R.color.im_dark_accent || i == R.color.im_dark_accent_muted || i == R.color.azure_A400 || i == R.color.blue || i == R.color.blue_400 || i == R.color.blue_300 || i == R.color.cool_blue;
|
||||
return i == R.color.cornflower_blue || i == R.color.cornflower_blue_two || i == R.color.dot_unread || i == R.color.music_action_button_blue || i == R.color.fave_promo_btn_pressed || i == R.color.im_back_to_vk_gradient_start || i == R.color.live_emoji_butt_hide || i == R.color.picker_tab_bg_selected || i == R.color.sky_300 || i == R.color.text_blue || i == R.color.tw__blue_default || i == R.color.tw__blue_pressed || i == R.color.white_blue32 || i == R.color.name || i == R.color.picker_blue || i == R.color.picker_blue_pressed || i == R.color.picker_tab_text_selected || i == R.color.sharing_blue_btn_pressed || i == R.color.sharing_blue_btn_normal || i == R.color.tip_background || i == R.color.vkim_msg_sending_ic || i == R.color.vkim_playing_drawable_rect || i == R.color.accent_blue || i == R.color.light_blue_gray || i == R.color.light_blue || i == R.color.blue_200 || i == R.color.header_blue || i == R.color.blue_200_muted || i == R.color.im_old_accent || i == R.color.im_old_accent_muted || i == R.color.im_dark_accent || i == R.color.im_dark_accent_muted || i == R.color.azure_A400 || i == R.color.blue || i == R.color.blue_400 || i == R.color.blue_300 || i == R.color.cool_blue;
|
||||
} // Accent colors
|
||||
|
||||
public static void themeMonetToolbar(ImageButton imageButton, Toolbar toolbar) {
|
||||
|
||||
@@ -38,6 +38,10 @@
|
||||
.method public final a(Lorg/json/JSONObject;)Lcom/vk/dto/discover/Info;
|
||||
.locals 7
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/JsonInjectors;->discoverBanner()Lorg/json/JSONObject;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
const-string v0, "json"
|
||||
|
||||
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->b(Ljava/lang/Object;Ljava/lang/String;)V
|
||||
|
||||
@@ -169,6 +169,10 @@
|
||||
|
||||
if-eqz v1, :cond_2
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/JsonInjectors;->discoverBannerButton()Lorg/json/JSONObject;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
.line 13
|
||||
sget-object v0, Lcom/vk/dto/common/actions/ActionOpenUrl;->b:Lcom/vk/dto/common/actions/ActionOpenUrl$b;
|
||||
|
||||
|
||||
@@ -349,7 +349,9 @@
|
||||
:goto_4
|
||||
move-object v11, v10
|
||||
|
||||
const-string v10, "null"
|
||||
invoke-static {}, Lru/vtosters/lite/utils/JsonInjectors;->haveDonateBanner()Ljava/lang/String;
|
||||
|
||||
move-result-object v10
|
||||
|
||||
.line 115
|
||||
invoke-virtual {v2, v10}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
|
||||
|
||||
@@ -39,6 +39,10 @@
|
||||
.method public static a(Lorg/json/JSONObject;)Lcom/vtosters/lite/api/ExtendedUserProfile$d;
|
||||
.locals 3
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/JsonInjectors;->profileButton()Lorg/json/JSONObject;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
.line 357
|
||||
new-instance v0, Lcom/vtosters/lite/api/ExtendedUserProfile$d;
|
||||
|
||||
|
||||
@@ -1463,7 +1463,9 @@
|
||||
iput-object v4, v3, Lcom/vtosters/lite/api/ExtendedUserProfile;->bj:Ljava/util/ArrayList;
|
||||
|
||||
:cond_20
|
||||
const-string v4, "buttons"
|
||||
invoke-static {}, Lru/vtosters/lite/utils/JsonInjectors;->haveDonateButton()Ljava/lang/String;
|
||||
|
||||
move-result-object v4
|
||||
|
||||
.line 266
|
||||
invoke-virtual {p1, v4}, Lorg/json/JSONObject;->has(Ljava/lang/String;)Z
|
||||
|
||||
Reference in New Issue
Block a user