Refactoring + renaming
This commit is contained in:
@@ -14,7 +14,6 @@ import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class LibVKXClient {
|
||||
@@ -29,7 +28,7 @@ public class LibVKXClient {
|
||||
|
||||
public static LibVKXClientImpl getInstance() {
|
||||
LibVKXClientImpl libVKXClientImpl = impl;
|
||||
return libVKXClientImpl == null ? getInstance(GetContext()) : libVKXClientImpl;
|
||||
return libVKXClientImpl == null ? getInstance(getContext()) : libVKXClientImpl;
|
||||
}
|
||||
|
||||
public static boolean isVkxInstalled() {
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.os.RemoteException;
|
||||
import java.util.List;
|
||||
|
||||
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class LibVKXClientImpl {
|
||||
private ILibVkxService serviceInstance;
|
||||
@@ -53,7 +52,7 @@ public class LibVKXClientImpl {
|
||||
public boolean runOnService(LibVKXAction action) {
|
||||
if (serviceInstance != null) {
|
||||
try {
|
||||
if (serviceInstance.getUserId() != GetUserId()) return false;
|
||||
if (serviceInstance.getUserId() != getUserId()) return false;
|
||||
action.run(serviceInstance);
|
||||
return true;
|
||||
} catch (RemoteException e) {
|
||||
@@ -77,7 +76,7 @@ public class LibVKXClientImpl {
|
||||
isBindFailed = true;
|
||||
} else {
|
||||
try {
|
||||
if (serviceInstance.getUserId() != GetUserId()) return;
|
||||
if (serviceInstance.getUserId() != getUserId()) return;
|
||||
runAfterBind.run(serviceInstance);
|
||||
} catch (RemoteException e) {
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -20,7 +20,6 @@ import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.ThreadPoolExecutor;
|
||||
|
||||
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
/**
|
||||
* Created by Aefyr on 19.05.2018.
|
||||
@@ -116,7 +115,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyPackAdded(TelegramStickersPack pack, int atIndex) {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -126,7 +125,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyPackChanged(TelegramStickersPack pack, int atIndex) {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -136,7 +135,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyPackRemoved(TelegramStickersPack pack, int atIndex) {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -146,7 +145,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyPackDownloadError(TelegramStickersPack pack, Exception error) {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -156,7 +155,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyActivePacksListChanged() {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
@@ -166,7 +165,7 @@ public class TelegramStickersService {
|
||||
}
|
||||
|
||||
private void notifyInactivePacksListChanged() {
|
||||
GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
getContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
|
||||
if (listeners.isEmpty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@ import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.URL;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class F0x1dRequest {
|
||||
|
||||
public static void makeRequest(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback) {
|
||||
@@ -58,7 +56,7 @@ public class F0x1dRequest {
|
||||
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(this.url)).openConnection();
|
||||
httpURLConnection.setRequestMethod(this.mIsPut ? "PUT" : "GET");
|
||||
if (this.mIsVkToasterRequest) {
|
||||
httpURLConnection.setRequestProperty("Token", GetUserToken());
|
||||
httpURLConnection.setRequestProperty("Token", getUserToken());
|
||||
}
|
||||
if (!this.mIsVkToasterRequest) {
|
||||
httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a());
|
||||
|
||||
@@ -10,11 +10,8 @@ import com.vk.im.engine.models.dialogs.Dialog;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ru.f0x1d.net.F0x1dRequest;
|
||||
import ru.vtosters.lite.dnr.helpers.DoNotReadDBHelper;
|
||||
import ru.vtosters.lite.dnr.helpers.DoNotTypeDBHelper;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Proxy;
|
||||
|
||||
public class DNRModule {
|
||||
public static DoNotReadDBHelper mDoNotReadDBHelper = new DoNotReadDBHelper();
|
||||
@@ -54,7 +51,7 @@ public class DNRModule {
|
||||
}
|
||||
|
||||
public static void hookRead(Dialog dialog) {
|
||||
makeRequest("https://" + getApiCom() + "/method/messages.markAsRead?start_message_id=" + dialog.lastMsgVkId + "&peer_id=" + dialog.a() + "&v=5.91&access_token=" + GetUserToken(), response -> {
|
||||
makeRequest("https://" + getApiCom() + "/method/messages.markAsRead?start_message_id=" + dialog.lastMsgVkId + "&peer_id=" + dialog.a() + "&v=5.91&access_token=" + getUserToken(), response -> {
|
||||
ToastUtils.a("Чат помечен как прочитанный!");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -11,11 +11,10 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.dnr.DNRPrefs;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class DoNotReadDBHelper extends SQLiteOpenHelper {
|
||||
public DoNotReadDBHelper() {
|
||||
super(GetContext(), "dnr", null, 1);
|
||||
super(getContext(), "dnr", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -13,7 +13,7 @@ import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class DoNotTypeDBHelper extends SQLiteOpenHelper {
|
||||
public DoNotTypeDBHelper() {
|
||||
super(Helper.GetContext(), "dnt", null, 1);
|
||||
super(Helper.getContext(), "dnt", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,7 +19,6 @@ import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
import ru.vtosters.lite.badmanners.DeviceInfoCollector;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class Crashreporter {
|
||||
@@ -37,12 +36,12 @@ public class Crashreporter {
|
||||
}
|
||||
|
||||
static void start(Thread.UncaughtExceptionHandler uncaughtExceptionHandler, Thread thread, Throwable th, Activity activity) {
|
||||
logString = getStackTrace(th) + "\n\n" + new DeviceInfoCollector().collect(GetContext()).toDeviceName() + "\n VTL Version: " + Prefs.VERSIONNAME + ", build: " + Prefs.getBuildNumber();
|
||||
logString = getStackTrace(th) + "\n\n" + new DeviceInfoCollector().collect(getContext()).toDeviceName() + "\n VTL Version: " + Prefs.VERSIONNAME + ", build: " + Prefs.getBuildNumber();
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
var notificationChannel = new NotificationChannel("crashes", "crash", NotificationManager.IMPORTANCE_DEFAULT);
|
||||
notificationChannel.enableVibration(true);
|
||||
notificationChannel.enableLights(true);
|
||||
((NotificationManager) GetContext().getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChannel);
|
||||
((NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChannel);
|
||||
}
|
||||
|
||||
var foxbinIntent = new Intent("com.f0x1d.dogbin.ACTION_UPLOAD_TO_FOXBIN");
|
||||
@@ -54,19 +53,19 @@ public class Crashreporter {
|
||||
foxbinIntent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
|
||||
}
|
||||
|
||||
var saveLogIntent = new Intent(GetContext(), LogWriterService.class);
|
||||
var saveLogIntent = new Intent(getContext(), LogWriterService.class);
|
||||
saveLogIntent.putExtra("log", logString);
|
||||
saveLogIntent.putExtra("notificationId", 1);
|
||||
var psaveLogIntent = PendingIntent.getService(GetContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
var psaveLogIntent = PendingIntent.getService(getContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
|
||||
|
||||
var builder = new Notification.Builder(GetContext());
|
||||
var builder = new Notification.Builder(getContext());
|
||||
builder.setSmallIcon(R.drawable.ic_bug_24);
|
||||
builder.setContentTitle("VTL Крашнулся!");
|
||||
builder.setContentText(logString);
|
||||
builder.setStyle(new Notification.BigTextStyle().bigText(logString));
|
||||
builder.setAutoCancel(true);
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
|
||||
builder.addAction(new Notification.Action(0, "Загрузить логи", PendingIntent.getActivity(GetContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
|
||||
builder.addAction(new Notification.Action(0, "Загрузить логи", PendingIntent.getActivity(getContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
|
||||
builder.addAction(new Notification.Action(0, "Сохранить в файл", psaveLogIntent));
|
||||
} else {
|
||||
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
|
||||
@@ -77,13 +76,13 @@ public class Crashreporter {
|
||||
}
|
||||
|
||||
|
||||
((NotificationManager) GetContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify(-2147483548, builder.build());
|
||||
((NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify(-2147483548, builder.build());
|
||||
Log.e("VTosters Lite", "crashed: " + th.getLocalizedMessage());
|
||||
uncaughtExceptionHandler.uncaughtException(thread, th);
|
||||
}
|
||||
|
||||
private static boolean isFoxbinInstalled() {
|
||||
var pm = GetContext().getPackageManager();
|
||||
var pm = getContext().getPackageManager();
|
||||
try {
|
||||
pm.getPackageInfo("com.f0x1d.dogbin", 0);
|
||||
return true;
|
||||
|
||||
@@ -10,7 +10,6 @@ import android.content.Intent;
|
||||
import android.os.Environment;
|
||||
import android.os.IBinder;
|
||||
import android.util.Log;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
@@ -19,8 +18,6 @@ import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class LogWriterService extends Service {
|
||||
public LogWriterService() {
|
||||
}
|
||||
@@ -41,12 +38,12 @@ public class LogWriterService extends Service {
|
||||
writeLog(intent, file);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
makeText(GetContext(), "Не удалось сохранить лог-файл", LENGTH_SHORT).show();
|
||||
makeText(getContext(), "Не удалось сохранить лог-файл", LENGTH_SHORT).show();
|
||||
}
|
||||
var notificationId = intent.getIntExtra("notificationId", 1);
|
||||
var manager = (NotificationManager) GetContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
var manager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
manager.cancel(notificationId);
|
||||
makeText(GetContext(), "Лог-файл был сохранен", LENGTH_SHORT).show();
|
||||
makeText(getContext(), "Лог-файл был сохранен", LENGTH_SHORT).show();
|
||||
|
||||
stopSelf();
|
||||
return START_NOT_STICKY;
|
||||
|
||||
@@ -6,7 +6,7 @@ import android.preference.PreferenceManager;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class TGPref {
|
||||
private static final SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(Helper.GetContext());
|
||||
private static final SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(Helper.getContext());
|
||||
|
||||
private static final String CNCT_METHOD = "VTGS:CM";
|
||||
private static final String TG_BOTKEY = "VTGS:BKey";
|
||||
|
||||
@@ -22,8 +22,6 @@ import org.json.JSONObject;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class TGRoot {
|
||||
public static final int N = 76820000;
|
||||
public static final int X = 976820000;
|
||||
@@ -49,7 +47,7 @@ public class TGRoot {
|
||||
int stickerId = (id - N) % 120;
|
||||
|
||||
TelegramStickersPack pack = null;
|
||||
for (TelegramStickersPack p : TelegramStickersService.getInstance(GetContext()).getActivePacksListReference()) {
|
||||
for (TelegramStickersPack p : TelegramStickersService.getInstance(getContext()).getActivePacksListReference()) {
|
||||
if (p.index == index) {
|
||||
pack = p;
|
||||
break;
|
||||
@@ -70,7 +68,7 @@ public class TGRoot {
|
||||
|
||||
public static void injectStickers(List<StickerStockItem> list) {
|
||||
try {
|
||||
List<TelegramStickersPack> packs = TelegramStickersService.getInstance(GetContext()).getActivePacksListReference();
|
||||
List<TelegramStickersPack> packs = TelegramStickersService.getInstance(getContext()).getActivePacksListReference();
|
||||
for (int i = packs.size() - 1; i >= 0; i--)
|
||||
list.add(0, toStickerPack(packs.get(i)));
|
||||
} catch (Exception e) {
|
||||
@@ -83,7 +81,7 @@ public class TGRoot {
|
||||
int index = (stickerId - N) / 120;
|
||||
|
||||
TelegramStickersPack p = null;
|
||||
for (TelegramStickersPack p_ : TelegramStickersService.getInstance(GetContext())
|
||||
for (TelegramStickersPack p_ : TelegramStickersService.getInstance(getContext())
|
||||
.getActivePacksListReference()) {
|
||||
if (p_.index == index) {
|
||||
p = p_;
|
||||
|
||||
@@ -24,7 +24,6 @@ import androidx.core.view.ViewCompat;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
import com.vtosters.lite.ui.MaterialSwitchPreference;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public class PreferencesUtil {
|
||||
@@ -35,7 +34,7 @@ public class PreferencesUtil {
|
||||
}
|
||||
|
||||
public static void addListPreference(MaterialPreferenceToolbarFragment fragment, String key, String def, CharSequence title, CharSequence[] entries, CharSequence[] entriesValue) {
|
||||
ListPreference preference = new ListPreference(GetContext());
|
||||
ListPreference preference = new ListPreference(getContext());
|
||||
preference.a(entries);
|
||||
preference.b(entriesValue);
|
||||
preference.c(title); // setTitle
|
||||
@@ -46,7 +45,7 @@ public class PreferencesUtil {
|
||||
}
|
||||
|
||||
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment materialPreferenceToolbarFragment, String key, CharSequence title, CharSequence summary, boolean defValue) {
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(GetContext());
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(getContext());
|
||||
materialSwitchPreference.c(title); // setTitle
|
||||
materialSwitchPreference.b(summary); // setSummary
|
||||
materialSwitchPreference.d(key); // setKey
|
||||
@@ -56,7 +55,7 @@ public class PreferencesUtil {
|
||||
}
|
||||
|
||||
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, int icon, boolean defValue, Preference.b listener) {
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(GetContext());
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(getContext());
|
||||
materialSwitchPreference.c(title); // setTitle
|
||||
materialSwitchPreference.b(summary); // setSummary
|
||||
materialSwitchPreference.d(key); // setKey
|
||||
@@ -64,13 +63,13 @@ public class PreferencesUtil {
|
||||
materialSwitchPreference.a(listener); // setOnPreferenceClickListener
|
||||
|
||||
if (icon != 1)
|
||||
materialSwitchPreference.a(setTint(GetContext(), ContextCompat.getDrawable(GetContext(), icon))); // preference.setIcon
|
||||
materialSwitchPreference.a(setTint(getContext(), ContextCompat.getDrawable(getContext(), icon))); // preference.setIcon
|
||||
|
||||
fragment.ay().d(materialSwitchPreference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, String icon, boolean defValue, Preference.b listener) {
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(GetContext());
|
||||
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(getContext());
|
||||
materialSwitchPreference.c(title); // setTitle
|
||||
materialSwitchPreference.b(summary); // setSummary
|
||||
materialSwitchPreference.d(key); // setKey
|
||||
@@ -78,14 +77,14 @@ public class PreferencesUtil {
|
||||
fragment.ay().d(materialSwitchPreference); // materialPreferenceToolbarFragment.getPreferenceScreen().addPreference(preference)
|
||||
|
||||
if (icon != null)
|
||||
materialSwitchPreference.a(setTint(GetContext(), getDrawable(GetContext(), icon))); // preference.setIcon
|
||||
materialSwitchPreference.a(setTint(getContext(), getDrawable(getContext(), icon))); // preference.setIcon
|
||||
materialSwitchPreference.a(listener); // setOnPreferenceClickListener(listener)
|
||||
|
||||
fragment.ay().d(materialSwitchPreference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary) {
|
||||
Preference preference = new Preference(GetContext());
|
||||
Preference preference = new Preference(getContext());
|
||||
preference.b(summary); // setSummary
|
||||
preference.c(title); // setTitle
|
||||
preference.d(key); // setKey
|
||||
@@ -94,59 +93,59 @@ public class PreferencesUtil {
|
||||
}
|
||||
|
||||
public static void addPreference(MaterialPreferenceToolbarFragment fragment, CharSequence title, CharSequence summary, @Nullable String icon, Preference.c listener) {
|
||||
Preference preference = new Preference(GetContext());
|
||||
Preference preference = new Preference(getContext());
|
||||
preference.b(summary); // setSummary
|
||||
preference.c(title); // setTitle
|
||||
|
||||
if (icon != null)
|
||||
preference.a(setTint(GetContext(), getDrawable(GetContext(), icon))); // preference.setIcon
|
||||
preference.a(setTint(getContext(), getDrawable(getContext(), icon))); // preference.setIcon
|
||||
preference.a(listener); // preference.setOnPreferenceClickListener(listener)
|
||||
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, @Nullable String icon, Preference.c listener) {
|
||||
Preference preference = new Preference(GetContext());
|
||||
Preference preference = new Preference(getContext());
|
||||
preference.b(summary); // setSummary
|
||||
preference.c(title); // setTitle
|
||||
preference.d(key); // setKey
|
||||
|
||||
if (icon != null)
|
||||
preference.a(setTint(GetContext(), getDrawable(GetContext(), icon))); // preference.setIcon
|
||||
preference.a(setTint(getContext(), getDrawable(getContext(), icon))); // preference.setIcon
|
||||
preference.a(listener); // preference.setOnPreferenceClickListener(listener)
|
||||
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreferenceCategory(MaterialPreferenceToolbarFragment fragment, CharSequence title) {
|
||||
PreferenceCategory preference = new PreferenceCategory(GetContext(), null);
|
||||
PreferenceCategory preference = new PreferenceCategory(getContext(), null);
|
||||
preference.c(title); // setTitle
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addPreferenceCategory(MaterialPreferenceToolbarFragment fragment, CharSequence title, int collapsedSize) {
|
||||
PreferenceCategory preference = new PreferenceCategory(GetContext(), null);
|
||||
PreferenceCategory preference = new PreferenceCategory(getContext(), null);
|
||||
preference.c(title); // setTitle
|
||||
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
|
||||
}
|
||||
|
||||
public static void addEditTextPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, EditTextPrefChangeListener editTextPrefChangeListener) {
|
||||
Preference preference = new Preference(GetContext());
|
||||
Preference preference = new Preference(getContext());
|
||||
|
||||
preference.c(title); // setTitle
|
||||
preference.d(key); // setKey
|
||||
preference.a(preference1 -> {
|
||||
LinearLayout linearLayout = new LinearLayout(GetContext());
|
||||
LinearLayout linearLayout = new LinearLayout(getContext());
|
||||
|
||||
final EditText editText = new EditText(GetContext());
|
||||
editText.setText(PreferenceManager.getDefaultSharedPreferences(GetContext()).getString(key, ""));
|
||||
final EditText editText = new EditText(getContext());
|
||||
editText.setText(PreferenceManager.getDefaultSharedPreferences(getContext()).getString(key, ""));
|
||||
editText.setHint(title);
|
||||
editText.setHintTextColor(PreferencesUtil.getSTextColor(GetContext()));
|
||||
editText.setHintTextColor(PreferencesUtil.getSTextColor(getContext()));
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(GetContext())));
|
||||
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(getContext())));
|
||||
} else {
|
||||
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(GetContext())));
|
||||
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(getContext())));
|
||||
}
|
||||
linearLayout.addView(editText);
|
||||
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
@@ -162,7 +161,7 @@ public class PreferencesUtil {
|
||||
if (!change)
|
||||
return;
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(GetContext())
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
.edit()
|
||||
.putString(key, editText.getText().toString())
|
||||
.apply();
|
||||
|
||||
@@ -11,14 +11,13 @@ import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.PowerManager;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.OEMDetector;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class DisableBattery {
|
||||
public static void alert(Activity activity) {
|
||||
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && Prefs.BooleanTrue("showDoze")) {
|
||||
final Context context = GetContext();
|
||||
final Context context = getContext();
|
||||
if (!((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle("Выключите оптимизацию батареи!");
|
||||
|
||||
@@ -11,12 +11,11 @@ import android.content.Intent;
|
||||
import com.vk.navigation.Navigator;
|
||||
|
||||
import ru.vtosters.lite.ui.fragments.InstallGMSFragment;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class InstallGMS {
|
||||
public static void alert(final Activity activity) {
|
||||
if (!IsGmsInstalled()) {
|
||||
if (!isGmsInstalled()) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle("Внимание!");
|
||||
builder.setMessage(Text());
|
||||
@@ -33,7 +32,7 @@ public class InstallGMS {
|
||||
@Override
|
||||
public void onClick(DialogInterface dialogInterface, int i) {
|
||||
edit().putBoolean("showAlertGms", false).apply();
|
||||
Context context = GetContext();
|
||||
Context context = getContext();
|
||||
Intent a2 = new Navigator(InstallGMSFragment.class).a(context);
|
||||
context.startActivity(a2);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,6 @@ import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
import android.widget.Toast;
|
||||
|
||||
import com.vk.audio.AudioMessageUtils;
|
||||
import com.vk.auth.api.VKAccount;
|
||||
@@ -26,8 +25,6 @@ import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override
|
||||
@@ -62,7 +59,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
copy(GetContext(), GetUserToken());
|
||||
copy(getContext(), getUserToken());
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -99,7 +96,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
restarting();
|
||||
restartApplication();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -129,9 +126,9 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
SharedPreferences prefs = GetContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
|
||||
prefs.edit().clear().commit();
|
||||
restarting();
|
||||
restartApplication();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -143,7 +140,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
deletePrefs();
|
||||
restarting();
|
||||
restartApplication();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.widget.TextView;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public class DockBarAdapter extends RecyclerView.a
|
||||
@@ -42,7 +41,7 @@ public class DockBarAdapter extends RecyclerView.a
|
||||
}
|
||||
|
||||
private View createTabItem() {
|
||||
LinearLayout container = new LinearLayout(GetContext());
|
||||
LinearLayout container = new LinearLayout(getContext());
|
||||
container.setTag("tab_item_container");
|
||||
container.setGravity(Gravity.CENTER_VERTICAL);
|
||||
container.setOrientation(LinearLayout.HORIZONTAL);
|
||||
@@ -54,7 +53,7 @@ public class DockBarAdapter extends RecyclerView.a
|
||||
);
|
||||
container.setLayoutParams(new LinearLayout.LayoutParams(-1, convertDpToPixel(48)));
|
||||
|
||||
ImageView icon = new ImageView(GetContext());
|
||||
ImageView icon = new ImageView(getContext());
|
||||
icon.setTag("icon");
|
||||
icon.setImageTintList(ColorStateList.valueOf(Themes.getAccentColor()));
|
||||
icon.setLayoutParams(new LinearLayout.LayoutParams(
|
||||
@@ -62,7 +61,7 @@ public class DockBarAdapter extends RecyclerView.a
|
||||
convertDpToPixel(24)));
|
||||
container.addView(icon);
|
||||
|
||||
TextView title = new TextView(GetContext());
|
||||
TextView title = new TextView(getContext());
|
||||
title.setTag("title");
|
||||
title.setTextSize(16.0f);
|
||||
title.setTypeface(Typeface.DEFAULT_BOLD);
|
||||
@@ -76,10 +75,10 @@ public class DockBarAdapter extends RecyclerView.a
|
||||
}
|
||||
|
||||
private View createGroupTitle() {
|
||||
LinearLayout layout = new LinearLayout(GetContext());
|
||||
LinearLayout layout = new LinearLayout(getContext());
|
||||
layout.setLayoutParams(new LinearLayout.LayoutParams(-1, -2));
|
||||
|
||||
TextView title = new TextView(GetContext());
|
||||
TextView title = new TextView(getContext());
|
||||
title.setTag("group_title");
|
||||
title.setTextSize(13.0f);
|
||||
title.setPadding(
|
||||
|
||||
@@ -14,7 +14,6 @@ import android.widget.FrameLayout;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import me.grishka.appkit.fragments.ToolbarFragment;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class DockBarFragment extends ToolbarFragment {
|
||||
|
||||
@@ -43,7 +42,7 @@ public class DockBarFragment extends ToolbarFragment {
|
||||
save.setText("Сохранить");
|
||||
save.setOnClickListener(v -> {
|
||||
DockBarManager.getInstance().save();
|
||||
restarting();
|
||||
restartApplication();
|
||||
});
|
||||
|
||||
LinearLayout.LayoutParams saveParams = new LinearLayout.LayoutParams(0, -2);
|
||||
@@ -57,7 +56,7 @@ public class DockBarFragment extends ToolbarFragment {
|
||||
reset.setText("Сбросить");
|
||||
reset.setOnClickListener(v -> {
|
||||
DockBarManager.getInstance().delete();
|
||||
restarting();
|
||||
restartApplication();
|
||||
});
|
||||
|
||||
LinearLayout.LayoutParams resetParams = new LinearLayout.LayoutParams(0, -2);
|
||||
|
||||
@@ -26,8 +26,6 @@ import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class DockBarInjector {
|
||||
private static final DockBarManager sManager = DockBarManager.getInstance();
|
||||
|
||||
@@ -63,8 +61,8 @@ public class DockBarInjector {
|
||||
|
||||
for (DockBarTab tab : sManager.getSelectedTabs()) {
|
||||
MenuItem add = menu.add(0, tab.id, 0, tab.titleID);
|
||||
Drawable drawable = GetContext().getResources().getDrawable(tab.iconID);
|
||||
ColorStateList colorStateList = GetContext().getResources().getColorStateList(com.vtosters.lite.R.color.bottom_navigation_item);
|
||||
Drawable drawable = getContext().getResources().getDrawable(tab.iconID);
|
||||
ColorStateList colorStateList = getContext().getResources().getColorStateList(com.vtosters.lite.R.color.bottom_navigation_item);
|
||||
// if (isAndroidMonet()) {
|
||||
// colorStateList = ColorStateList.valueOf(Themes.getAccentColor());
|
||||
// }
|
||||
|
||||
@@ -75,7 +75,7 @@ public class DockBarManager {
|
||||
}
|
||||
|
||||
private void load() {
|
||||
File dockbar = new File(Helper.GetContext().getFilesDir(), "dockbar.json");
|
||||
File dockbar = new File(Helper.getContext().getFilesDir(), "dockbar.json");
|
||||
|
||||
if (!dockbar.exists()) {
|
||||
mSelectedTabs.add(new DockBarTab("tab_news", Prefs.olddock() ? R.drawable.ic_newsfeed_28 : R.drawable.ic_menu_newsfeed_outline_28, R.string.newsfeed, R.id.tab_news, Prefs.isUseAlternativeFragments() ? Feed2049.b.c() : NewsfeedFragment.class));
|
||||
@@ -163,13 +163,13 @@ public class DockBarManager {
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
File dockbar = new File(Helper.GetContext().getFilesDir(), "dockbar.json");
|
||||
File dockbar = new File(Helper.getContext().getFilesDir(), "dockbar.json");
|
||||
if (dockbar.exists()) dockbar.delete();
|
||||
}
|
||||
|
||||
public void save() {
|
||||
try {
|
||||
File dockbar = new File(Helper.GetContext().getFilesDir(), "dockbar.json");
|
||||
File dockbar = new File(Helper.getContext().getFilesDir(), "dockbar.json");
|
||||
|
||||
JSONArray selected = new JSONArray();
|
||||
for (DockBarTab tab : mSelectedTabs) {
|
||||
|
||||
+3
-6
@@ -26,9 +26,6 @@ import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.MultiAccountViewHolder> {
|
||||
|
||||
private final List<MultiAccountItem> mAccounts = MultiAccountManager.buildList();
|
||||
@@ -126,7 +123,7 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
|
||||
VKAccount b = VKAccountManager.b();
|
||||
PushSubscriber.a.a(b.b(), b.c());
|
||||
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
|
||||
restarting();
|
||||
restartApplication();
|
||||
});
|
||||
Drawable drawable = recolorDrawable(getResources().getDrawable(R.drawable.ic_list_add));
|
||||
mAction.setImageDrawable(drawable);
|
||||
@@ -142,7 +139,7 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
|
||||
VKAccount b = VKAccountManager.b();
|
||||
PushSubscriber.a.a(b.b(), b.c());
|
||||
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
|
||||
restarting();
|
||||
restartApplication();
|
||||
|
||||
});
|
||||
|
||||
@@ -163,7 +160,7 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
|
||||
VKAccount b = VKAccountManager.b();
|
||||
PushSubscriber.a.a(b.b(), b.c());
|
||||
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
|
||||
restarting();
|
||||
restartApplication();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+13
-15
@@ -1,7 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.multiaccount;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Helper.GetContext;
|
||||
import static ru.vtosters.lite.utils.Helper.getContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -12,26 +12,24 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class MultiAccountManager {
|
||||
|
||||
public static void migrate() {
|
||||
SharedPreferences OldPrefs = GetContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE);
|
||||
SharedPreferences OldPrefs = getContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE);
|
||||
String OldPrefsValue = OldPrefs.getString("key_vk_account", "");
|
||||
SharedPreferences NewPrefs = GetContext().getSharedPreferences("pref_account_manager0", Context.MODE_PRIVATE);
|
||||
SharedPreferences NewPrefs = getContext().getSharedPreferences("pref_account_manager0", Context.MODE_PRIVATE);
|
||||
SharedPreferences.Editor editor = NewPrefs.edit();
|
||||
editor.putString("key_vk_account", OldPrefsValue);
|
||||
editor.apply();
|
||||
}
|
||||
|
||||
public static SharedPreferences getCurrentAccount() {
|
||||
int account = GetPreferences().getInt("account", 0);
|
||||
return GetContext().getSharedPreferences("pref_account_manager" + (account != 0 ? account : ""), Context.MODE_PRIVATE);
|
||||
int account = getPreferences().getInt("account", 0);
|
||||
return getContext().getSharedPreferences("pref_account_manager" + (account != 0 ? account : ""), Context.MODE_PRIVATE);
|
||||
}
|
||||
|
||||
private static int getAccountPrefsCount() {
|
||||
File[] prefs = new File(GetContext().getFilesDir().getParent(), "shared_prefs")
|
||||
File[] prefs = new File(getContext().getFilesDir().getParent(), "shared_prefs")
|
||||
.listFiles((dir, name) -> {
|
||||
return name.matches("pref_account_manager\\d+\\.xml");
|
||||
});
|
||||
@@ -50,7 +48,7 @@ public class MultiAccountManager {
|
||||
public static List<MultiAccountItem> buildList() {
|
||||
List<MultiAccountItem> list = new ArrayList<>();
|
||||
for (int i = 0; i <= getAccountPrefsCount(); i++) {
|
||||
SharedPreferences prefs = GetContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
String keyVKAccount = prefs.getString("key_vk_account", "");
|
||||
if (!keyVKAccount.isEmpty()) {
|
||||
String name = withRegex(keyVKAccount, ".*\"name\":\\{.*?:\"(.*?)\"\\}.*", "");
|
||||
@@ -65,22 +63,22 @@ public class MultiAccountManager {
|
||||
}
|
||||
|
||||
public static boolean switchAccount(int i) {
|
||||
int account = GetPreferences().getInt("account", 0);
|
||||
int account = getPreferences().getInt("account", 0);
|
||||
if (account == i) return false;
|
||||
|
||||
GetPreferences().edit().putInt("account", i).commit();
|
||||
getPreferences().edit().putInt("account", i).commit();
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void addAccount() {
|
||||
GetPreferences().edit().putInt("account", getAccountPrefsCount()).commit();
|
||||
getPreferences().edit().putInt("account", getAccountPrefsCount()).commit();
|
||||
}
|
||||
|
||||
public static void deleteAccount(int i) {
|
||||
int account = GetPreferences().getInt("account", 0);
|
||||
SharedPreferences prefs = GetContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
int account = getPreferences().getInt("account", 0);
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
|
||||
prefs.edit().clear().commit();
|
||||
File file = new File(new File(GetContext().getFilesDir().getParent(), "shared_prefs"), "pref_account_manager" + i);
|
||||
File file = new File(new File(getContext().getFilesDir().getParent(), "shared_prefs"), "pref_account_manager" + i);
|
||||
if (file.exists()) file.delete();
|
||||
if (account == i && getAccountPrefsCount() > 0)
|
||||
switchAccount(buildList().get(0).index);
|
||||
|
||||
@@ -28,7 +28,6 @@ import android.widget.FrameLayout;
|
||||
import android.widget.ImageView;
|
||||
import android.widget.LinearLayout;
|
||||
import android.widget.TextView;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
@@ -47,9 +46,7 @@ import java.io.File;
|
||||
import me.grishka.appkit.fragments.ToolbarFragment;
|
||||
import ru.vtosters.lite.tgs.TGPref;
|
||||
import ru.vtosters.lite.ui.PreferencesUtil;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
import ru.vtosters.lite.utils.Themes;
|
||||
|
||||
public class StickersFragment extends ToolbarFragment {
|
||||
|
||||
@@ -209,7 +206,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
@Override
|
||||
public View d(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
grabber = new TelegramStickersGrabber(TGPref.getTGBotKey());
|
||||
stickersService = TelegramStickersService.getInstance(GetContext());
|
||||
stickersService = TelegramStickersService.getInstance(getContext());
|
||||
|
||||
editPadding = convertDpToPixel(24f);
|
||||
|
||||
@@ -252,13 +249,13 @@ public class StickersFragment extends ToolbarFragment {
|
||||
LinearLayout linearLayout = new LinearLayout(super.n());
|
||||
|
||||
final EditText editText = new EditText(super.n());
|
||||
editText.setHintTextColor(PreferencesUtil.getSTextColor(GetContext()));
|
||||
editText.setHintTextColor(PreferencesUtil.getSTextColor(getContext()));
|
||||
|
||||
// Костыль для китката
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(GetContext())));
|
||||
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(getContext())));
|
||||
} else {
|
||||
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(GetContext())));
|
||||
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(getContext())));
|
||||
}
|
||||
linearLayout.addView(editText);
|
||||
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||
@@ -272,7 +269,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
|
||||
String pack = editText.getText().toString();
|
||||
pack = parsePack(pack);
|
||||
stickersService.requestPackDownload(pack, new File(GetContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
|
||||
stickersService.requestPackDownload(pack, new File(getContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
|
||||
}).setNeutralButton(android.R.string.cancel, null).create().show();
|
||||
};
|
||||
if (TGPref.getTGBotKey() == null) enterBotKey(() -> checkApiKey(work));
|
||||
@@ -291,7 +288,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
@Override
|
||||
public void b(@Nullable Bundle savedInstanceState) {
|
||||
super.b(savedInstanceState);
|
||||
GetContext().registerReceiver(receiver, new IntentFilter(ACTION_RELOAD));
|
||||
getContext().registerReceiver(receiver, new IntentFilter(ACTION_RELOAD));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -306,7 +303,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
@Override
|
||||
public void A_() {
|
||||
super.A_();
|
||||
GetContext().unregisterReceiver(receiver);
|
||||
getContext().unregisterReceiver(receiver);
|
||||
}
|
||||
|
||||
private String parsePack(String pack) {
|
||||
@@ -353,7 +350,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
holder.updateButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.ic_camera_switch_48)));
|
||||
holder.updateButton.setOnClickListener(listener -> {
|
||||
stickersService.setBotKey(TGPref.getTGBotKey());
|
||||
stickersService.requestPackDownload(pack.id, new File(GetContext().getFilesDir(), new File("VT-Stickers", pack.id).getAbsolutePath()));
|
||||
stickersService.requestPackDownload(pack.id, new File(getContext().getFilesDir(), new File("VT-Stickers", pack.id).getAbsolutePath()));
|
||||
});
|
||||
|
||||
holder.deleteButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.vkim_ic_msg_delete)));
|
||||
|
||||
+2
-3
@@ -11,7 +11,6 @@ import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
import ru.vtosters.lite.tgs.TGPref;
|
||||
import ru.vtosters.lite.tgs.TGRoot;
|
||||
import ru.vtosters.lite.ui.PreferencesUtil;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@@ -19,7 +18,7 @@ public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragme
|
||||
public void b(Bundle bundle) {
|
||||
super.b(bundle);
|
||||
|
||||
int vtosterXml = GetContext().getResources().getIdentifier("empty", "xml", GetContext().getPackageName());
|
||||
int vtosterXml = getContext().getResources().getIdentifier("empty", "xml", getContext().getPackageName());
|
||||
this.a(vtosterXml);
|
||||
|
||||
PreferencesUtil.addPreferenceCategory(this, getString("sprefsstickers"));
|
||||
@@ -85,7 +84,7 @@ public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragme
|
||||
|
||||
@Override
|
||||
public int aq() {
|
||||
return GetContext().getResources().getIdentifier("vtltgs", "string", GetContext().getPackageName());
|
||||
return getContext().getResources().getIdentifier("vtltgs", "string", getContext().getPackageName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public class ExternalLinkHandler {
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
|
||||
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
|
||||
}
|
||||
GetContext().startActivity(intent);
|
||||
getContext().startActivity(intent);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
@@ -129,7 +129,7 @@ public class ExternalLinkHandler {
|
||||
}
|
||||
|
||||
private static String getMXPlayerPackageName() {
|
||||
for (ApplicationInfo info : GetContext().getPackageManager().getInstalledApplications(0)) {
|
||||
for (ApplicationInfo info : getContext().getPackageManager().getInstalledApplications(0)) {
|
||||
String packName = info.packageName;
|
||||
if (packName.equals("com.mxtech.videoplayer.ad") || packName.equals("com.mxtech.videoplayer.pro"))
|
||||
return packName;
|
||||
|
||||
@@ -2,6 +2,8 @@ package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Proxy.*;
|
||||
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -9,6 +11,7 @@ import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
@@ -23,24 +26,20 @@ import com.vtosters.lite.im.ImEngineProvider;
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Helper {
|
||||
public static int GetUserId() {
|
||||
public static int getUserId() {
|
||||
return VKAccountManager.b().a();
|
||||
}
|
||||
|
||||
public static String GetUserSecret() {
|
||||
public static String getUserSecret() {
|
||||
return VKAccountManager.b().c();
|
||||
}
|
||||
|
||||
public static String GetUserToken() {
|
||||
public static String getUserToken() {
|
||||
return VKAccountManager.b().b();
|
||||
}
|
||||
|
||||
public static SharedPreferences.Editor edit() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GetContext()).edit();
|
||||
}
|
||||
|
||||
public static String getConnectorDomain(String str) {
|
||||
return GetConnector(str);
|
||||
return PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
|
||||
}
|
||||
|
||||
public static void reloadMSG() {
|
||||
@@ -67,8 +66,9 @@ public class Helper {
|
||||
return extendedUserProfile.a;
|
||||
}
|
||||
|
||||
public static void restarting() {
|
||||
Context ctx = GetContext();
|
||||
// Application restart (works on sdk 29+ too)
|
||||
public static void restartApplication() {
|
||||
Context ctx = getContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
Intent intent = pm.getLaunchIntentForPackage(ctx.getPackageName());
|
||||
Intent mainIntent = Intent.makeRestartActivityTask(intent.getComponent());
|
||||
@@ -76,8 +76,9 @@ public class Helper {
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
||||
// Global Context
|
||||
@NonNull
|
||||
public static Context GetContext() {
|
||||
public static Context getContext() {
|
||||
try {
|
||||
Class<?> appGlobalsClazz = Class.forName("android.app.AppGlobals");
|
||||
|
||||
@@ -91,9 +92,10 @@ public class Helper {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean IsGmsInstalled() {
|
||||
// Google Market Services check
|
||||
public static boolean isGmsInstalled() {
|
||||
try {
|
||||
GetContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
|
||||
getContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
@@ -101,38 +103,30 @@ public class Helper {
|
||||
}
|
||||
|
||||
public static Resources getResources() {
|
||||
return GetContext().getResources();
|
||||
return getContext().getResources();
|
||||
}
|
||||
|
||||
public static int getIdentifier(String str, String str2) {
|
||||
return getResources().getIdentifier(str, str2, GetContext().getPackageName());
|
||||
return getResources().getIdentifier(str, str2, getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static String getString(String str) {
|
||||
return GetContext().getString(Integer.parseInt(String.valueOf(GetContext().getResources().getIdentifier(str, "string", GetContext().getPackageName()))));
|
||||
return getContext().getString(Integer.parseInt(String.valueOf(getContext().getResources().getIdentifier(str, "string", getContext().getPackageName()))));
|
||||
}
|
||||
|
||||
public static String getPackageName() {
|
||||
return GetContext().getPackageName();
|
||||
return getContext().getPackageName();
|
||||
}
|
||||
|
||||
public static int convertDpToPixel(float f) {
|
||||
return (int) (f * (((float) GetContext().getResources().getDisplayMetrics().densityDpi) / 160.0f));
|
||||
return (int) (f * (((float) getContext().getResources().getDisplayMetrics().densityDpi) / 160.0f));
|
||||
}
|
||||
|
||||
public static String GetString(@StringRes int res, Object... args) {
|
||||
return GetContext().getString(res, args);
|
||||
public static SharedPreferences getPreferences() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
}
|
||||
|
||||
public static SharedPreferences GetPrefs() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
}
|
||||
|
||||
public static SharedPreferences GetPreferences() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
}
|
||||
|
||||
public static void SendToast(String text) {
|
||||
public static void sendToast(String text) {
|
||||
ToastUtils.a(text);
|
||||
}
|
||||
|
||||
@@ -141,8 +135,27 @@ public class Helper {
|
||||
}
|
||||
|
||||
public static boolean isNetworkConnected() {
|
||||
ConnectivityManager cm = (ConnectivityManager) GetContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
|
||||
}
|
||||
|
||||
public static void fixGapps() {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
boolean z = false;
|
||||
try {
|
||||
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
|
||||
z = true;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (!z) {
|
||||
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(com.vtosters.lite.R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,14 +7,14 @@ import android.content.pm.PackageManager;
|
||||
|
||||
public class IconHelper {
|
||||
public static void switchToVK() {
|
||||
var packageManager = GetContext().getPackageManager();
|
||||
var packageManager = getContext().getPackageManager();
|
||||
var packageName = getPackageName();
|
||||
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
|
||||
}
|
||||
|
||||
public static void switchToDefault() {
|
||||
var packageManager = GetContext().getPackageManager();
|
||||
var packageManager = getContext().getPackageManager();
|
||||
var packageName = getPackageName();
|
||||
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
|
||||
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Proxy.setProxy;
|
||||
|
||||
@@ -63,19 +64,16 @@ public class Prefs {
|
||||
private static List<String> mFilters;
|
||||
|
||||
public static boolean BooleanFalse(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs.getBoolean(key, false);
|
||||
}
|
||||
|
||||
public static boolean BooleanTrue(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs.getBoolean(key, true);
|
||||
}
|
||||
|
||||
public static void ClearCache() {
|
||||
}
|
||||
|
||||
public static String GetBackgroundStickers() {
|
||||
public static String getBackgroundStickers() {
|
||||
if (isBGStickersEnabled()) {
|
||||
return "images_with_background";
|
||||
}
|
||||
@@ -86,18 +84,10 @@ public class Prefs {
|
||||
return BooleanTrue("isBGStickersEnabled");
|
||||
}
|
||||
|
||||
public static String GetCopyright() {
|
||||
return copyright_post() ? "null" : "copyright";
|
||||
}
|
||||
|
||||
public static String GetFriendRecomm() {
|
||||
public static String getFriendRecomm() {
|
||||
return friendsrecomm() ? "friends_recommendations" : "null";
|
||||
}
|
||||
|
||||
public static String GetStories() {
|
||||
return stories() ? "stories" : "null";
|
||||
}
|
||||
|
||||
public static boolean ads() {
|
||||
return BooleanFalse("__dbg_no_ads");
|
||||
}
|
||||
@@ -242,11 +232,11 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getBuildNumber() {
|
||||
return Prefs.getBuild(GetContext(), "version.properties");
|
||||
return Prefs.getBuild(getContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getCommitLink() {
|
||||
return "https://github.com/vtosters/lite/commit/" + Prefs.getBuild(GetContext(), "version.properties");
|
||||
return "https://github.com/vtosters/lite/commit/" + Prefs.getBuild(getContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getBuild(Context context, String name) {
|
||||
@@ -266,7 +256,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getBranch() {
|
||||
return GetPreferences().getString("ota_branches", "Stable");
|
||||
return getPreferences().getString("ota_branches", "Stable");
|
||||
}
|
||||
|
||||
public static String getDarkVKUI() {
|
||||
@@ -274,12 +264,12 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getAmoledVKUI() {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
return string.equals("amoled") ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getCommentsSort(String def) {
|
||||
String string = GetPreferences().getString("commentssort", "");
|
||||
String string = getPreferences().getString("commentssort", "");
|
||||
if (string.isEmpty()) {
|
||||
return def;
|
||||
}
|
||||
@@ -293,11 +283,11 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getMeToken() {
|
||||
return GetPreferences().getString("me_token", "");
|
||||
return getPreferences().getString("me_token", "");
|
||||
}
|
||||
|
||||
public static void setMeToken(String str) {
|
||||
GetPreferences().edit().putString("me_token", str).apply();
|
||||
getPreferences().edit().putString("me_token", str).apply();
|
||||
}
|
||||
|
||||
public static int getNavbarColor() {
|
||||
@@ -305,11 +295,11 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getSSFSLink() {
|
||||
return SSFSDomain() + "?token=" + GetUserToken() + "&vt_dark=" + getDarkVKUI() + "&vt_amoled=" + getAmoledVKUI() + "&secret=" + GetUserSecret() + "&proxy=" + getUserProxy() + "&lang=" + getLocale() + "&vt=1&vtl=1&vksans=" + isVKSansEnabled() + "&vt_version=" + getBuildNumber() + "&vt_debug=" + isDEVModEnabled();
|
||||
return SSFSDomain() + "?token=" + getUserToken() + "&vt_dark=" + getDarkVKUI() + "&vt_amoled=" + getAmoledVKUI() + "&secret=" + getUserSecret() + "&proxy=" + getUserProxy() + "&lang=" + getLocale() + "&vt=1&vtl=1&vksans=" + isVKSansEnabled() + "&vt_version=" + getBuildNumber() + "&vt_debug=" + isDEVModEnabled();
|
||||
}
|
||||
|
||||
public static String getString(String key, String defValue) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs.getString(key, defValue);
|
||||
}
|
||||
|
||||
@@ -382,32 +372,32 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String proxyHostHTTP() {
|
||||
String string = GetPreferences().getString("proxyHostHTTP", "");
|
||||
String string = getPreferences().getString("proxyHostHTTP", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostHTTPS() {
|
||||
String string = GetPreferences().getString("proxyHostHTTPS", "");
|
||||
String string = getPreferences().getString("proxyHostHTTPS", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostSocks() {
|
||||
String string = GetPreferences().getString("proxyHostSocks", "");
|
||||
String string = getPreferences().getString("proxyHostSocks", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTP() {
|
||||
String string = GetPreferences().getString("proxyPortHTTP", "");
|
||||
String string = getPreferences().getString("proxyPortHTTP", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTPS() {
|
||||
String string = GetPreferences().getString("proxyPortHTTPS", "");
|
||||
String string = getPreferences().getString("proxyPortHTTPS", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortSocks() {
|
||||
String string = GetPreferences().getString("proxyPortSocks", "");
|
||||
String string = getPreferences().getString("proxyPortSocks", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
@@ -492,7 +482,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static int getMsgCount() {
|
||||
String customvalue = GetPreferences().getString("msgcount", "");
|
||||
String customvalue = getPreferences().getString("msgcount", "");
|
||||
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
|
||||
}
|
||||
|
||||
@@ -535,7 +525,7 @@ public class Prefs {
|
||||
StandardFilterPut();
|
||||
ShortLinkPut();
|
||||
IDontWantToReadIt();
|
||||
String string = GetPreferences().getString("spamfilters", "");
|
||||
String string = getPreferences().getString("spamfilters", "");
|
||||
if (!string.isEmpty()) {
|
||||
mFilters.addAll(Arrays.asList(string.split(", ")));
|
||||
}
|
||||
@@ -544,7 +534,7 @@ public class Prefs {
|
||||
public static void ReferalsPut() {
|
||||
if (BooleanTrue("refsfilter")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("Referals.txt")));
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open("Referals.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
@@ -563,7 +553,7 @@ public class Prefs {
|
||||
public static void ShortLinkPut() {
|
||||
if (BooleanTrue("shortlinkfilter")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("LinkShorter.txt")));
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open("LinkShorter.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
@@ -582,7 +572,7 @@ public class Prefs {
|
||||
public static void StandardFilterPut() {
|
||||
if (BooleanTrue("default_ad_list")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("StandartFilter.txt")));
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open("StandartFilter.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
@@ -601,7 +591,7 @@ public class Prefs {
|
||||
public static void IDontWantToReadIt() {
|
||||
if (BooleanTrue("shitposting")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("IDontWantToReadIt.txt")));
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open("IDontWantToReadIt.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
@@ -618,7 +608,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String SSFSDomain() {
|
||||
String string = GetPreferences().getString("ssfscustom", "");
|
||||
String string = getPreferences().getString("ssfscustom", "");
|
||||
if (!string.isEmpty()) {
|
||||
return string;
|
||||
}
|
||||
@@ -626,7 +616,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String VKVersion() {
|
||||
String string = GetPreferences().getString("vkversion", "");
|
||||
String string = getPreferences().getString("vkversion", "");
|
||||
if (!string.isEmpty()) {
|
||||
return string;
|
||||
}
|
||||
@@ -674,7 +664,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static String getLocale() {
|
||||
String string = GetPreferences().getString("lang_value", "");
|
||||
String string = getPreferences().getString("lang_value", "");
|
||||
if (string.equals("system")) {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
@@ -682,7 +672,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static boolean proxy() {
|
||||
return GetPreferences().getString("proxy", "").equals("apiproxy");
|
||||
return getPreferences().getString("proxy", "").equals("apiproxy");
|
||||
}
|
||||
|
||||
public static boolean authors_rec(String str) {
|
||||
@@ -729,7 +719,7 @@ public class Prefs {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
MultiAccountManager.migrate();
|
||||
migrate();
|
||||
registerActivities(application);
|
||||
}
|
||||
|
||||
@@ -774,7 +764,7 @@ public class Prefs {
|
||||
}
|
||||
|
||||
public static Class getStartFragment() {
|
||||
String string = GetPreferences().getString("start_values", "");
|
||||
String string = getPreferences().getString("start_values", "");
|
||||
if (string.equals("default")) {
|
||||
return DockBarManager.getInstance().getSelectedTabs().get(0).fragmentClass;
|
||||
}
|
||||
@@ -850,51 +840,4 @@ public class Prefs {
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
return context;
|
||||
}
|
||||
|
||||
public static int vk_sans_display_demibold() {
|
||||
return vksans() ? R.font.tt_commons_demi_bold : R.font.vk_sans_display_demibold;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_black() {
|
||||
return vksans() ? R.font.vk_sans_display_bold : R.font.roboto_black;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_bold() {
|
||||
return vksans() ? R.font.vk_sans_text_bold : R.font.roboto_bold;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_demibold() {
|
||||
return vksans() ? R.font.vk_sans_text_demibold : R.font.roboto_bold_italic;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_light() {
|
||||
return vksans() ? R.font.vk_sans_text_light : R.font.roboto_light;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_medium() {
|
||||
return vksans() ? R.font.vk_sans_text_medium : R.font.roboto_medium;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_regular() {
|
||||
return vksans() ? R.font.vk_sans_text_regular : R.font.roboto_regular;
|
||||
}
|
||||
|
||||
public static void fixGapps() {
|
||||
try {
|
||||
if (Build.VERSION.SDK_INT >= 26) {
|
||||
NotificationManager notificationManager = (NotificationManager) GetContext().getSystemService(Context.NOTIFICATION_SERVICE);
|
||||
boolean z = false;
|
||||
try {
|
||||
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
|
||||
z = true;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (!z) {
|
||||
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
|
||||
}
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static String getApiCom() {
|
||||
String string = GetPreferences().getString("proxyapi", "");
|
||||
String string = getPreferences().getString("proxyapi", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
return "api.vk.com";
|
||||
}
|
||||
@@ -52,7 +52,7 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static String getAwayPhpCom() {
|
||||
String string = GetPreferences().getString("proxyapi", "");
|
||||
String string = getPreferences().getString("proxyapi", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
return "m.vk.com";
|
||||
}
|
||||
@@ -60,7 +60,7 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static String getOauthCom() {
|
||||
String string = GetPreferences().getString("proxyoauth", "");
|
||||
String string = getPreferences().getString("proxyoauth", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
return "oauth.vk.com";
|
||||
}
|
||||
@@ -68,7 +68,7 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static String getStaticCom() {
|
||||
String string = GetPreferences().getString("proxystatic", "");
|
||||
String string = getPreferences().getString("proxystatic", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
return "static.vk.com";
|
||||
}
|
||||
@@ -77,7 +77,7 @@ public class Proxy {
|
||||
|
||||
public static String staticFix(String str) {
|
||||
String str2;
|
||||
String string = GetPreferences().getString("proxystatic", "");
|
||||
String string = getPreferences().getString("proxystatic", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
return str;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static void setProxy() {
|
||||
switch (GetPreferences().getString("proxy", "")) {
|
||||
switch (getPreferences().getString("proxy", "")) {
|
||||
case "zaborona":
|
||||
Properties properties = System.getProperties();
|
||||
properties.setProperty("socksProxyHost", "socks.zaboronahelp.pp.ua");
|
||||
|
||||
@@ -5,7 +5,7 @@ import static android.os.Environment.getExternalStoragePublicDirectory;
|
||||
import static android.widget.Toast.LENGTH_LONG;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.Helper.GetContext;
|
||||
import static ru.vtosters.lite.utils.Helper.getContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -21,11 +21,11 @@ import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
public class SettBackup {
|
||||
static SharedPreferences prefs = GetContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
|
||||
static SharedPreferences prefs = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
|
||||
|
||||
public static void deletePrefs() {
|
||||
prefs.edit().clear().commit();
|
||||
File file = new File(new File(GetContext().getFilesDir().getParent(), "shared_prefs"), "com.vtosters.lite_preferences");
|
||||
File file = new File(new File(getContext().getFilesDir().getParent(), "shared_prefs"), "com.vtosters.lite_preferences");
|
||||
if (file.exists()) file.delete();
|
||||
}
|
||||
|
||||
@@ -45,15 +45,15 @@ public class SettBackup {
|
||||
FileWriter out = new FileWriter(file);
|
||||
out.write(getAllPrefs());
|
||||
out.close();
|
||||
makeText(GetContext(), "Сохранено в файл " + directory, LENGTH_LONG).show();
|
||||
makeText(getContext(), "Сохранено в файл " + directory, LENGTH_LONG).show();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
makeText(GetContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
|
||||
makeText(getContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
makeText(GetContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
|
||||
makeText(getContext(), "Не удалось сохранить файл", LENGTH_SHORT).show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,6 +66,6 @@ public class SettBackup {
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(Intent.ACTION_GET_CONTENT);
|
||||
intent.setType("text/plain");
|
||||
GetContext().startActivity(intent);
|
||||
getContext().startActivity(intent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Prefs.*;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
@@ -37,19 +38,19 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static int getAmoledTheme() {
|
||||
return GetContext().getResources().getIdentifier("BaseAmoledStyle", "style", GetContext().getPackageName());
|
||||
return getContext().getResources().getIdentifier("BaseAmoledStyle", "style", getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static int picFix() {
|
||||
return GetContext().getResources().getIdentifier("ActionBarThemeFix", "style", GetContext().getPackageName());
|
||||
return getContext().getResources().getIdentifier("ActionBarThemeFix", "style", getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static int getAmoledImTheme() {
|
||||
return GetContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", GetContext().getPackageName());
|
||||
return getContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static VKTheme getDarkTheme() {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
@@ -60,7 +61,7 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static ImTheme getImDarkTheme() {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
@@ -71,7 +72,7 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static VKTheme getLightTheme() {
|
||||
String string = GetPreferences().getString("lighttheme", "");
|
||||
String string = getPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
@@ -79,7 +80,7 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static ImTheme getImLightTheme() {
|
||||
String string = GetPreferences().getString("lighttheme", "");
|
||||
String string = getPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
@@ -164,10 +165,37 @@ public class Themes {
|
||||
if (isColorRefAccented(i) && isAndroidMonet()) {
|
||||
return getAccentColor();
|
||||
}
|
||||
return GetContext().getResources().getColor(i);
|
||||
return getContext().getResources().getColor(i);
|
||||
}
|
||||
|
||||
public static String hex(int i) {
|
||||
return String.format("#%06X", Integer.valueOf(i & 16777215));
|
||||
}
|
||||
public static int vk_sans_display_demibold() {
|
||||
return vksans() ? R.font.vk_sans_display_demibold : R.font.tt_commons_demi_bold;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_black() {
|
||||
return vksans() ? R.font.vk_sans_display_bold : R.font.roboto_black;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_bold() {
|
||||
return vksans() ? R.font.vk_sans_text_bold : R.font.roboto_bold;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_demibold() {
|
||||
return vksans() ? R.font.vk_sans_text_demibold : R.font.roboto_bold_italic;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_light() {
|
||||
return vksans() ? R.font.vk_sans_text_light : R.font.roboto_light;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_medium() {
|
||||
return vksans() ? R.font.vk_sans_text_medium : R.font.roboto_medium;
|
||||
}
|
||||
|
||||
public static int vk_sans_text_regular() {
|
||||
return vksans() ? R.font.vk_sans_text_regular : R.font.roboto_regular;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ public class VKUIInjector {
|
||||
|
||||
private static String load(String str) {
|
||||
try {
|
||||
InputStream open = GetContext().getAssets().open(str);
|
||||
InputStream open = getContext().getAssets().open(str);
|
||||
StringBuilder sb = new StringBuilder();
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(open, StandardCharsets.UTF_8));
|
||||
while (true) {
|
||||
@@ -64,7 +64,7 @@ public class VKUIInjector {
|
||||
}
|
||||
|
||||
public static void inject(WebView webView) {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
if (Prefs.BooleanTrue("VKUI_INJ")) {
|
||||
if (!isLoaded) {
|
||||
load();
|
||||
|
||||
@@ -304,7 +304,7 @@
|
||||
|
||||
if-eqz v0, :cond_8
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
|
||||
@@ -4040,7 +4040,7 @@
|
||||
|
||||
if-eqz v2, :cond_51
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4091,7 +4091,7 @@
|
||||
|
||||
if-eqz v2, :cond_52
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4144,7 +4144,7 @@
|
||||
|
||||
if-eqz v2, :cond_130
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4197,7 +4197,7 @@
|
||||
|
||||
if-eqz v2, :cond_131
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4250,7 +4250,7 @@
|
||||
|
||||
if-eqz v2, :cond_132
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4304,7 +4304,7 @@
|
||||
|
||||
if-eqz v2, :cond_53
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4355,7 +4355,7 @@
|
||||
|
||||
if-eqz v2, :cond_54
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4406,7 +4406,7 @@
|
||||
|
||||
if-eqz v2, :cond_55
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4457,7 +4457,7 @@
|
||||
|
||||
if-eqz v2, :cond_56
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4508,7 +4508,7 @@
|
||||
|
||||
if-eqz v2, :cond_57
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4559,7 +4559,7 @@
|
||||
|
||||
if-eqz v2, :cond_58
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4610,7 +4610,7 @@
|
||||
|
||||
if-eqz v2, :cond_59
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -4661,7 +4661,7 @@
|
||||
|
||||
if-eqz v2, :cond_5a
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
const v1, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v1
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@
|
||||
|
||||
if-eqz v1, :cond_3
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
|
||||
@@ -1071,7 +1071,7 @@
|
||||
.method private setLang()V
|
||||
.locals 6
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
|
||||
@@ -2582,7 +2582,7 @@
|
||||
|
||||
iput-boolean v2, v0, Lcom/vtosters/lite/api/ExtendedUserProfile;->bp:Z
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->GetFriendRecomm()Ljava/lang/String;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->getFriendRecomm()Ljava/lang/String;
|
||||
|
||||
move-result-object v2
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
|
||||
const v3, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v3
|
||||
|
||||
|
||||
@@ -129,7 +129,7 @@
|
||||
.line 61
|
||||
sget p3, Lcom/vk/s/R$d;->roboto_regular:I
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result p3
|
||||
|
||||
@@ -186,7 +186,7 @@
|
||||
.line 71
|
||||
sget v0, Lcom/vk/s/R$d;->roboto_regular:I
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result v0
|
||||
|
||||
|
||||
@@ -2213,7 +2213,7 @@
|
||||
.line 183
|
||||
sget-object v3, Lcom/vk/im/engine/internal/api_parsers/ImageSizesParser;->a:Lcom/vk/im/engine/internal/api_parsers/ImageSizesParser;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->GetBackgroundStickers()Ljava/lang/String;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->getBackgroundStickers()Ljava/lang/String;
|
||||
|
||||
move-result-object v4
|
||||
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
|
||||
sget v2, Lcom/vk/im/ui/R$f;->roboto_medium:I
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v2
|
||||
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
|
||||
const v0, 0x7f09000d
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_display_demibold()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_display_demibold()I
|
||||
|
||||
move-result v0
|
||||
|
||||
@@ -152,7 +152,7 @@
|
||||
|
||||
const p2, 0x7f09000d
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_display_demibold()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_display_demibold()I
|
||||
|
||||
move-result p2
|
||||
|
||||
@@ -213,7 +213,7 @@
|
||||
|
||||
const p2, 0x7f09000d
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_display_demibold()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_display_demibold()I
|
||||
|
||||
move-result p2
|
||||
|
||||
|
||||
@@ -458,7 +458,7 @@
|
||||
|
||||
const p3, 0x7f090009
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result p3
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
const v1, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v1
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
|
||||
const v3, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v3
|
||||
|
||||
|
||||
@@ -512,7 +512,7 @@
|
||||
|
||||
invoke-virtual {v0, v2}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->IsGmsInstalled()Z
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->isGmsInstalled()Z
|
||||
|
||||
move-result v6
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result p0
|
||||
|
||||
@@ -144,7 +144,7 @@
|
||||
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_black()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_black()I
|
||||
|
||||
move-result p0
|
||||
|
||||
@@ -169,7 +169,7 @@
|
||||
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_light()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_light()I
|
||||
|
||||
move-result p0
|
||||
|
||||
@@ -194,7 +194,7 @@
|
||||
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result p0
|
||||
|
||||
@@ -219,7 +219,7 @@
|
||||
|
||||
sget-object v0, Lcom/vk/core/util/AppContextHolder;->a:Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_bold()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_bold()I
|
||||
|
||||
move-result p0
|
||||
|
||||
@@ -246,7 +246,7 @@
|
||||
|
||||
sget v1, Lcom/vk/s/R$d;->roboto_medium:I
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v1
|
||||
|
||||
@@ -262,7 +262,7 @@
|
||||
|
||||
sget v1, Lcom/vk/s/R$d;->roboto_medium:I
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v1
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@
|
||||
|
||||
const p3, 0x7f090009
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result p3
|
||||
|
||||
|
||||
@@ -202,7 +202,7 @@
|
||||
|
||||
const v5, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v5
|
||||
|
||||
|
||||
@@ -618,7 +618,7 @@
|
||||
|
||||
.line 187
|
||||
:sswitch_3
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p0
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
move-result v2
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->GetBackgroundStickers()Ljava/lang/String;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->getBackgroundStickers()Ljava/lang/String;
|
||||
|
||||
move-result-object v0
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@
|
||||
|
||||
const v1, 0x7f090009
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result v1
|
||||
|
||||
|
||||
@@ -404,7 +404,7 @@
|
||||
|
||||
const v0, 0x7f090007
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_medium()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_medium()I
|
||||
|
||||
move-result v0
|
||||
|
||||
|
||||
+2
-2
@@ -494,11 +494,11 @@
|
||||
.method private final savedmsg()V
|
||||
.locals 8
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetContext()Landroid/content/Context;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->GetUserId()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Helper;->getUserId()I
|
||||
|
||||
move-result v0
|
||||
|
||||
|
||||
@@ -1340,7 +1340,7 @@
|
||||
|
||||
const v9, 0x7f090009
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->vk_sans_text_regular()I
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Themes;->vk_sans_text_regular()I
|
||||
|
||||
move-result v9
|
||||
|
||||
|
||||
Reference in New Issue
Block a user