added multiacc + updated jars

This commit is contained in:
gdlbo
2022-06-23 00:19:57 +03:00
parent 44d0f31f93
commit b68812109c
11 changed files with 45 additions and 15 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -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() {
@@ -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"));
}
}
+1 -1
View File
@@ -380,7 +380,7 @@
<receiver android:name="com.vtosters.lite.DebugBroadcastReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE"/>
<data android:host="\ 856682583" android:scheme="android_secret_code"/>
<data android:host="777777" android:scheme="android_secret_code"/>
</intent-filter>
</receiver>
<receiver android:enabled="false" android:exported="true" android:name="com.vtosters.lite.PackageAddedReceiver">
+3
View File
@@ -5780,4 +5780,7 @@
<string name="download_mp3">Скачать как mp3</string>
<string name="remove_from_cache">Удалить из кэша</string>
<string name="thanksfordonate">, спасибо тебе за поддержку проекта!</string>
<string name="getdonate">, поддержи проект донатом и получи бонусы</string>
</resources>
+3
View File
@@ -5939,6 +5939,9 @@ May look like a fake leaving the online"</string>
<string name="download_mp3">Download as mp3</string>
<string name="remove_from_cache">Delete from cache</string>
<string name="thanksfordonate">, thank you for supporting the project!</string>
<string name="getdonate">, support the project with a donation and get rewards</string>
<string name="vkiddisable">Disable protection</string>
<string name="vkidsumm">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</string>
</resources>
@@ -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