From 06d5b1a7795dd6ddb24407fdacee13fb249b3401 Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Sun, 24 Jul 2022 16:16:17 +0300 Subject: [PATCH] some profile inj fixes --- .../ru/vtosters/lite/hooks/JsonInjectors.java | 7 +++++-- .../lite/ui/fragments/VTSettings.java | 19 +++++++++++-------- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java b/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java index 9416a90f0..c8b365ae3 100644 --- a/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java +++ b/app/src/main/java/ru/vtosters/lite/hooks/JsonInjectors.java @@ -10,6 +10,7 @@ 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.getUserToken; +import static ru.vtosters.lite.utils.Globals.isVKTester; import static ru.vtosters.lite.utils.Newsfeed.checkCaption; import static ru.vtosters.lite.utils.Newsfeed.checkCopyright; import static ru.vtosters.lite.utils.Newsfeed.isBadNews; @@ -64,7 +65,9 @@ public class JsonInjectors{ newItem.put(donateRecomm()); } - newItem.put(vktesters(id)); + if (!orig.has("type") && isVKTester()) { + newItem.put(vktesters(id)); + } orig.put("buttons", newItem); @@ -113,7 +116,7 @@ public class JsonInjectors{ } public static JSONObject vktesters(int id) throws JSONException{ - var title = "Профиль VK Testers"; + var title = "Карточка Тестера"; var text_color = "2D81E0"; var link = "https://static.vk.com/bugs?lang=" + LangUtils.a() + "#/reporter" + id; diff --git a/app/src/main/java/ru/vtosters/lite/ui/fragments/VTSettings.java b/app/src/main/java/ru/vtosters/lite/ui/fragments/VTSettings.java index 11874e386..6e53d39ef 100644 --- a/app/src/main/java/ru/vtosters/lite/ui/fragments/VTSettings.java +++ b/app/src/main/java/ru/vtosters/lite/ui/fragments/VTSettings.java @@ -17,6 +17,7 @@ import static ru.vtosters.lite.utils.Globals.getPrefsValue; import static ru.vtosters.lite.utils.Globals.getUserPhoto; import static ru.vtosters.lite.utils.Globals.getUsername; import static ru.vtosters.lite.utils.Globals.isGmsInstalled; +import static ru.vtosters.lite.utils.Globals.isVKTester; import static ru.vtosters.lite.utils.Globals.restartApplication; import static ru.vtosters.lite.utils.Preferences.DoNotUseOldIcons; import static ru.vtosters.lite.utils.Preferences.ads; @@ -233,14 +234,16 @@ public class VTSettings extends MaterialPreferenceToolbarFragment{ return false; }); - addPreference(this, "", Globals.getString("bugs"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> { - Context context = getContext(); - VKUIwrapper.officalLinks("bugs"); - Intent a2 = new Navigator(VKUIwrapper.class).b(context); - a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); - context.startActivity(a2); - return false; - }); + if (isVKTester()) { + addPreference(this, "", Globals.getString("bugs"), "", !DoNotUseOldIcons() ? "ic_bug_24" : "ic_bug_outline_28", preference -> { + Context context = getContext(); + VKUIwrapper.officalLinks("bugs"); + Intent a2 = new Navigator(VKUIwrapper.class).b(context); + a2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + context.startActivity(a2); + return false; + }); + } addPreference(this, "", Globals.getString("vtssfs"), ssfs, !DoNotUseOldIcons() ? "ic_link_24" : "ic_link_circle_outline_28", preference -> { Context context = getContext();