diff --git a/app/libs/classes-dex2jar.jar b/app/libs/classes-dex2jar.jar index d3b2734c7..4441d51c5 100644 Binary files a/app/libs/classes-dex2jar.jar and b/app/libs/classes-dex2jar.jar differ diff --git a/app/libs/classes2-dex2jar.jar b/app/libs/classes2-dex2jar.jar index 734868ec9..45bdd06f6 100644 Binary files a/app/libs/classes2-dex2jar.jar and b/app/libs/classes2-dex2jar.jar differ diff --git a/app/libs/classes3-dex2jar.jar b/app/libs/classes3-dex2jar.jar index 69c6dcbff..955b26f57 100644 Binary files a/app/libs/classes3-dex2jar.jar and b/app/libs/classes3-dex2jar.jar differ diff --git a/app/libs/classes4-dex2jar.jar b/app/libs/classes4-dex2jar.jar index 1c8fff8c5..03e1d6e8d 100644 Binary files a/app/libs/classes4-dex2jar.jar and b/app/libs/classes4-dex2jar.jar differ diff --git a/app/libs/classes5-dex2jar.jar b/app/libs/classes5-dex2jar.jar index 97158cfef..8d984ed13 100644 Binary files a/app/libs/classes5-dex2jar.jar and b/app/libs/classes5-dex2jar.jar differ 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 9b9cc6c68..804cc10f6 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 @@ -5,14 +5,19 @@ import static ru.vtosters.lite.f0x1d.VTVerifications.vtverif; import static ru.vtosters.lite.utils.About.getBuildNumber; import static ru.vtosters.lite.utils.About.getCommitLink; import static ru.vtosters.lite.utils.CacheUtils.humanReadableByteCountBin; +import static ru.vtosters.lite.utils.Globals.drawableFromUrl; import static ru.vtosters.lite.utils.Globals.edit; import static ru.vtosters.lite.utils.Globals.getIdentifier; 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.restartApplication; import static ru.vtosters.lite.utils.Preferences.ads; import static ru.vtosters.lite.utils.Preferences.devmenu; import static ru.vtosters.lite.utils.Preferences.disableSettingsSumms; import static ru.vtosters.lite.utils.Preferences.hasSpecialVerif; +import static ru.vtosters.lite.utils.Preferences.hasVerification; import static ru.vtosters.lite.utils.Preferences.isValidSignature; import static ru.vtosters.lite.utils.Preferences.navbar; import static ru.vtosters.lite.utils.Preferences.offline; @@ -33,6 +38,7 @@ import android.os.Bundle; import com.aefyr.tsg.g2.TelegramStickersService; import com.vk.about.AboutAppFragment; import com.vk.balance.BalanceFragment; +import com.vk.bridges.AuthBridge; import com.vk.navigation.Navigator; import com.vk.notifications.settings.NotificationsSettingsFragment; import com.vk.webapp.fragments.PrivacyFragment; @@ -44,9 +50,6 @@ import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment; import com.vtosters.lite.general.fragments.SettingsAccountFragment; import com.vtosters.lite.general.fragments.SettingsGeneralFragment; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - import ru.vtosters.lite.ui.PreferencesUtil; import ru.vtosters.lite.ui.dialogs.OTADialog; import ru.vtosters.lite.ui.fragments.dockbar.DockBarFragment; @@ -79,6 +82,12 @@ public class VTSettings extends MaterialPreferenceToolbarFragment { int vtosterXml = getIdentifier("empty", "xml"); this.addPreferencesFromResource(vtosterXml); + PreferencesUtil.addPreferenceDrawable(this, "", "Аккаунты", getUsername() + (hasVerification()? Globals.getString("thanksfordonate") : Globals.getString("getdonate")), drawableFromUrl(getUserPhoto()), preference -> { + AuthBridge.logout(); + restartApplication(); + return false; + }); + PreferencesUtil.addPreferenceCategory(this, Globals.getString("vtsettdarktheme")); PreferencesUtil.addMaterialSwitchPreference(this, "isdark", Globals.getString("vtsettdarktheme"), "", oldicons() ? "ic_palette_24" : "ic_palette_outline_28", false, (preference, o) -> { @@ -94,7 +103,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment { return true; }); - if (Build.VERSION.SDK_INT >= 28 && false) { + if (Build.VERSION.SDK_INT >= 28 && false) { // TODO refactoring systen theme PreferencesUtil.addMaterialSwitchPreference(this, "systemtheme", Globals.getString("appearance_theme_use_system"), Globals.getString("appearance_theme_use_system_summary"), oldicons() ? "ic_recent_24" : "ic_recent_outline_28", true, (preference, o) -> { boolean value = (boolean) o; @@ -373,14 +382,6 @@ public class VTSettings extends MaterialPreferenceToolbarFragment { return Globals.getContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE); } - public static String withRegex(String base, String regex, String def) { - Pattern pattern = Pattern.compile(regex); - Matcher matcher = pattern.matcher(base); - if (matcher.find()) { - return matcher.group(1); - } - return def; - } @Override public int T4() { diff --git a/app/src/main/java/ru/vtosters/lite/utils/Globals.java b/app/src/main/java/ru/vtosters/lite/utils/Globals.java index 3c055e304..d43851486 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/Globals.java +++ b/app/src/main/java/ru/vtosters/lite/utils/Globals.java @@ -97,6 +97,14 @@ public class Globals { return VKAccountManager.d().b(); } + public static String getUsername() { + return VKAccountManager.d().Z(); + } + + public static String getUserPhoto() { + return VKAccountManager.d().d0(); + } + public static SharedPreferences.Editor edit() { return PreferenceManager.getDefaultSharedPreferences(getContext()).edit(); } // Edit SharedPreferences @@ -136,9 +144,9 @@ public class Globals { InputStream is = conn.getInputStream(); Bitmap bmp = BitmapFactory.decodeStream(is); - return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(getBitmapClippedCircle(bmp), convertDpToPixel(48), convertDpToPixel(48), true)); + return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(getBitmapClippedCircle(bmp), convertDpToPixel(256), convertDpToPixel(256), true)); } catch (Exception e) { - return getDrawable(getContext(), com.vtosters.lite.R.drawable.libverify_ic_account_circle_white); + return getDrawable(getContext(), getIdentifier("ic_user_circle_outline_28", "drawable")); } } diff --git a/smali/AndroidManifest.xml b/smali/AndroidManifest.xml index 25eb55270..d95e7a72f 100644 --- a/smali/AndroidManifest.xml +++ b/smali/AndroidManifest.xml @@ -380,7 +380,7 @@ - + diff --git a/smali/res/values-ru/strings.xml b/smali/res/values-ru/strings.xml index ceb9fbf44..0fd22d530 100644 --- a/smali/res/values-ru/strings.xml +++ b/smali/res/values-ru/strings.xml @@ -5780,4 +5780,7 @@ Скачать как mp3 Удалить из кэша + + , спасибо тебе за поддержку проекта! + , поддержи проект донатом и получи бонусы diff --git a/smali/res/values/strings.xml b/smali/res/values/strings.xml index c67caf4b4..4bf58018d 100644 --- a/smali/res/values/strings.xml +++ b/smali/res/values/strings.xml @@ -5939,6 +5939,9 @@ May look like a fake leaving the online" Download as mp3 Delete from cache + , thank you for supporting the project! + , support the project with a donation and get rewards + Disable protection VK has started blocking the use of third-party applications, so for the stable operation of all parts of the application, it is necessary to disable Protection from suspicious applications \n\nVK ID -> Security and Login -> Protection from suspicious applications diff --git a/smali/smali_classes2/com/vk/bridges/AuthBridge.smali b/smali/smali_classes2/com/vk/bridges/AuthBridge.smali index 04a332bf7..8fd83af85 100644 --- a/smali/smali_classes2/com/vk/bridges/AuthBridge.smali +++ b/smali/smali_classes2/com/vk/bridges/AuthBridge.smali @@ -28,6 +28,21 @@ throw v0 .end method +.method public static logout()V + .registers 3 + + .line 2 + sget-object v0, Lcom/vk/bridges/AuthBridge;->a:Lcom/vk/bridges/AuthBridge3; + + const-string v1, "user" + + const/4 v2, 0x1 + + invoke-interface {v0, v1, v2}, Lcom/vk/bridges/AuthBridge3;->a(Ljava/lang/String;Z)V + + return-void +.end method + .method public static final a(Lcom/vk/bridges/AuthBridge3;)V .locals 0