Compare commits
46
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e992203b7c | ||
|
|
0ed057d705 | ||
|
|
9b70ca6faf | ||
|
|
422c3e4a6c | ||
|
|
6dac880d61 | ||
|
|
c911b2d64e | ||
|
|
39f72f9058 | ||
|
|
2bff354ad0 | ||
|
|
cb55e9b96f | ||
|
|
33f551d464 | ||
|
|
282fa7bdda | ||
|
|
0abd97e8e1 | ||
|
|
5dd616685d | ||
|
|
aff99be92d | ||
|
|
c255f1e498 | ||
|
|
70342daf07 | ||
|
|
f95672e57d | ||
|
|
8f5da42df4 | ||
|
|
4022903069 | ||
|
|
4600c185e4 | ||
|
|
30e8ec0038 | ||
|
|
367b212ca3 | ||
|
|
6533feb62b | ||
|
|
95ef37f6a3 | ||
|
|
6216c66d95 | ||
|
|
02b6e4a728 | ||
|
|
00c1e926e6 | ||
|
|
ef8109e2e8 | ||
|
|
732ee76957 | ||
|
|
b97d2261de | ||
|
|
c362bfc8da | ||
|
|
cc445e4aea | ||
|
|
4ac83d59b5 | ||
|
|
5025a5fa94 | ||
|
|
b8cb19c8db | ||
|
|
593153de8f | ||
|
|
6c36b83d64 | ||
|
|
1381fdd3bb | ||
|
|
f680a37eb1 | ||
|
|
4531b7af52 | ||
|
|
0c4d1af2dc | ||
|
|
d6a18ecca6 | ||
|
|
dc768952c3 | ||
|
|
57cdcfcbd1 | ||
|
|
fb4837ce40 | ||
|
|
b85e1e6937 |
@@ -0,0 +1,46 @@
|
||||
name: Build VTosters Lite
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ master ]
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Set up JDK 11
|
||||
uses: actions/setup-java@v2
|
||||
with:
|
||||
java-version: '11'
|
||||
distribution: 'adopt'
|
||||
|
||||
- uses: actions/checkout@v2
|
||||
|
||||
- name: Download tools
|
||||
run: |
|
||||
sudo apt update
|
||||
sudo apt install default-jre
|
||||
sudo apt install python3
|
||||
chmod +x scripts/apktool.jar
|
||||
chmod +x scripts/apksigner.jar
|
||||
|
||||
- name: Build VTLite
|
||||
run: |
|
||||
git checkout master
|
||||
bash scripts/buildworkflow.sh
|
||||
|
||||
- name: Sign and verify the apk
|
||||
run: |
|
||||
java -jar scripts/apksigner.jar sign --ks scripts/debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android smali/VTLite.apk
|
||||
java -jar scripts/apksigner.jar verify smali/VTLite.apk
|
||||
|
||||
- name: Upload apk to artifact
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: VTLite.apk
|
||||
path: smali/VTLite.apk
|
||||
@@ -1,18 +1,78 @@
|
||||
# VTosters Lite
|
||||
|
||||
VTosters Lite - это модифицированный клиент ВКонтакте, основанный на версии 5.29
|
||||
VTosters Lite - это модифицированный клиент (декомпиляция) официального ВКонтакте основанный на версии 5.29
|
||||
|
||||
О найденных багах сообщать в [issues](https://github.com/vtosters/lite/issues), просьба не плодить дубликаты, воспользуйтесь поиском перед созданием нового issue
|
||||
|
||||
Скачивать самые актуальные версии можно с [Actions](https://github.com/vtosters/lite/actions)
|
||||
|
||||
Стабильные сборки находятся в [Releases](https://github.com/vtosters/lite/releases)
|
||||
|
||||
## Отладка приложения
|
||||
|
||||
Для отладки с помощью Android Studio необходимо пройти в `/smali/AndroidManifest.xml`
|
||||
```
|
||||
android:debuggable="false" -> android:debuggable="true"
|
||||
```
|
||||
|
||||
Для дополнительной отладки ответов, доп логов и подмены данных для дебаг приложения необходимо включить **Режим разработчика**
|
||||
```
|
||||
Настройки -> Для разработчиков -> Режим разработчика
|
||||
```
|
||||
|
||||
Для просмотра трафика необходимо отключить функцию **SSL Pinning**
|
||||
|
||||
```
|
||||
Настройки -> Для разработчиков -> SSL Pinning
|
||||
```
|
||||
|
||||
Для логгирования внутренних запросов к API необходимо включить функции **Логгирование API**
|
||||
|
||||
(Работает только при использовании внутреннего логгера!)
|
||||
|
||||
```
|
||||
Настройки -> Для разработчиков -> Логгирование API
|
||||
```
|
||||
|
||||
Для использования внутреннего логгера необходимо включить функции **Запись логов в файл**
|
||||
```
|
||||
Настройки -> Для разработчиков -> Запись логов в файл
|
||||
```
|
||||
Сразу после нажатия на запись аппа начнет записывать **все действия** в файлы по пути
|
||||
```
|
||||
/VK/logs/com.vtosters.lite
|
||||
```
|
||||
При следующем открытии аппы она автоматически запакует эти файлы и отправит вам в **Документы** ВК
|
||||
|
||||
Позже архив можно будет скачать и работать с файлами логов которые находятся в нем
|
||||
|
||||
## Разработка
|
||||
Мы всегда готовы к новым предложениям в [Pull Requests](https://github.com/vtosters/lite/pulls)
|
||||
|
||||
Для понимания декомпилированного кода требуется использовать **Dex to Java** декомпилятор [jadx](https://github.com/skylot/jadx) или же сторонние варианты как [Fernflower](https://github.com/fesh0r/fernflower)
|
||||
|
||||
Рекомендуется установка **Android Debug Bridge** в систему ([Гайд как это сделать](https://technastic.com/system-wide-adb-fastboot-windows-10))
|
||||
|
||||
Для индексации декомпилированного кода в Studio используется [dex2jar](https://github.com/pxb1988/dex2jar)
|
||||
|
||||
Сгенерированные библиотеки из дексов находятся в `/app/libs`
|
||||
|
||||
При чистой перекомпиляции дексов в jar может сломаться некоторая индексация файлов, исправляйте ручками что попадется (К примеру какие-то функции в дексах изменены с **private** на **public**)
|
||||
|
||||
Для сборки декомпилированного кода и ресурсов используется [Apktool](https://github.com/iBotPeaches/Apktool)
|
||||
|
||||
А при нахождении решения каких-либо проблем ждем вас в [Pull Requests](https://github.com/vtosters/lite/pulls)
|
||||
|
||||
### Всё необходимое для сборки и компиляции
|
||||
|
||||
`Не меняйте packagename во избежание проблем с приложением`
|
||||
|
||||
`Некоторые функции связанные с музыкой не будут работать в пересобранном приложении`
|
||||
|
||||
## Компиляция
|
||||
Весь декомпилированный код клиента находится в `/smali`
|
||||
|
||||
Весь исходный код написанный на Java находится в `/app`
|
||||
Весь исходный код модификации находится в `/app`
|
||||
|
||||
Все необходимые скрипты для компиляции APK, его подписывании и не только находятся в `/scripts`
|
||||
Все необходимые скрипты/жарники для компиляции APK, его подписывании и не только находятся в `/scripts`
|
||||
|
||||
### Необходимые зависимости
|
||||
Требуется установленная **Java** >11 версии
|
||||
@@ -33,10 +93,3 @@ build.bat
|
||||
```
|
||||
|
||||

|
||||
|
||||
|
||||
## Проверка версии коммита
|
||||
|
||||
С версии 0.0.4 доступна прямая проверка версии коммита внутри приложения.
|
||||
|
||||

|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
|
||||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
|
||||
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
|
||||
|
||||
<application
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package bruhcollective.itaysonlab.libvkx.client;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
|
||||
|
||||
import android.content.Context;
|
||||
import android.os.RemoteException;
|
||||
@@ -14,8 +15,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 {
|
||||
private static LibVKXClientImpl impl;
|
||||
@@ -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() {
|
||||
@@ -37,7 +36,7 @@ public class LibVKXClient {
|
||||
}
|
||||
|
||||
public static boolean isIntegrationEnabled() {
|
||||
return Prefs.BooleanFalse("libvkx_integration") && isVkxInstalled();
|
||||
return BooleanFalse("libvkx_integration") && isVkxInstalled();
|
||||
}
|
||||
|
||||
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, PlayerRefer playerRefer) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package bruhcollective.itaysonlab.libvkx.client;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserId;
|
||||
|
||||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
@@ -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();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package com.aefyr.tsg.g2;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ru.f0x1d.net;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserToken;
|
||||
|
||||
import android.os.AsyncTask;
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package ru.vtosters.lite.audio.gcm;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.VKVersion;
|
||||
import static ru.vtosters.lite.utils.Preferences.VKVersionBuild;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Base64;
|
||||
|
||||
@@ -108,7 +111,7 @@ public class GCMFix {
|
||||
params.add("X-X-subscription=841415684880");
|
||||
}
|
||||
params.add("X-X-subtype=841415684880");
|
||||
params.add("X-app_ver=3439");
|
||||
params.add("X-app_ver=" + VKVersionBuild());
|
||||
params.add("X-kid=|ID|" + rid + "|");
|
||||
params.add("X-osv=30");
|
||||
params.add("X-sig=" + sig);
|
||||
@@ -129,12 +132,12 @@ public class GCMFix {
|
||||
if (!del) {
|
||||
params.add("X-gmp_app_id=1:841415684880:android:632f429381141121");
|
||||
}
|
||||
params.add("X-app_ver_name=5.29");
|
||||
params.add("X-app_ver_name=" + VKVersion());
|
||||
params.add("app=com.vkontakte.android");
|
||||
params.add("sender=841415684880");
|
||||
params.add("device=" + androidId);
|
||||
params.add("cert=48761eef50ee53afc4cc9c5f10e6bde7f8f5b82f");
|
||||
params.add("app_ver=3439");
|
||||
params.add("app_ver=" + VKVersionBuild());
|
||||
params.add("gcm_ver=11949470");
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.vtosters.lite.badmanners;
|
||||
package ru.vtosters.lite.deviceinfo;
|
||||
|
||||
public class Device {
|
||||
private String androidId;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.vtosters.lite.badmanners;
|
||||
package ru.vtosters.lite.deviceinfo;
|
||||
|
||||
import android.bluetooth.BluetoothAdapter;
|
||||
import android.content.Context;
|
||||
@@ -1,7 +1,10 @@
|
||||
package ru.vtosters.lite.dnr;
|
||||
|
||||
import static ru.vtosters.lite.dnr.DNRModule.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.dnr.DNRModule.hookDNR;
|
||||
import static ru.vtosters.lite.dnr.DNRModule.hookDNT;
|
||||
import static ru.vtosters.lite.dnr.DNRModule.isDnrEnabledFor;
|
||||
import static ru.vtosters.lite.dnr.DNRModule.isDntEnabledFor;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
|
||||
import com.vk.im.engine.models.dialogs.Dialog;
|
||||
import com.vk.im.ui.components.common.DialogAction;
|
||||
@@ -9,8 +12,6 @@ import com.vk.im.ui.components.common.DialogAction;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class DNRInjector {
|
||||
public static void inject(Dialog dialog, List<DialogAction> list) {
|
||||
int peerId = dialog.a();
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
package ru.vtosters.lite.dnr;
|
||||
|
||||
import static ru.f0x1d.net.F0x1dRequest.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Proxy.*;
|
||||
import static ru.f0x1d.net.F0x1dRequest.makeRequest;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserToken;
|
||||
import static ru.vtosters.lite.utils.Proxy.getApiCom;
|
||||
|
||||
import com.vk.core.util.ToastUtils;
|
||||
import com.vk.im.engine.commands.messages.SetUserActivityCmd;
|
||||
@@ -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("Чат помечен как прочитанный!");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
package ru.vtosters.lite.dnr;
|
||||
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
|
||||
|
||||
public class DNRPrefs {
|
||||
public static boolean getStoriesRead() {
|
||||
return Prefs.BooleanFalse("read_s");
|
||||
return BooleanFalse("read_s");
|
||||
}
|
||||
|
||||
public static boolean getMarkAsReadWithoutExceptions(int peerId) {
|
||||
@@ -28,27 +28,27 @@ public class DNRPrefs {
|
||||
}
|
||||
|
||||
public static boolean readPM(int peer) {
|
||||
return (peer > 0 && peer < 2000000000) && Prefs.BooleanFalse("read_pm");
|
||||
return (peer > 0 && peer < 2000000000) && BooleanFalse("read_pm");
|
||||
}
|
||||
|
||||
public static boolean readConversations(int peer) {
|
||||
return (peer > 2000000000) && Prefs.BooleanFalse("read_conversations");
|
||||
return (peer > 2000000000) && BooleanFalse("read_conversations");
|
||||
}
|
||||
|
||||
public static boolean readBots(int peer) {
|
||||
return (peer < 0) && Prefs.BooleanFalse("read_bot");
|
||||
return (peer < 0) && BooleanFalse("read_bot");
|
||||
}
|
||||
|
||||
public static boolean writePM(int peer) {
|
||||
return (peer > 0 && peer < 2000000000) && Prefs.BooleanFalse("write_pm");
|
||||
return (peer > 0 && peer < 2000000000) && BooleanFalse("write_pm");
|
||||
}
|
||||
|
||||
public static boolean writeConversations(int peer) {
|
||||
return (peer > 2000000000) && Prefs.BooleanFalse("write_conversations");
|
||||
return (peer > 2000000000) && BooleanFalse("write_conversations");
|
||||
}
|
||||
|
||||
public static boolean writeBots(int peer) {
|
||||
return (peer < 0) && Prefs.BooleanFalse("write_bot");
|
||||
return (peer < 0) && BooleanFalse("write_bot");
|
||||
}
|
||||
|
||||
public static boolean getActivityWithoutExceptions(int peerId) {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ru.vtosters.lite.dnr.helpers;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
@@ -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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.dnr.helpers;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteDatabase;
|
||||
@@ -9,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 DoNotTypeDBHelper extends SQLiteOpenHelper {
|
||||
public DoNotTypeDBHelper() {
|
||||
super(Helper.GetContext(), "dnt", null, 1);
|
||||
super(getContext(), "dnt", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -0,0 +1,116 @@
|
||||
package ru.vtosters.lite.encryption;
|
||||
|
||||
import android.util.Log;
|
||||
import android.util.Pair;
|
||||
|
||||
import com.vk.im.engine.models.messages.Msg;
|
||||
import com.vk.im.engine.models.messages.MsgFromUser;
|
||||
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.BeeCryptProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.DefaultCoffeeProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.DonateCoffeeProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.MP3InvisibleProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.VTostersAESProcessor;
|
||||
import ru.vtosters.lite.encryption.processors.VTostersProcessor;
|
||||
|
||||
public class EncryptProvider {
|
||||
public static List<IMProcessor> processors = new ArrayList<>();
|
||||
|
||||
public static IMProcessor getProcessorFor(int peerId) {
|
||||
IMProcessor enabled = null;
|
||||
for (IMProcessor processor: EncryptProvider.processors) {
|
||||
if (processor.isUsedToEncrypt(peerId)) {
|
||||
enabled = processor;
|
||||
}
|
||||
}
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public static String getBody(MsgFromUser msg) {
|
||||
return msg.E();
|
||||
}
|
||||
|
||||
public static int getPeerId(Msg msg) {
|
||||
return msg.b();
|
||||
}
|
||||
|
||||
// This will run through EVERY single processor available.
|
||||
public static String decryptMessage(MsgFromUser msg) {
|
||||
return decryptMessage(getBody(msg), getPeerId(msg));
|
||||
}
|
||||
|
||||
public static String decryptMessage(String msgBody, int peer) {
|
||||
try {
|
||||
for (IMProcessor processor : processors) {
|
||||
if ((processor.isUsed() || !processor.isPublic()) && processor.isEncrypted(msgBody) && (processor.isPublic() || getKeyForProcessor(processor, peer) != null))
|
||||
return "\uD83D\uDD12 " + processor.decode(msgBody, getKeyForProcessor(processor, peer));
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return msgBody;
|
||||
}
|
||||
|
||||
private static byte[] getKeyForProcessor(IMProcessor processor, int peer) {
|
||||
if (processor.isPublic()) return null;
|
||||
String keyString = processor.getEncryptionKeyFor(peer);
|
||||
if (keyString == null) return null;
|
||||
|
||||
try {
|
||||
MessageDigest digest = MessageDigest.getInstance("SHA-256");
|
||||
byte[] hash = digest.digest(keyString.getBytes());
|
||||
byte[] key = new byte[16];
|
||||
System.arraycopy(hash, 0, key, 0, key.length);
|
||||
return key;
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return keyString.getBytes();
|
||||
}
|
||||
|
||||
// This will use only the processor which was chosen in chat menu [that's why ID is needed, bruh]
|
||||
public static String encryptMessage(MsgFromUser msg) {
|
||||
|
||||
String msgBody = getBody(msg);
|
||||
|
||||
Log.d("EncryptProvider", "encryptMessage: msg = " + msg.toString());
|
||||
Log.d("EncryptProvider", "encryptMessage: body = " + msgBody);
|
||||
Log.d("EncryptProvider", "encryptMessage: peerId = " + getPeerId(msg));
|
||||
|
||||
for (IMProcessor processor: processors) {
|
||||
int peer = getPeerId(msg);
|
||||
if (processor.isUsedToEncrypt(peer)) {
|
||||
return processor.encode(msgBody, getKeyForProcessor(processor, peer));
|
||||
}
|
||||
}
|
||||
|
||||
return msgBody;
|
||||
}
|
||||
|
||||
// For rendering UI
|
||||
public static List<Pair<String, String>> getUserVisibleEncoders() {
|
||||
List<Pair<String, String>> theList = new ArrayList<>();
|
||||
|
||||
for (IMProcessor processor: processors) {
|
||||
if (processor.isPublic()) theList.add(new Pair<>("VT_IMDecode_"+processor.getPrefKey(), processor.getUIName()));
|
||||
}
|
||||
|
||||
return theList;
|
||||
}
|
||||
|
||||
static {
|
||||
processors.add(new VTostersProcessor());
|
||||
processors.add(new VTostersAESProcessor());
|
||||
processors.add(new DefaultCoffeeProcessor());
|
||||
processors.add(new DonateCoffeeProcessor());
|
||||
processors.add(new BeeCryptProcessor());
|
||||
processors.add(new MP3InvisibleProcessor());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,78 @@
|
||||
package ru.vtosters.lite.encryption.base;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
|
||||
public abstract class IMProcessor {
|
||||
// By default it checks start and end tag.
|
||||
public boolean isEncrypted(String source) {
|
||||
//Log.d("IMProcessor", "Checking if encrypted: "+source+" / "+getUIName());
|
||||
return source.startsWith(startTag()) && source.endsWith(endTag());
|
||||
}
|
||||
|
||||
// Key can be null - if it's a public processor
|
||||
@NonNull protected abstract String encodeInternal(@NonNull String source, @Nullable byte[] key);
|
||||
@NonNull protected abstract String decodeInternal(@NonNull String source, @Nullable byte[] key);
|
||||
|
||||
// Automatically removes tags. Magic!
|
||||
@NonNull
|
||||
public String encode(@NonNull String source, @Nullable byte[] key) {
|
||||
//Log.d("IMProcessor", "Encoding "+source);
|
||||
return startTag() + encodeInternal(source, key) + endTag();
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public String decode(@NonNull String source, @Nullable byte[] key) {
|
||||
//Log.d("IMProcessor", "Decoding");
|
||||
return decodeInternal(source.substring(startTag().length(), source.length() - endTag().length()), key);
|
||||
}
|
||||
|
||||
// Public - no key required.
|
||||
public boolean isPublic() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// UI thing
|
||||
@NonNull abstract public String getUIName();
|
||||
@NonNull abstract public String getPrefKey();
|
||||
|
||||
@NonNull public String startTag() {
|
||||
return "";
|
||||
}
|
||||
@NonNull public String endTag() {
|
||||
return "";
|
||||
}
|
||||
|
||||
public boolean isUsed() {
|
||||
//Log.d("IMProcessor", "Checking if decoded with "+getUIName());
|
||||
return BooleanTrue("VT_IMDecode_"+getPrefKey());
|
||||
}
|
||||
|
||||
public boolean isUsedToEncrypt(int id) {
|
||||
//Log.d("IMProcessor", "Checking if "+id+" is ready to be encrypted with "+getUIName());
|
||||
return BooleanFalse("VT_IMEncode_"+getPrefKey()+"_"+id);
|
||||
}
|
||||
|
||||
public void enableEncryptFor(int id) {
|
||||
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, true).apply();
|
||||
}
|
||||
|
||||
public void disableEncryptFor(int id) {
|
||||
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, false).apply();
|
||||
}
|
||||
|
||||
public void setEncryptionKeyFor(int id, @Nullable String key) {
|
||||
if (key == null || key.isEmpty()) key = "VTAesDefault";
|
||||
Globals.getPrefs().edit().putString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, key).apply();
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public String getEncryptionKeyFor(int id) {
|
||||
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
|
||||
public class BeeCryptProcessor extends IMProcessor {
|
||||
private static final String BC_CHARSET = "жъЖЪ";
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
String a = Base64.encodeToString(source.getBytes(StandardCharsets.UTF_8), 2);
|
||||
StringBuilder res = new StringBuilder();
|
||||
for (int i = 0; i < a.length(); i++) {
|
||||
StringBuilder bintxt = new StringBuilder();
|
||||
int c = a.charAt(i);
|
||||
for (int j = 0; j < 4; j++) {
|
||||
bintxt.insert(0, BC_CHARSET.charAt(c % 4));
|
||||
c /= 4;
|
||||
}
|
||||
res.append(bintxt);
|
||||
}
|
||||
return res.toString();
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEncrypted(String source) {
|
||||
return source.matches("[жъЖЪ]{16,}");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
StringBuilder b64 = new StringBuilder();
|
||||
int i = 0;
|
||||
while (i < source.length() - 3) {
|
||||
try {
|
||||
String bintxt = source.substring(i, i + 4);
|
||||
int c = 0;
|
||||
for (int j = 0; j < 4; j++) {
|
||||
c = (c * 4) + Math.max(0, BC_CHARSET.indexOf(bintxt.charAt(j)));
|
||||
}
|
||||
b64.append((char) c);
|
||||
i += 4;
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
return new String(Base64.decode(b64.toString(), 2), StandardCharsets.UTF_8);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "MP3 [beecrypt]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "mp3_bc";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,103 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
|
||||
public class DefaultCoffeeProcessor extends IMProcessor {
|
||||
private final static String KEY = "stupidUsersMustD";
|
||||
private static Cipher dCipher, eCipher;
|
||||
|
||||
static {
|
||||
try {
|
||||
SecretKeySpec key = new SecretKeySpec(KEY.getBytes(), "AES");
|
||||
|
||||
dCipher = Cipher.getInstance("AES");
|
||||
dCipher.init(Cipher.DECRYPT_MODE, key);
|
||||
|
||||
eCipher = Cipher.getInstance("AES");
|
||||
eCipher.init(Cipher.ENCRYPT_MODE, key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private String toHex(String text) {
|
||||
char[] chars = text.toCharArray();
|
||||
StringBuilder str = new StringBuilder();
|
||||
for (char aChar : chars) {
|
||||
String s = Integer.toHexString(aChar);
|
||||
if (s.length() < 2) s = "0" + s;
|
||||
str.append(s.toUpperCase()).append(" ");
|
||||
}
|
||||
|
||||
String string = str.toString();
|
||||
return string.substring(0, string.length()-1);
|
||||
}
|
||||
|
||||
private String fromHex(String text) {
|
||||
text = text.replace(" ", "");
|
||||
char[] chars = text.toCharArray();
|
||||
char[] chars2 = new char[chars.length/2];
|
||||
for (int i = 0; i < chars.length; i+=2) {
|
||||
String c = String.valueOf(chars[i]) + chars[i + 1];
|
||||
chars2[i/2] = (char) Integer.parseInt(c, 16);
|
||||
}
|
||||
|
||||
return new String(chars2);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
return toHex(Base64.encodeToString(eCipher.doFinal(source.getBytes()), 0));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
return new String(dCipher.doFinal(Base64.decode(fromHex(source), 0)));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return source;
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String startTag() {
|
||||
return "VK CO FF EE ";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String endTag() {
|
||||
return " VK CO FF EE";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "VK Coffee [default]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "coffee_default";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
public class DonateCoffeeProcessor extends DefaultCoffeeProcessor {
|
||||
@Override
|
||||
@NonNull
|
||||
public String startTag() {
|
||||
return "II ";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String endTag() {
|
||||
return " II";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "VK Coffee [hidden]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "coffee_donate";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import android.text.TextUtils;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
|
||||
public class MP3InvisibleProcessor extends IMProcessor {
|
||||
@NonNull
|
||||
@Override
|
||||
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
byte[] bytes = source.getBytes(StandardCharsets.UTF_8);
|
||||
java.lang.String[] plainText = new String[bytes.length];
|
||||
for (int i = 0; i < plainText.length; i++) {
|
||||
plainText[i] = toStr(bytes[i] & 255, " ");
|
||||
}
|
||||
return " " + TextUtils.join(" ", plainText);
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
java.lang.String[] t = source.replaceAll("^" + " ", "").split(" ");
|
||||
byte[] plainText = new byte[t.length];
|
||||
for (int i = 0; i < plainText.length; i++) {
|
||||
plainText[i] = (byte) toNum(t[i], " ");
|
||||
}
|
||||
return new String(plainText, StandardCharsets.UTF_8);
|
||||
} catch (java.lang.Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
private static String toStr(int a, String cc) {
|
||||
StringBuilder s = new StringBuilder();
|
||||
while (a > 0) {
|
||||
s.insert(0, cc.charAt(a % cc.length()));
|
||||
a /= cc.length();
|
||||
}
|
||||
return s.toString();
|
||||
}
|
||||
|
||||
private static int toNum(String a, String cc) {
|
||||
int n = 0;
|
||||
for (int i = 0; i < a.length(); i++) {
|
||||
int start = (a.length() - i) - 1;
|
||||
n = (int) (((double) n) + (((double) cc.indexOf(a.substring(start, start + 1))) * Math.pow(cc.length(), i)));
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isEncrypted(String source) {
|
||||
return source.matches("^" + " " + "([" + " " + "\\s]*)");
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "MP3 [invisible]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "mp3";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.security.InvalidAlgorithmParameterException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.HashMap;
|
||||
|
||||
import javax.crypto.Cipher;
|
||||
import javax.crypto.NoSuchPaddingException;
|
||||
import javax.crypto.spec.IvParameterSpec;
|
||||
import javax.crypto.spec.SecretKeySpec;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
|
||||
public class VTostersAESProcessor extends IMProcessor {
|
||||
private final static String CIPHER_INSTANCE = "AES/CBC/PKCS7Padding";
|
||||
private final static String KEY_METHOD = "AES";
|
||||
|
||||
private HashMap<byte[], Cipher> decodeMap = new HashMap<>(), encodeMap = new HashMap<>();
|
||||
|
||||
public void free(byte[] key) {
|
||||
decodeMap.remove(key);
|
||||
encodeMap.remove(key);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Cipher wrapEncoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException {
|
||||
if (encodeMap.containsKey(key)) return encodeMap.get(key);
|
||||
|
||||
Triple<Cipher, SecretKeySpec, IvParameterSpec> encodeCipher = getBaseCipher(key);
|
||||
encodeCipher.first.init(Cipher.ENCRYPT_MODE, encodeCipher.second, encodeCipher.third);
|
||||
encodeMap.put(key, encodeCipher.first);
|
||||
|
||||
return encodeCipher.first;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Cipher wrapDecoder(byte[] key) throws InvalidAlgorithmParameterException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException {
|
||||
if (decodeMap.containsKey(key)) return decodeMap.get(key);
|
||||
|
||||
Triple<Cipher, SecretKeySpec, IvParameterSpec> decodeCipher = getBaseCipher(key);
|
||||
decodeCipher.first.init(Cipher.DECRYPT_MODE, decodeCipher.second, decodeCipher.third);
|
||||
decodeMap.put(key, decodeCipher.first);
|
||||
|
||||
return decodeCipher.first;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
private Triple<Cipher, SecretKeySpec, IvParameterSpec> getBaseCipher(byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException {
|
||||
byte[] off = new byte[16];
|
||||
System.arraycopy(key, 0, off, 0, off.length);
|
||||
return new Triple<>(Cipher.getInstance(CIPHER_INSTANCE), new SecretKeySpec(key, KEY_METHOD), new IvParameterSpec(off));
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
return Base64.encodeToString(wrapEncoder(key).doFinal(source.getBytes(StandardCharsets.UTF_8)), Base64.DEFAULT);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
try {
|
||||
return new String(wrapDecoder(key).doFinal(Base64.decode(source, Base64.DEFAULT)), StandardCharsets.UTF_8);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isPublic() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String startTag() {
|
||||
return "VT0ST3RS [AES] ";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String endTag() {
|
||||
return " VT0ST3RS [AES]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "VTosters [AES]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "vtaes";
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public String getEncryptionKeyFor(int id) {
|
||||
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, "VTAesDefault");
|
||||
}
|
||||
|
||||
public static class Triple<F, S, T> {
|
||||
public final F first;
|
||||
public final S second;
|
||||
public final T third;
|
||||
|
||||
public Triple(F first, S second, T third) {
|
||||
this.first = first;
|
||||
this.second = second;
|
||||
this.third = third;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package ru.vtosters.lite.encryption.processors;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.Nullable;
|
||||
|
||||
import ru.vtosters.lite.encryption.base.IMProcessor;
|
||||
|
||||
public class VTostersProcessor extends IMProcessor {
|
||||
@NonNull
|
||||
@Override
|
||||
protected String encodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
return Base64.encodeToString(source.getBytes(), Base64.DEFAULT);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
protected String decodeInternal(@NonNull String source, @Nullable byte[] key) {
|
||||
return new String(Base64.decode(source, Base64.DEFAULT));
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String startTag() {
|
||||
return "VT0ST3RS ";
|
||||
}
|
||||
|
||||
@Override
|
||||
@NonNull
|
||||
public String endTag() {
|
||||
return " VT0ST3RS";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getUIName() {
|
||||
return "VTosters Classique [Base64]";
|
||||
}
|
||||
|
||||
@NonNull
|
||||
@Override
|
||||
public String getPrefKey() {
|
||||
return "vt64";
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.f0x1d;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.About.getBuildNumber;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Notification;
|
||||
@@ -18,9 +19,7 @@ import com.vtosters.lite.R;
|
||||
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;
|
||||
import ru.vtosters.lite.deviceinfo.DeviceInfoCollector;
|
||||
|
||||
public class Crashreporter {
|
||||
protected static String logString;
|
||||
@@ -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() + ", commit: " + 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.setContentTitle("Произошла ошибка в работе VTLite!");
|
||||
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;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package ru.vtosters.lite.f0x1d;
|
||||
|
||||
import static android.widget.Toast.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.app.NotificationManager;
|
||||
import android.app.Service;
|
||||
@@ -10,7 +11,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 +19,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 +39,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;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.f0x1d;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.util.Base64;
|
||||
@@ -24,7 +26,6 @@ import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.RequestBody;
|
||||
import okhttp3.Response;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class VTVerifications {
|
||||
public static final HashMap<Integer, Boolean> sServiceAccountsMap = new HashMap<>();
|
||||
@@ -135,7 +136,7 @@ public class VTVerifications {
|
||||
if (jSONObject.optInt("verified", 0) == 1) {
|
||||
return true;
|
||||
}
|
||||
if (!Prefs.BooleanTrue("VT_Verification")) {
|
||||
if (!BooleanTrue("VT_Verification")) {
|
||||
return false;
|
||||
}
|
||||
return isVerified((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
|
||||
@@ -145,14 +146,14 @@ public class VTVerifications {
|
||||
if (jSONObject.optInt("trending", 0) == 1) {
|
||||
return true;
|
||||
}
|
||||
if (!Prefs.BooleanTrue("VT_Fire")) {
|
||||
if (!BooleanTrue("VT_Fire")) {
|
||||
return false;
|
||||
}
|
||||
return hasPrometheus((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
|
||||
}
|
||||
|
||||
public static boolean hasDeveloper(JSONObject jSONObject) {
|
||||
if (!Prefs.BooleanTrue("VT_Dev")) {
|
||||
if (!BooleanTrue("VT_Dev")) {
|
||||
return false;
|
||||
}
|
||||
return isDeveloper((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package ru.vtosters.lite.foaf;
|
||||
|
||||
import static android.widget.Toast.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Proxy.getApiCom;
|
||||
import static ru.vtosters.lite.utils.Proxy.proxy;
|
||||
|
||||
import android.app.ProgressDialog;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.support.v7.app.AlertDialog;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.exifinterface.media.ExifInterface;
|
||||
|
||||
@@ -27,8 +27,7 @@ import java.util.regex.Pattern;
|
||||
import okhttp3.OkHttpClient;
|
||||
import okhttp3.Request;
|
||||
import ru.f0x1d.net.F0x1dRequest;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
import ru.vtosters.lite.utils.Preferences;
|
||||
|
||||
public class FoafBase {
|
||||
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
|
||||
@@ -51,7 +50,7 @@ public class FoafBase {
|
||||
private static String getLink(int i) {
|
||||
String str;
|
||||
StringBuilder sb;
|
||||
if (Prefs.proxy()) {
|
||||
if (proxy()) {
|
||||
sb = new StringBuilder();
|
||||
str = "https://" + getApiCom() + "/_/vk.com/foaf.php?id=";
|
||||
} else {
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
package ru.vtosters.lite.tgs;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.SharedPreferences;
|
||||
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(getContext());
|
||||
|
||||
private static final String CNCT_METHOD = "VTGS:CM";
|
||||
private static final String TG_BOTKEY = "VTGS:BKey";
|
||||
@@ -57,8 +57,7 @@ public class TGPref {
|
||||
}
|
||||
|
||||
public static void setTGProxyUserPass(String user, String pass) {
|
||||
Prefs.edit().putString(TG_PROXYUSER, user).putString(TG_PROXYPASS, pass)
|
||||
.apply();
|
||||
Prefs.edit().putString(TG_PROXYUSER, user).putString(TG_PROXYPASS, pass).apply();
|
||||
}
|
||||
|
||||
public static boolean isTGProxyPassEnabled() {
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.tgs;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
|
||||
import android.graphics.Bitmap;
|
||||
import android.graphics.BitmapFactory;
|
||||
@@ -22,8 +23,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 +48,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 +69,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 +82,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_;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
@@ -24,7 +25,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 +35,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 +46,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 +56,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 +64,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 +78,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 +94,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 +162,7 @@ public class PreferencesUtil {
|
||||
if (!change)
|
||||
return;
|
||||
|
||||
PreferenceManager.getDefaultSharedPreferences(GetContext())
|
||||
PreferenceManager.getDefaultSharedPreferences(getContext())
|
||||
.edit()
|
||||
.putString(key, editText.getText().toString())
|
||||
.apply();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package ru.vtosters.lite.ui.dialogs;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
@@ -11,14 +13,12 @@ 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();
|
||||
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && BooleanTrue("showDoze")) {
|
||||
final Context context = getContext();
|
||||
if (!((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {
|
||||
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
|
||||
builder.setTitle("Выключите оптимизацию батареи!");
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package ru.vtosters.lite.ui.dialogs;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
@@ -11,12 +14,10 @@ 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,12 +34,12 @@ 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);
|
||||
}
|
||||
});
|
||||
if (Prefs.BooleanTrue("showAlertGms")) {
|
||||
if (BooleanTrue("showAlertGms")) {
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.dialogs;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.edit;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.AlertDialog;
|
||||
@@ -9,9 +10,7 @@ import android.content.Intent;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.OEMDetector;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class Start {
|
||||
public static void alert(final Activity activity) {
|
||||
@@ -37,7 +36,7 @@ public class Start {
|
||||
activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/vtosters")));
|
||||
}
|
||||
});
|
||||
if (Prefs.BooleanTrue("showAlert")) {
|
||||
if (BooleanTrue("showAlert")) {
|
||||
builder.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
@@ -7,8 +9,6 @@ import com.vk.core.util.ToastUtils;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override
|
||||
public void b(Bundle bundle) {
|
||||
@@ -22,7 +22,7 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
|
||||
}
|
||||
|
||||
public boolean restart(Preference preference, Object obj) {
|
||||
ToastUtils.a(Helper.getString("restartapp"));
|
||||
ToastUtils.a(getString("restartapp"));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,11 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static android.widget.Toast.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserToken;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
import static ru.vtosters.lite.utils.SettBackup.backupSettings;
|
||||
import static ru.vtosters.lite.utils.SettBackup.deletePrefs;
|
||||
import static ru.vtosters.lite.utils.SettBackup.restoreBackup;
|
||||
@@ -12,7 +16,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 +29,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 +63,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;
|
||||
}
|
||||
}
|
||||
@@ -73,6 +74,8 @@ 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);
|
||||
prefs.edit().clear().commit();
|
||||
VKImageLoader.b();
|
||||
ImEngineProvider.a().h();
|
||||
AudioMessageUtils.j();
|
||||
@@ -99,7 +102,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
restarting();
|
||||
restartApplication();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -129,9 +132,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 +146,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
|
||||
@Override // android.support.v7.preference.Preference.c
|
||||
public boolean a(Preference preference) {
|
||||
deletePrefs();
|
||||
restarting();
|
||||
restartApplication();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package ru.vtosters.lite.ui.fragments;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.IconHelper.switchToDefault;
|
||||
import static ru.vtosters.lite.utils.IconHelper.switchToVK;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.preference.Preference;
|
||||
|
||||
@@ -7,9 +11,6 @@ import com.vk.core.util.ToastUtils;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.IconHelper;
|
||||
|
||||
public class ThemesFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
@Override
|
||||
@@ -21,11 +22,11 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
|
||||
|
||||
public boolean apply(Preference preference, Object obj) {
|
||||
if (((Boolean) obj).booleanValue()) {
|
||||
IconHelper.switchToVK();
|
||||
switchToVK();
|
||||
} else {
|
||||
IconHelper.switchToDefault();
|
||||
switchToDefault();
|
||||
}
|
||||
ToastUtils.a(Helper.getString("iconapplying"));
|
||||
ToastUtils.a(getString("iconapplying"));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,7 +39,7 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
|
||||
public static class b implements Preference.b {
|
||||
@Override // android.support.v7.preference.Preference.b
|
||||
public boolean a(Preference preference, Object obj) {
|
||||
ToastUtils.a(Helper.getString("restartapp"));
|
||||
ToastUtils.a(getString("restartapp"));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.dockbar;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.Typeface;
|
||||
@@ -14,7 +15,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 +42,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 +54,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 +62,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 +76,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(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.dockbar;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
@@ -14,7 +15,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 +43,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 +57,7 @@ public class DockBarFragment extends ToolbarFragment {
|
||||
reset.setText("Сбросить");
|
||||
reset.setOnClickListener(v -> {
|
||||
DockBarManager.getInstance().delete();
|
||||
restarting();
|
||||
restartApplication();
|
||||
});
|
||||
|
||||
LinearLayout.LayoutParams resetParams = new LinearLayout.LayoutParams(0, -2);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
package ru.vtosters.lite.ui.fragments.dockbar;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
@@ -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());
|
||||
// }
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package ru.vtosters.lite.ui.fragments.dockbar;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Preferences.newfeed;
|
||||
import static ru.vtosters.lite.utils.Preferences.olddock;
|
||||
|
||||
import com.vk.apps.AppsFragment;
|
||||
import com.vk.discover.DiscoverFeedFragment;
|
||||
import com.vk.discover.DiscoverFragment;
|
||||
import com.vk.discover.GatewaysFragment;
|
||||
import com.vk.fave.fragments.FaveTabFragment;
|
||||
import com.vk.feedlikes.fragments.FeedLikesFragment;
|
||||
import com.vk.menu.MenuFragment;
|
||||
import com.vk.music.fragment.MusicFragment;
|
||||
import com.vk.newsfeed.Feed2049;
|
||||
import com.vk.newsfeed.HomeFragment;
|
||||
import com.vk.newsfeed.NewsfeedFragment;
|
||||
import com.vk.notifications.NotificationsContainerFragment;
|
||||
import com.vtosters.lite.R;
|
||||
@@ -40,9 +44,6 @@ import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Prefs;
|
||||
|
||||
public class DockBarManager {
|
||||
public static final int MIN_SELECTED_TABS_LIMIT = 3;
|
||||
public static final int MAX_SELECTED_TABS_LIMIT = 9;
|
||||
@@ -75,14 +76,14 @@ public class DockBarManager {
|
||||
}
|
||||
|
||||
private void load() {
|
||||
File dockbar = new File(Helper.GetContext().getFilesDir(), "dockbar.json");
|
||||
File dockbar = new File(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));
|
||||
mSelectedTabs.add(new DockBarTab("tab_discover", Prefs.olddock() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, Prefs.isUseAlternativeFragments() ? DiscoverFragment.class : DiscoverFeedFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_messages", Prefs.olddock() ? R.drawable.ic_menu_messages_28 : R.drawable.ic_message_28_outline, R.string.messages, R.id.tab_messages, DialogsFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_feedback", Prefs.olddock() ? R.drawable.ic_menu_notifications_28 : R.drawable.ic_menu_notification_outline_28, R.string.feedback, R.id.tab_feedback, NotificationsContainerFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_menu", Prefs.olddock() ? R.drawable.ic_menu_more_28 : R.drawable.ic_menu_more_outline_28, R.string.menu, R.id.tab_menu, MenuFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_news", olddock() ? R.drawable.ic_newsfeed_28 : R.drawable.ic_menu_newsfeed_outline_28, R.string.newsfeed, R.id.tab_news, newfeed() ? HomeFragment.class : NewsfeedFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_discover", olddock() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, newfeed() ? GatewaysFragment.class : DiscoverFragment.class ));
|
||||
mSelectedTabs.add(new DockBarTab("tab_messages", olddock() ? R.drawable.ic_menu_messages_28 : R.drawable.ic_message_28_outline, R.string.messages, R.id.tab_messages, DialogsFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_feedback", olddock() ? R.drawable.ic_menu_notifications_28 : R.drawable.ic_menu_notification_outline_28, R.string.feedback, R.id.tab_feedback, NotificationsContainerFragment.class));
|
||||
mSelectedTabs.add(new DockBarTab("tab_menu", olddock() ? R.drawable.ic_menu_more_28 : R.drawable.ic_menu_more_outline_28, R.string.menu, R.id.tab_menu, MenuFragment.class));
|
||||
|
||||
mDisabledTabs.add(new DockBarTab("tab_friends", R.drawable.ic_user_24, R.string.friends, R.id.menu_friends, FriendsFragment.class));
|
||||
mDisabledTabs.add(new DockBarTab("tab_groups", R.drawable.ic_users_24, R.string.groups, R.id.menu_groups, GroupsFragment.class));
|
||||
@@ -114,17 +115,17 @@ public class DockBarManager {
|
||||
item.getInt("id"),
|
||||
Class.forName(item.getString("fragmentClass"))
|
||||
);
|
||||
if (Prefs.isUseAlternativeFragments()) {
|
||||
if (newfeed()) {
|
||||
if (tab.fragmentClass == NewsfeedFragment.class) {
|
||||
tab.fragmentClass = Feed2049.b.c();
|
||||
} else if (tab.fragmentClass == DiscoverFeedFragment.class) {
|
||||
tab.fragmentClass = HomeFragment.class;
|
||||
} else if (tab.fragmentClass == DiscoverFragment.class) {
|
||||
tab.fragmentClass = DiscoverFragment.class;
|
||||
}
|
||||
} else {
|
||||
if (tab.fragmentClass == Feed2049.b.c()) {
|
||||
if (tab.fragmentClass == HomeFragment.class) {
|
||||
tab.fragmentClass = NewsfeedFragment.class;
|
||||
} else if (tab.fragmentClass == DiscoverFragment.class) {
|
||||
tab.fragmentClass = DiscoverFeedFragment.class;
|
||||
} else if (tab.fragmentClass == GatewaysFragment.class) {
|
||||
tab.fragmentClass = GatewaysFragment.class;
|
||||
}
|
||||
}
|
||||
mSelectedTabs.add(tab);
|
||||
@@ -140,17 +141,17 @@ public class DockBarManager {
|
||||
item.getInt("id"),
|
||||
Class.forName(item.getString("fragmentClass"))
|
||||
);
|
||||
if (Prefs.isUseAlternativeFragments()) {
|
||||
if (newfeed()) {
|
||||
if (tab.fragmentClass == NewsfeedFragment.class) {
|
||||
tab.fragmentClass = Feed2049.b.c();
|
||||
} else if (tab.fragmentClass == DiscoverFeedFragment.class) {
|
||||
tab.fragmentClass = DiscoverFragment.class;
|
||||
tab.fragmentClass = HomeFragment.class;
|
||||
} else if (tab.fragmentClass == DiscoverFragment.class) {
|
||||
tab.fragmentClass = GatewaysFragment.class;
|
||||
}
|
||||
} else {
|
||||
if (tab.fragmentClass == Feed2049.b.c()) {
|
||||
if (tab.fragmentClass == HomeFragment.class) {
|
||||
tab.fragmentClass = NewsfeedFragment.class;
|
||||
} else if (tab.fragmentClass == DiscoverFragment.class) {
|
||||
tab.fragmentClass = DiscoverFeedFragment.class;
|
||||
} else if (tab.fragmentClass == GatewaysFragment.class) {
|
||||
tab.fragmentClass = DiscoverFragment.class;
|
||||
}
|
||||
}
|
||||
mDisabledTabs.add(tab);
|
||||
@@ -163,13 +164,13 @@ public class DockBarManager {
|
||||
}
|
||||
|
||||
public void delete() {
|
||||
File dockbar = new File(Helper.GetContext().getFilesDir(), "dockbar.json");
|
||||
File dockbar = new File(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(getContext().getFilesDir(), "dockbar.json");
|
||||
|
||||
JSONArray selected = new JSONArray();
|
||||
for (DockBarTab tab : mSelectedTabs) {
|
||||
|
||||
+18
-8
@@ -1,8 +1,15 @@
|
||||
package ru.vtosters.lite.ui.fragments.multiaccount;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Themes.*;
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getResources;
|
||||
import static ru.vtosters.lite.utils.Globals.isNetworkConnected;
|
||||
import static ru.vtosters.lite.utils.Globals.restartApplication;
|
||||
import static ru.vtosters.lite.utils.Themes.getTextAttr;
|
||||
import static ru.vtosters.lite.utils.Themes.recolorDrawable;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.graphics.Typeface;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
@@ -26,9 +33,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 +130,9 @@ 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();
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
|
||||
prefs.edit().clear().commit();
|
||||
restartApplication();
|
||||
});
|
||||
Drawable drawable = recolorDrawable(getResources().getDrawable(R.drawable.ic_list_add));
|
||||
mAction.setImageDrawable(drawable);
|
||||
@@ -142,7 +148,9 @@ 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();
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
|
||||
prefs.edit().clear().commit();
|
||||
restartApplication();
|
||||
|
||||
});
|
||||
|
||||
@@ -163,7 +171,9 @@ 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();
|
||||
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
|
||||
prefs.edit().clear().commit();
|
||||
restartApplication();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
+3
-2
@@ -1,5 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.multiaccount;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.support.v7.widget.LinearLayoutManager;
|
||||
import android.support.v7.widget.RecyclerView;
|
||||
@@ -9,7 +11,6 @@ import android.view.ViewGroup;
|
||||
import android.widget.LinearLayout;
|
||||
|
||||
import me.grishka.appkit.fragments.ToolbarFragment;
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
|
||||
public class MultiAccountFragment extends ToolbarFragment {
|
||||
|
||||
@@ -36,6 +37,6 @@ public class MultiAccountFragment extends ToolbarFragment {
|
||||
|
||||
super.a(arg0, arg1);
|
||||
|
||||
a(Helper.getString("accounts"));
|
||||
a(getString("accounts"));
|
||||
}
|
||||
}
|
||||
|
||||
+34
-18
@@ -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.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
@@ -12,26 +12,34 @@ import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import ru.vtosters.lite.utils.Helper;
|
||||
import ru.vtosters.lite.utils.Globals;
|
||||
|
||||
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();
|
||||
editor.commit();
|
||||
}
|
||||
|
||||
public static void migrationRestart() {
|
||||
SharedPreferences prefs = getPreferences();
|
||||
if (prefs.getBoolean("multiaccount_restart", true)) {
|
||||
prefs.edit().putBoolean("multiaccount_restart", false).commit();
|
||||
Globals.restartApplication();
|
||||
}
|
||||
}
|
||||
|
||||
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 +58,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,24 +73,32 @@ 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);
|
||||
if (account == i && getAccountPrefsCount() > 0) {
|
||||
List<MultiAccountItem> accounts = buildList();
|
||||
if (accounts.size() > 0)
|
||||
switchAccount(buildList().get(0).index);
|
||||
else {
|
||||
getContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE)
|
||||
.edit().clear().commit();
|
||||
Globals.getPreferences().edit().putBoolean("multiaccount_restart", true).commit();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package ru.vtosters.lite.ui.fragments.tgstickers;
|
||||
|
||||
import static android.widget.Toast.*;
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Themes.*;
|
||||
import static android.widget.Toast.LENGTH_SHORT;
|
||||
import static android.widget.Toast.makeText;
|
||||
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getIdentifier;
|
||||
import static ru.vtosters.lite.utils.Globals.getResources;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
import static ru.vtosters.lite.utils.Themes.getAccentColor;
|
||||
import static ru.vtosters.lite.utils.Themes.getNavbarColor;
|
||||
import static ru.vtosters.lite.utils.Themes.getSTextAttr;
|
||||
import static ru.vtosters.lite.utils.Themes.getTextAttr;
|
||||
import static ru.vtosters.lite.utils.Themes.recolorDrawable;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.app.ProgressDialog;
|
||||
@@ -28,7 +37,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 +55,6 @@ 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 +214,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 +257,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 +277,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 +296,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 +311,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 +358,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)));
|
||||
@@ -367,7 +372,7 @@ public class StickersFragment extends ToolbarFragment {
|
||||
holder.switchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> stickersService.setPackEnabled(pack, isChecked, false));
|
||||
holder.count.setText(pack.stickersCount + " " + getString("stickerscount"));
|
||||
|
||||
holder.layout.setBackgroundColor(Prefs.getNavbarColor());
|
||||
holder.layout.setBackgroundColor(getNavbarColor());
|
||||
|
||||
// Color костыль
|
||||
int color = getTextAttr();
|
||||
|
||||
+4
-4
@@ -1,6 +1,7 @@
|
||||
package ru.vtosters.lite.ui.fragments.tgstickers;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getString;
|
||||
|
||||
import android.os.Bundle;
|
||||
|
||||
@@ -11,7 +12,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 +19,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 +85,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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getApplicationName;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Preferences.VERSIONNAME;
|
||||
import static ru.vtosters.lite.utils.Preferences.oldabout;
|
||||
|
||||
import android.content.Context;
|
||||
|
||||
import com.vk.about.Items;
|
||||
import com.vk.about.Items1;
|
||||
import com.vk.about.Items2;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Scanner;
|
||||
|
||||
public class About {
|
||||
public static void injectAbout(List<Items2> list) {
|
||||
list.clear();
|
||||
list.add(new Items1());
|
||||
if (!oldabout()) {
|
||||
list.add(new Items(21, com.vtosters.lite.R.string.opencommit));
|
||||
list.add(new Items(8, com.vtosters.lite.R.string.tgchannel));
|
||||
list.add(new Items(9, com.vtosters.lite.R.string.tgchat));
|
||||
list.add(new Items(16, com.vtosters.lite.R.string.vtfaq));
|
||||
list.add(new Items(19, com.vtosters.lite.R.string.vtsite));
|
||||
list.add(new Items(20, com.vtosters.lite.R.string.donate));
|
||||
list.add(new Items(17, com.vtosters.lite.R.string.vkgroup));
|
||||
list.add(new Items(18, com.vtosters.lite.R.string.sett_debug));
|
||||
return;
|
||||
}
|
||||
list.add(new Items(0, com.vtosters.lite.R.string.about_app_feedback));
|
||||
list.add(new Items(1, com.vtosters.lite.R.string.about_app_estimate));
|
||||
list.add(new Items(2, com.vtosters.lite.R.string.about_app_privacy));
|
||||
list.add(new Items(5, com.vtosters.lite.R.string.about_app_cookie));
|
||||
list.add(new Items(3, com.vtosters.lite.R.string.about_app_terms_to_use));
|
||||
list.add(new Items(4, com.vtosters.lite.R.string.about_app_license));
|
||||
list.add(new Items(6, com.vtosters.lite.R.string.about_app_data_protect));
|
||||
list.add(new Items(8, com.vtosters.lite.R.string.sett_debug));
|
||||
}
|
||||
public static String getBuildNumber() {
|
||||
return getBuild(getContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getCommitLink() {
|
||||
return "https://github.com/vtosters/lite/commit/" + getBuild(getContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getBuild(Context context, String name) {
|
||||
try {
|
||||
Scanner scanner = new Scanner(context.getAssets().open(name));
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.findInLine("VERSION_BUILD=.+");
|
||||
if (line != null)
|
||||
return line.replace("VERSION_BUILD=", "");
|
||||
return "0000000";
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return "0000000";
|
||||
}
|
||||
|
||||
public static String getAppVersion() throws IOException {
|
||||
return getApplicationName() + " " + VERSIONNAME + " | " + getBuildNumber();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
|
||||
|
||||
import android.content.ContentValues;
|
||||
import android.database.Cursor;
|
||||
import android.database.sqlite.SQLiteOpenHelper;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.vk.im.engine.events.OnMsgUpdateEvent;
|
||||
import com.vk.im.engine.internal.longpoll.a.MsgDeleteLpTask;
|
||||
import com.vk.im.engine.internal.storage.CacheEnvironment;
|
||||
import com.vk.im.engine.models.messages.Msg;
|
||||
import com.vk.im.engine.models.messages.MsgFromUser;
|
||||
import com.vk.im.engine.models.messages.NestedMsg;
|
||||
import com.vk.libsqliteext.CustomSqliteExtensions;
|
||||
|
||||
import org.sqlite.database.sqlite.SQLiteDatabase;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import ru.vtosters.lite.encryption.EncryptProvider;
|
||||
|
||||
public class DeletedMessagesHandler {
|
||||
|
||||
private static List<Integer> sDeletedMessagesList = new ArrayList<>();
|
||||
|
||||
private static SQLiteDatabase sVKSQLiteDatabase;
|
||||
private static int sBodyIndex = -1;
|
||||
private static DeletedMessagesDBHelper sVTDatabase;
|
||||
|
||||
public static void reloadMessagesList() {
|
||||
if (sVTDatabase == null) {
|
||||
sVTDatabase = new DeletedMessagesDBHelper();
|
||||
}
|
||||
sDeletedMessagesList = new ArrayList<>(sVTDatabase.loadAllMessages());
|
||||
}
|
||||
|
||||
public static void grabVKDatabase(CacheEnvironment storageEnvironment) {
|
||||
sVKSQLiteDatabase = storageEnvironment.b();
|
||||
}
|
||||
|
||||
public static boolean hook() {
|
||||
return BooleanFalse("undeletemsg");
|
||||
}
|
||||
|
||||
public static void setBodyDBParser(Msg msg) {
|
||||
if (!(msg instanceof MsgFromUser)) return;
|
||||
|
||||
for (Integer integer : sDeletedMessagesList) {
|
||||
MsgFromUser msgFromUser = (MsgFromUser) msg;
|
||||
checkForNestedMsg(msgFromUser.g);
|
||||
if (integer == msg.d) {
|
||||
editTextOfMsg((MsgFromUser) msg);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void checkForNestedMsg(List<NestedMsg> nestedMsgs) {
|
||||
for (NestedMsg nestedMsg : nestedMsgs) {
|
||||
if (!nestedMsg.i.isEmpty()) checkForNestedMsg(nestedMsg.i);
|
||||
|
||||
nestedMsg.b(EncryptProvider.decryptMessage(nestedMsg.E(), nestedMsg.h().c));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private static void editTextOfMsg(MsgFromUser msgFromUser) {
|
||||
if (!msgFromUser.e.startsWith(getPreifxUndelete())) {
|
||||
msgFromUser.e = getPreifxUndelete() + EncryptProvider.decryptMessage(msgFromUser);
|
||||
}
|
||||
}
|
||||
|
||||
private static String getPreifxUndelete() {
|
||||
String string = getPreferences().getString("undeletemsg_prefix", "");
|
||||
if (string.isEmpty()) {
|
||||
return "[Удалено] ";
|
||||
}
|
||||
if (string.equals("icon")) {
|
||||
return "\uD83D\uDDD1 ";
|
||||
}
|
||||
if (string.equals("icon2")) {
|
||||
return "❌ ";
|
||||
}
|
||||
return "[Удалено] ";
|
||||
}
|
||||
|
||||
public static void updateDialog(MsgDeleteLpTask msgDeleteLpTask) {
|
||||
Cursor c = getMessageFromDatabaseById(msgDeleteLpTask.c);
|
||||
if (c == null) return;
|
||||
|
||||
int localId = c.getInt(c.getColumnIndex("local_id"));
|
||||
|
||||
String str = DeletedMessagesHandler.class.getSimpleName();
|
||||
msgDeleteLpTask.a.a(str, new OnMsgUpdateEvent(str, msgDeleteLpTask.b, localId));
|
||||
}
|
||||
|
||||
public static void hookDeletedMessageId(MsgDeleteLpTask msgDeleteLpTask) {
|
||||
if (!hook()) return;
|
||||
|
||||
int messageId = msgDeleteLpTask.c;
|
||||
|
||||
Cursor c = getMessageFromDatabaseById(messageId);
|
||||
if (c == null) return;
|
||||
if (sBodyIndex == -1) sBodyIndex = c.getColumnIndex("body");
|
||||
if (TextUtils.isEmpty(c.getString(sBodyIndex))) {
|
||||
deleteMessageFromDB(messageId);
|
||||
return;
|
||||
}
|
||||
|
||||
sDeletedMessagesList.add(messageId);
|
||||
sVTDatabase.saveDeletedMessage(messageId);
|
||||
}
|
||||
|
||||
public static Cursor getMessageFromDatabaseById(int messageId) {
|
||||
String query = "SELECT * FROM messages WHERE vk_id = " + messageId;
|
||||
Cursor c = CustomSqliteExtensions.a(sVKSQLiteDatabase, query);
|
||||
if (!c.moveToFirst()) return null;
|
||||
return c;
|
||||
}
|
||||
|
||||
public static void deleteMessageFromDB(int messageId) {
|
||||
sVKSQLiteDatabase.execSQL("DELETE FROM messages WHERE vk_id = " + messageId);
|
||||
}
|
||||
|
||||
public static class DeletedMessagesDBHelper extends SQLiteOpenHelper {
|
||||
|
||||
public DeletedMessagesDBHelper() {
|
||||
super(getContext(), "deleted_msgs", null, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onCreate(android.database.sqlite.SQLiteDatabase db) {
|
||||
db.execSQL("create table deleted_msgs (id integer primary key, msgId integer)");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpgrade(android.database.sqlite.SQLiteDatabase db, int oldVersion, int newVersion) {
|
||||
|
||||
}
|
||||
|
||||
public void saveDeletedMessage(int msgId) {
|
||||
android.database.sqlite.SQLiteDatabase sqLiteDatabase = getWritableDatabase();
|
||||
|
||||
ContentValues contentValues = new ContentValues();
|
||||
contentValues.put("msgId", msgId);
|
||||
|
||||
sqLiteDatabase.insert("deleted_msgs", null, contentValues);
|
||||
sqLiteDatabase.close();
|
||||
}
|
||||
|
||||
public List<Integer> loadAllMessages() {
|
||||
List<Integer> msgIdsList = new ArrayList<>();
|
||||
|
||||
Cursor cursor = getReadableDatabase().query("deleted_msgs", null, null, null, null, null, null);
|
||||
if (cursor.moveToFirst()) {
|
||||
int msgIdIndex = cursor.getColumnIndex("msgId");
|
||||
|
||||
do {
|
||||
msgIdsList.add(cursor.getInt(msgIdIndex));
|
||||
} while (cursor.moveToNext());
|
||||
cursor.close();
|
||||
}
|
||||
|
||||
return msgIdsList;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.isEmpty;
|
||||
import static ru.vtosters.lite.utils.Preferences.isEnableExternalOpening;
|
||||
|
||||
import android.app.AlertDialog;
|
||||
import android.content.Context;
|
||||
@@ -39,7 +41,7 @@ public class ExternalLinkHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if (!Prefs.isEnableExternalOpening()) return false;
|
||||
if (!isEnableExternalOpening()) return false;
|
||||
|
||||
if (checkVkVideo(file)) {
|
||||
if (qualities.size() == 1) {
|
||||
@@ -120,7 +122,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 +131,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;
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.getLocale;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.widget.Toast;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
|
||||
import com.vtosters.lite.UserProfile;
|
||||
import com.vtosters.lite.VKActivity;
|
||||
import com.vtosters.lite.api.ExtendedUserProfile;
|
||||
import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
public class Globals {
|
||||
private static final List<Activity> activities = new ArrayList<>();
|
||||
|
||||
static SharedPreferences prefs = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
|
||||
|
||||
public static SharedPreferences getPrefs() {
|
||||
if (prefs == null) prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs;
|
||||
}
|
||||
|
||||
// Current UserId
|
||||
public static int getUserId() {
|
||||
return VKAccountManager.b().a();
|
||||
}
|
||||
|
||||
public static String getUserSecret() {
|
||||
return VKAccountManager.b().c();
|
||||
}
|
||||
|
||||
public static String getUserToken() {
|
||||
return VKAccountManager.b().b();
|
||||
}
|
||||
|
||||
public static SharedPreferences.Editor edit() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
|
||||
}
|
||||
|
||||
// Delete and reload msg cache
|
||||
public static void reloadMSG() {
|
||||
ImEngineProvider.a().h();
|
||||
}
|
||||
|
||||
// UserId Profile via userProfile
|
||||
public static int getUserID(UserProfile userProfile) {
|
||||
return userProfile.n;
|
||||
}
|
||||
|
||||
public static String getUserFirstName(UserProfile userProfile) {
|
||||
return userProfile.p;
|
||||
}
|
||||
|
||||
public static String getUserLastName(UserProfile userProfile) {
|
||||
return userProfile.o;
|
||||
}
|
||||
|
||||
// UserId Profile via extendedUserProfile
|
||||
public static int getUserID(ExtendedUserProfile extendedUserProfile) {
|
||||
return getUserID(fromEup(extendedUserProfile));
|
||||
}
|
||||
|
||||
public static UserProfile fromEup(ExtendedUserProfile extendedUserProfile) {
|
||||
return extendedUserProfile.a;
|
||||
}
|
||||
|
||||
// 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());
|
||||
ctx.startActivity(mainIntent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
||||
// Global Context
|
||||
@NonNull
|
||||
public static Context getContext() {
|
||||
try {
|
||||
Class<?> appGlobalsClazz = Class.forName("android.app.AppGlobals");
|
||||
Method getInitialApplication = appGlobalsClazz.getDeclaredMethod("getInitialApplication");
|
||||
getInitialApplication.setAccessible(true);
|
||||
return (Context) getInitialApplication.invoke(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
// Google Market Services check
|
||||
public static boolean isGmsInstalled() {
|
||||
try {
|
||||
getContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Resources getResources() {
|
||||
return getContext().getResources();
|
||||
}
|
||||
|
||||
public static int getIdentifier(String str, String str2) {
|
||||
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()))));
|
||||
}
|
||||
|
||||
public static String getPackageName() {
|
||||
return getContext().getPackageName();
|
||||
}
|
||||
|
||||
public static int convertDpToPixel(float f) {
|
||||
return (int) (f * ((float) getContext().getResources().getDisplayMetrics().densityDpi / 160.0f));
|
||||
}
|
||||
|
||||
public static SharedPreferences getPreferences() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
}
|
||||
|
||||
public static void sendToast(String text) {
|
||||
Toast.makeText(getContext(), text, Toast.LENGTH_SHORT).show();
|
||||
}
|
||||
|
||||
public static boolean isEmpty(String str) {
|
||||
return str == null || str.isEmpty();
|
||||
}
|
||||
|
||||
public static boolean isNetworkConnected() {
|
||||
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
|
||||
}
|
||||
|
||||
// Music channels fix
|
||||
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) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static void registerActivities(Application application) {
|
||||
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
if (activity instanceof VKActivity) {
|
||||
activities.add(activity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
activities.remove(activity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static Activity getCurrentActivity() {
|
||||
if (activities.size() == 0) return null;
|
||||
else return activities.get(0);
|
||||
}
|
||||
|
||||
public static String getApplicationName() {
|
||||
return getContext().getApplicationInfo().loadLabel(getContext().getPackageManager()).toString();
|
||||
}
|
||||
|
||||
// Language changer and BaseContext inject
|
||||
public static Context BaseContextLocale(Context context) {
|
||||
Locale locale = new Locale(getLocale());
|
||||
Locale.setDefault(locale);
|
||||
var resources = context.getResources();
|
||||
var configuration = resources.getConfiguration();
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
configuration.setLocale(locale);
|
||||
configuration.setLayoutDirection(locale);
|
||||
return context.createConfigurationContext(configuration);
|
||||
}
|
||||
configuration.locale = locale;
|
||||
configuration.setLayoutDirection(locale);
|
||||
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
|
||||
return context;
|
||||
}
|
||||
}
|
||||
@@ -1,148 +0,0 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Proxy.*;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.content.res.Resources;
|
||||
import android.net.ConnectivityManager;
|
||||
import android.net.NetworkInfo;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import androidx.annotation.NonNull;
|
||||
import androidx.annotation.StringRes;
|
||||
|
||||
import com.vk.core.util.ToastUtils;
|
||||
import com.vtosters.lite.UserProfile;
|
||||
import com.vtosters.lite.api.ExtendedUserProfile;
|
||||
import com.vtosters.lite.auth.VKAccountManager;
|
||||
import com.vtosters.lite.im.ImEngineProvider;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
|
||||
public class Helper {
|
||||
public static int GetUserId() {
|
||||
return VKAccountManager.b().a();
|
||||
}
|
||||
|
||||
public static String GetUserSecret() {
|
||||
return VKAccountManager.b().c();
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
public static void reloadMSG() {
|
||||
ImEngineProvider.a().h();
|
||||
}
|
||||
|
||||
public static int getUserID(UserProfile userProfile) {
|
||||
return userProfile.n;
|
||||
}
|
||||
|
||||
public static String getUserFirstName(UserProfile userProfile) {
|
||||
return userProfile.p;
|
||||
}
|
||||
|
||||
public static String getUserLastName(UserProfile userProfile) {
|
||||
return userProfile.o;
|
||||
}
|
||||
|
||||
public static int getUserID(ExtendedUserProfile extendedUserProfile) {
|
||||
return getUserID(fromEup(extendedUserProfile));
|
||||
}
|
||||
|
||||
public static UserProfile fromEup(ExtendedUserProfile extendedUserProfile) {
|
||||
return extendedUserProfile.a;
|
||||
}
|
||||
|
||||
public static void restarting() {
|
||||
Context ctx = GetContext();
|
||||
PackageManager pm = ctx.getPackageManager();
|
||||
Intent intent = pm.getLaunchIntentForPackage(ctx.getPackageName());
|
||||
Intent mainIntent = Intent.makeRestartActivityTask(intent.getComponent());
|
||||
ctx.startActivity(mainIntent);
|
||||
Runtime.getRuntime().exit(0);
|
||||
}
|
||||
|
||||
@NonNull
|
||||
public static Context GetContext() {
|
||||
try {
|
||||
Class<?> appGlobalsClazz = Class.forName("android.app.AppGlobals");
|
||||
|
||||
Method getInitialApplication = appGlobalsClazz.getDeclaredMethod("getInitialApplication");
|
||||
getInitialApplication.setAccessible(true);
|
||||
|
||||
return (Context) getInitialApplication.invoke(null);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public static boolean IsGmsInstalled() {
|
||||
try {
|
||||
GetContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
|
||||
return true;
|
||||
} catch (Exception unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static Resources getResources() {
|
||||
return GetContext().getResources();
|
||||
}
|
||||
|
||||
public static int getIdentifier(String str, String str2) {
|
||||
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()))));
|
||||
}
|
||||
|
||||
public static String getPackageName() {
|
||||
return GetContext().getPackageName();
|
||||
}
|
||||
|
||||
public static int convertDpToPixel(float f) {
|
||||
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 GetPrefs() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
}
|
||||
|
||||
public static SharedPreferences GetPreferences() {
|
||||
return PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
}
|
||||
|
||||
public static void SendToast(String text) {
|
||||
ToastUtils.a(text);
|
||||
}
|
||||
|
||||
public static boolean isEmpty(String str) {
|
||||
return str == null || str.isEmpty();
|
||||
}
|
||||
|
||||
public static boolean isNetworkConnected() {
|
||||
ConnectivityManager cm = (ConnectivityManager) GetContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
|
||||
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,21 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPackageName;
|
||||
|
||||
import android.content.ComponentName;
|
||||
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);
|
||||
|
||||
@@ -0,0 +1,239 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static java.lang.Long.MAX_VALUE;
|
||||
import static ru.vtosters.lite.ui.fragments.dockbar.DockBarManager.getInstance;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
import static ru.vtosters.lite.utils.Preferences.adsgroup;
|
||||
import static ru.vtosters.lite.utils.Preferences.adsstories;
|
||||
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.copyright_post;
|
||||
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
|
||||
import static ru.vtosters.lite.utils.Preferences.newfeed;
|
||||
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
|
||||
|
||||
import com.vk.apps.AppsFragment;
|
||||
import com.vk.core.preference.Preference;
|
||||
import com.vk.discover.DiscoverFragment;
|
||||
import com.vk.discover.GatewaysFragment;
|
||||
import com.vk.fave.fragments.FaveTabFragment;
|
||||
import com.vk.menu.MenuFragment;
|
||||
import com.vk.music.fragment.MusicFragment;
|
||||
import com.vk.navigation.NavigatorKeys;
|
||||
import com.vk.newsfeed.HomeFragment;
|
||||
import com.vk.newsfeed.NewsfeedFragment;
|
||||
import com.vk.notifications.NotificationsContainerFragment;
|
||||
import com.vtosters.lite.fragments.GamesFragment;
|
||||
import com.vtosters.lite.fragments.PhotosFragment;
|
||||
import com.vtosters.lite.fragments.ProfileFragment;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
import com.vtosters.lite.fragments.d.DocumentsViewFragment;
|
||||
import com.vtosters.lite.fragments.f.FriendsFragment;
|
||||
import com.vtosters.lite.fragments.g.BirthdaysFragment;
|
||||
import com.vtosters.lite.fragments.h.GroupsFragment;
|
||||
import com.vtosters.lite.fragments.lives.LivesTabsFragment;
|
||||
import com.vtosters.lite.fragments.m.VideosFragment;
|
||||
import com.vtosters.lite.fragments.messages.dialogs.DialogsFragment;
|
||||
import com.vtosters.lite.fragments.money.MoneyTransfersFragment;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
public class Newsfeed {
|
||||
public static List<String> mFilters;
|
||||
|
||||
public static boolean isBlockedByFilter(String str) {
|
||||
for (String str2 : mFilters) {
|
||||
if (str.toLowerCase().contains(str2.toLowerCase())) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setupFilters() {
|
||||
mFilters = new ArrayList();
|
||||
|
||||
getFilter("refsfilter", "Referals.txt");
|
||||
getFilter("shortlinkfilter", "LinkShorter.txt");
|
||||
getFilter("default_ad_list", "StandartFilter.txt");
|
||||
getFilter("shitposting", "IDontWantToReadIt.txt");
|
||||
|
||||
String string = getPreferences().getString("spamfilters", "");
|
||||
|
||||
if (!string.isEmpty()) {
|
||||
mFilters.addAll(Arrays.asList(string.split(", ")));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void getFilter(String boolname, String filename) {
|
||||
if (BooleanTrue(boolname)) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open(filename)));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
mFilters.add(readLine);
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean injectFilters(JSONObject jSONObject) {
|
||||
String optString = jSONObject.optString(NavigatorKeys.j, "");
|
||||
if (!ads(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
|
||||
String optString2 = jSONObject.optString("post_type", "");
|
||||
if (!ads(optString2) && !authors_rec(optString2) && !recomm(optString2) && !friendrecomm(optString2)) {
|
||||
String optString3 = jSONObject.optString("filters", "");
|
||||
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || checkCopyright(jSONObject) || captions(jSONObject)) {
|
||||
return false;
|
||||
}
|
||||
return !AD(jSONObject);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean authors_rec(String str) {
|
||||
return str.equals("authors_rec") && !authorsrecomm();
|
||||
}
|
||||
|
||||
public static boolean captions(JSONObject jSONObject) {
|
||||
try {
|
||||
JSONObject jSONObject2 = jSONObject.getJSONObject("caption");
|
||||
if (!Preferences.captions()) {
|
||||
return true;
|
||||
}
|
||||
return (jSONObject2.getString(NavigatorKeys.j).equals("explorebait") && !postsrecomm()) || ((jSONObject2.getString(NavigatorKeys.j).equals("shared") && postsrecomm()) || ((jSONObject.getString(NavigatorKeys.j).equals("digest") && postsrecomm()) || ((jSONObject2.getString(NavigatorKeys.j).equals("commented") && postsrecomm()) || (jSONObject2.getString(NavigatorKeys.j).equals("voted") && postsrecomm()))));
|
||||
} catch (JSONException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean ads(String str) {
|
||||
if ((str.equals("ads_easy_promote") || str.equals("promo_button") || str.equals("app_widget") || str.equals("ads")) && Preferences.ads()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static boolean recomm(String str) {
|
||||
return (str.equals("user_rec") || str.equals("live_recommended") || str.equals("inline_user_rec")) && !postsrecomm();
|
||||
}
|
||||
|
||||
public static boolean friendrecomm(String str) {
|
||||
return str.equals("friends_recommendations") && !friendsrecomm();
|
||||
}
|
||||
|
||||
public static boolean AD(JSONObject jSONObject) {
|
||||
return jSONObject.optInt("marked_as_ads", 0) == 1 && adsgroup();
|
||||
}
|
||||
|
||||
public static boolean checkCopyright(JSONObject jSONObject) {
|
||||
return jSONObject.optInt("copyright", 0) == 1 && copyright_post();
|
||||
}
|
||||
|
||||
public static String friendsads() {
|
||||
return postsrecomm() ? "user_rec" : "null";
|
||||
}
|
||||
|
||||
public static String getFriendRecomm() {
|
||||
return friendsrecomm() ? "friends_recommendations" : "null";
|
||||
}
|
||||
|
||||
public static String authorsads() {
|
||||
return authorsrecomm() ? "authors_rec" : "null";
|
||||
}
|
||||
|
||||
public static String widgetads() {
|
||||
return Preferences.ads() ? "null" : "app_widget";
|
||||
}
|
||||
|
||||
public static String promoads() {
|
||||
return Preferences.ads() ? "null" : "promo_button";
|
||||
}
|
||||
|
||||
public static String storyads() {
|
||||
return adsstories() ? "null" : "ads";
|
||||
}
|
||||
|
||||
public static String getCommentsSort(String def) {
|
||||
switch (getPreferences().getString("commentssort", "")) {
|
||||
case "new":
|
||||
return "desc";
|
||||
case "old":
|
||||
return "asc";
|
||||
default:
|
||||
return def;
|
||||
}
|
||||
}
|
||||
|
||||
public static long getUpdateNewsfeed(boolean refresh_timeout) {
|
||||
switch (getPreferences().getString("newsupdate", "")) {
|
||||
case "no_update":
|
||||
return MAX_VALUE;
|
||||
case "imd_update":
|
||||
return 10000L;
|
||||
default:
|
||||
return Preference.b().getLong(refresh_timeout ? "refresh_timeout_top" : "refresh_timeout_recent", 600000L);
|
||||
}
|
||||
}
|
||||
|
||||
public static Class getStartFragment() {
|
||||
switch (getPreferences().getString("start_values", "")) {
|
||||
case "newsfeed":
|
||||
return newfeed() ? HomeFragment.class : NewsfeedFragment.class;
|
||||
case "messenger":
|
||||
return DialogsFragment.class;
|
||||
case "groups":
|
||||
return GroupsFragment.class;
|
||||
case "music":
|
||||
return MusicFragment.class;
|
||||
case "friends":
|
||||
return FriendsFragment.class;
|
||||
case "photos":
|
||||
return PhotosFragment.class;
|
||||
case "videos":
|
||||
return VideosFragment.class;
|
||||
case "settings":
|
||||
return SettingsListFragment.class;
|
||||
case "apps":
|
||||
return AppsFragment.class;
|
||||
case "discover":
|
||||
return newfeed() ? GatewaysFragment.class : DiscoverFragment.class;
|
||||
case "notifications":
|
||||
return NotificationsContainerFragment.class;
|
||||
case "money":
|
||||
return MoneyTransfersFragment.class;
|
||||
case "games":
|
||||
return GamesFragment.class;
|
||||
case "liked":
|
||||
return FaveTabFragment.class;
|
||||
case "menu":
|
||||
return MenuFragment.class;
|
||||
case "profile":
|
||||
return ProfileFragment.class;
|
||||
case "lives":
|
||||
return LivesTabsFragment.class;
|
||||
case "docs":
|
||||
return DocumentsViewFragment.class;
|
||||
case "brtd":
|
||||
return BirthdaysFragment.class;
|
||||
default:
|
||||
return getInstance().getSelectedTabs().get(0).fragmentClass;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Preferences.dev;
|
||||
import static ru.vtosters.lite.utils.Preferences.opusmodule;
|
||||
|
||||
import android.util.Log;
|
||||
|
||||
import com.vk.medianative.MediaNative;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
|
||||
public class OpusLoader {
|
||||
private static long timetracker;
|
||||
private static boolean inited;
|
||||
|
||||
public static void LoadLibrary(String libname){
|
||||
try {
|
||||
System.loadLibrary(libname);
|
||||
inited = true;
|
||||
} catch (UnsatisfiedLinkError unused2) {
|
||||
if(dev()) Log.d("VTLite", "Failed to load " + libname);
|
||||
inited = false;
|
||||
}
|
||||
}
|
||||
|
||||
public static long getLength() {
|
||||
if (isReadyToUse()) {
|
||||
long length = System.currentTimeMillis() - timetracker;
|
||||
timetracker = System.currentTimeMillis();
|
||||
return length;
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
public static int AudioStartRecordBridge(String str) {
|
||||
if (isReadyToUse()) {
|
||||
// Init custom AudioStartRecord
|
||||
timetracker = System.currentTimeMillis();
|
||||
return 1;
|
||||
}
|
||||
return MediaNative.nativeAudioStartRecord(str);
|
||||
}
|
||||
|
||||
public static int AudioWriteFrameBridge(ByteBuffer buffer, int length) {
|
||||
if (isReadyToUse()) {
|
||||
// Init custom AudioWriteFrame
|
||||
}
|
||||
return MediaNative.nativeAudioWriteFrame(buffer, length);
|
||||
}
|
||||
|
||||
public static void AudioStopRecordBridge() {
|
||||
if (isReadyToUse()) {
|
||||
// Init custom AudioStopRecord
|
||||
}
|
||||
MediaNative.nativeAudioStopRecord();
|
||||
}
|
||||
|
||||
private static boolean isReadyToUse() {
|
||||
return opusmodule() && inited;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,339 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
|
||||
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
|
||||
import static ru.vtosters.lite.utils.Globals.fixGapps;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Globals.registerActivities;
|
||||
import static ru.vtosters.lite.utils.Newsfeed.setupFilters;
|
||||
import static ru.vtosters.lite.utils.OpusLoader.LoadLibrary;
|
||||
import static ru.vtosters.lite.utils.Proxy.setProxy;
|
||||
|
||||
import android.app.Application;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.preference.PreferenceManager;
|
||||
|
||||
import com.vk.core.util.Screen;
|
||||
import com.vtosters.lite.data.Users;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class Preferences {
|
||||
public static String VERSIONNAME = "Beta";
|
||||
|
||||
public static Integer VKBUILD = 12116; // 3439 orig
|
||||
public static String VKVER = "7.24"; // 5.29 orig
|
||||
|
||||
public static void init(Application application) {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
migrate();
|
||||
reloadMessagesList();
|
||||
registerActivities(application);
|
||||
LoadLibrary("vkopustest");
|
||||
}
|
||||
|
||||
public static boolean BooleanFalse(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs.getBoolean(key, false);
|
||||
}
|
||||
|
||||
public static boolean BooleanTrue(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
|
||||
return prefs.getBoolean(key, true);
|
||||
}
|
||||
|
||||
public static boolean opusmodule() {
|
||||
return BooleanTrue("opusmodule");
|
||||
}
|
||||
|
||||
public static boolean authorsrecomm() {
|
||||
return BooleanTrue("authorsrecomm");
|
||||
}
|
||||
|
||||
public static boolean captions() {
|
||||
return BooleanTrue("captions");
|
||||
}
|
||||
|
||||
public static boolean copyright_post() {
|
||||
return BooleanFalse("copyright_post");
|
||||
}
|
||||
|
||||
public static boolean default_ad_list() {
|
||||
return BooleanFalse("default_ad_list");
|
||||
}
|
||||
|
||||
public static boolean shitposting() {
|
||||
return BooleanFalse("shitposting");
|
||||
}
|
||||
|
||||
public static boolean friendsrecomm() {
|
||||
return BooleanTrue("friendsrecomm");
|
||||
}
|
||||
|
||||
public static boolean isBGStickersEnabled() {
|
||||
return BooleanTrue("isBGStickersEnabled");
|
||||
}
|
||||
|
||||
public static boolean ads() {
|
||||
return BooleanFalse("__dbg_no_ads");
|
||||
}
|
||||
|
||||
public static boolean adsgroup() {
|
||||
return BooleanFalse("adsgroup");
|
||||
}
|
||||
|
||||
public static boolean olddock() {
|
||||
return BooleanFalse("olddock");
|
||||
}
|
||||
|
||||
public static boolean adsslider() {
|
||||
return BooleanFalse("__dbg_no_slider_ads");
|
||||
}
|
||||
|
||||
public static boolean adsstories() {
|
||||
return BooleanFalse("adsstories");
|
||||
}
|
||||
|
||||
public static boolean alteremoji(Context context) {
|
||||
return alteremojipref() ? alteremojipref() : Screen.a(context);
|
||||
}
|
||||
|
||||
public static boolean alteremojipref() {
|
||||
return BooleanFalse("alteremoji");
|
||||
}
|
||||
|
||||
public static boolean awayphp() {
|
||||
return BooleanTrue("awayphp");
|
||||
}
|
||||
|
||||
public static boolean VKUI_INJ() {
|
||||
return BooleanTrue("VKUI_INJ");
|
||||
}
|
||||
|
||||
public static boolean benchmark() {
|
||||
return BooleanFalse("benchmark");
|
||||
}
|
||||
|
||||
public static boolean calls() {
|
||||
return BooleanTrue("calls");
|
||||
}
|
||||
|
||||
public static boolean convUsersOnline() {
|
||||
return BooleanFalse("convUsersOnline");
|
||||
}
|
||||
|
||||
public static boolean darkmode() {
|
||||
return BooleanTrue("darkmode");
|
||||
}
|
||||
|
||||
public static boolean dev() {
|
||||
return BooleanFalse("dev");
|
||||
}
|
||||
|
||||
public static boolean devmenu() {
|
||||
return BooleanFalse("devmenu");
|
||||
}
|
||||
|
||||
public static boolean dnr() {
|
||||
return BooleanTrue("dnr");
|
||||
}
|
||||
|
||||
public static boolean dns() {
|
||||
return BooleanTrue("dns");
|
||||
}
|
||||
|
||||
public static boolean libverify() {
|
||||
return BooleanFalse("libverify");
|
||||
}
|
||||
|
||||
public static boolean dnt() {
|
||||
return BooleanTrue("dnt");
|
||||
}
|
||||
|
||||
public static boolean dockcounter() {
|
||||
return BooleanTrue("dockcounter");
|
||||
}
|
||||
|
||||
public static boolean feedcache() {
|
||||
return BooleanTrue("feedcache");
|
||||
}
|
||||
|
||||
public static void forceOffline() {
|
||||
if (setoffline()) {
|
||||
Users.b();
|
||||
}
|
||||
setupFilters();
|
||||
}
|
||||
|
||||
public static boolean fulltime() {
|
||||
return BooleanTrue("fulltime");
|
||||
}
|
||||
|
||||
public static boolean gcmfix() {
|
||||
return BooleanTrue("gcmfix");
|
||||
}
|
||||
|
||||
public static boolean hasMusicSubscription() {
|
||||
return BooleanTrue("hasMusicSubscription");
|
||||
}
|
||||
|
||||
public static boolean isEnableExternalOpening() {
|
||||
return BooleanFalse("isEnableExternalOpening");
|
||||
}
|
||||
|
||||
public static boolean iconvk() {
|
||||
return BooleanFalse("iconvk");
|
||||
}
|
||||
|
||||
public static boolean iconvkru() {
|
||||
return BooleanFalse("iconvkru");
|
||||
}
|
||||
|
||||
public static boolean isMusicRestricted() {
|
||||
return BooleanTrue("isMusicRestricted");
|
||||
}
|
||||
|
||||
public static boolean msgflat() {
|
||||
return BooleanFalse("msgflat");
|
||||
}
|
||||
|
||||
public static boolean msgtails() {
|
||||
return BooleanTrue("msgtails");
|
||||
}
|
||||
|
||||
public static boolean navbar() {
|
||||
return BooleanTrue("navbar");
|
||||
}
|
||||
|
||||
public static boolean newfeed() {
|
||||
return BooleanTrue("newfeed");
|
||||
}
|
||||
|
||||
public static boolean offline() {
|
||||
return BooleanTrue("offline");
|
||||
}
|
||||
|
||||
public static boolean oldabout() {
|
||||
return BooleanFalse("oldabout");
|
||||
}
|
||||
|
||||
public static boolean postsrecomm() {
|
||||
return BooleanTrue("postsrecomm");
|
||||
}
|
||||
|
||||
public static String readstatus() {
|
||||
return dnr() ? "messages.markAsRead" : "null";
|
||||
}
|
||||
|
||||
public static boolean refsfilter() {
|
||||
return BooleanFalse("refsfilter");
|
||||
}
|
||||
|
||||
public static boolean setoffline() {
|
||||
return BooleanFalse("setoffline");
|
||||
}
|
||||
|
||||
public static boolean shortinfo() {
|
||||
return BooleanTrue("shortinfo");
|
||||
}
|
||||
|
||||
public static boolean shortlinkfilter() {
|
||||
return BooleanFalse("shortlinkfilter");
|
||||
}
|
||||
|
||||
public static boolean shortpost() {
|
||||
return BooleanTrue("shortpost");
|
||||
}
|
||||
|
||||
public static boolean showmenu() {
|
||||
return BooleanFalse("showmenu");
|
||||
}
|
||||
|
||||
public static boolean ssl() {
|
||||
return BooleanTrue("ssl");
|
||||
}
|
||||
|
||||
public static boolean stories() {
|
||||
return BooleanTrue("stories");
|
||||
}
|
||||
|
||||
public static boolean swipe() {
|
||||
return BooleanTrue("swipe");
|
||||
}
|
||||
|
||||
public static boolean systememoji() {
|
||||
return BooleanFalse("systememoji");
|
||||
}
|
||||
|
||||
public static boolean unlockstats() {
|
||||
return BooleanFalse("unlockstats");
|
||||
}
|
||||
|
||||
public static boolean usevkui() {
|
||||
return BooleanTrue("usevkui");
|
||||
}
|
||||
|
||||
public static boolean vksans() {
|
||||
return BooleanFalse("vksans");
|
||||
}
|
||||
|
||||
public static boolean voice() {
|
||||
return BooleanTrue("voice");
|
||||
}
|
||||
|
||||
public static boolean newvideo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static int getMsgCount() {
|
||||
String customvalue = getPreferences().getString("msgcount", "");
|
||||
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
|
||||
}
|
||||
|
||||
public static String MediacontentFix() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
|
||||
}
|
||||
|
||||
public static String MediacontentFix2() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
|
||||
}
|
||||
|
||||
public static String MediacontentFix3() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
|
||||
}
|
||||
|
||||
public static boolean color_grishka() {
|
||||
return BooleanTrue("color_grishka");
|
||||
}
|
||||
|
||||
public static boolean vkme_msg() {
|
||||
return BooleanFalse("vkme_msg");
|
||||
}
|
||||
|
||||
public static String VKVersion() {
|
||||
String string = getPreferences().getString("vkver", "");
|
||||
return !string.isEmpty() ? string : VKVER;
|
||||
}
|
||||
|
||||
public static int VKVersionBuild() {
|
||||
String string = getPreferences().getString("vkbuild", "");
|
||||
return !string.isEmpty() ? Integer.parseInt(string) : VKBUILD;
|
||||
}
|
||||
|
||||
public static long VKVersionBuildLong() {
|
||||
return (long) VKVersionBuild();
|
||||
}
|
||||
|
||||
public static String getLocale() {
|
||||
String string = getPreferences().getString("lang_value", "");
|
||||
if (string.equals("system")) {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
return string.isEmpty() ? Locale.getDefault().getLanguage() : string;
|
||||
}
|
||||
}
|
||||
@@ -1,900 +0,0 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Proxy.setProxy;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.app.Application;
|
||||
import android.app.NotificationChannel;
|
||||
import android.app.NotificationManager;
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.view.Window;
|
||||
|
||||
import com.vk.about.Items;
|
||||
import com.vk.about.Items1;
|
||||
import com.vk.about.Items2;
|
||||
import com.vk.apps.AppsFragment;
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
import com.vk.core.util.Screen;
|
||||
import com.vk.fave.fragments.FaveTabFragment;
|
||||
import com.vk.menu.MenuFragment;
|
||||
import com.vk.music.fragment.MusicFragment;
|
||||
import com.vk.navigation.NavigatorKeys;
|
||||
import com.vk.newsfeed.Feed2049;
|
||||
import com.vk.notifications.NotificationsContainerFragment;
|
||||
import com.vtosters.lite.R;
|
||||
import com.vtosters.lite.VKActivity;
|
||||
import com.vtosters.lite.data.Users;
|
||||
import com.vtosters.lite.fragments.GamesFragment;
|
||||
import com.vtosters.lite.fragments.PhotosFragment;
|
||||
import com.vtosters.lite.fragments.ProfileFragment;
|
||||
import com.vtosters.lite.fragments.SettingsListFragment;
|
||||
import com.vtosters.lite.fragments.d.DocumentsViewFragment;
|
||||
import com.vtosters.lite.fragments.f.FriendsFragment;
|
||||
import com.vtosters.lite.fragments.g.BirthdaysFragment;
|
||||
import com.vtosters.lite.fragments.h.GroupsFragment;
|
||||
import com.vtosters.lite.fragments.lives.LivesTabsFragment;
|
||||
import com.vtosters.lite.fragments.m.VideosFragment;
|
||||
import com.vtosters.lite.fragments.messages.dialogs.DialogsFragment;
|
||||
import com.vtosters.lite.fragments.money.MoneyTransfersFragment;
|
||||
|
||||
import org.json.JSONException;
|
||||
import org.json.JSONObject;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Scanner;
|
||||
|
||||
import ru.vtosters.lite.ui.fragments.dockbar.DockBarManager;
|
||||
import ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager;
|
||||
|
||||
public class Prefs {
|
||||
private static final List<Activity> activities = new ArrayList<>();
|
||||
public static String VERSIONNAME = "2.0 Beta";
|
||||
private static List<String> mFilters;
|
||||
|
||||
public static boolean BooleanFalse(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
return prefs.getBoolean(key, false);
|
||||
}
|
||||
|
||||
public static boolean BooleanTrue(String key) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
return prefs.getBoolean(key, true);
|
||||
}
|
||||
|
||||
public static void ClearCache() {
|
||||
}
|
||||
|
||||
public static String GetBackgroundStickers() {
|
||||
if (isBGStickersEnabled()) {
|
||||
return "images_with_background";
|
||||
}
|
||||
return "images";
|
||||
}
|
||||
|
||||
public static boolean isBGStickersEnabled() {
|
||||
return BooleanTrue("isBGStickersEnabled");
|
||||
}
|
||||
|
||||
public static String GetCopyright() {
|
||||
return copyright_post() ? "null" : "copyright";
|
||||
}
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
public static boolean adsgroup() {
|
||||
return BooleanFalse("adsgroup");
|
||||
}
|
||||
|
||||
public static boolean olddock() {
|
||||
return BooleanFalse("olddock");
|
||||
}
|
||||
|
||||
public static boolean adsslider() {
|
||||
return BooleanFalse("__dbg_no_slider_ads");
|
||||
}
|
||||
|
||||
public static boolean adsstories() {
|
||||
return BooleanFalse("adsstories");
|
||||
}
|
||||
|
||||
public static boolean alteremoji(Context context) {
|
||||
return alteremojipref() ? alteremojipref() : Screen.a(context);
|
||||
}
|
||||
|
||||
public static boolean alteremojipref() {
|
||||
return BooleanFalse("alteremoji");
|
||||
}
|
||||
|
||||
public static String authorsads() {
|
||||
return authorsrecomm() ? "authors_rec" : "null";
|
||||
}
|
||||
|
||||
public static boolean authorsrecomm() {
|
||||
return BooleanTrue("authorsrecomm");
|
||||
}
|
||||
|
||||
public static boolean awayphp() {
|
||||
return BooleanTrue("awayphp");
|
||||
}
|
||||
|
||||
public static boolean VKUI_INJ() {
|
||||
return BooleanTrue("VKUI_INJ");
|
||||
}
|
||||
|
||||
public static boolean benchmark() {
|
||||
return BooleanFalse("benchmark");
|
||||
}
|
||||
|
||||
public static boolean calls() {
|
||||
return BooleanTrue("calls");
|
||||
}
|
||||
|
||||
public static boolean captions() {
|
||||
return BooleanTrue("captions");
|
||||
}
|
||||
|
||||
public static boolean convUsersOnline() {
|
||||
return BooleanFalse("convUsersOnline");
|
||||
}
|
||||
|
||||
public static boolean copyright_post() {
|
||||
return BooleanTrue("copyright_post");
|
||||
}
|
||||
|
||||
public static boolean darkmode() {
|
||||
return BooleanTrue("darkmode");
|
||||
}
|
||||
|
||||
public static boolean default_ad_list() {
|
||||
return BooleanFalse("default_ad_list");
|
||||
}
|
||||
|
||||
public static boolean shitposting() {
|
||||
return BooleanFalse("shitposting");
|
||||
}
|
||||
|
||||
public static boolean dev() {
|
||||
return BooleanFalse("dev");
|
||||
}
|
||||
|
||||
public static boolean devmenu() {
|
||||
return BooleanFalse("devmenu");
|
||||
}
|
||||
|
||||
public static boolean dnr() {
|
||||
return BooleanTrue("dnr");
|
||||
}
|
||||
|
||||
public static boolean dns() {
|
||||
return BooleanTrue("dns");
|
||||
}
|
||||
|
||||
public static boolean libverify() {
|
||||
return BooleanFalse("libverify");
|
||||
}
|
||||
|
||||
public static boolean dnt() {
|
||||
return BooleanTrue("dnt");
|
||||
}
|
||||
|
||||
public static boolean dockcounter() {
|
||||
return BooleanTrue("dockcounter");
|
||||
}
|
||||
|
||||
public static boolean feedautoupdate() {
|
||||
return BooleanTrue("feedautoupdate");
|
||||
}
|
||||
|
||||
public static boolean feedcache() {
|
||||
return BooleanTrue("feedcache");
|
||||
}
|
||||
|
||||
public static void forceOffline() {
|
||||
if (setoffline()) {
|
||||
Users.b();
|
||||
}
|
||||
setupFilters();
|
||||
}
|
||||
|
||||
public static boolean forcenogms() {
|
||||
return BooleanTrue("forcenogms");
|
||||
}
|
||||
|
||||
public static String friendsads() {
|
||||
return postsrecomm() ? "user_rec" : "null";
|
||||
}
|
||||
|
||||
public static boolean friendsrecomm() {
|
||||
return BooleanTrue("friendsrecomm");
|
||||
}
|
||||
|
||||
public static boolean fulltime() {
|
||||
return BooleanTrue("fulltime");
|
||||
}
|
||||
|
||||
public static boolean gcmfix() {
|
||||
return BooleanTrue("gcmfix");
|
||||
}
|
||||
|
||||
public static String getAppVersion() throws IOException {
|
||||
return "VTLite | " + VERSIONNAME + " | " + getBuildNumber();
|
||||
}
|
||||
|
||||
public static String getBuildNumber() {
|
||||
return Prefs.getBuild(GetContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getCommitLink() {
|
||||
return "https://github.com/vtosters/lite/commit/" + Prefs.getBuild(GetContext(), "version.properties");
|
||||
}
|
||||
|
||||
public static String getBuild(Context context, String name) {
|
||||
try {
|
||||
Scanner scanner = new Scanner(context.getAssets().open(name));
|
||||
while (scanner.hasNextLine()) {
|
||||
String line = scanner.findInLine("VERSION_BUILD=.+");
|
||||
if (line != null)
|
||||
return line.replace("VERSION_BUILD=", "");
|
||||
return "0000000";
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static String getBranch() {
|
||||
return GetPreferences().getString("ota_branches", "Stable");
|
||||
}
|
||||
|
||||
public static String getDarkVKUI() {
|
||||
return !VKThemeHelper.d() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getAmoledVKUI() {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
return string.equals("amoled") ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getCommentsSort(String def) {
|
||||
String string = GetPreferences().getString("commentssort", "");
|
||||
if (string.isEmpty()) {
|
||||
return def;
|
||||
}
|
||||
if (string.equals("new")) {
|
||||
return "desc";
|
||||
}
|
||||
if (string.equals("old")) {
|
||||
return "asc";
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
public static String getMeToken() {
|
||||
return GetPreferences().getString("me_token", "");
|
||||
}
|
||||
|
||||
public static void setMeToken(String str) {
|
||||
GetPreferences().edit().putString("me_token", str).apply();
|
||||
}
|
||||
|
||||
public static int getNavbarColor() {
|
||||
return VKThemeHelper.a(R.attr.tabbar_background);
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
public static String getString(String key, String defValue) {
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(GetContext());
|
||||
return prefs.getString(key, defValue);
|
||||
}
|
||||
|
||||
public static String getUserProxy() {
|
||||
return proxy() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static boolean hasMusicSubscription() {
|
||||
return BooleanTrue("hasMusicSubscription");
|
||||
}
|
||||
|
||||
public static boolean isEnableExternalOpening() {
|
||||
return BooleanFalse("isEnableExternalOpening");
|
||||
}
|
||||
|
||||
public static boolean iconvk() {
|
||||
return BooleanFalse("iconvk");
|
||||
}
|
||||
|
||||
public static boolean iconvkru() {
|
||||
return BooleanFalse("iconvkru");
|
||||
}
|
||||
|
||||
public static String isDEVModEnabled() {
|
||||
return dev() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static boolean isOtaEnabled() {
|
||||
return BooleanTrue("ota_enabled");
|
||||
}
|
||||
|
||||
public static boolean isMusicRestricted() {
|
||||
return BooleanTrue("isMusicRestricted");
|
||||
}
|
||||
|
||||
public static String isVKSansEnabled() {
|
||||
return vksans() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static boolean msgflat() {
|
||||
return BooleanFalse("msgflat");
|
||||
}
|
||||
|
||||
public static boolean msgtails() {
|
||||
return BooleanTrue("msgtails");
|
||||
}
|
||||
|
||||
public static boolean navbar() {
|
||||
return BooleanTrue("navbar");
|
||||
}
|
||||
|
||||
public static boolean newfeed() {
|
||||
return BooleanTrue("newfeed");
|
||||
}
|
||||
|
||||
public static boolean offline() {
|
||||
return BooleanTrue("offline");
|
||||
}
|
||||
|
||||
public static boolean oldabout() {
|
||||
return BooleanFalse("oldabout");
|
||||
}
|
||||
|
||||
public static boolean postsrecomm() {
|
||||
return BooleanTrue("postsrecomm");
|
||||
}
|
||||
|
||||
public static String promoads() {
|
||||
return ads() ? "null" : "promo_button";
|
||||
}
|
||||
|
||||
public static String proxyHostHTTP() {
|
||||
String string = GetPreferences().getString("proxyHostHTTP", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostHTTPS() {
|
||||
String string = GetPreferences().getString("proxyHostHTTPS", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostSocks() {
|
||||
String string = GetPreferences().getString("proxyHostSocks", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTP() {
|
||||
String string = GetPreferences().getString("proxyPortHTTP", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTPS() {
|
||||
String string = GetPreferences().getString("proxyPortHTTPS", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortSocks() {
|
||||
String string = GetPreferences().getString("proxyPortSocks", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static boolean proxyvk() {
|
||||
return BooleanFalse("proxyvk");
|
||||
}
|
||||
|
||||
public static String readstatus() {
|
||||
return dnr() ? "messages.markAsRead" : "null";
|
||||
}
|
||||
|
||||
public static boolean refsfilter() {
|
||||
return BooleanFalse("refsfilter");
|
||||
}
|
||||
|
||||
public static boolean rightLikes() {
|
||||
return BooleanFalse("rightLikes");
|
||||
}
|
||||
|
||||
public static boolean setoffline() {
|
||||
return BooleanFalse("setoffline");
|
||||
}
|
||||
|
||||
public static boolean shortinfo() {
|
||||
return BooleanTrue("shortinfo");
|
||||
}
|
||||
|
||||
public static boolean shortlinkfilter() {
|
||||
return BooleanFalse("shortlinkfilter");
|
||||
}
|
||||
|
||||
public static boolean shortpost() {
|
||||
return BooleanTrue("shortpost");
|
||||
}
|
||||
|
||||
public static boolean showmenu() {
|
||||
return BooleanFalse("showmenu");
|
||||
}
|
||||
|
||||
public static boolean ssl() {
|
||||
return BooleanTrue("ssl");
|
||||
}
|
||||
|
||||
public static boolean stories() {
|
||||
return BooleanTrue("stories");
|
||||
}
|
||||
|
||||
public static String storyads() {
|
||||
return adsstories() ? "null" : "ads";
|
||||
}
|
||||
|
||||
public static boolean swipe() {
|
||||
return BooleanTrue("swipe");
|
||||
}
|
||||
|
||||
public static boolean systememoji() {
|
||||
return BooleanFalse("systememoji");
|
||||
}
|
||||
|
||||
public static boolean unlockstats() {
|
||||
return BooleanFalse("unlockstats");
|
||||
}
|
||||
|
||||
public static boolean usevkui() {
|
||||
return BooleanTrue("usevkui");
|
||||
}
|
||||
|
||||
public static boolean vksans() {
|
||||
return BooleanFalse("vksans");
|
||||
}
|
||||
|
||||
public static boolean voice() {
|
||||
return BooleanTrue("voice");
|
||||
}
|
||||
|
||||
public static boolean newvideo() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String widgetads() {
|
||||
return ads() ? "null" : "app_widget";
|
||||
}
|
||||
|
||||
public static int getMsgCount() {
|
||||
String customvalue = GetPreferences().getString("msgcount", "");
|
||||
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
|
||||
}
|
||||
|
||||
public static void setNavbarColor(Window window, int i) {
|
||||
if (navbar() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
window.setNavigationBarColor(getNavbarColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static String MediacontentFix() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
|
||||
}
|
||||
|
||||
public static String MediacontentFix2() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
|
||||
}
|
||||
|
||||
public static String MediacontentFix3() {
|
||||
return Build.VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
|
||||
}
|
||||
|
||||
public static boolean inject(JSONObject jSONObject) {
|
||||
String optString = jSONObject.optString(NavigatorKeys.j, "");
|
||||
if (!ads(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
|
||||
String optString2 = jSONObject.optString("post_type", "");
|
||||
if (!ads(optString2) && !authors_rec(optString2) && !recomm(optString2) && !friendrecomm(optString2)) {
|
||||
String optString3 = jSONObject.optString("filters", "");
|
||||
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || checkCopyright(jSONObject) || captions(jSONObject)) {
|
||||
return false;
|
||||
}
|
||||
return !AD(jSONObject);
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void setupFilters() {
|
||||
mFilters = new ArrayList();
|
||||
ReferalsPut();
|
||||
StandardFilterPut();
|
||||
ShortLinkPut();
|
||||
IDontWantToReadIt();
|
||||
String string = GetPreferences().getString("spamfilters", "");
|
||||
if (!string.isEmpty()) {
|
||||
mFilters.addAll(Arrays.asList(string.split(", ")));
|
||||
}
|
||||
}
|
||||
|
||||
public static void ReferalsPut() {
|
||||
if (BooleanTrue("refsfilter")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("Referals.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
mFilters.add(readLine);
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void ShortLinkPut() {
|
||||
if (BooleanTrue("shortlinkfilter")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("LinkShorter.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
mFilters.add(readLine);
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void StandardFilterPut() {
|
||||
if (BooleanTrue("default_ad_list")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("StandartFilter.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
mFilters.add(readLine);
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void IDontWantToReadIt() {
|
||||
if (BooleanTrue("shitposting")) {
|
||||
try {
|
||||
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(GetContext().getAssets().open("IDontWantToReadIt.txt")));
|
||||
while (true) {
|
||||
String readLine = bufferedReader.readLine();
|
||||
if (readLine != null) {
|
||||
mFilters.add(readLine);
|
||||
} else {
|
||||
bufferedReader.close();
|
||||
return;
|
||||
}
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String SSFSDomain() {
|
||||
String string = GetPreferences().getString("ssfscustom", "");
|
||||
if (!string.isEmpty()) {
|
||||
return string;
|
||||
}
|
||||
return "https://vtsf.vknext.net";
|
||||
}
|
||||
|
||||
public static String VKVersion() {
|
||||
String string = GetPreferences().getString("vkversion", "");
|
||||
if (!string.isEmpty()) {
|
||||
return string;
|
||||
}
|
||||
return "5.29";
|
||||
}
|
||||
|
||||
public static boolean isBlockedByFilter(String str) {
|
||||
for (String str2 : mFilters) {
|
||||
if (str.toLowerCase().contains(str2.toLowerCase())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void injectAbout(List<Items2> list) {
|
||||
list.clear();
|
||||
list.add(new Items1());
|
||||
if (!oldabout()) {
|
||||
list.add(new Items(21, R.string.opencommit));
|
||||
list.add(new Items(8, R.string.tgchannel));
|
||||
list.add(new Items(9, R.string.tgchat));
|
||||
list.add(new Items(16, R.string.vtfaq));
|
||||
list.add(new Items(19, R.string.vtsite));
|
||||
list.add(new Items(20, R.string.donate));
|
||||
list.add(new Items(17, R.string.vkgroup));
|
||||
list.add(new Items(18, R.string.sett_debug));
|
||||
return;
|
||||
}
|
||||
list.add(new Items(0, R.string.about_app_feedback));
|
||||
list.add(new Items(1, R.string.about_app_estimate));
|
||||
list.add(new Items(2, R.string.about_app_privacy));
|
||||
list.add(new Items(5, R.string.about_app_cookie));
|
||||
list.add(new Items(3, R.string.about_app_terms_to_use));
|
||||
list.add(new Items(4, R.string.about_app_license));
|
||||
list.add(new Items(6, R.string.about_app_data_protect));
|
||||
list.add(new Items(8, R.string.sett_debug));
|
||||
}
|
||||
|
||||
public static boolean ads(String str) {
|
||||
if ((str.equals("ads_easy_promote") || str.equals("promo_button") || str.equals("app_widget") || str.equals("ads")) && ads()) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static String getLocale() {
|
||||
String string = GetPreferences().getString("lang_value", "");
|
||||
if (string.equals("system")) {
|
||||
return Locale.getDefault().getLanguage();
|
||||
}
|
||||
return string.isEmpty() ? Locale.getDefault().getLanguage() : string;
|
||||
}
|
||||
|
||||
public static boolean proxy() {
|
||||
return GetPreferences().getString("proxy", "").equals("apiproxy");
|
||||
}
|
||||
|
||||
public static boolean authors_rec(String str) {
|
||||
return str.equals("authors_rec") && !authorsrecomm();
|
||||
}
|
||||
|
||||
public static boolean captions(JSONObject jSONObject) {
|
||||
try {
|
||||
JSONObject jSONObject2 = jSONObject.getJSONObject("caption");
|
||||
if (!captions()) {
|
||||
return true;
|
||||
}
|
||||
boolean postsrecomm = postsrecomm();
|
||||
return (jSONObject2.getString(NavigatorKeys.j).equals("explorebait") && !postsrecomm) || ((jSONObject2.getString(NavigatorKeys.j).equals("shared") && postsrecomm) || ((jSONObject.getString(NavigatorKeys.j).equals("digest") && postsrecomm) || ((jSONObject2.getString(NavigatorKeys.j).equals("commented") && postsrecomm) || (jSONObject2.getString(NavigatorKeys.j).equals("voted") && postsrecomm))));
|
||||
} catch (JSONException unused) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean recomm(String str) {
|
||||
return (str.equals("user_rec") || str.equals("live_recommended") || str.equals("inline_user_rec")) && !postsrecomm();
|
||||
}
|
||||
|
||||
public static boolean friendrecomm(String str) {
|
||||
return str.equals("friends_recommendations") && !friendsrecomm();
|
||||
}
|
||||
|
||||
public static boolean AD(JSONObject jSONObject) {
|
||||
return jSONObject.optInt("marked_as_ads", 0) == 1 && adsgroup();
|
||||
}
|
||||
|
||||
public static boolean checkCopyright(JSONObject jSONObject) {
|
||||
return jSONObject.optInt("copyright", 0) == 1 && copyright_post();
|
||||
}
|
||||
|
||||
public static Activity getCurrentActivity() {
|
||||
if (activities.size() == 0) {
|
||||
return null;
|
||||
}
|
||||
return activities.get(0);
|
||||
}
|
||||
|
||||
public static void init(Application application) {
|
||||
setupFilters();
|
||||
fixGapps();
|
||||
setProxy();
|
||||
MultiAccountManager.migrate();
|
||||
registerActivities(application);
|
||||
}
|
||||
|
||||
private static void registerActivities(Application application) {
|
||||
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { // from class: ru.vtoster2.VTCore.1
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityPaused(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityResumed(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStarted(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityStopped(Activity activity) {
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityCreated(Activity activity, Bundle bundle) {
|
||||
if (activity instanceof VKActivity) {
|
||||
Prefs.activities.add(activity);
|
||||
}
|
||||
}
|
||||
|
||||
@Override // android.app.Application.ActivityLifecycleCallbacks
|
||||
public void onActivityDestroyed(Activity activity) {
|
||||
Prefs.activities.remove(activity);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
public static boolean isUseAlternativeFragments() {
|
||||
return true;
|
||||
}
|
||||
|
||||
public static Class getStartFragment() {
|
||||
String string = GetPreferences().getString("start_values", "");
|
||||
if (string.equals("default")) {
|
||||
return DockBarManager.getInstance().getSelectedTabs().get(0).fragmentClass;
|
||||
}
|
||||
if (string.equals("newsfeed")) {
|
||||
return Feed2049.b.c();
|
||||
}
|
||||
if (string.equals("messenger")) {
|
||||
return DialogsFragment.class;
|
||||
}
|
||||
if (string.equals("groups")) {
|
||||
return GroupsFragment.class;
|
||||
}
|
||||
if (string.equals("music")) {
|
||||
return MusicFragment.class;
|
||||
}
|
||||
if (string.equals("friends")) {
|
||||
return FriendsFragment.class;
|
||||
}
|
||||
if (string.equals("photos")) {
|
||||
return PhotosFragment.class;
|
||||
}
|
||||
if (string.equals("videos")) {
|
||||
return VideosFragment.class;
|
||||
}
|
||||
if (string.equals("settings")) {
|
||||
return SettingsListFragment.class;
|
||||
}
|
||||
if (string.equals("apps")) {
|
||||
return AppsFragment.class;
|
||||
}
|
||||
if (string.equals("discover")) {
|
||||
return Feed2049.b.e();
|
||||
}
|
||||
if (string.equals("notifications")) {
|
||||
return NotificationsContainerFragment.class;
|
||||
}
|
||||
if (string.equals("money")) {
|
||||
return MoneyTransfersFragment.class;
|
||||
}
|
||||
if (string.equals("games")) {
|
||||
return GamesFragment.class;
|
||||
}
|
||||
if (string.equals("liked")) {
|
||||
return FaveTabFragment.class;
|
||||
}
|
||||
if (string.equals("menu")) {
|
||||
return MenuFragment.class;
|
||||
}
|
||||
if (string.equals("profile")) {
|
||||
return ProfileFragment.class;
|
||||
}
|
||||
if (string.equals("lives")) {
|
||||
return LivesTabsFragment.class;
|
||||
}
|
||||
if (string.equals("docs")) {
|
||||
return DocumentsViewFragment.class;
|
||||
}
|
||||
return string.equals("brtd") ? BirthdaysFragment.class : DockBarManager.getInstance().getSelectedTabs().get(0).fragmentClass;
|
||||
}
|
||||
|
||||
public static Context BaseContextLocale(Context context) {
|
||||
Locale locale = new Locale(getLocale());
|
||||
Locale.setDefault(locale);
|
||||
var resources = context.getResources();
|
||||
var configuration = resources.getConfiguration();
|
||||
if (Build.VERSION.SDK_INT >= 24) {
|
||||
configuration.setLocale(locale);
|
||||
configuration.setLayoutDirection(locale);
|
||||
return context.createConfigurationContext(configuration);
|
||||
}
|
||||
configuration.locale = locale;
|
||||
configuration.setLayoutDirection(locale);
|
||||
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) {
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,8 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyHostHTTP;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyHostHTTPS;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyHostSocks;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyPortHTTP;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyPortHTTPS;
|
||||
import static ru.vtosters.lite.utils.Prefs.proxyPortSocks;
|
||||
import static java.lang.System.*;
|
||||
import static ru.vtosters.lite.utils.Globals.*;
|
||||
import static ru.vtosters.lite.utils.Preferences.*;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -44,32 +40,32 @@ public class Proxy {
|
||||
}
|
||||
|
||||
public static String getApiCom() {
|
||||
String string = GetPreferences().getString("proxyapi", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
String string = getPreferences().getString("proxyapi", "");
|
||||
if (!proxy() & string.isEmpty()) {
|
||||
return "api.vk.com";
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static String getAwayPhpCom() {
|
||||
String string = GetPreferences().getString("proxyapi", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
String string = getPreferences().getString("proxyapi", "");
|
||||
if (!proxy() & string.isEmpty()) {
|
||||
return "m.vk.com";
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static String getOauthCom() {
|
||||
String string = GetPreferences().getString("proxyoauth", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
String string = getPreferences().getString("proxyoauth", "");
|
||||
if (!proxy() & string.isEmpty()) {
|
||||
return "oauth.vk.com";
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
public static String getStaticCom() {
|
||||
String string = GetPreferences().getString("proxystatic", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
String string = getPreferences().getString("proxystatic", "");
|
||||
if (!proxy() & string.isEmpty()) {
|
||||
return "static.vk.com";
|
||||
}
|
||||
return string;
|
||||
@@ -77,75 +73,145 @@ public class Proxy {
|
||||
|
||||
public static String staticFix(String str) {
|
||||
String str2;
|
||||
String string = GetPreferences().getString("proxystatic", "");
|
||||
if (!Prefs.proxy() & string.isEmpty()) {
|
||||
String string = getPreferences().getString("proxystatic", "");
|
||||
if (!proxy() & string.isEmpty()) {
|
||||
return str;
|
||||
}
|
||||
str2 = string;
|
||||
return str.replace(str2, "static.vk.com");
|
||||
}
|
||||
|
||||
public static String GetConnector(String str) {
|
||||
if (!Prefs.proxy()) {
|
||||
return str;
|
||||
}
|
||||
if (str.startsWith("https://")) {
|
||||
String replace = str.replace("https://", "");
|
||||
return "https://" + getApiCom() + "/_/" + replace;
|
||||
} else if (str.startsWith("http://")) {
|
||||
String replace2 = str.replace("http://", "");
|
||||
return "http://" + getApiCom() + "/_/" + replace2;
|
||||
} else {
|
||||
return getApiCom() + "/_/" + str;
|
||||
public static void setProxy() {
|
||||
Properties properties = getProperties();
|
||||
switch (getPreferences().getString("proxy", "")) {
|
||||
case "zaborona":
|
||||
properties.setProperty("socksProxyHost", "socks.zaboronahelp.pp.ua");
|
||||
properties.setProperty("socksProxyPort", "1488");
|
||||
resetProxySocks();
|
||||
break;
|
||||
case "socks":
|
||||
properties.setProperty("socksProxyHost", proxyHostSocks());
|
||||
properties.setProperty("socksProxyPort", proxyPortSocks());
|
||||
resetProxySocks();
|
||||
break;
|
||||
case "http":
|
||||
properties.setProperty("http.proxyHost", proxyHostHTTP());
|
||||
properties.setProperty("http.proxyPort", proxyPortHTTP());
|
||||
properties.setProperty("http.proxyUser", proxyUserHTTP());
|
||||
properties.setProperty("http.proxyPassword", proxyPassHTTP());
|
||||
resetProxyHttp();
|
||||
break;
|
||||
case "https":
|
||||
properties.setProperty("https.proxyHost", proxyHostHTTPS());
|
||||
properties.setProperty("https.proxyPort", proxyPortHTTPS());
|
||||
properties.setProperty("https.proxyUser", proxyUserHTTPS());
|
||||
properties.setProperty("https.proxyPassword", proxyPassHTTPS());
|
||||
resetProxyHttps();
|
||||
break;
|
||||
default:
|
||||
resetProxy();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setProxy() {
|
||||
switch (GetPreferences().getString("proxy", "")) {
|
||||
case "zaborona":
|
||||
Properties properties = System.getProperties();
|
||||
properties.setProperty("socksProxyHost", "socks.zaboronahelp.pp.ua");
|
||||
properties.setProperty("socksProxyPort", "1488");
|
||||
System.clearProperty("https.proxyHost");
|
||||
System.clearProperty("https.proxyPort");
|
||||
System.clearProperty("http.proxyHost");
|
||||
System.clearProperty("http.proxyPort");
|
||||
break;
|
||||
case "socks":
|
||||
Properties properties2 = System.getProperties();
|
||||
properties2.setProperty("socksProxyHost", proxyHostSocks());
|
||||
properties2.setProperty("socksProxyPort", proxyPortSocks());
|
||||
System.clearProperty("https.proxyHost");
|
||||
System.clearProperty("https.proxyPort");
|
||||
System.clearProperty("http.proxyHost");
|
||||
System.clearProperty("http.proxyPort");
|
||||
break;
|
||||
case "http":
|
||||
Properties properties3 = System.getProperties();
|
||||
properties3.setProperty("http.proxyHost", proxyHostHTTP());
|
||||
properties3.setProperty("http.proxyPort", proxyPortHTTP());
|
||||
System.clearProperty("socksProxyHost");
|
||||
System.clearProperty("socksPortHost");
|
||||
System.clearProperty("https.proxyHost");
|
||||
System.clearProperty("https.proxyPort");
|
||||
break;
|
||||
case "https":
|
||||
Properties properties4 = System.getProperties();
|
||||
properties4.setProperty("https.proxyHost", proxyHostHTTPS());
|
||||
properties4.setProperty("https.proxyPort", proxyPortHTTPS());
|
||||
System.clearProperty("socksProxyHost");
|
||||
System.clearProperty("socksPortHost");
|
||||
System.clearProperty("http.proxyHost");
|
||||
System.clearProperty("http.proxyPort");
|
||||
break;
|
||||
default:
|
||||
System.clearProperty("socksProxyHost");
|
||||
System.clearProperty("socksPortHost");
|
||||
System.clearProperty("https.proxyHost");
|
||||
System.clearProperty("https.proxyPort");
|
||||
System.clearProperty("http.proxyHost");
|
||||
System.clearProperty("http.proxyPort");
|
||||
break;
|
||||
}
|
||||
public static void resetProxy() {
|
||||
clearProperty("https.proxyHost");
|
||||
clearProperty("https.proxyPort");
|
||||
clearProperty("https.proxyUser");
|
||||
clearProperty("https.proxyPassword");
|
||||
clearProperty("http.proxyHost");
|
||||
clearProperty("http.proxyPort");
|
||||
clearProperty("http.proxyUser");
|
||||
clearProperty("http.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
|
||||
public static void resetProxySocks() {
|
||||
clearProperty("https.proxyHost");
|
||||
clearProperty("https.proxyPort");
|
||||
clearProperty("https.proxyUser");
|
||||
clearProperty("https.proxyPassword");
|
||||
clearProperty("http.proxyHost");
|
||||
clearProperty("http.proxyPort");
|
||||
clearProperty("http.proxyUser");
|
||||
clearProperty("http.proxyPassword");
|
||||
}
|
||||
|
||||
public static void resetProxyHttp() {
|
||||
clearProperty("https.proxyHost");
|
||||
clearProperty("https.proxyPort");
|
||||
clearProperty("https.proxyUser");
|
||||
clearProperty("https.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
|
||||
public static void resetProxyHttps() {
|
||||
clearProperty("http.proxyHost");
|
||||
clearProperty("http.proxyPort");
|
||||
clearProperty("http.proxyUser");
|
||||
clearProperty("http.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
|
||||
public static String proxyHostHTTP() {
|
||||
String string = getPreferences().getString("proxyHostHTTP", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostHTTPS() {
|
||||
String string = getPreferences().getString("proxyHostHTTPS", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyHostSocks() {
|
||||
String string = getPreferences().getString("proxyHostSocks", "");
|
||||
return string.isEmpty() ? "192.168.0.1" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTP() {
|
||||
String string = getPreferences().getString("proxyPortHTTP", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortHTTPS() {
|
||||
String string = getPreferences().getString("proxyPortHTTPS", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyPortSocks() {
|
||||
String string = getPreferences().getString("proxyPortSocks", "");
|
||||
return string.isEmpty() ? "8888" : string;
|
||||
}
|
||||
|
||||
public static String proxyUserHTTP() {
|
||||
String string = getPreferences().getString("proxyUserHTTP", "");
|
||||
return string.isEmpty() ? "" : string;
|
||||
}
|
||||
|
||||
public static String proxyUserHTTPS() {
|
||||
String string = getPreferences().getString("proxyUserHTTPS", "");
|
||||
return string.isEmpty() ? "" : string;
|
||||
}
|
||||
|
||||
public static String proxyPassHTTP() {
|
||||
String string = getPreferences().getString("proxyPassHTTP", "");
|
||||
return string.isEmpty() ? "" : string;
|
||||
}
|
||||
|
||||
public static String proxyPassHTTPS() {
|
||||
String string = getPreferences().getString("proxyPassHTTPS", "");
|
||||
return string.isEmpty() ? "" : string;
|
||||
}
|
||||
|
||||
public static boolean proxy() {
|
||||
return getPreferences().getString("proxy", "").equals("apiproxy");
|
||||
}
|
||||
|
||||
// Official vk proxy enforcer
|
||||
public static boolean proxyvk() {
|
||||
return BooleanFalse("proxyvk");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.About.getBuildNumber;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserSecret;
|
||||
import static ru.vtosters.lite.utils.Globals.getUserToken;
|
||||
import static ru.vtosters.lite.utils.Preferences.dev;
|
||||
import static ru.vtosters.lite.utils.Preferences.getLocale;
|
||||
import static ru.vtosters.lite.utils.Preferences.vksans;
|
||||
import static ru.vtosters.lite.utils.Proxy.proxy;
|
||||
|
||||
import com.vk.core.ui.themes.VKThemeHelper;
|
||||
|
||||
public class SSFS {
|
||||
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();
|
||||
}
|
||||
|
||||
public static String SSFSDomain() {
|
||||
String string = getPreferences().getString("ssfscustom", "");
|
||||
if (!string.isEmpty()) {
|
||||
return string;
|
||||
}
|
||||
return "https://vtsf.vknext.net";
|
||||
}
|
||||
|
||||
public static String getDarkVKUI() {
|
||||
return !VKThemeHelper.d() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getAmoledVKUI() {
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
return string.equals("amoled") ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String getUserProxy() {
|
||||
return proxy() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String isVKSansEnabled() {
|
||||
return vksans() ? "1" : "0";
|
||||
}
|
||||
|
||||
public static String isDEVModEnabled() {
|
||||
return dev() ? "1" : "0";
|
||||
}
|
||||
}
|
||||
@@ -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.Globals.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,12 +1,18 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Preferences.color_grishka;
|
||||
import static ru.vtosters.lite.utils.Preferences.isBGStickersEnabled;
|
||||
import static ru.vtosters.lite.utils.Preferences.navbar;
|
||||
import static ru.vtosters.lite.utils.Preferences.vksans;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.support.v7.widget.Toolbar;
|
||||
import android.view.Window;
|
||||
import android.widget.ImageButton;
|
||||
|
||||
import com.vk.core.d.RecoloredDrawable;
|
||||
@@ -37,53 +43,47 @@ 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", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DARK;
|
||||
switch (getPreferences().getString("darktheme", "")) {
|
||||
case "amoled":
|
||||
return VKTheme.AMOLED;
|
||||
default:
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
if (string.equals("amoled")) {
|
||||
return VKTheme.AMOLED;
|
||||
}
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
|
||||
public static ImTheme getImDarkTheme() {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_DARK;
|
||||
switch (getPreferences().getString("darktheme", "")) {
|
||||
case "amoled":
|
||||
return ImTheme.VKAPP_AMOLED;
|
||||
default:
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
if (string.equals("amoled")) {
|
||||
return ImTheme.VKAPP_AMOLED;
|
||||
}
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
|
||||
public static VKTheme getLightTheme() {
|
||||
String string = GetPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
switch (getPreferences().getString("lighttheme", "")) {
|
||||
default:
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
|
||||
public static ImTheme getImLightTheme() {
|
||||
String string = GetPreferences().getString("lighttheme", "");
|
||||
if (string.isEmpty()) {
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
switch (getPreferences().getString("lighttheme", "")) {
|
||||
default:
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
|
||||
public static int getColorFromAttr(int attr) {
|
||||
@@ -95,15 +95,7 @@ public class Themes {
|
||||
}
|
||||
|
||||
public static boolean isAndroidMonet() {
|
||||
if (color_grishka()) {
|
||||
return Build.VERSION.SDK_INT >= 31;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean color_grishka() {
|
||||
return ru.vtosters.lite.utils.Prefs.BooleanTrue("color_grishka");
|
||||
return color_grishka() && Build.VERSION.SDK_INT >= 31;
|
||||
}
|
||||
|
||||
public static boolean isColorRefAccented(int i) {
|
||||
@@ -117,18 +109,6 @@ public class Themes {
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean vkim_msg() {
|
||||
return ru.vtosters.lite.utils.Prefs.BooleanFalse("vkim_msg");
|
||||
}
|
||||
|
||||
public static boolean amoled() {
|
||||
return ru.vtosters.lite.utils.Prefs.BooleanFalse("amoled");
|
||||
}
|
||||
|
||||
public static boolean vkme_msg() {
|
||||
return ru.vtosters.lite.utils.Prefs.BooleanFalse("vkme_msg");
|
||||
}
|
||||
|
||||
public static Drawable recolorDrawable(Drawable drawable) {
|
||||
if (drawable == null) {
|
||||
return null;
|
||||
@@ -164,10 +144,54 @@ public class Themes {
|
||||
if (isColorRefAccented(i) && isAndroidMonet()) {
|
||||
return getAccentColor();
|
||||
}
|
||||
return GetContext().getResources().getColor(i);
|
||||
return getContext().getResources().getColor(i);
|
||||
}
|
||||
|
||||
public static void setNavbarColor(Window window, int i) {
|
||||
if (navbar() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
|
||||
window.setNavigationBarColor(getNavbarColor());
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
public static int getNavbarColor() {
|
||||
return VKThemeHelper.a(R.attr.tabbar_background);
|
||||
}
|
||||
|
||||
public static String getBackgroundStickers() {
|
||||
if (isBGStickersEnabled()) {
|
||||
return "images_with_background";
|
||||
}
|
||||
return "images";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Helper.*;
|
||||
import static ru.vtosters.lite.utils.Themes.*;
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPreferences;
|
||||
import static ru.vtosters.lite.utils.Themes.getColorFromAttr;
|
||||
import static ru.vtosters.lite.utils.Themes.hex;
|
||||
|
||||
import android.util.Base64;
|
||||
import android.webkit.WebView;
|
||||
@@ -27,7 +29,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,8 +66,8 @@ public class VKUIInjector {
|
||||
}
|
||||
|
||||
public static void inject(WebView webView) {
|
||||
String string = GetPreferences().getString("darktheme", "");
|
||||
if (Prefs.BooleanTrue("VKUI_INJ")) {
|
||||
String string = getPreferences().getString("darktheme", "");
|
||||
if (Preferences.BooleanTrue("VKUI_INJ")) {
|
||||
if (!isLoaded) {
|
||||
load();
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ buildscript {
|
||||
mavenCentral()
|
||||
}
|
||||
dependencies {
|
||||
classpath 'com.android.tools.build:gradle:7.2.0-rc01'
|
||||
classpath 'com.android.tools.build:gradle:7.2.0-rc02'
|
||||
|
||||
// NOTE: Do not place your application dependencies here; they belong
|
||||
// in the individual module build.gradle files
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
#!/bin/bash
|
||||
echo -e "${BOLD}${UNDERLINE}Сборка dex..${NC}\n"
|
||||
|
||||
gradle versionFile
|
||||
gradle assembleDebug
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}${UNDERLINE}Экспорт dex..${NC}"
|
||||
gradle exportDex
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}${UNDERLINE}Перенос dex6 в папку с исходным кодом..${NC}"
|
||||
mv app/classes6.dex smali/
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}${UNDERLINE}Перенос dex8 в папку с исходным кодом..${NC}"
|
||||
mv app/classes8.dex smali/
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}${UNDERLINE}Перенос version.properties в папку с исходным кодом..${NC}"
|
||||
mv app/version.properties smali/assets/
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
fi
|
||||
|
||||
echo -e "${BOLD}${UNDERLINE}Сборка apk..${NC}"
|
||||
java -jar scripts/apktool.jar b smali -o smali/VTLite.apk --use-aapt2 -p scripts/framework/
|
||||
if [ $? -eq 0 ]; then
|
||||
echo -e "${GREEN}Успех!${NC}\n"
|
||||
else
|
||||
echo -e "${RED}Провал.${NC}\n"
|
||||
exit 1
|
||||
fi
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple android:color="@color/picker_blue_pressed"
|
||||
<ripple android:color="?accent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple android:color="@color/picker_blue_pressed"
|
||||
<ripple android:color="?accent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<selector>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<ripple android:color="@color/picker_blue_pressed"
|
||||
<ripple android:color="?accent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item>
|
||||
<shape android:shape="rectangle">
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<solid android:color="@color/picker_blue_pressed" />
|
||||
<solid android:color="?accent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<selector xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="oval">
|
||||
<solid android:color="@color/picker_blue_pressed" />
|
||||
<solid android:color="?accent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<item android:state_pressed="true">
|
||||
<shape android:shape="rectangle">
|
||||
<corners android:radius="10000.0dip" />
|
||||
<solid android:color="@color/picker_blue_pressed" />
|
||||
<solid android:color="?accent" />
|
||||
</shape>
|
||||
</item>
|
||||
<item>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<FrameLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@id/toolbar"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?header_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?actionBarSize"
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginLeft="4.0dip"
|
||||
android:src="@drawable/ic_back_24"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
android:contentDescription="@string/music_talkback_go_back"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginRight="4.0dip"
|
||||
android:src="@drawable/ic_menu_search"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="16.0dip"
|
||||
android:textColor="?text_primary"
|
||||
android:textColor="?header_text"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/title"
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0dip"
|
||||
android:textColor="?text_secondary"
|
||||
android:textColor="?header_text_secondary"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/subtitle"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout android:background="#fffafbfc"
|
||||
<FrameLayout android:background="?tabbar_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
<com.vk.im.ui.views.span.SpanPressableTextView
|
||||
android:textSize="14.0sp"
|
||||
android:textColor="#ff71757a"
|
||||
android:textColor="?text_primary"
|
||||
android:ellipsize="end"
|
||||
android:gravity="center_vertical"
|
||||
android:layout_gravity="center_vertical"
|
||||
@@ -56,13 +56,13 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:src="@drawable/ic_cancel_24"
|
||||
android:scaleType="centerInside"
|
||||
android:tint="@color/light_gray"
|
||||
android:tint="?text_primary"
|
||||
android:contentDescription="@null" />
|
||||
</LinearLayout>
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0sp"
|
||||
android:textColor="#ff71757a"
|
||||
android:textColor="?text_primary"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="start|center"
|
||||
android:id="@id/loading"
|
||||
@@ -77,7 +77,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0sp"
|
||||
android:textColor="#ff71757a"
|
||||
android:textColor="?text_primary"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="start|center"
|
||||
android:id="@id/error"
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
<com.vtosters.lite.ui.LinkedTextView
|
||||
android:textSize="16.0dip"
|
||||
android:textColor="#ff999999"
|
||||
android:textColor="?text_primary"
|
||||
android:gravity="center"
|
||||
android:id="@id/empty_text"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/content_wrap"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:paddingTop="219.0dip"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<android.support.design.widget.AppBarLayout
|
||||
android:background="?header_alternate_background"
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="?actionBarSize"
|
||||
style="@style/VKAppBar">
|
||||
|
||||
@@ -7,12 +7,13 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/content_wrap"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.vk.sharing.view.SharingActionsView android:orientation="horizontal"
|
||||
android:id="@id/sharing_actions_container"
|
||||
android:background="@color/pale_grey"
|
||||
android:background="?tabbar_background"
|
||||
android:paddingLeft="4.0dip"
|
||||
android:paddingTop="8.0dip"
|
||||
android:paddingRight="4.0dip"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<FrameLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@id/toolbar"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?header_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?actionBarSize"
|
||||
@@ -17,7 +17,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginLeft="4.0dip"
|
||||
android:src="@drawable/ic_back_24"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
android:contentDescription="@string/music_talkback_go_back"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginRight="4.0dip"
|
||||
android:src="@drawable/ic_menu_search"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
<LinearLayout
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="16.0dip"
|
||||
android:textColor="?text_primary"
|
||||
android:textColor="?header_text"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/title"
|
||||
@@ -54,7 +54,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0dip"
|
||||
android:textColor="?text_secondary"
|
||||
android:textColor="?header_text_secondary"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/subtitle"
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<FrameLayout
|
||||
android:orientation="horizontal"
|
||||
android:id="@id/toolbar"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?header_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:minHeight="?actionBarSize"
|
||||
@@ -18,7 +18,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginLeft="4.0dip"
|
||||
android:src="@drawable/ic_back_24"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
android:contentDescription="@string/music_talkback_go_back"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
android:layout_height="48.0dip"
|
||||
android:layout_marginRight="4.0dip"
|
||||
android:src="@drawable/ic_menu_search"
|
||||
android:tint="?accent"
|
||||
android:tint="?header_text"
|
||||
style="@style/ActionButton.White" />
|
||||
|
||||
<com.vk.imageloader.view.VKCircleImageView
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="16.0dip"
|
||||
android:textColor="?text_primary"
|
||||
android:textColor="?header_text"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/title"
|
||||
@@ -64,7 +64,7 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0dip"
|
||||
android:textColor="?text_secondary"
|
||||
android:textColor="?header_text_secondary"
|
||||
android:ellipsize="end"
|
||||
android:layout_gravity="center_vertical"
|
||||
android:id="@id/subtitle"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<com.vk.attachpicker.widget.TopShadowLinearLayout android:orientation="vertical"
|
||||
android:background="?tabbar_background"
|
||||
android:background="#ffffffff"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
@@ -43,7 +43,7 @@
|
||||
android:gravity="center"
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@id/tv_bottom_panel_cancel"
|
||||
android:background="?tabbar_background"
|
||||
android:background="@drawable/picker_btn_white"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="@dimen/picker_viewer_bottom_padding"
|
||||
android:text="@string/picker_cancel"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<LinearLayout android:orientation="horizontal"
|
||||
android:id="@id/picker_attach_gallery_camera_layout"
|
||||
android:background="?tabbar_background"
|
||||
android:background="#ffffffff"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="56.0dip"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/content_wrap"
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<com.vk.attachpicker.widget.GraffitiRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -23,6 +23,7 @@
|
||||
<com.vk.imageloader.view.VKImageView
|
||||
android:id="@id/iv_preview"
|
||||
android:background="@drawable/picker_bg_graffiti_preview_top"
|
||||
android:backgroundTint="?background_content"
|
||||
android:paddingLeft="32.0dip"
|
||||
android:paddingTop="32.0dip"
|
||||
android:paddingRight="32.0dip"
|
||||
@@ -34,10 +35,11 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="14.0sp"
|
||||
android:textColor="#ffffffff"
|
||||
android:textColor="?header_text"
|
||||
android:gravity="center"
|
||||
android:id="@id/tv_send_button"
|
||||
android:background="@drawable/picker_bg_graffiti_preview_bottom"
|
||||
android:backgroundTint="?accent"
|
||||
android:paddingLeft="24.0dip"
|
||||
android:paddingRight="24.0dip"
|
||||
android:paddingBottom="24.0dip"
|
||||
|
||||
@@ -6,12 +6,13 @@
|
||||
|
||||
<FrameLayout
|
||||
android:id="@id/content_wrap"
|
||||
android:background="?tabbar_background"
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent">
|
||||
|
||||
<me.grishka.appkit.views.UsableRecyclerView
|
||||
android:id="@id/list"
|
||||
android:background="?background_content"
|
||||
android:scrollbars="vertical"
|
||||
android:clipToPadding="false"
|
||||
android:layout_width="fill_parent"
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ScrollView
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fillViewport="true">
|
||||
|
||||
<com.vtosters.lite.ui.ConstrainedLinearLayout
|
||||
android:background="?background_content"
|
||||
android:gravity="center_horizontal"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:orientation="vertical"
|
||||
@@ -103,11 +105,11 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="16.0sp"
|
||||
android:textColor="#ffffffff"
|
||||
android:textColor="?header_text"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@id/tv_apply_params"
|
||||
android:background="@drawable/picker_btn_blue"
|
||||
android:background="?tabbar_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="48.0dip"
|
||||
android:text="@string/discover_search_show_result"
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto">
|
||||
|
||||
<ScrollView
|
||||
android:background="?background_content"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="fill_parent"
|
||||
android:fillViewport="true">
|
||||
@@ -15,6 +16,7 @@
|
||||
android:paddingRight="@dimen/standard_list_item_padding"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:background="?background_content"
|
||||
app:max_width="400.0dip">
|
||||
|
||||
<include layout="@layout/discover_search_header" />
|
||||
@@ -147,11 +149,11 @@
|
||||
|
||||
<TextView
|
||||
android:textSize="16.0sp"
|
||||
android:textColor="#ffffffff"
|
||||
android:textColor="?header_text"
|
||||
android:gravity="center"
|
||||
android:layout_gravity="bottom"
|
||||
android:id="@id/tv_apply_params"
|
||||
android:background="@drawable/picker_btn_blue"
|
||||
android:background="?tabbar_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="48.0dip"
|
||||
android:text="@string/discover_search_show_result"
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
app:tabBackground="@drawable/highlight"
|
||||
app:tabPaddingLeftRight="12.0dip"
|
||||
app:textAllCaps="true"
|
||||
app:underlineColor="#ffd8d8d8"
|
||||
app:underlineColor="?background_content"
|
||||
app:underlineHeight="0.5dip" />
|
||||
</FrameLayout>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<FrameLayout android:background="#fffafbfc"
|
||||
<FrameLayout android:background="?tabbar_background"
|
||||
android:layout_width="fill_parent"
|
||||
android:layout_height="wrap_content"
|
||||
xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
@@ -64,7 +64,7 @@
|
||||
android:layout_marginTop="4.0dip"
|
||||
android:src="@drawable/ic_cancel_24"
|
||||
android:scaleType="centerInside"
|
||||
android:tint="@color/light_gray"
|
||||
android:tint="?text_primary"
|
||||
android:contentDescription="@null" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
@@ -495,4 +495,14 @@
|
||||
<item>От Новых к Старым</item>
|
||||
<item>От Старых к Новым</item>
|
||||
</string-array>
|
||||
<string-array name="newsupdate_value">
|
||||
<item>По умолчанию</item>
|
||||
<item>Не обновлять</item>
|
||||
<item>Обновлять мгновенно</item>
|
||||
</string-array>
|
||||
<string-array name="undel_value">
|
||||
<item>[Удалено]</item>
|
||||
<item>🗑</item>
|
||||
<item>❌</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
+500
-28
@@ -147,7 +147,7 @@
|
||||
<item name="landing_text_secondary">@color/white_alpha60</item>
|
||||
<item name="landing_text_title">@color/white</item>
|
||||
<item name="like_text_tint">@color/red_light</item>
|
||||
<item name="link_alternate">@android:color/system_neutral1_50</item>
|
||||
<item name="link_alternate">?accent</item>
|
||||
<item name="loader_background">@android:color/system_neutral1_900</item>
|
||||
<item name="loader_tint">@android:color/system_neutral2_200</item>
|
||||
<item name="loader_track_fill">@color/gray_700</item>
|
||||
@@ -287,7 +287,7 @@
|
||||
<item name="header_alternate_tab_active_text">@android:color/system_accent1_600</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_400</item>
|
||||
<item name="header_background">?background_page</item>
|
||||
<item name="header_background_before_blur">@color/blue_A400</item>
|
||||
<item name="header_background_before_blur">?accent</item>
|
||||
<item name="header_background_before_blur_alternate">@color/white</item>
|
||||
<item name="header_search_field_background">@android:color/system_accent1_400</item>
|
||||
<item name="header_search_field_tint">@android:color/system_accent1_700</item>
|
||||
@@ -343,7 +343,7 @@
|
||||
<item name="landing_text_secondary">@color/white_alpha60</item>
|
||||
<item name="landing_text_title">@color/white</item>
|
||||
<item name="like_text_tint">@color/red_nice</item>
|
||||
<item name="link_alternate">@android:color/system_accent1_900</item>
|
||||
<item name="link_alternate">?accent</item>
|
||||
<item name="loader_background">@color/gray_50</item>
|
||||
<item name="loader_tint">@color/gray_500</item>
|
||||
<item name="loader_track_fill">@color/gray_100</item>
|
||||
@@ -441,7 +441,7 @@
|
||||
<item name="button_primary_foreground_disabled">#66ffffff</item>
|
||||
<item name="button_secondary_background">@color/black_blue45_alpha10</item>
|
||||
<item name="button_secondary_background_disabled">#0a003973</item>
|
||||
<item name="button_secondary_foreground">@color/blue_600</item>
|
||||
<item name="button_secondary_foreground">?accent</item>
|
||||
<item name="button_secondary_foreground_disabled">#6645678f</item>
|
||||
<item name="button_tertiary_background">@color/clear</item>
|
||||
<item name="button_tertiary_background_disabled">#66000000</item>
|
||||
@@ -482,7 +482,7 @@
|
||||
<item name="header_alternate_tab_active_text">?accent</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_400</item>
|
||||
<item name="header_background">?background_page</item>
|
||||
<item name="header_background_before_blur">@color/blue_A400</item>
|
||||
<item name="header_background_before_blur">?accent</item>
|
||||
<item name="header_background_before_blur_alternate">@color/white</item>
|
||||
<item name="header_search_field_background">@android:color/system_accent1_400</item>
|
||||
<item name="header_search_field_tint">@android:color/system_accent1_700</item>
|
||||
@@ -539,7 +539,7 @@
|
||||
<item name="im_bubble_border_alternate_highlighted">@color/gray_A150</item>
|
||||
<item name="im_bubble_button_background">@color/black_blue45_alpha10</item>
|
||||
<item name="im_bubble_button_background_disabled">#0a003973</item>
|
||||
<item name="im_bubble_button_foreground">@color/blue_600</item>
|
||||
<item name="im_bubble_button_foreground">?accent</item>
|
||||
<item name="im_bubble_button_foreground_disabled">#6645678f</item>
|
||||
<item name="im_bubble_gift_background">@color/gold_200</item>
|
||||
<item name="im_bubble_gift_text">@color/gold_500</item>
|
||||
@@ -560,7 +560,7 @@
|
||||
<item name="im_conversation_unread_counter_foreground">@color/white</item>
|
||||
<item name="im_conversation_unread_counter_muted_background">#ffa9b0b8</item>
|
||||
<item name="im_conversation_verified_icon">#ff67a5eb</item>
|
||||
<item name="im_forward_line_tint">@color/blue_600</item>
|
||||
<item name="im_forward_line_tint">?accent</item>
|
||||
<item name="im_history_common_badge_background">#66000000</item>
|
||||
<item name="im_history_common_badge_foreground">@color/white</item>
|
||||
<item name="im_history_divider_background">@color/white</item>
|
||||
@@ -651,7 +651,7 @@
|
||||
<item name="placeholder_icon_foreground_primary">@color/steel_gray_300</item>
|
||||
<item name="placeholder_icon_foreground_secondary">@color/steel_gray_200</item>
|
||||
<item name="placeholder_icon_tint">@color/black_blue24</item>
|
||||
<item name="poll_option_background">@color/blue_600</item>
|
||||
<item name="poll_option_background">?accent</item>
|
||||
<item name="search_bar_background">?text_secondary</item>
|
||||
<item name="search_bar_field_background">?background_page</item>
|
||||
<item name="search_bar_field_tint">@color/steel_gray_300</item>
|
||||
@@ -673,7 +673,7 @@
|
||||
<item name="tabbar_background">?background_page</item>
|
||||
<item name="tabbar_inactive_icon">@color/steel_gray_300</item>
|
||||
<item name="text_action_counter">@color/steel_gray_400</item>
|
||||
<item name="text_link">@color/blue_A500</item>
|
||||
<item name="text_link">?accent</item>
|
||||
<item name="text_link_hightlighted_background">@color/black</item>
|
||||
<item name="text_muted">?text_secondary</item>
|
||||
<item name="text_name">?text_primary</item>
|
||||
@@ -792,10 +792,10 @@
|
||||
<item name="im_app_background_navbar">@color/black</item>
|
||||
<item name="im_app_background_navbar_light">false</item>
|
||||
<item name="im_app_background_secondary">#ffebedf0</item>
|
||||
<item name="im_app_background_statusbar">@color/muted_blue</item>
|
||||
<item name="im_app_background_statusbar">?accent</item>
|
||||
<item name="im_app_background_statusbar_light">false</item>
|
||||
<item name="im_app_background_tabbar">#fffafafa</item>
|
||||
<item name="im_app_icon">@color/im_old_accent</item>
|
||||
<item name="im_app_icon">?accent</item>
|
||||
<item name="im_app_icon_destructive">@color/red</item>
|
||||
<item name="im_app_icon_inv">@color/white</item>
|
||||
<item name="im_app_icon_secondary">@color/im_old_blue_gray_light</item>
|
||||
@@ -807,12 +807,12 @@
|
||||
<item name="im_app_toolbar_foreground_semitransparent">#80ffffff</item>
|
||||
<item name="im_app_toolbar_foreground_start">@color/white</item>
|
||||
<item name="im_app_toolbar_tabs_indicator">@color/white</item>
|
||||
<item name="im_attach_tint">@color/sky_300</item>
|
||||
<item name="im_attach_tint">?accent</item>
|
||||
<item name="im_btn_accept_background">@color/black</item>
|
||||
<item name="im_btn_accept_background_dark">@color/black</item>
|
||||
<item name="im_btn_accept_foreground">@color/white</item>
|
||||
<item name="im_btn_confirm">@drawable/vkim_btn_confirm_default</item>
|
||||
<item name="im_btn_confirm_background">@color/blue_300</item>
|
||||
<item name="im_btn_confirm_background">?accent</item>
|
||||
<item name="im_btn_confirm_background_dark">@android:color/system_neutral1_50</item>
|
||||
<item name="im_btn_confirm_background_disabled">@android:color/system_accent1_400</item>
|
||||
<item name="im_btn_reject_background">@color/black</item>
|
||||
@@ -839,7 +839,7 @@
|
||||
</item>
|
||||
<item name="im_bubble_outgoing_highlighted">@android:color/system_accent1_800</item>
|
||||
<item name="im_conversation_error_icon">@color/red_error</item>
|
||||
<item name="im_conversation_sending_icon">@color/im_old_accent</item>
|
||||
<item name="im_conversation_sending_icon">?accent</item>
|
||||
<item name="im_conversation_unread_counter_background">@android:color/system_neutral1_50
|
||||
</item>
|
||||
<item name="im_conversation_unread_counter_foreground">@color/white</item>
|
||||
@@ -852,44 +852,44 @@
|
||||
<item name="im_history_divider_foreground">@color/im_old_blue_gray_medium</item>
|
||||
<item name="im_history_divider_separator">#1e000000</item>
|
||||
<item name="im_history_image_bubbleless_border">#1e000000</item>
|
||||
<item name="im_history_incoming_attachment_icon">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_incoming_attachment_icon">?accent</item>
|
||||
<item name="im_history_incoming_background">#ffebeced</item>
|
||||
<item name="im_history_incoming_background_selected">#ffc2c7cc</item>
|
||||
<item name="im_history_incoming_button">@color/im_old_accent</item>
|
||||
<item name="im_history_incoming_button">?accent</item>
|
||||
<item name="im_history_incoming_foreground">@color/black</item>
|
||||
<item name="im_history_incoming_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_incoming_foreground_caption_inv">@color/white</item>
|
||||
<item name="im_history_incoming_foreground_link">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_incoming_foreground_name">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_incoming_foreground_link">?accent</item>
|
||||
<item name="im_history_incoming_foreground_name">?accent</item>
|
||||
<item name="im_history_incoming_image_placeholder_background">#14000c1a</item>
|
||||
<item name="im_history_incoming_snippet_placeholder_background">
|
||||
@color/im_old_accent_muted_14
|
||||
</item>
|
||||
<item name="im_history_incoming_snippet_placeholder_icon">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_incoming_snippet_placeholder_icon">?accent</item>
|
||||
<item name="im_history_info_bar_background">#fffafbfc</item>
|
||||
<item name="im_history_info_bar_border">#26000000</item>
|
||||
<item name="im_history_live_badge_background">#ffff3347</item>
|
||||
<item name="im_history_outgoing_attachment_icon">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_outgoing_attachment_icon">?accent</item>
|
||||
<item name="im_history_outgoing_background">@android:color/system_neutral1_800</item>
|
||||
<item name="im_history_outgoing_background_selected">@android:color/system_accent1_300
|
||||
</item>
|
||||
<item name="im_history_outgoing_button">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_outgoing_button">?accent</item>
|
||||
<item name="im_history_outgoing_foreground">@color/black</item>
|
||||
<item name="im_history_outgoing_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_outgoing_foreground_link">@color/im_old_accent</item>
|
||||
<item name="im_history_outgoing_foreground_name">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_outgoing_foreground_link">?accent</item>
|
||||
<item name="im_history_outgoing_foreground_name">?accent</item>
|
||||
<item name="im_history_outgoing_image_placeholder_background">#14000c1a</item>
|
||||
<item name="im_history_outgoing_snippet_placeholder_background">
|
||||
@color/im_old_accent_muted_14
|
||||
</item>
|
||||
<item name="im_history_outgoing_snippet_placeholder_icon">@color/im_old_accent_muted</item>
|
||||
<item name="im_history_sending_icon">@color/im_old_accent</item>
|
||||
<item name="im_history_outgoing_snippet_placeholder_icon">?accent</item>
|
||||
<item name="im_history_sending_icon">?accent</item>
|
||||
<item name="im_history_sticker_badge_background">#e6ffffff</item>
|
||||
<item name="im_history_sticker_badge_foreground">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_unread_icon">@color/im_old_accent</item>
|
||||
<item name="im_history_unread_icon">?accent</item>
|
||||
<item name="im_is_vk_me">false</item>
|
||||
<item name="im_item_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_item_foreground_name">@color/im_old_accent_muted</item>
|
||||
<item name="im_item_foreground_name">?accent</item>
|
||||
<item name="im_item_foreground_subhead">@color/im_old_gray_dark</item>
|
||||
<item name="im_item_foreground_tertiary">@color/im_old_gray_light</item>
|
||||
<item name="im_menu_foreground">@color/gray_800</item>
|
||||
@@ -912,7 +912,7 @@
|
||||
<item name="landing_text_secondary">@color/white_alpha60</item>
|
||||
<item name="landing_text_title">@color/white</item>
|
||||
<item name="like_text_tint">@color/red_light</item>
|
||||
<item name="link_alternate">@android:color/system_neutral1_50</item>
|
||||
<item name="link_alternate">?accent</item>
|
||||
<item name="loader_background">@android:color/system_neutral1_900</item>
|
||||
<item name="loader_tint">@android:color/system_neutral2_200</item>
|
||||
<item name="loader_track_fill">@color/gray_700</item>
|
||||
@@ -969,4 +969,476 @@
|
||||
<item name="writebar_icon">@android:color/system_neutral2_200</item>
|
||||
<item name="tabbar_fix">?tabbar_background</item>
|
||||
</style>
|
||||
|
||||
<style name="Vk.Theme.client_amoled_generated" parent="@style/Vk.Theme.Dark">
|
||||
<item name="accent">@android:color/system_neutral1_200</item>
|
||||
<item name="action_sheet_action_foreground">@color/white</item>
|
||||
<item name="action_sheet_separator">@color/white_alpha12</item>
|
||||
<item name="activity_indicator_tint">@color/gray_600</item>
|
||||
<item name="attach_picker_tab_active_background">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_active_icon">@color/black</item>
|
||||
<item name="attach_picker_tab_active_text">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_inactive_background">@color/black</item>
|
||||
<item name="attach_picker_tab_inactive_icon">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="background_content">@color/black</item>
|
||||
<item name="background_highlighted">@color/white_alpha12</item>
|
||||
<item name="background_keyboard">@color/black</item>
|
||||
<item name="background_light">@color/black</item>
|
||||
<item name="background_page">@color/black</item>
|
||||
<item name="background_suggestions">@color/black</item>
|
||||
<item name="button_bot_shadow">@color/black</item>
|
||||
<item name="button_bot_shadow_disabled">#6619191a</item>
|
||||
<item name="button_commerce_background">@color/green</item>
|
||||
<item name="button_commerce_background_disabled">#664bb34b</item>
|
||||
<item name="button_commerce_foreground">@color/white</item>
|
||||
<item name="button_commerce_foreground_disabled">#66ffffff</item>
|
||||
<item name="button_muted_background">@color/black</item>
|
||||
<item name="button_muted_background_disabled">#662c2d2e</item>
|
||||
<item name="button_muted_foreground">@color/gray_100</item>
|
||||
<item name="button_muted_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_outline_border">@color/gray_100</item>
|
||||
<item name="button_outline_border_disabled">#66e1e3e6</item>
|
||||
<item name="button_outline_foreground">@color/gray_100</item>
|
||||
<item name="button_outline_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_primary_background">@color/gray_100</item>
|
||||
<item name="button_primary_background_disabled">#66e1e3e6</item>
|
||||
<item name="button_primary_foreground">@color/black</item>
|
||||
<item name="button_primary_foreground_disabled">#6619191a</item>
|
||||
<item name="button_secondary_background">@color/gray_700</item>
|
||||
<item name="button_secondary_background_disabled">#66454647</item>
|
||||
<item name="button_secondary_foreground">@color/gray_100</item>
|
||||
<item name="button_secondary_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_tertiary_background">@color/clear</item>
|
||||
<item name="button_tertiary_background_disabled">#66000000</item>
|
||||
<item name="button_tertiary_foreground">@color/gray_100</item>
|
||||
<item name="button_tertiary_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="cell_button_foreground">@color/gray_100</item>
|
||||
<item name="cell_button_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="content_placeholder_icon">@color/gray_300</item>
|
||||
<item name="content_placeholder_text">@color/gray_300</item>
|
||||
<item name="content_tint_background">@color/black</item>
|
||||
<item name="content_tint_foreground">@color/gray_400</item>
|
||||
<item name="control_background">@color/gray_700</item>
|
||||
<item name="control_foreground">@color/gray_100</item>
|
||||
<item name="control_tint">@color/black</item>
|
||||
<item name="control_tint_muted">@color/gray_400</item>
|
||||
<item name="counter_primary_background">@android:color/system_neutral1_200</item>
|
||||
<item name="counter_primary_text">@color/white</item>
|
||||
<item name="counter_secondary_background">@color/gray_500</item>
|
||||
<item name="counter_secondary_text">@color/black</item>
|
||||
<item name="destructive">@color/red_light</item>
|
||||
<item name="feed_recommended_friend_promo_background">@color/steel_gray_500</item>
|
||||
<item name="field_background">@color/black</item>
|
||||
<item name="field_border">@color/white_alpha12</item>
|
||||
<item name="field_error_background">@color/red_dark</item>
|
||||
<item name="field_error_border">@color/red_light</item>
|
||||
<item name="field_text_placeholder">@color/gray_500</item>
|
||||
<item name="field_valid_border">@color/green</item>
|
||||
<item name="float_button_background">@color/gray_700</item>
|
||||
<item name="float_button_background_disabled">#66454647</item>
|
||||
<item name="float_button_background_highlighted">@color/black</item>
|
||||
<item name="float_button_background_highlighted_disabled">#660a0a0a</item>
|
||||
<item name="float_button_border">@color/black_alpha12</item>
|
||||
<item name="float_button_border_disabled">#0c000000</item>
|
||||
<item name="float_button_foreground">@color/gray_300</item>
|
||||
<item name="float_button_foreground_disabled">#66aaaeb3</item>
|
||||
<item name="header_alternate_background">@color/black</item>
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background_before_blur">@color/gray_950</item>
|
||||
<item name="header_background_before_blur_alternate">@color/gray_950</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
<item name="header_search_field_tint">@color/gray_100</item>
|
||||
<item name="header_tab_active_background">@color/gray_600</item>
|
||||
<item name="header_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_text">@color/gray_100</item>
|
||||
<item name="header_text_alternate">@color/gray_100</item>
|
||||
<item name="header_text_secondary">@color/white_alpha60</item>
|
||||
<item name="header_tint">@color/gray_100</item>
|
||||
<item name="header_tint_alternate">@color/gray_100</item>
|
||||
<item name="icon_alpha_placeholder">@color/gray_100</item>
|
||||
<item name="icon_medium">@color/gray_400</item>
|
||||
<item name="icon_name">@color/gray_300</item>
|
||||
<item name="icon_outline_medium">@color/gray_300</item>
|
||||
<item name="icon_outline_secondary">@color/gray_400</item>
|
||||
<item name="icon_secondary">@color/gray_500</item>
|
||||
<item name="icon_tertiary">@color/gray_700</item>
|
||||
<item name="im_attach_tint">@android:color/system_neutral1_200</item>
|
||||
<item name="im_bubble_border_alternate">@color/clear</item>
|
||||
<item name="im_bubble_border_alternate_highlighted">@color/clear</item>
|
||||
<item name="im_bubble_button_background">@color/black</item>
|
||||
<item name="im_bubble_button_background_disabled">#66313233</item>
|
||||
<item name="im_bubble_button_foreground">@color/gray_100</item>
|
||||
<item name="im_bubble_button_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="im_bubble_gift_background">@color/gold_300</item>
|
||||
<item name="im_bubble_gift_text">@color/gold_100</item>
|
||||
<item name="im_bubble_gift_text_secondary">@color/gold_150</item>
|
||||
<item name="im_bubble_incoming">@color/black</item>
|
||||
<item name="im_bubble_incoming_alternate">@color/black</item>
|
||||
<item name="im_bubble_incoming_alternate_highlighted">@color/gray_600</item>
|
||||
<item name="im_bubble_incoming_highlighted">@color/gray_600</item>
|
||||
<item name="im_bubble_outgoing">@color/gray_700</item>
|
||||
<item name="im_bubble_outgoing_alternate">@color/gray_700</item>
|
||||
<item name="im_bubble_outgoing_alternate_highlighted">@color/gray_500</item>
|
||||
<item name="im_bubble_outgoing_highlighted">@color/gray_600</item>
|
||||
<item name="im_forward_line_tint">@color/white</item>
|
||||
<item name="im_reply_sender_text">@color/white</item>
|
||||
<item name="im_reply_separator">@color/white</item>
|
||||
<item name="im_service_message_text">@color/steel_gray_400</item>
|
||||
<item name="im_toolbar_separator">@color/gray_300</item>
|
||||
<item name="im_toolbar_voice_msg_background">@color/gray_700</item>
|
||||
<item name="image_border">@color/white_alpha8</item>
|
||||
<item name="input_background">@color/gray_700</item>
|
||||
<item name="input_border">@color/gray_700</item>
|
||||
<item name="landing_background">?accent</item>
|
||||
<item name="landing_primary_button_background">@color/white</item>
|
||||
<item name="landing_primary_button_background_disabled">#66ffffff</item>
|
||||
<item name="landing_primary_button_foreground">?accent</item>
|
||||
<item name="landing_primary_button_foreground_disabled">#665181b8</item>
|
||||
<item name="landing_snippet_border">@color/clear</item>
|
||||
<item name="landing_text_secondary">@color/white_alpha60</item>
|
||||
<item name="landing_text_title">@color/white</item>
|
||||
<item name="like_text_tint">@color/red_light</item>
|
||||
<item name="link_alternate">?accent</item>
|
||||
<item name="loader_background">@color/black</item>
|
||||
<item name="loader_tint">@color/gray_500</item>
|
||||
<item name="loader_track_fill">@color/gray_700</item>
|
||||
<item name="loader_track_value_fill">@android:color/system_neutral1_200</item>
|
||||
<item name="media_overlay_button_background">@color/white</item>
|
||||
<item name="media_overlay_button_background_disabled">#66ffffff</item>
|
||||
<item name="media_overlay_button_foreground">@color/black</item>
|
||||
<item name="media_overlay_button_foreground_disabled">#662c2d2e</item>
|
||||
<item name="modal_card_background">@color/black</item>
|
||||
<item name="modal_card_border">@color/white_alpha12</item>
|
||||
<item name="modal_card_header_close">@color/white</item>
|
||||
<item name="music_playback_icon">@color/white</item>
|
||||
<item name="overlay_status_background">@color/black</item>
|
||||
<item name="overlay_status_foreground">@color/gray_100</item>
|
||||
<item name="overlay_status_icon">@color/gray_50</item>
|
||||
<item name="panel_tab_active_background">@color/gray_700</item>
|
||||
<item name="panel_tab_active_text">@color/gray_100</item>
|
||||
<item name="panel_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="placeholder_icon_background">@color/white_alpha8</item>
|
||||
<item name="placeholder_icon_foreground_primary">@color/gray_400</item>
|
||||
<item name="placeholder_icon_foreground_secondary">@color/gray_600</item>
|
||||
<item name="placeholder_icon_tint">@color/white</item>
|
||||
<item name="poll_option_background">@color/white</item>
|
||||
<item name="search_bar_background">@color/black</item>
|
||||
<item name="search_bar_field_background">@color/gray_700</item>
|
||||
<item name="search_bar_field_tint">@color/gray_300</item>
|
||||
<item name="search_bar_segmented_control_tint">@color/gray_400</item>
|
||||
<item name="segmented_control_bar_background">@color/black</item>
|
||||
<item name="segmented_control_tint">@color/gray_500</item>
|
||||
<item name="selection_off_icon">@color/gray_700</item>
|
||||
<item name="separator_alpha">@color/white_alpha15</item>
|
||||
<item name="separator_alternate">@color/black</item>
|
||||
<item name="separator_common">@color/black</item>
|
||||
<item name="snippet_background">@color/black</item>
|
||||
<item name="snippet_border">@color/white_alpha12</item>
|
||||
<item name="snippet_icon_tertiary">@color/gray_600</item>
|
||||
<item name="splashscreen_icon">@color/black</item>
|
||||
<item name="statusbar_alternate_legacy_background">@color/clear</item>
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@android:color/system_neutral1_200</item>
|
||||
<item name="text_link_hightlighted_background">@android:color/system_neutral1_200</item>
|
||||
<item name="text_muted">@color/gray_200</item>
|
||||
<item name="text_name">@color/gray_100</item>
|
||||
<item name="text_placeholder">@color/gray_300</item>
|
||||
<item name="text_primary">@color/gray_100</item>
|
||||
<item name="text_secondary">@color/gray_500</item>
|
||||
<item name="text_subhead">@color/gray_400</item>
|
||||
<item name="text_tertiary">@color/gray_600</item>
|
||||
<item name="toolbar_attach_background_from">@color/gray_500</item>
|
||||
<item name="toolbar_attach_background_to">@color/gray_600</item>
|
||||
<item name="writebar_icon">@color/gray_400</item>
|
||||
<item name="tabbar_fix">?tabbar_background</item>
|
||||
</style>
|
||||
<style name="VkIm.Theme.VkApp.Amoled" parent="@style/VkIm.Theme.VkApp">
|
||||
<item name="accent">@android:color/system_neutral1_200</item>
|
||||
<item name="action_sheet_action_foreground">@color/white</item>
|
||||
<item name="action_sheet_separator">@color/white_alpha12</item>
|
||||
<item name="activity_indicator_tint">@color/gray_600</item>
|
||||
<item name="attach_picker_tab_active_background">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_active_icon">@color/black</item>
|
||||
<item name="attach_picker_tab_active_text">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_inactive_background">@color/black</item>
|
||||
<item name="attach_picker_tab_inactive_icon">@color/gray_100</item>
|
||||
<item name="attach_picker_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="background_content">@color/black</item>
|
||||
<item name="background_highlighted">@color/white_alpha12</item>
|
||||
<item name="background_keyboard">@color/black</item>
|
||||
<item name="background_light">@color/black</item>
|
||||
<item name="background_page">@color/black</item>
|
||||
<item name="background_suggestions">@color/black</item>
|
||||
<item name="button_bot_shadow">@color/black</item>
|
||||
<item name="button_bot_shadow_disabled">#6619191a</item>
|
||||
<item name="button_commerce_background">@color/green</item>
|
||||
<item name="button_commerce_background_disabled">#664bb34b</item>
|
||||
<item name="button_commerce_foreground">@color/white</item>
|
||||
<item name="button_commerce_foreground_disabled">#66ffffff</item>
|
||||
<item name="button_muted_background">@color/black</item>
|
||||
<item name="button_muted_background_disabled">#662c2d2e</item>
|
||||
<item name="button_muted_foreground">@color/gray_100</item>
|
||||
<item name="button_muted_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_outline_border">@color/gray_100</item>
|
||||
<item name="button_outline_border_disabled">#66e1e3e6</item>
|
||||
<item name="button_outline_foreground">@color/gray_100</item>
|
||||
<item name="button_outline_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_primary_background">@color/gray_100</item>
|
||||
<item name="button_primary_background_disabled">#66e1e3e6</item>
|
||||
<item name="button_primary_foreground">@color/black</item>
|
||||
<item name="button_primary_foreground_disabled">#6619191a</item>
|
||||
<item name="button_secondary_background">@color/gray_700</item>
|
||||
<item name="button_secondary_background_disabled">#66454647</item>
|
||||
<item name="button_secondary_foreground">@color/gray_100</item>
|
||||
<item name="button_secondary_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="button_tertiary_background">@color/clear</item>
|
||||
<item name="button_tertiary_background_disabled">#66000000</item>
|
||||
<item name="button_tertiary_foreground">@color/gray_100</item>
|
||||
<item name="button_tertiary_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="cell_button_foreground">@color/gray_100</item>
|
||||
<item name="cell_button_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="content_placeholder_icon">@color/gray_300</item>
|
||||
<item name="content_placeholder_text">@color/gray_300</item>
|
||||
<item name="content_tint_background">@color/black</item>
|
||||
<item name="content_tint_foreground">@color/gray_400</item>
|
||||
<item name="control_background">@color/gray_700</item>
|
||||
<item name="control_foreground">@color/gray_100</item>
|
||||
<item name="control_tint">@color/black</item>
|
||||
<item name="control_tint_muted">@color/gray_400</item>
|
||||
<item name="counter_primary_background">@android:color/system_neutral1_200</item>
|
||||
<item name="counter_primary_text">@color/white</item>
|
||||
<item name="counter_secondary_background">@color/gray_500</item>
|
||||
<item name="counter_secondary_text">@color/black</item>
|
||||
<item name="destructive">@color/red_light</item>
|
||||
<item name="feed_recommended_friend_promo_background">@color/steel_gray_500</item>
|
||||
<item name="field_background">@color/black</item>
|
||||
<item name="field_border">@color/white_alpha12</item>
|
||||
<item name="field_error_background">@color/red_dark</item>
|
||||
<item name="field_error_border">@color/red_light</item>
|
||||
<item name="field_text_placeholder">@color/gray_500</item>
|
||||
<item name="field_valid_border">@color/green</item>
|
||||
<item name="float_button_background">@color/gray_700</item>
|
||||
<item name="float_button_background_disabled">#66454647</item>
|
||||
<item name="float_button_background_highlighted">@color/black</item>
|
||||
<item name="float_button_background_highlighted_disabled">#660a0a0a</item>
|
||||
<item name="float_button_border">@color/black_alpha12</item>
|
||||
<item name="float_button_border_disabled">#0c000000</item>
|
||||
<item name="float_button_foreground">@color/gray_300</item>
|
||||
<item name="float_button_foreground_disabled">#66aaaeb3</item>
|
||||
<item name="header_alternate_background">@color/black</item>
|
||||
<item name="header_alternate_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_alternate_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_background">@color/gray_900</item>
|
||||
<item name="header_background_before_blur">@color/black</item>
|
||||
<item name="header_background_before_blur_alternate">@color/black</item>
|
||||
<item name="header_search_field_background">@color/gray_700</item>
|
||||
<item name="header_search_field_tint">@color/gray_100</item>
|
||||
<item name="header_tab_active_background">@color/gray_600</item>
|
||||
<item name="header_tab_active_indicator">@color/gray_100</item>
|
||||
<item name="header_tab_active_text">@color/gray_100</item>
|
||||
<item name="header_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="header_text">@color/gray_100</item>
|
||||
<item name="header_text_alternate">@color/gray_100</item>
|
||||
<item name="header_text_secondary">@color/white_alpha60</item>
|
||||
<item name="header_tint">@color/gray_100</item>
|
||||
<item name="header_tint_alternate">@color/gray_100</item>
|
||||
<item name="icon_alpha_placeholder">@color/gray_100</item>
|
||||
<item name="icon_medium">@color/gray_400</item>
|
||||
<item name="icon_name">@color/gray_300</item>
|
||||
<item name="icon_outline_medium">@color/gray_300</item>
|
||||
<item name="icon_outline_secondary">@color/gray_400</item>
|
||||
<item name="icon_secondary">@color/gray_500</item>
|
||||
<item name="icon_tertiary">@color/gray_700</item>
|
||||
<item name="im_accent">?accent</item>
|
||||
<item name="im_accent_dark">?accent</item>
|
||||
<item name="im_alert">@color/red</item>
|
||||
<item name="im_app_background_chat">?background_content</item>
|
||||
<item name="im_app_background_navbar">@color/black</item>
|
||||
<item name="im_app_background_navbar_light">false</item>
|
||||
<item name="im_app_background_secondary">#ffebedf0</item>
|
||||
<item name="im_app_background_statusbar">?accent</item>
|
||||
<item name="im_app_background_statusbar_light">false</item>
|
||||
<item name="im_app_background_tabbar">#fffafafa</item>
|
||||
<item name="im_app_icon">?accent</item>
|
||||
<item name="im_app_icon_destructive">@color/red</item>
|
||||
<item name="im_app_icon_inv">@color/white</item>
|
||||
<item name="im_app_icon_secondary">@color/im_old_blue_gray_light</item>
|
||||
<item name="im_app_icon_toolbar">@color/white</item>
|
||||
<item name="im_app_swipe_background_end">#ff4cb8ff</item>
|
||||
<item name="im_app_swipe_background_start">#ff3f7fe0</item>
|
||||
<item name="im_app_toolbar_foreground">@color/white</item>
|
||||
<item name="im_app_toolbar_foreground_end">@color/white</item>
|
||||
<item name="im_app_toolbar_foreground_semitransparent">#80ffffff</item>
|
||||
<item name="im_app_toolbar_foreground_start">@color/white</item>
|
||||
<item name="im_app_toolbar_tabs_indicator">@color/white</item>
|
||||
<item name="im_attach_tint">@android:color/system_neutral1_200</item>
|
||||
<item name="im_btn_accept_background">@color/black</item>
|
||||
<item name="im_btn_accept_background_dark">@color/black</item>
|
||||
<item name="im_btn_accept_foreground">@color/white</item>
|
||||
<item name="im_btn_confirm">@drawable/vkim_btn_confirm_default</item>
|
||||
<item name="im_btn_confirm_background">?accent</item>
|
||||
<item name="im_btn_confirm_background_dark">?accent</item>
|
||||
<item name="im_btn_confirm_background_disabled">@color/blue_200_muted</item>
|
||||
<item name="im_btn_reject_background">@color/black</item>
|
||||
<item name="im_btn_reject_background_dark">@color/black</item>
|
||||
<item name="im_btn_reject_foreground">@color/white</item>
|
||||
<item name="im_bubble_border_alternate">@color/clear</item>
|
||||
<item name="im_bubble_border_alternate_highlighted">@color/clear</item>
|
||||
<item name="im_bubble_button_background">@color/gray_750</item>
|
||||
<item name="im_bubble_button_background_disabled">#66313233</item>
|
||||
<item name="im_bubble_button_foreground">@color/gray_100</item>
|
||||
<item name="im_bubble_button_foreground_disabled">#66e1e3e6</item>
|
||||
<item name="im_bubble_gift_background">@color/gold_300</item>
|
||||
<item name="im_bubble_gift_text">@color/gold_100</item>
|
||||
<item name="im_bubble_gift_text_secondary">@color/gold_150</item>
|
||||
<item name="im_bubble_incoming">@color/gray_800</item>
|
||||
<item name="im_bubble_incoming_alternate">@color/gray_800</item>
|
||||
<item name="im_bubble_incoming_alternate_highlighted">@color/gray_600</item>
|
||||
<item name="im_bubble_incoming_highlighted">@color/gray_600</item>
|
||||
<item name="im_bubble_outgoing">@color/gray_750</item>
|
||||
<item name="im_bubble_outgoing_alternate">@color/gray_750</item>
|
||||
<item name="im_bubble_outgoing_alternate_highlighted">@color/gray_500</item>
|
||||
<item name="im_bubble_outgoing_highlighted">@color/gray_600</item>
|
||||
<item name="im_conversation_error_icon">@color/red_error</item>
|
||||
<item name="im_conversation_sending_icon">?accent</item>
|
||||
<item name="im_conversation_unread_counter_background">?accent</item>
|
||||
<item name="im_conversation_unread_counter_foreground">@color/white</item>
|
||||
<item name="im_conversation_unread_counter_muted_background">#ffa9b0b8</item>
|
||||
<item name="im_conversation_verified_icon">#ff67a5eb</item>
|
||||
<item name="im_forward_line_tint">@color/white</item>
|
||||
<item name="im_history_common_badge_background">#66000000</item>
|
||||
<item name="im_history_common_badge_foreground">@color/white</item>
|
||||
<item name="im_history_divider_background">@color/white</item>
|
||||
<item name="im_history_divider_foreground">@color/im_old_blue_gray_medium</item>
|
||||
<item name="im_history_divider_separator">#1e000000</item>
|
||||
<item name="im_history_image_bubbleless_border">#1e000000</item>
|
||||
<item name="im_history_incoming_attachment_icon">?accent</item>
|
||||
<item name="im_history_incoming_background">#ffebeced</item>
|
||||
<item name="im_history_incoming_background_selected">#ffc2c7cc</item>
|
||||
<item name="im_history_incoming_button">?accent</item>
|
||||
<item name="im_history_incoming_foreground">@color/black</item>
|
||||
<item name="im_history_incoming_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_incoming_foreground_caption_inv">@color/white</item>
|
||||
<item name="im_history_incoming_foreground_link">?accent</item>
|
||||
<item name="im_history_incoming_foreground_name">?accent</item>
|
||||
<item name="im_history_incoming_image_placeholder_background">#14000c1a</item>
|
||||
<item name="im_history_incoming_snippet_placeholder_background">
|
||||
@color/im_old_accent_muted_14
|
||||
</item>
|
||||
<item name="im_history_incoming_snippet_placeholder_icon">?accent</item>
|
||||
<item name="im_history_info_bar_background">#fffafbfc</item>
|
||||
<item name="im_history_info_bar_border">#26000000</item>
|
||||
<item name="im_history_live_badge_background">#ffff3347</item>
|
||||
<item name="im_history_outgoing_attachment_icon">?accent</item>
|
||||
<item name="im_history_outgoing_background">#ffc2ddfc</item>
|
||||
<item name="im_history_outgoing_background_selected">#ffa3bedc</item>
|
||||
<item name="im_history_outgoing_button">?accent</item>
|
||||
<item name="im_history_outgoing_foreground">@color/black</item>
|
||||
<item name="im_history_outgoing_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_outgoing_foreground_link">?accent</item>
|
||||
<item name="im_history_outgoing_foreground_name">?accent</item>
|
||||
<item name="im_history_outgoing_image_placeholder_background">#14000c1a</item>
|
||||
<item name="im_history_outgoing_snippet_placeholder_background">
|
||||
@color/im_old_accent_muted_14
|
||||
</item>
|
||||
<item name="im_history_outgoing_snippet_placeholder_icon">?accent</item>
|
||||
<item name="im_history_sending_icon">?accent</item>
|
||||
<item name="im_history_sticker_badge_background">#e6ffffff</item>
|
||||
<item name="im_history_sticker_badge_foreground">@color/im_old_gray_medium</item>
|
||||
<item name="im_history_unread_icon">?accent</item>
|
||||
<item name="im_is_vk_me">false</item>
|
||||
<item name="im_item_foreground_caption">@color/im_old_gray_medium</item>
|
||||
<item name="im_item_foreground_name">?accent</item>
|
||||
<item name="im_item_foreground_subhead">@color/im_old_gray_dark</item>
|
||||
<item name="im_item_foreground_tertiary">@color/im_old_gray_light</item>
|
||||
<item name="im_menu_foreground">@color/gray_800</item>
|
||||
<item name="im_reply_sender_text">@color/white</item>
|
||||
<item name="im_reply_separator">@color/white</item>
|
||||
<item name="im_service_message_text">@color/steel_gray_400</item>
|
||||
<item name="im_tabbar_icon_active">?accent</item>
|
||||
<item name="im_tabbar_icon_inactive">@color/im_old_blue_gray_light</item>
|
||||
<item name="im_toolbar_separator">@color/gray_300</item>
|
||||
<item name="im_toolbar_voice_msg_background">@color/gray_700</item>
|
||||
<item name="image_border">@color/white_alpha8</item>
|
||||
<item name="input_background">@color/gray_700</item>
|
||||
<item name="input_border">@color/gray_700</item>
|
||||
<item name="landing_background">?accent</item>
|
||||
<item name="landing_primary_button_background">@color/white</item>
|
||||
<item name="landing_primary_button_background_disabled">#66ffffff</item>
|
||||
<item name="landing_primary_button_foreground">?accent</item>
|
||||
<item name="landing_primary_button_foreground_disabled">#665181b8</item>
|
||||
<item name="landing_snippet_border">@color/clear</item>
|
||||
<item name="landing_text_secondary">@color/white_alpha60</item>
|
||||
<item name="landing_text_title">@color/white</item>
|
||||
<item name="like_text_tint">@color/red_light</item>
|
||||
<item name="link_alternate">?accent</item>
|
||||
<item name="loader_background">@color/black</item>
|
||||
<item name="loader_tint">@color/gray_500</item>
|
||||
<item name="loader_track_fill">@color/gray_700</item>
|
||||
<item name="loader_track_value_fill">@android:color/system_neutral1_200</item>
|
||||
<item name="media_overlay_button_background">@color/white</item>
|
||||
<item name="media_overlay_button_background_disabled">#66ffffff</item>
|
||||
<item name="media_overlay_button_foreground">@color/black</item>
|
||||
<item name="media_overlay_button_foreground_disabled">#662c2d2e</item>
|
||||
<item name="modal_card_background">@color/black</item>
|
||||
<item name="modal_card_border">@color/white_alpha12</item>
|
||||
<item name="modal_card_header_close">@color/white</item>
|
||||
<item name="music_playback_icon">@color/white</item>
|
||||
<item name="overlay_status_background">@color/black</item>
|
||||
<item name="overlay_status_foreground">@color/gray_100</item>
|
||||
<item name="overlay_status_icon">@color/gray_50</item>
|
||||
<item name="panel_tab_active_background">@color/gray_700</item>
|
||||
<item name="panel_tab_active_text">@color/gray_100</item>
|
||||
<item name="panel_tab_inactive_text">@color/gray_500</item>
|
||||
<item name="placeholder_icon_background">@color/white_alpha8</item>
|
||||
<item name="placeholder_icon_foreground_primary">@color/gray_400</item>
|
||||
<item name="placeholder_icon_foreground_secondary">@color/gray_600</item>
|
||||
<item name="placeholder_icon_tint">@color/white</item>
|
||||
<item name="poll_option_background">@color/white</item>
|
||||
<item name="search_bar_background">@color/black</item>
|
||||
<item name="search_bar_field_background">@color/gray_700</item>
|
||||
<item name="search_bar_field_tint">@color/gray_300</item>
|
||||
<item name="search_bar_segmented_control_tint">@color/gray_400</item>
|
||||
<item name="segmented_control_bar_background">@color/black</item>
|
||||
<item name="segmented_control_tint">@color/gray_500</item>
|
||||
<item name="selection_off_icon">@color/gray_700</item>
|
||||
<item name="separator_alpha">@color/white_alpha15</item>
|
||||
<item name="separator_alternate">@color/black</item>
|
||||
<item name="separator_common">@color/gray_750</item>
|
||||
<item name="snippet_background">@color/black</item>
|
||||
<item name="snippet_border">@color/white_alpha12</item>
|
||||
<item name="snippet_icon_tertiary">@color/gray_600</item>
|
||||
<item name="splashscreen_icon">@color/black</item>
|
||||
<item name="statusbar_alternate_legacy_background">@color/clear</item>
|
||||
<item name="stories_skeleton_loader_background">@color/gray_700</item>
|
||||
<item name="switch_ios_off_border">@color/black</item>
|
||||
<item name="tabbar_active_icon">@color/white</item>
|
||||
<item name="tabbar_background">@color/gray_900</item>
|
||||
<item name="tabbar_inactive_icon">@color/gray_500</item>
|
||||
<item name="text_action_counter">@color/gray_300</item>
|
||||
<item name="text_link">@android:color/system_neutral1_200</item>
|
||||
<item name="text_link_hightlighted_background">@android:color/system_neutral1_200</item>
|
||||
<item name="text_muted">@color/gray_200</item>
|
||||
<item name="text_name">@color/gray_100</item>
|
||||
<item name="text_placeholder">@color/gray_300</item>
|
||||
<item name="text_primary">@color/gray_100</item>
|
||||
<item name="text_secondary">@color/gray_500</item>
|
||||
<item name="text_subhead">@color/gray_400</item>
|
||||
<item name="text_tertiary">@color/gray_600</item>
|
||||
<item name="toolbar_attach_background_from">@color/gray_500</item>
|
||||
<item name="toolbar_attach_background_to">@color/gray_600</item>
|
||||
<item name="writebar_icon">@color/gray_400</item>
|
||||
</style>
|
||||
</resources>
|
||||
|
||||
@@ -686,4 +686,24 @@
|
||||
<item>new</item>
|
||||
<item>old</item>
|
||||
</string-array>
|
||||
<string-array name="newsupdate_value">
|
||||
<item>Default</item>
|
||||
<item>Do not update</item>
|
||||
<item>Immediately update</item>
|
||||
</string-array>
|
||||
<string-array name="newsupdate">
|
||||
<item>default</item>
|
||||
<item>no_update</item>
|
||||
<item>imd_update</item>
|
||||
</string-array>
|
||||
<string-array name="undel_value">
|
||||
<item>[Deleted]</item>
|
||||
<item>🗑</item>
|
||||
<item>❌</item>
|
||||
</string-array>
|
||||
<string-array name="undel">
|
||||
<item>default</item>
|
||||
<item>icon</item>
|
||||
<item>icon2</item>
|
||||
</string-array>
|
||||
</resources>
|
||||
|
||||
@@ -8016,7 +8016,7 @@
|
||||
</style>
|
||||
|
||||
<style name="Widget.Design.BottomSheet.Modal" parent="@android:style/Widget">
|
||||
<item name="android:background">?android:colorBackground</item>
|
||||
<item name="android:background">?background_content</item>
|
||||
<item name="behavior_hideable">true</item>
|
||||
<item name="behavior_peekHeight">auto</item>
|
||||
<item name="behavior_skipCollapsed">false</item>
|
||||
|
||||
@@ -54,6 +54,18 @@
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/privacy_vtl">
|
||||
<com.vtosters.lite.ui.SummaryListPreference
|
||||
android:defaultValue="default"
|
||||
android:dialogTitle="Выберите значение"
|
||||
android:entries="@array/undel_value"
|
||||
android:entryValues="@array/undel"
|
||||
android:key="undeletemsg_prefix"
|
||||
android:title="Пометка удаленного сообщения" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="undeletemsg"
|
||||
android:summary="Может не сохранять вложения"
|
||||
android:title="Оставлять удаленные сообщения" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="awayphp"
|
||||
@@ -64,5 +76,15 @@
|
||||
android:key="benchmark"
|
||||
android:summary="@string/benchapisummary"
|
||||
android:title="@string/benchapi" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="7.24"
|
||||
android:key="vkver"
|
||||
android:summary="Требуется перезапуск"
|
||||
android:title="Подмена версии ВК" />
|
||||
<EditTextPreference
|
||||
android:defaultValue="12116"
|
||||
android:key="vkbuild"
|
||||
android:summary="Требуется перезапуск"
|
||||
android:title="Подмена версии билда ВК" />
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
||||
@@ -10,11 +10,6 @@
|
||||
android:key="devmenu"
|
||||
android:title="Показывать пункт дебага в настройках" />
|
||||
<PreferenceCategory android:title="Experimental">
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="vkversion"
|
||||
android:summary="Требуется перезапуск"
|
||||
android:title="Изменение версии вк" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="usevkui"
|
||||
@@ -37,10 +32,6 @@
|
||||
android:defaultValue="true"
|
||||
android:key="color_grishka"
|
||||
android:title="Фикс некоторых покрасок Monet" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="vkim_msg"
|
||||
android:title="VK Me theme" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="false"
|
||||
android:key="libverify"
|
||||
@@ -50,6 +41,10 @@
|
||||
android:defaultValue="false"
|
||||
android:key="msgflat"
|
||||
android:title="@string/vtlmsgflat" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="opusmodule"
|
||||
android:title="Opus Module" />
|
||||
<com.vtosters.lite.ui.SummaryListPreference
|
||||
android:defaultValue="system"
|
||||
android:dialogTitle="Выберите язык приложения"
|
||||
|
||||
@@ -79,10 +79,13 @@
|
||||
android:entryValues="@array/commentssort"
|
||||
android:key="commentssort"
|
||||
android:title="Сортировка комментариев" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="feedautoupdate"
|
||||
android:title="@string/vtlfeedreload" />
|
||||
<com.vtosters.lite.ui.SummaryListPreference
|
||||
android:defaultValue="default"
|
||||
android:dialogTitle="Выберите значение"
|
||||
android:entries="@array/newsupdate_value"
|
||||
android:entryValues="@array/newsupdate"
|
||||
android:key="newsupdate"
|
||||
android:title="Обновление новостей" />
|
||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||
android:defaultValue="true"
|
||||
android:key="feedcache"
|
||||
|
||||
@@ -38,6 +38,16 @@
|
||||
android:defaultValue=""
|
||||
android:key="proxyPortHTTP"
|
||||
android:title="@string/proxyport" />
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="proxyUserHTTP"
|
||||
android:summary="Если имеется"
|
||||
android:title="Логин" />
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="proxyPassHTTP"
|
||||
android:summary="Если имеется"
|
||||
android:title="Пароль" />
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/proxyhttps">
|
||||
@@ -49,6 +59,16 @@
|
||||
android:defaultValue=""
|
||||
android:key="proxyPortHTTPS"
|
||||
android:title="@string/proxyport" />
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="proxyUserHTTPS"
|
||||
android:summary="Если имеется"
|
||||
android:title="Логин" />
|
||||
<EditTextPreference
|
||||
android:defaultValue=""
|
||||
android:key="proxyPassHTTPS"
|
||||
android:summary="Если имеется"
|
||||
android:title="Пароль" />
|
||||
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
|
||||
</PreferenceCategory>
|
||||
<PreferenceCategory android:title="@string/proxysocks">
|
||||
|
||||
@@ -273,7 +273,7 @@
|
||||
|
||||
check-cast v2, Landroid/content/Context;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->getCommitLink()Ljava/lang/String;
|
||||
invoke-static {}, Lru/vtosters/lite/utils/About;->getCommitLink()Ljava/lang/String;
|
||||
|
||||
move-result-object v3
|
||||
|
||||
@@ -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/Globals;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
|
||||
@@ -632,7 +632,7 @@
|
||||
|
||||
invoke-interface {p1, v0}, Ljava/util/List;->add(Ljava/lang/Object;)Z
|
||||
|
||||
invoke-static {p1}, Lru/vtosters/lite/utils/Prefs;->injectAbout(Ljava/util/List;)V
|
||||
invoke-static {p1}, Lru/vtosters/lite/utils/About;->injectAbout(Ljava/util/List;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
@@ -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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->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/Globals;->getContext()Landroid/content/Context;
|
||||
|
||||
move-result-object v1
|
||||
|
||||
@@ -5758,7 +5758,7 @@
|
||||
|
||||
move-result v0
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->newvideo()Z
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->newvideo()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
|
||||
@@ -109,7 +109,7 @@
|
||||
|
||||
move-result v0
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->dev()Z
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->dev()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
|
||||
move-result v0
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Prefs;->dev()Z
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->dev()Z
|
||||
|
||||
move-result v0
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user