Compare commits

...
174 Commits
Author SHA1 Message Date
gdlbo dfa7ba031e shakal mode 2022-06-17 19:49:41 +03:00
gdlbo 6ddea672ad fixed multi account 2022-06-17 19:27:35 +03:00
gdlbo 047378a11d updated gh actions script 2022-06-17 19:13:27 +03:00
gdlbo 3420c4abb0 added compress disabler 2022-06-17 19:10:57 +03:00
gdlbo 15a8d70f5f added compress disabler 2022-06-17 19:08:37 +03:00
gdlbo 91f90a6609 Merge remote-tracking branch 'origin/master' 2022-06-17 18:35:06 +03:00
gdlbo e170b70999 added auto cleaning cache 2022-06-17 18:35:01 +03:00
gdlbo b489011d24 Merge pull request #342 from k1zn/master
Fix avatar position on tablet
2022-06-17 18:27:20 +03:00
gdlbo 58adfbd261 added auto cleaning cache 2022-06-17 18:21:10 +03:00
Erik Kiznov 3bb18b6daf Fix README.md 2022-06-17 20:09:03 +05:00
Erik Kiznov 120bf18416 Fix avatar position on tablet 2022-06-17 19:36:42 +05:00
Vologhat 428c4ef7d6 changed buttons style 2022-06-17 17:12:26 +03:00
gdlbo 40fc05fc15 fix foxbin.f0x1d.com/enotik 2022-06-17 15:12:59 +03:00
gdlbo 2e913223a2 fix 2022-06-17 14:54:47 +03:00
gdlbo 48f12a912c fix 99% problems on android 11 and lower 2022-06-17 14:19:27 +03:00
gdlbo 0228c0b8a1 fixed colors 2022-06-17 13:58:41 +03:00
gdlbo ba07aeb4d7 fix vk icon in menu 2022-06-17 13:53:17 +03:00
gdlbo 529b13f18b fixed crash android 5.1 2022-06-17 13:34:40 +03:00
gdlbo 5720fddb59 fix crash MusicFragment 2022-06-16 23:30:08 +03:00
gdlbo f5c80b230a gcmfix v2 is here 2022-06-16 22:46:07 +03:00
gdlbo 87ee01bac9 gcmfix v2 is here 2022-06-16 22:32:00 +03:00
gdlbo 126ad044f2 gcmfix v2 is here 2022-06-16 22:30:00 +03:00
gdlbo b636648457 counters is back 2022-06-16 21:58:13 +03:00
gdlbo bf3672a8c4 fix rounded msg + improved vkme msg mode 2022-06-16 21:25:41 +03:00
gdlbo e6478d5161 fixed bg stickers issue 2022-06-16 21:14:13 +03:00
gdlbo ddea78aa4b VKID Protection alert in music settings 2022-06-16 20:25:02 +03:00
gdlbo b872fb17b8 VKID Protection alert 2022-06-16 19:38:18 +03:00
gdlbo 4ec2c17df1 VKID Protection alert 2022-06-16 19:35:45 +03:00
gdlbo 38a51f48d0 fix sharing action buttons 2022-06-16 17:05:42 +03:00
gdlbo 838897611c small fixes 2022-06-16 16:51:27 +03:00
gdlbo f42150063c small fixes 2022-06-16 16:37:35 +03:00
gdlbo d164d1219d verif icon coloring in dialogs 2022-06-16 16:24:23 +03:00
gdlbo fb71b4d781 toolbar fixes 2022-06-16 16:02:19 +03:00
gdlbo f338738c1e writebar fix 2022-06-16 14:16:46 +03:00
gdlbo fb704c7388 fix msg loading 2022-06-16 14:03:39 +03:00
gdlbo c99bca4200 online fixes 2022-06-16 13:18:09 +03:00
gdlbo 92f43acb80 fix 2022-06-16 09:12:39 +03:00
gdlbo a7c85a24f2 added signature check to detect github actions builds and etc 2022-06-16 01:26:07 +03:00
gdlbo fe5616b3f7 fixes 2022-06-16 01:06:11 +03:00
gdlbo 5c882c5ce2 fixes 2022-06-16 00:33:40 +03:00
gdlbo 61a4ed43b9 fixed toast 2022-06-16 00:15:31 +03:00
Vologhat b242ad7ae4 Merge branch 'ota' 2022-06-16 00:09:40 +03:00
Vologhat 1b02e806f8 Final fixes 2022-06-16 00:04:34 +03:00
gdlbo eaf23a24ba impossible color fix 2022-06-15 23:08:58 +03:00
gdlbo ce64296c01 kill androidx 2022-06-15 21:47:21 +03:00
Vologhat 6e3716fe01 final changes
added apk downloading and installing features, bottomshit wrapper with mirroring
2022-06-15 21:29:09 +03:00
gdlbo dcdd83243b color fixes 2022-06-15 21:11:30 +03:00
gdlbo 986ec2987c wtf debuggable must be false 2022-06-15 17:20:01 +03:00
gdlbo c98609db5d fixes 2022-06-15 17:13:18 +03:00
Vologhat 0b4e3c6303 added ota 2022-06-15 16:41:21 +03:00
gdlbo bc3e5a706d fixed auto theme 2022-06-15 07:59:10 +03:00
gdlbo 0b56d9dd23 fixes 2022-06-15 02:36:25 +03:00
gdlbo 62ccdf8eba upgraded new settings
refactored multi account counter
2022-06-15 02:13:33 +03:00
gdlbo 72f4226419 fixes 2022-06-14 23:48:07 +03:00
gdlbo f6a45beac5 isdarktheme now should work depending on the dark theme of the app v2 2022-06-14 13:26:47 +03:00
gdlbo a657ddef58 Merge pull request #313 from iNotFlying/master
New VK logo
2022-06-14 13:10:11 +03:00
gdlbo 726e38ff2e isdarktheme now should work depending on the dark theme of the app 2022-06-14 13:08:20 +03:00
iNotFlying 191d3f760e Some fixes 2022-06-14 10:48:25 +03:00
iNotFlying 2cd3b0f39c Merge branch 'vtosters:master' into master 2022-06-14 11:41:47 +04:00
gdlbo abd990eef7 injected new setting to default theme 2022-06-14 01:19:20 +03:00
gdlbo cd875af7d7 fixed dark theme in new settings 2022-06-14 01:07:17 +03:00
gdlbo b1e8f93371 fixed amoled css 2022-06-14 00:15:25 +03:00
gdlbo 64afd0222b amoled theme now is fully amoled theme 2022-06-14 00:11:33 +03:00
gdlbo 32369f1f38 fixes 2022-06-13 23:57:53 +03:00
gdlbo f00be506cc fixes 2022-06-13 22:49:22 +03:00
gdlbo 248fd1ce9c fixes 2022-06-13 22:40:10 +03:00
gdlbo 3e2d4bb665 vkme mode updated 2022-06-13 22:34:35 +03:00
iNotFlying 92689941ca New VK logo 2022-06-13 21:45:29 +03:00
gdlbo c46110cfea vkme mode updated 2022-06-13 21:07:16 +03:00
gdlbo b5250e0b8d vkme mode updated 2022-06-13 21:06:36 +03:00
gdlbo 0e81397305 vkme mode updated 2022-06-13 21:04:16 +03:00
gdlbo 95d306eaed vkme mode updated 2022-06-13 18:18:38 +03:00
gdlbo 339a4fe01f vkme mode updated 2022-06-13 12:38:50 +03:00
gdlbo 48cdbc7681 vkme mode updated 2022-06-13 12:20:21 +03:00
gdlbo 5e85ba10f4 vkme mode updated 2022-06-13 12:01:04 +03:00
gdlbo ea7dd7aba5 vkme mode test 2022-06-13 01:03:10 +03:00
gdlbo c60b766f37 test coloring bottomsheet 2022-06-12 20:02:15 +03:00
gdlbo da9ded2ae1 mini refactoring 2022-06-12 16:19:45 +03:00
gdlbo 29eb517bb9 fix https://github.com/vtosters/lite/issues/156 2022-06-12 15:44:05 +03:00
gdlbo 84a3f6caff fix 2022-06-12 01:49:10 +03:00
gdlbo b34821463a fix hardcoded text 2022-06-12 01:29:19 +03:00
gdlbo 127abbaaeb fix 2022-06-12 01:12:01 +03:00
gdlbo d462d42775 dropdown menu text color fix 2022-06-12 00:36:18 +03:00
gdlbo 5e80ad7e4e dropdown menu coloring!!!!!!! 2022-06-11 23:51:48 +03:00
gdlbo e1aadade5f fixes 2022-06-11 23:08:16 +03:00
gdlbo 77d6f5d977 fixes 2022-06-11 22:57:52 +03:00
gdlbo c4ae2ec0a3 fixes 2022-06-11 22:45:55 +03:00
gdlbo 07ee9269b7 fixes 2022-06-11 20:16:10 +03:00
gdlbo 3ee43f1c50 Animation fragment injector (beta) 2022-06-11 19:46:22 +03:00
gdlbo dd65196af9 fixed games button 2022-06-11 17:29:05 +03:00
gdlbo 5547de006b upgraded ColorStateList recoloring 2022-06-11 16:42:39 +03:00
gdlbo 0fbf571c60 some fixes of color inj 2022-06-11 15:24:04 +03:00
gdlbo f5f05697b6 Merge remote-tracking branch 'origin/master' 2022-06-11 14:26:43 +03:00
gdlbo 5f179f6a26 fixed search color 2022-06-11 14:26:39 +03:00
gdlbo 37c6d29e84 Fix string 2022-06-10 22:22:46 +03:00
gdlbo 0e81ba31cb fixed crash docs 2022-06-10 21:49:12 +03:00
gdlbo 1f24d32109 fixed crash docs 2022-06-10 21:37:52 +03:00
gdlbo ff16f84c43 some improves 2022-06-10 21:00:37 +03:00
gdlbo 5b929bf515 fixed issue with undelete by default (oops) 2022-06-10 19:42:20 +03:00
gdlbo bdcb3db238 fixed issue with dateformat value 2022-06-10 19:00:26 +03:00
gdlbo f7960b1695 Added an expanded view of the date format type selection
Full date in private messages
Minor improvements
Fixed a bug with anti-deletion of messages
2022-06-10 18:58:19 +03:00
gdlbo 825d1b95da improved disabling number shortening 2022-06-10 17:26:40 +03:00
gdlbo 0e7abaf3f0 fixed pic rounding 2022-06-10 16:40:50 +03:00
gdlbo 2731989ae8 fixed serach text coloring 2022-06-10 16:19:00 +03:00
gdlbo 5ad09e11df fixed casino moment 2022-06-10 16:17:32 +03:00
gdlbo 653d2eeeee fixed casino moment 2022-06-10 15:29:46 +03:00
gdlbo 756ad615ed fixed rounded msgs colors monet 2022-06-10 15:26:40 +03:00
gdlbo dd6abafad5 added pref disableanimstickers to debug 2022-06-09 00:04:14 +03:00
gdlbo 0434f06bb5 fixed some accents 2022-06-08 23:44:58 +03:00
gdlbo 50971098ad fixed accent vkim link 2022-06-08 23:26:30 +03:00
gdlbo 1787f10fca fixed load friends page 2022-06-08 22:58:52 +03:00
gdlbo 6d2684db70 added shadow in dialogs vkme 2022-06-08 21:18:05 +03:00
gdlbo f0f1b3a946 disabled divider in dialogs 2022-06-08 21:09:12 +03:00
gdlbo ae9b703726 fixed shadow 2022-06-08 20:55:19 +03:00
gdlbo 10512fb74b fixed shadow on 31 sdk+ 2022-06-08 20:47:52 +03:00
gdlbo ce9bdba30c sdk 31 rounded msgs 2022-06-08 20:29:30 +03:00
gdlbo 188c98589c amoled theme for rounded msgs 2022-06-08 19:55:11 +03:00
gdlbo e5fa42ff14 some fixes 2022-06-08 19:32:29 +03:00
gdlbo f42aa95003 init rounded msg for light theme 2022-06-08 19:26:01 +03:00
gdlbo b16dc816b6 added applying theme after restart 2022-06-08 19:25:01 +03:00
gdlbo b86fe4d65d init rounded msg for dark theme 2022-06-08 18:50:28 +03:00
gdlbo d7e17416f1 init rounded theme 2022-06-08 18:41:03 +03:00
gdlbo 91355f1dd5 fixed stickers time color 2022-06-08 18:28:56 +03:00
gdlbo ae9e3ed07c fixes some themes logic 2022-06-08 17:22:11 +03:00
gdlbo f701993b0f fixes + more translations 2022-06-08 15:14:34 +03:00
gdlbo c5bf617f65 fixes + more translations 2022-06-08 14:02:45 +03:00
gdlbo f09cae1684 fixes 2022-06-07 17:50:02 +03:00
gdlbo 99d7f06981 New feature open news settings via settings lmao 2022-06-07 11:56:23 +03:00
gdlbo eaaf7e2bbf fixed news logic 2022-06-07 11:26:29 +03:00
gdlbo 897382de2b Fixed some translations + fixed settings logic 2022-06-07 11:24:44 +03:00
gdlbo 55d02a8412 Fixed links 2022-06-07 10:51:24 +03:00
gdlbo 7733582238 Casino update from 7 to 5 2022-06-04 22:14:36 +03:00
gdlbo 754c8339df Added randomize to disable donate alert 2022-06-04 21:18:50 +03:00
gdlbo ebf7baaa65 fixed links + disable recomms 2022-06-04 20:36:00 +03:00
gdlbo 8b26b12813 Added donate banners lmao 2022-06-04 20:04:28 +03:00
gdlbo 5deb4186f9 Fixed market colors 2022-06-04 11:25:38 +03:00
gdlbo d3d501f94a Fix dark accent color on monet 2022-06-04 10:25:41 +03:00
gdlbo 634f1213d4 Merge pull request #283 from bxkr/master 2022-06-04 09:32:58 +03:00
Andrew 6fa97ee435 Update R.java 2022-06-04 06:10:16 +03:00
gdlbo 05b3342763 Fix pull requests building 2022-06-04 04:54:54 +03:00
Andrew d434f42d12 Preferences localization
- Added en,ru translations for hardcoded strings in preferences
- Updated public.xml
- Fixed some ru strings
2022-06-03 23:38:52 +03:00
gdlbo 084f13eda4 Fix actions compiling 2022-06-03 20:36:56 +03:00
gdlbo ed59b54618 Fix actions compiling 2022-06-03 20:33:29 +03:00
gdlbo df282b95ad fix some strings 2022-06-03 19:43:23 +03:00
gdlbo 1b38533c83 color fixes 2022-06-03 17:47:29 +03:00
gdlbo 8f4c370ab2 Update build.gradle 2022-06-03 16:00:11 +03:00
gdlbo 9360ea4d85 Color article fixes 2022-06-02 19:45:49 +03:00
gdlbo c87d6581c8 Color fixes 2022-06-02 19:28:16 +03:00
gdlbo 7133fc6c03 Disabled discover ads 2022-06-02 19:04:24 +03:00
gdlbo 46af5af250 Fix https://github.com/vtosters/lite/issues/266 2022-06-02 17:38:28 +03:00
gdlbo 5b9cc6778c Fixes 2022-06-02 16:42:45 +03:00
gdlbo 5260ad8243 Fixed comments load 2022-06-02 14:25:32 +03:00
gdlbo 2996772020 Updated gitignore 2022-06-02 14:02:37 +03:00
gdlbo d37534cb6b Fixed icon changing 2022-06-02 13:25:19 +03:00
gdlbo 92eb48c21e Fixed crash + fixed msg cache 2022-06-02 13:06:55 +03:00
gdlbo d9e867cb6e Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 12:33:52 +03:00
gdlbo f200c6e59a Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 11:20:11 +03:00
gdlbo c668f3bf9a Refactoring 2022-05-31 16:55:19 +03:00
gdlbo bd7afee09b added more documentations 2022-05-31 16:43:58 +03:00
gdlbo ff09a4aec0 Added our git links 2022-05-26 20:25:51 +03:00
gdlbo 1e6c60f2ed Fixed statusbar and navbar light coloring 2022-05-17 23:08:12 +03:00
gdlbo beedb1538d Poll fix 2022-05-17 20:05:16 +03:00
gdlbo 8463f9e963 Fixes 2022-05-17 18:40:56 +03:00
gdlbo ce8f88b8d4 reworked statusbar coloring 2022-05-17 00:35:39 +03:00
gdlbo ff7d080b5a fix music tabs 2022-05-16 22:38:57 +03:00
gdlbo 12ad83c607 reworked do not read 2022-05-16 21:50:32 +03:00
gdlbo cdf5d2c37c fixes 2022-05-16 21:27:59 +03:00
gdlbo 9af8e1729e copyright posts detect 2022-05-16 21:21:39 +03:00
gdlbo d5219ed322 Fixes + some imp of custom msg loader 2022-05-16 00:11:00 +03:00
gdlbo 7af9a72e77 Fixes 2022-05-15 21:23:48 +03:00
gdlbo 08817bde7e Reworked some cringe code 2022-05-15 21:11:25 +03:00
gdlbo d1e9aadd71 fixed white screamers (maybe) 2022-05-13 20:28:20 +03:00
gdlbo b6307182cd fixes 2022-05-13 19:59:36 +03:00
gdlbo cc70e55b53 Fix summ 2022-05-13 15:36:42 +03:00
338 changed files with 6230 additions and 2146 deletions
+4 -2
View File
@@ -4,7 +4,10 @@ on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
types:
- opened
- synchronize
- reopened
workflow_dispatch:
@@ -31,7 +34,6 @@ jobs:
- name: Build VTLite
run: |
git checkout master
bash scripts/buildworkflow.sh
- name: Sign and verify the apk
+1
View File
@@ -25,3 +25,4 @@ smali/assets/version.properties
app/src/main/assets/version.properties
smali/build/resources.zip
*.idsig
/smali/VTLite.apk.cache/
+8 -4
View File
@@ -8,6 +8,10 @@ VTosters Lite - это модифицированный клиент (деком
Стабильные сборки находятся в [Releases](https://github.com/vtosters/lite/releases)
Зеркало на нашем [Git](https://git.maki.su/gdlbo/lite)
Зеркало на [Github](https://github.com/vtosters/lite)
## Отладка приложения
Для отладки с помощью Android Studio необходимо пройти в `/smali/AndroidManifest.xml`
@@ -17,13 +21,13 @@ android:debuggable="false" -> android:debuggable="true"
Для дополнительной отладки ответов, доп логов и подмены данных для дебаг приложения необходимо включить **Режим разработчика**
```
Настройки -> Для разработчиков -> Режим разработчика
Настройки -> О приложении -> Для разработчиков -> Режим разработчика
```
Для просмотра трафика необходимо отключить функцию **SSL Pinning**
```
Настройки -> Для разработчиков -> SSL Pinning
Настройки -> О приложении -> Для разработчиков -> SSL Pinning
```
Для логгирования внутренних запросов к API необходимо включить функции **Логгирование API**
@@ -31,12 +35,12 @@ android:debuggable="false" -> android:debuggable="true"
(Работает только при использовании внутреннего логгера!)
```
Настройки -> Для разработчиков -> Логгирование API
Настройки -> О приложении -> Для разработчиков -> Логгирование API
```
Для использования внутреннего логгера необходимо включить функции **Запись логов в файл**
```
Настройки -> Для разработчиков -> Запись логов в файл
Настройки -> О приложении -> Для разработчиков -> Запись логов в файл
```
Сразу после нажатия на запись аппа начнет записывать **все действия** в файлы по пути
```
+2 -2
View File
@@ -91,8 +91,8 @@ android {
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.google.android.material:material:1.5.0'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.preference:preference:1.2.0'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
@@ -1,7 +1,7 @@
package bruhcollective.itaysonlab.libvkx.client;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.Context;
import android.os.RemoteException;
@@ -36,7 +36,7 @@ public class LibVKXClient {
}
public static boolean isIntegrationEnabled() {
return BooleanFalse("libvkx_integration") && isVkxInstalled();
return getBoolValue("libvkx_integration", false) && isVkxInstalled();
}
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, PlayerRefer playerRefer) {
@@ -27,11 +27,11 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import ru.f0x1d.net.NetCall;
import ru.f0x1d.net.NetCallback;
import ru.f0x1d.net.NetClient;
import ru.f0x1d.net.NetRequest;
import ru.f0x1d.net.NetResponse;
import ru.vtosters.lite.net.NetCall;
import ru.vtosters.lite.net.NetCallback;
import ru.vtosters.lite.net.NetClient;
import ru.vtosters.lite.net.NetRequest;
import ru.vtosters.lite.net.NetResponse;
/**
* Created by Aefyr on 11.05.2018.
@@ -0,0 +1,27 @@
package com.vk.core.ui.themes;
import com.vk.s.R;
import ru.vtosters.lite.utils.Themes;
public enum VKTheme {
DEFAULT_LIGHT(0, R.g.BaseStyle),
DARK(1, R.g.BaseDarkStyle),
AMOLED(2, Themes.getAmoledTheme());
private final long id;
private final int themeResId;
VKTheme(long j, int i) {
this.id = j;
this.themeResId = i;
}
public final long a() {
return this.id;
}
public final int b() {
return this.themeResId;
}
}
@@ -0,0 +1,33 @@
package com.vk.im.ui.themes;
import static com.vk.im.ui.R.m.VkIm_Theme_VkApp_Dark;
import static com.vk.im.ui.R.m.VkIm_Theme_VkApp_Light;
import static com.vk.im.ui.R.m.VkIm_Theme_VkMe_Dark;
import static com.vk.im.ui.R.m.VkIm_Theme_VkMe_Light;
import ru.vtosters.lite.utils.Themes;
public enum ImTheme {
VKAPP_LIGHT(0, VkIm_Theme_VkApp_Light),
VKAPP_DARK(3, VkIm_Theme_VkApp_Dark),
VKME_LIGHT(1, VkIm_Theme_VkMe_Light),
VKME_DARK(2, VkIm_Theme_VkMe_Dark),
VKME_AMOLED(5, Themes.getAmoledMeTheme()),
VKAPP_AMOLED(4, Themes.getAmoledImTheme());
private final int id;
private final int themeResId;
ImTheme(int i, int i2) {
this.id = i;
this.themeResId = i2;
}
public final int a() {
return this.id;
}
public final int b() {
return this.themeResId;
}
}
+158 -7
View File
@@ -164,8 +164,18 @@ public final class R {
public static final int start_values = 0x7f03005c;
public static final int proxy = 0x7f03005d;
public static final int proxy_value = 0x7f03005e;
public static final int msgcount = 0x7f03005f;
public static final int msgcount_value = 0x7f030060;
public static final int commentssort = 0x7f03005f;
public static final int commentssort_value = 0x7f030060;
public static final int darktheme = 0x7f030061;
public static final int darktheme_value = 0x7f030062;
public static final int lighttheme = 0x7f030063;
public static final int lighttheme_value = 0x7f030064;
public static final int msgcount = 0x7f030065;
public static final int msgcount_value = 0x7f030066;
public static final int newsupdate = 0x7f030067;
public static final int newsupdate_value = 0x7f030068;
public static final int undel = 0x7f030069;
public static final int undel_value = 0x7f03006a;
}
public static final class attr {
@@ -2397,6 +2407,7 @@ public final class R {
public static final int window_bg_transparent = 0x7f06028b;
public static final int yellow = 0x7f06028c;
public static final int yellow_light = 0x7f06028d;
public static final int iclauncher = 0x7f06028e;
}
public static final class dimen {
@@ -14466,8 +14477,8 @@ public final class R {
public static final int copytokenbtn = 0x7f111029;
public static final int killappbtn = 0x7f11102a;
public static final int experts = 0x7f11102b;
public static final int DNT_OFF = 0x7f11102c;
public static final int DNT_ON = 0x7f11102d;
public static final int DNT_OFF_res_0x7f11102c = 0x7f11102c;
public static final int DNT_ON_res_0x7f11102d = 0x7f11102d;
public static final int accounts = 0x7f11102e;
public static final int act_bot = 0x7f11102f;
public static final int act_cnv = 0x7f111030;
@@ -14988,6 +14999,144 @@ public final class R {
public static final int vtlota = 0x7f111233;
public static final int DNR_ON = 0x7f111234;
public static final int DNR_OFF = 0x7f111235;
public static final int DNT_ON_res_0x7f111236 = 0x7f111236;
public static final int DNT_OFF_res_0x7f111237 = 0x7f111237;
public static final int other_clear_stickers_cache_summary = 0x7f111238;
public static final int dockbar_editor = 0x7f111239;
public static final int dockbar_reset = 0x7f11123a;
public static final int dockbar_save = 0x7f11123b;
public static final int dockbar_selected_items = 0x7f11123c;
public static final int dockbar_unselected_items = 0x7f11123d;
public static final int checkforupdates = 0x7f11123e;
public static final int other_fix_dynamic_colors = 0x7f11123f;
public static final int other_reset_settings = 0x7f111240;
public static final int other_reset_settings_summary = 0x7f111241;
public static final int other_fix_app = 0x7f111242;
public static final int activity_dnr_summary = 0x7f111243;
public static final int activity_dnr_visual = 0x7f111244;
public static final int activity_dnr_warn = 0x7f111245;
public static final int activity_dns_summary = 0x7f111246;
public static final int activity_dnw_summary = 0x7f111247;
public static final int activity_undel = 0x7f111248;
public static final int activity_undel_attachments = 0x7f111249;
public static final int activity_undel_dial = 0x7f11124a;
public static final int activity_undel_enable = 0x7f11124b;
public static final int activity_undel_tag = 0x7f11124c;
public static final int activity_what_is_it = 0x7f11124d;
public static final int appearance_other_color_navbar_summary = 0x7f11124e;
public static final int appearance_other_color_webview_summary = 0x7f11124f;
public static final int appearance_theme_dark_theme = 0x7f111250;
public static final int appearance_theme_dialog_title = 0x7f111251;
public static final int appearance_theme_info = 0x7f111252;
public static final int appearance_theme_info_summary = 0x7f111253;
public static final int appearance_theme_light_theme = 0x7f111254;
public static final int appearance_theme_use_system = 0x7f111255;
public static final int appearance_theme_use_system_summary = 0x7f111256;
public static final int debug_cache = 0x7f111257;
public static final int debug_cache_trusted_hash = 0x7f111258;
public static final int debug_cache_video = 0x7f111259;
public static final int debug_cache_webview = 0x7f11125a;
public static final int debug_developer_dark_mode = 0x7f11125b;
public static final int debug_developer_force_ssl = 0x7f11125c;
public static final int debug_developer_force_ssl_summary = 0x7f11125d;
public static final int debug_developer_functions = 0x7f11125e;
public static final int debug_developer_has_music_subscription = 0x7f11125f;
public static final int debug_developer_has_music_subscription_summary = 0x7f111260;
public static final int debug_developer_is_music_restricted = 0x7f111261;
public static final int debug_developer_is_music_restricted_summary = 0x7f111262;
public static final int debug_developer_mode = 0x7f111263;
public static final int debug_developer_mode_summary = 0x7f111264;
public static final int debug_developer_old_about = 0x7f111265;
public static final int debug_developer_ssfs_custom = 0x7f111266;
public static final int debug_domains = 0x7f111267;
public static final int debug_domains_api = 0x7f111268;
public static final int debug_domains_awayphp = 0x7f111269;
public static final int debug_domains_editing = 0x7f11126a;
public static final int debug_domains_editing_summary = 0x7f11126b;
public static final int debug_domains_oauth = 0x7f11126c;
public static final int debug_domains_vkui_host = 0x7f11126d;
public static final int debug_domains_vkui_spa = 0x7f11126e;
public static final int debug_experimental = 0x7f11126f;
public static final int debug_experimental_language = 0x7f111270;
public static final int debug_experimental_language_summary = 0x7f111271;
public static final int debug_experimental_libverify = 0x7f111272;
public static final int debug_experimental_libverify_summary = 0x7f111273;
public static final int debug_experimental_opusmodule = 0x7f111274;
public static final int debug_experimental_page_stats = 0x7f111275;
public static final int debug_experimental_page_stats_summary = 0x7f111276;
public static final int debug_experimental_usevkui = 0x7f111277;
public static final int debug_experimental_vk_me_mode = 0x7f111278;
public static final int debug_experimental_vk_sans_font = 0x7f111279;
public static final int debug_logging = 0x7f11127a;
public static final int debug_logging_api = 0x7f11127b;
public static final int debug_logging_api_errors = 0x7f11127c;
public static final int debug_logging_api_errors_summary = 0x7f11127d;
public static final int debug_logging_api_summary = 0x7f11127e;
public static final int debug_logging_apply_spaces = 0x7f11127f;
public static final int debug_logging_apply_spaces_summary = 0x7f111280;
public static final int debug_logging_breakpoints = 0x7f111281;
public static final int debug_logging_breakpoints_summary = 0x7f111282;
public static final int debug_logging_file = 0x7f111283;
public static final int debug_logging_file_summary = 0x7f111284;
public static final int debug_logging_force_stats_sending = 0x7f111285;
public static final int debug_logging_memleak = 0x7f111286;
public static final int debug_logging_visualise_viewposttime = 0x7f111287;
public static final int debug_logging_visualise_viewposttime_summary = 0x7f111288;
public static final int debug_logging_webview = 0x7f111289;
public static final int debug_other = 0x7f11128a;
public static final int debug_proxy = 0x7f11128b;
public static final int debug_proxy_enable = 0x7f11128c;
public static final int debug_proxy_enable_summary = 0x7f11128d;
public static final int debug_proxy_force = 0x7f11128e;
public static final int debug_proxy_force_summary = 0x7f11128f;
public static final int debug_show_settings_item = 0x7f111290;
public static final int debug_system = 0x7f111291;
public static final int debug_system_fcm = 0x7f111292;
public static final int debug_system_fcm_copy_token = 0x7f111293;
public static final int debug_system_google_now = 0x7f111294;
public static final int debug_system_language = 0x7f111295;
public static final int debug_system_terminate = 0x7f111296;
public static final int debug_tests = 0x7f111297;
public static final int debug_tests_ads = 0x7f111298;
public static final int debug_tests_bd = 0x7f111299;
public static final int debug_tests_captcha = 0x7f11129a;
public static final int debug_tests_crash = 0x7f11129b;
public static final int debug_tests_pretty_cards = 0x7f11129c;
public static final int debug_tests_spa = 0x7f11129d;
public static final int debug_tests_spa_uri = 0x7f11129e;
public static final int debug_tests_validation = 0x7f11129f;
public static final int debug_warning = 0x7f1112a0;
public static final int debug_warning_summary = 0x7f1112a1;
public static final int feed_ads_carousel_summary = 0x7f1112a2;
public static final int feed_ads_regular_summary = 0x7f1112a3;
public static final int feed_ads_sources = 0x7f1112a4;
public static final int feed_ads_sources_summary = 0x7f1112a5;
public static final int feed_ads_stories_summary = 0x7f1112a6;
public static final int feed_other_cache_summary = 0x7f1112a7;
public static final int feed_other_sort_comments = 0x7f1112a8;
public static final int feed_other_sort_comments_summary = 0x7f1112a9;
public static final int feed_other_update = 0x7f1112aa;
public static final int feed_other_update_dialog_title = 0x7f1112ab;
public static final int feed_recommendations_authors_summary = 0x7f1112ac;
public static final int feed_recommendations_friends_reacted_summary = 0x7f1112ad;
public static final int feed_recommendations_friends_summary = 0x7f1112ae;
public static final int interface_global_old_icons = 0x7f1112af;
public static final int interface_global_old_icons_summary = 0x7f1112b0;
public static final int messages_interface_calls_summary = 0x7f1112b1;
public static final int messages_interface_tails_summary = 0x7f1112b2;
public static final int messages_other_choose_count = 0x7f1112b3;
public static final int messages_other_download_first = 0x7f1112b4;
public static final int proxy_if = 0x7f1112b5;
public static final int proxy_login_title = 0x7f1112b6;
public static final int proxy_password_title = 0x7f1112b7;
public static final int vkx_download = 0x7f1112b8;
public static final int vk_fix_music = 0x7f1112b9;
public static final int vk_fix_music_summary = 0x7f1112ba;
public static final int vkx_integration = 0x7f1112bb;
public static final int vk_fix_music_other = 0x7f1112bc;
public static final int vkx_title = 0x7f1112bd;
public static final int vkx_why = 0x7f1112be;
public static final int vkx_why_summary = 0x7f1112bf;
}
public static final class style {
@@ -15929,9 +16078,11 @@ public final class R {
public static final int MD_Button_Borderless = 0x7f1203a7;
public static final int MD_Button_Borderless_Dialog = 0x7f1203a8;
public static final int MaterialDialogTheme_Dark = 0x7f1203a9;
public static final int BaseAmoledStyle = 0x7f1203aa;
public static final int BaseAmoledTheme = 0x7f1203ab;
public static final int Vk_Theme_client_amoled_generated = 0x7f1203ac;
public static final int ActionBarThemeFix = 0x7f1203aa;
public static final int BaseAmoledStyle = 0x7f1203ab;
public static final int BaseAmoledTheme = 0x7f1203ac;
public static final int Vk_Theme_client_amoled_generated = 0x7f1203ad;
public static final int VkIm_Theme_VkApp_Amoled = 0x7f1203ae;
}
public static final class xml {
@@ -1,86 +0,0 @@
package ru.f0x1d.net;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.os.AsyncTask;
import com.vk.core.network.Network;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class F0x1dRequest {
public static void makeRequest(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback) {
new MakeRequestTask(bArr, f0x1dRequestCallback).execute();
}
public static void makeRequest(String str, F0x1dRequestCallback f0x1dRequestCallback) {
new MakeRequestTask(str.getBytes(), f0x1dRequestCallback).execute();
}
public static void makeRequestToaster(String str, F0x1dRequestCallback f0x1dRequestCallback, boolean z) {
new MakeRequestTask(str.getBytes(), f0x1dRequestCallback, true, !z).execute();
}
public interface F0x1dRequestCallback {
void onResponse(String str);
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private final F0x1dRequestCallback callback;
private boolean mIsPut;
private boolean mIsVkToasterRequest;
private final byte[] url;
public MakeRequestTask(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback) {
this.mIsVkToasterRequest = false;
this.mIsPut = false;
this.callback = f0x1dRequestCallback;
this.url = bArr;
}
public MakeRequestTask(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback, boolean z, boolean z2) {
this.mIsVkToasterRequest = false;
this.mIsPut = false;
this.callback = f0x1dRequestCallback;
this.url = bArr;
this.mIsVkToasterRequest = z;
this.mIsPut = z2;
}
public String doInBackground(Void... voidArr) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(this.url)).openConnection();
httpURLConnection.setRequestMethod(this.mIsPut ? "PUT" : "GET");
if (this.mIsVkToasterRequest) {
httpURLConnection.setRequestProperty("Token", getUserToken());
}
if (!this.mIsVkToasterRequest) {
httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a());
}
httpURLConnection.setRequestProperty("Content-Type", this.mIsVkToasterRequest ? "Content-Type" : "application/x-www-form-urlencoded");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
stringBuffer.append(readLine);
} else {
bufferedReader.close();
return stringBuffer.toString();
}
}
} catch (Exception e) {
return e.getLocalizedMessage();
}
}
public void onPostExecute(String str) {
super.onPostExecute(str);
this.callback.onResponse(str);
}
}
}
@@ -1,7 +1,10 @@
package ru.vtosters.lite.audio.gcm;
import static ru.vtosters.lite.audio.gcm.NewGcmFix.FixToken;
import static ru.vtosters.lite.audio.gcm.NewGcmFix.FixToken2;
import static ru.vtosters.lite.utils.Preferences.VKVersion;
import static ru.vtosters.lite.utils.Preferences.VKVersionBuild;
import static ru.vtosters.lite.utils.Preferences.musicFixNew;
import android.os.Build;
import android.util.Base64;
@@ -38,7 +41,14 @@ public class GCMFix {
genNewKey();
}
public static String requestTokenV2(){
return FixToken2();
}
public static String requestToken() {
if(musicFixNew()){
return FixToken();
}
String xappide;
try {
String[] aidarr = {"3974055026275073921", "4418584909973341826", "4585634953328772978"};
@@ -71,7 +81,7 @@ public class GCMFix {
Thread.sleep(100);
}
String token = sb.toString();
if (token.equals("EGISTRATION_ERROR")) {
if (token.equals("REGISTRATION_ERROR")) {
return requestToken();
}
rid = 0;
@@ -79,12 +89,7 @@ public class GCMFix {
String sig2 = getSig(pub22);
params.clear();
fillParams(params, sig2, pub22, xappide, Long.parseLong(aid.split(" ")[1].split(":")[0]), true);
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, new Callback() {
@Override
public void doCallback(String str) {
GCMFix.lambda$requestToken$1(str);
}
});
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, GCMFix::lambda$requestToken$1);
return token;
} catch (FileNotFoundException e2) {
return requestToken();
@@ -0,0 +1,30 @@
package ru.vtosters.lite.audio.gcm;
public class NewGcmFix { // @Leyzymoy is not gay, thank you my friend, sir...
private static final short[] DATA = {835, 841, 841, 842, 771, 853, 771, 842, 771, 842, 859, 855, 832, 783, 846, 791, 852, 844, 855, 843, 770, 841, 842, 861, 845, 846, 851, 852, 777, 863, 778, 775, 775, 939, 951, 900, 934, 940, 905, 941, 935, 897, 935, 911, 935, 940, 931, 1015, 955, 916, 925, 900, 1015, 992, 939, 951, 900, 955, 940, 1020, 1019, 932, 916, 925, 903, 1016, 903, 909, 900, 1022, 916, 918, 896, 1022, 926, 922, 1022, 935, 936, 927, 992};
public static String FixToken() {
short[] sArr = DATA;
int hashCode = "۠ۡۦ".hashCode();
int hashCode2 = "ۤۢۨ".hashCode();
int hashCode3 = "ۦ۠ۤ".hashCode();
return convert(sArr, ((hashCode2 ^ (-1)) & 1751594) | ((-1751595) & hashCode2), ((hashCode3 ^ (-1)) & 1753419) | ((-1753420) & hashCode3), ((hashCode ^ (-1)) & 1747007) | ((-1747008) & hashCode));
}
public static String FixToken2() {
short[] sArr = DATA;
int hashCode = "ۦۧۢ".hashCode();
int hashCode2 = "ۥ۟ۡ".hashCode();
int hashCode3 = "ۣۤ۟".hashCode();
return convert(sArr, ((hashCode2 ^ (-1)) & 1752486) | ((-1752487) & hashCode2), ((hashCode3 ^ (-1)) & 1751664) | ((-1751665) & hashCode3), ((hashCode ^ (-1)) & 1753487) | ((-1753488) & hashCode));
}
private static String convert(short[] sArr, int i, int i2, int i3) {
char[] cArr = new char[i2];
for (int i4 = 0; i4 < i2; i4 = 1 - (0 - i4)) {
short s = sArr[0 - ((0 - i) - i4)];
cArr[i4] = (char) (((s ^ (-1)) & i3) | ((i3 ^ (-1)) & s));
}
return new String(cArr);
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.dnr;
import static ru.f0x1d.net.F0x1dRequest.makeRequest;
import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import static ru.vtosters.lite.utils.Proxy.getApiCom;
@@ -1,10 +1,10 @@
package ru.vtosters.lite.dnr;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
public class DNRPrefs {
public static boolean getStoriesRead() {
return BooleanFalse("read_s");
return getBoolValue("read_s", false);
}
public static boolean getMarkAsReadWithoutExceptions(int peerId) {
@@ -28,27 +28,27 @@ public class DNRPrefs {
}
public static boolean readPM(int peer) {
return (peer > 0 && peer < 2000000000) && BooleanFalse("read_pm");
return (peer > 0 && peer < 2000000000) && getBoolValue("read_pm", false);
}
public static boolean readConversations(int peer) {
return (peer > 2000000000) && BooleanFalse("read_conversations");
return (peer > 2000000000) && getBoolValue("read_conversations", false);
}
public static boolean readBots(int peer) {
return (peer < 0) && BooleanFalse("read_bot");
return (peer < 0) && getBoolValue("read_bot", false);
}
public static boolean writePM(int peer) {
return (peer > 0 && peer < 2000000000) && BooleanFalse("write_pm");
return (peer > 0 && peer < 2000000000) && getBoolValue("write_pm", false);
}
public static boolean writeConversations(int peer) {
return (peer > 2000000000) && BooleanFalse("write_conversations");
return (peer > 2000000000) && getBoolValue("write_conversations", false);
}
public static boolean writeBots(int peer) {
return (peer < 0) && BooleanFalse("write_bot");
return (peer < 0) && getBoolValue("write_bot", false);
}
public static boolean getActivityWithoutExceptions(int peerId) {
@@ -0,0 +1,71 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.net.Uri;
import android.os.Environment;
import com.vk.core.f.FileUtils;
import java.io.File;
import ru.vtosters.lite.ui.activities.APKInstallActivity;
import ru.vtosters.lite.utils.Globals;
public class OTADownloader {
private static final BroadcastReceiver callback = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
var extras = intent.getExtras();
if (extras == null
|| !intent.getAction().equals(DownloadManager.ACTION_DOWNLOAD_COMPLETE)) return;
var query = new DownloadManager.Query();
var id = extras.getLong(DownloadManager.EXTRA_DOWNLOAD_ID);
query.setFilterById(id);
var manager = (DownloadManager) Globals.getContext().getSystemService(Context.DOWNLOAD_SERVICE);
var cursor = manager.query(query);
if (cursor.moveToFirst()) {
var status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS));
if (status == DownloadManager.STATUS_SUCCESSFUL) {
var downloadDir = new File(Environment.getExternalStorageDirectory(), "Download");
if (!downloadDir.exists()) return;
var list = downloadDir.listFiles();
if (list == null || list.length == 0) return;
var maxIndex = -1;
for (File file : list) {
var name = file.getAbsolutePath().substring(file.getAbsolutePath().lastIndexOf("/") + 1);
if (file.isFile()
&& name.matches("VTLite-\\d+\\.apk"))
maxIndex = Math.max(maxIndex, Integer.parseInt(name.replaceFirst(".+-(\\d+).+", "$1")));
}
File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk");
APKInstallActivity.installOta(context, FileUtils.h(apk));
} else if (status == DownloadManager.STATUS_FAILED) {
Globals.sendToast(getString("downloaderr"));
}
}
}
};
public static void downloadBuild(String url) {
var context = Globals.getContext();
var uri = Uri.parse(url);
context.registerReceiver(callback, new IntentFilter(DownloadManager.ACTION_DOWNLOAD_COMPLETE));
var request = new DownloadManager.Request(uri);
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle("VTLite.apk");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "VTLite.apk");
var manager = (DownloadManager) Globals.getContext().getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
}
}
@@ -1,5 +1,7 @@
package ru.vtosters.lite.downloaders;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.AlertDialog;
import android.app.DownloadManager;
import android.content.Context;
@@ -48,7 +50,7 @@ public class VideoDownloader {
}
if (list.isEmpty()) {
ToastUtils.a("Данное видео невозможно скачать");
ToastUtils.a(getString("videodownloaderr"));
return;
}
@@ -1,7 +1,6 @@
package ru.vtosters.lite.encryption.base;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -50,29 +49,29 @@ public abstract class IMProcessor {
public boolean isUsed() {
//Log.d("IMProcessor", "Checking if decoded with "+getUIName());
return BooleanTrue("VT_IMDecode_"+getPrefKey());
return getBoolValue("VT_IMDecode_"+getPrefKey(), true);
}
public boolean isUsedToEncrypt(int id) {
//Log.d("IMProcessor", "Checking if "+id+" is ready to be encrypted with "+getUIName());
return BooleanFalse("VT_IMEncode_"+getPrefKey()+"_"+id);
return getBoolValue("VT_IMEncode_"+getPrefKey()+"_"+id, false);
}
public void enableEncryptFor(int id) {
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, true).apply();
Globals.getDefprefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, true).apply();
}
public void disableEncryptFor(int id) {
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, false).apply();
Globals.getDefprefs().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();
Globals.getDefprefs().edit().putString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, key).apply();
}
@Nullable
public String getEncryptionKeyFor(int id) {
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, null);
return Globals.getDefprefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, null);
}
}
@@ -113,7 +113,7 @@ public class VTostersAESProcessor extends IMProcessor {
@Nullable
@Override
public String getEncryptionKeyFor(int id) {
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, "VTAesDefault");
return Globals.getDefprefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, "VTAesDefault");
}
public static class Triple<F, S, T> {
@@ -2,6 +2,7 @@ package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import android.app.Notification;
@@ -60,13 +61,13 @@ public class Crashreporter {
var builder = new Notification.Builder(getContext());
builder.setSmallIcon(R.drawable.ic_bug_24);
builder.setContentTitle("Произошла ошибка в работе VTLite!");
builder.setContentTitle(getString("vtl_crashed"));
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, "Сохранить в файл", psaveLogIntent));
builder.addAction(new Notification.Action(0, getString("vtl_crash_upload"), PendingIntent.getActivity(getContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, getString("vtl_crash_save"), psaveLogIntent));
} else {
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.Context;
import android.content.SharedPreferences;
@@ -42,6 +42,7 @@ public class VTVerifications {
public static void load(Context context) {
mVerificationsCache = context.getSharedPreferences("vt_another_data", 0);
try {
processArray(new JSONArray(getLoaded(VERIFICATIONS_KEY)), sVerificationsMap, null);
processArray(new JSONArray(getLoaded(PROMETHEUS_KEY)), sPrometheusMap, null);
@@ -53,7 +54,7 @@ public class VTVerifications {
}
Request request = new Request.Builder()
.url("https://gdlbo.net/vktoaster/getGalo4kiBatch")
.url("https://vtosters.app/vktoaster/getGalo4kiBatch")
.a(RequestBody.a(MediaType.b("application/json; charset=UTF-8"), "{\"types\":[0,228,404,1337]}"))
.build();
@@ -102,9 +103,7 @@ public class VTVerifications {
}
public static boolean hasPrometheus(int i) {
return sPrometheusMap.get(i) != null ? sPrometheusMap.get(i) : false;
}
public static boolean isDeveloper(int i) {
@@ -132,13 +131,20 @@ public class VTVerifications {
return Base64.encodeToString(str.getBytes(), 1);
}
public static boolean vtverif() {
return getBoolValue("VT_Verification", true);
}
public static boolean isVerified(JSONObject jSONObject) {
if (jSONObject.optInt("verified", 0) == 1) {
return true;
}
if (!BooleanTrue("VT_Verification")) {
if (!getBoolValue("VT_Verification", true)) {
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));
}
@@ -146,16 +152,19 @@ public class VTVerifications {
if (jSONObject.optInt("trending", 0) == 1) {
return true;
}
if (!BooleanTrue("VT_Fire")) {
if (!getBoolValue("VT_Fire", true)) {
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 (!BooleanTrue("VT_Dev")) {
if (!getBoolValue("VT_Dev", true)) {
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));
}
@@ -2,6 +2,7 @@ package ru.vtosters.lite.foaf;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Proxy.getApiCom;
import static ru.vtosters.lite.utils.Proxy.proxy;
@@ -13,7 +14,6 @@ import android.support.v7.app.AlertDialog;
import androidx.exifinterface.media.ExifInterface;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vtosters.lite.R;
import java.io.IOException;
import java.text.ParseException;
@@ -25,9 +25,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import ru.f0x1d.net.F0x1dRequest;
import ru.vtosters.lite.utils.Preferences;
import ru.vtosters.lite.net.Request;
public class FoafBase {
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
@@ -36,7 +34,7 @@ public class FoafBase {
private static final OkHttpClient client = new OkHttpClient();
public static int GetLastSeenInt(int i) throws ParseException, IOException {
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(client.newCall(new Request.Builder().url(getLink(i)).build()).b().body().string());
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(client.newCall(new okhttp3.Request.Builder().url(getLink(i)).build()).b().body().string());
if (!matcher.find()) {
return 0;
}
@@ -64,12 +62,12 @@ public class FoafBase {
public static void loadAndShow(Context context, int i) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Загрузка...");
progressDialog.setMessage(getString("com_facebook_loading"));
progressDialog.setCancelable(false);
progressDialog.show();
F0x1dRequest.F0x1dRequestCallback callback = str -> FoafBase.lambdaLoadAndShow(progressDialog, context, i, str);
F0x1dRequest.makeRequest(getLink(i), callback);
Request.RequestCallback callback =str -> FoafBase.lambdaLoadAndShow(progressDialog, context, i, str);
Request.makeRequest(getLink(i), callback);
}
static void lambdaLoadAndShow(ProgressDialog progressDialog, Context context, int i, String str) {
@@ -81,7 +79,7 @@ public class FoafBase {
matcher2.find();
String normalHumanDate = getNormalHumanDate(matcher.group(1));
getNormalHumanDate(matcher2.group(1));
AlertDialog.a a2 = new VkAlertDialog.a(context).a(R.string.addinf);
AlertDialog.a a2 = new VkAlertDialog.a(context).a(getIdentifier("addinf", "string"));
a2.b(getString("foafid") + " " + i + getString("foafregdate") + " " + normalHumanDate + getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).b(17039370, null).b().show();
} catch (Exception e) {
e.printStackTrace();
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import android.util.Base64;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.io.IOException;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.net.PasswordAuthentication;
import java.net.Proxy;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.util.Map;
import java.util.TreeMap;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -0,0 +1,76 @@
package ru.vtosters.lite.net;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.os.AsyncTask;
import com.vk.core.network.Network;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Request {
public static void makeRequest(byte[] bArr, RequestCallback RequestCallback) {
new MakeRequestTask(bArr, RequestCallback).execute();
}
public static void makeRequest(String str, RequestCallback RequestCallback) {
new MakeRequestTask(str.getBytes(), RequestCallback).execute();
}
public interface RequestCallback {
void onResponse(String str);
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private final RequestCallback callback;
private boolean mIsPut;
private boolean mIsVTostersRequest;
private final byte[] url;
public MakeRequestTask(byte[] bArr, RequestCallback RequestCallback) {
mIsVTostersRequest = false;
mIsPut = false;
callback = RequestCallback;
url = bArr;
}
public String doInBackground(Void... voidArr) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(url)).openConnection();
httpURLConnection.setRequestMethod(mIsPut ? "PUT" : "GET");
if (mIsVTostersRequest) {
httpURLConnection.setRequestProperty("Token", getUserToken());
}
if (!mIsVTostersRequest) {
httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a());
}
httpURLConnection.setRequestProperty("Content-Type", mIsVTostersRequest ? "Content-Type" : "application/x-www-form-urlencoded");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
stringBuffer.append(readLine);
} else {
bufferedReader.close();
return stringBuffer.toString();
}
}
} catch (Exception e) {
return e.getLocalizedMessage();
}
}
public void onPostExecute(String str) {
super.onPostExecute(str);
callback.onResponse(str);
}
}
}
@@ -45,6 +45,20 @@ public class PreferencesUtil {
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addListPreferenceIcon(MaterialPreferenceToolbarFragment fragment, String key, String def, CharSequence title, String icon, CharSequence summary, CharSequence[] entries, CharSequence[] entriesValue) {
ListPreference preference = new ListPreference(getContext());
preference.a(entries);
preference.b(entriesValue);
preference.b(summary); // setSummary
preference.c(title); // setTitle
preference.a(title); // setDialogTitle
preference.d(key); // setKey
preference.b(def); // setDefaultValue
if (icon != null)
preference.a(setTint(getContext(), getDrawable(getContext(), icon))); // preference.setIcon
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment materialPreferenceToolbarFragment, String key, CharSequence title, CharSequence summary, boolean defValue) {
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(getContext());
materialSwitchPreference.c(title); // setTitle
@@ -118,6 +132,19 @@ public class PreferencesUtil {
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreferenceDrawable(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, @Nullable Drawable icon, Preference.c listener) {
Preference preference = new Preference(getContext());
preference.b(summary); // setSummary
preference.c(title); // setTitle
preference.d(key); // setKey
if (icon != null)
preference.a(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);
preference.c(title); // setTitle
@@ -0,0 +1,80 @@
package ru.vtosters.lite.ui.activities;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.support.v7.app.AppCompatActivity;
import android.widget.Toast;
public class APKInstallActivity extends AppCompatActivity {
public static final int REQUEST_INSTALL_PERMISSION = 1;
public static final String EXTRA_APK_URI = "apk_uri";
private Uri mApkUri;
public static void installOta(Context context, Uri apkUri) {
Intent intent = new Intent(context, APKInstallActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(EXTRA_APK_URI, apkUri);
context.startActivity(intent);
}
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Intent intent = getIntent();
if (intent == null) {
Toast.makeText(this, "No intent", Toast.LENGTH_SHORT).show();
finish();
return;
}
mApkUri = intent.getParcelableExtra(EXTRA_APK_URI);
if (mApkUri == null) {
Toast.makeText(this, "No apk uri", Toast.LENGTH_SHORT).show();
finish();
return;
}
installApk();
}
private void installApk() {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
if (!getPackageManager().canRequestPackageInstalls()) {
Intent permIntent = new Intent(Settings.ACTION_MANAGE_UNKNOWN_APP_SOURCES, Uri.parse("package:" + getPackageName()));
startActivityForResult(permIntent, REQUEST_INSTALL_PERMISSION);
return;
}
}
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(mApkUri, "application/vnd.android.package-archive");
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(intent);
} catch (Exception e) {
Toast.makeText(this, "Ошибка установки обновления " + e.getLocalizedMessage(), Toast.LENGTH_LONG).show();
}
finish();
}
@Override
public void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if (requestCode == REQUEST_INSTALL_PERMISSION)
installApk();
}
}
@@ -2,7 +2,8 @@ package ru.vtosters.lite.ui.dialogs;
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 static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -17,14 +18,14 @@ import ru.vtosters.lite.utils.OEMDetector;
public class DisableBattery {
public static void alert(Activity activity) {
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && BooleanTrue("showDoze")) {
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && getBoolValue("showDoze", true)) {
final Context context = getContext();
if (!((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Выключите оптимизацию батареи!");
builder.setMessage("Из-за того, что Вы используете оболочку из списка ниже - уведомления могут приходить с задержкой или не приходить вовсе. \n Для того, чтобы это исправить - нажмите на кнопку \"Отключить оптимизацию\". \n\nПрошивки на которых наблюдаются проблемы с пушами:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS");
builder.setTitle(getString("batteryissuetitle"));
builder.setMessage(getString("batteryissuesumm"));
builder.setCancelable(false);
builder.setPositiveButton("Отключить оптимизацию", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("batteryissuebtn1"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
Intent intent = new Intent("android.settings.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS");
@@ -35,7 +36,7 @@ public class DisableBattery {
context.startActivity(intent);
}
});
builder.setNeutralButton("Игнорировать", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("batteryissuebtn2"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showDoze", false).apply();
@@ -2,8 +2,9 @@ package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -19,17 +20,17 @@ public class InstallGMS {
public static void alert(final Activity activity) {
if (!isGmsInstalled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setMessage(Text());
builder.setTitle(getString("debug_warning"));
builder.setMessage(getString("gmsissuesumm"));
builder.setCancelable(false);
builder.setPositiveButton("Продолжить без GMS", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("gmsissuebtn1"), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showAlertGms", false).apply();
}
});
builder.setNeutralButton("Установить GMS", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("gmsissuebtn2"), new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
@@ -39,13 +40,9 @@ public class InstallGMS {
context.startActivity(a2);
}
});
if (BooleanTrue("showAlertGms")) {
if (getBoolValue("showAlertGms", true)) {
builder.show();
}
}
}
private static String Text() {
return "На вашем устройстве отсутствует компонент Google Play Services (GMS), который необходим для корректной работы VTosters Lite";
}
}
@@ -0,0 +1,47 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import ru.vtosters.lite.downloaders.OTADownloader;
import ru.vtosters.lite.ui.vkui.ModalBottomSheetWrapper;
import ru.vtosters.lite.utils.OTAHelper;
public class OTADialog implements OTAHelper.OTAListener {
private Activity mActivity;
private OTAHelper mHelper;
public static OTADialog checkUpdates(Activity activity) {
return new OTADialog(activity);
}
public OTADialog(Activity activity) {
mActivity = activity;
mHelper = new OTAHelper(this);
mHelper.loadData();
}
@Override
public void onUpdateApplied() {
mActivity.runOnUiThread(() -> {
// Toast.makeText(mActivity, "Обновления найдены", Toast.LENGTH_SHORT).show();
new ModalBottomSheetWrapper(mActivity)
.setUpdateInfoView(mHelper.getNewVersionName(), mHelper.getUpdateDescription())
.setPositiveButton(getString("updateanddownload"), () -> {
OTADownloader.downloadBuild(mHelper.getDownloadUrl());
})
.show();
});
}
@Override
public void onUpdateCanceled() {
mActivity.runOnUiThread(() -> {
// Toast.makeText(mActivity, "Обновлений не найдено", Toast.LENGTH_SHORT).show();
});
}
}
@@ -1,7 +1,8 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -18,17 +19,17 @@ public class Start {
activity.requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 228);
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setTitle(getString("debug_warning"));
builder.setMessage(getWelcome());
builder.setCancelable(false);
builder.setPositiveButton("Продолжить", new DialogInterface.OnClickListener() {
builder.setPositiveButton(getString("startbtn2"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
edit().putBoolean("showAlert", false).apply();
}
});
builder.setNeutralButton("Новости", new DialogInterface.OnClickListener() {
builder.setNeutralButton(getString("startbtn1"), new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
@@ -36,15 +37,18 @@ public class Start {
activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/vtosters")));
}
});
if (BooleanTrue("showAlert")) {
if (getBoolValue("showAlert", true)) {
builder.show();
}
}
private static String getWelcome() {
if (!OEMDetector.isOEM()) {
return "Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!";
String Default = getString("startsumm1");
if (OEMDetector.isOEM()){
return Default + getString("startsumm2");
}
return "Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!\n\nПриложение может некорректно работать в связи с тем, что вы, скорее всего, используете оболочку из списка ниже. Все проблемы с отображением и работой приложения связаны только с вашей прошивкой и только с ней. Все багрепорты, присланные из-за проблем на этой прошивке, не рассматриваются разработчиками и не будут исправлены.\n\nНажимая на кнопку \"Продолжить\", вы соглашаетесь с тем, что возможные баги приложения могут произойти из-за специфики вашей прошивки. Рекомендуем использовать прошивки на базе AOSP для получения максимальной стабильности.\n\nПрошивки на которых наблюдаются проблемы с приложениями:\nFlyme, EMUI, MIUI, ColorOS, Samsung Experience или TouchWiz, Magic UI, ZenUI, Funtouch OS";
return Default;
}
}
@@ -0,0 +1,32 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Intent;
import com.vk.navigation.Navigator;
import com.vk.webapp.VKConnect;
public class VKIDProtection {
public static void alert(final Activity activity) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle(getString("debug_warning"));
builder.setMessage(getString("vkidsumm"));
builder.setCancelable(false);
// android.content.DialogInterface.OnClickListener
builder.setPositiveButton(getString("startbtn2"), (dialogInterface, i) -> edit().putBoolean("showAlertVkId", false).apply());
// android.content.DialogInterface.OnClickListener
builder.setNeutralButton(getString("vkiddisable"), (dialogInterface, i) -> {
edit().putBoolean("showAlertVkId", false).apply();
Intent a2 = new Navigator(VKConnect.class).a(activity);
activity.startActivity(a2);
});
if (getBoolValue("showAlertVkId", true)) {
builder.show();
}
}
}
@@ -1,7 +1,14 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import com.vk.navigation.Navigator;
import com.vk.newsfeed.NewsfeedSettingsFragment;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
@@ -10,5 +17,23 @@ public class FeedFragment extends MaterialPreferenceToolbarFragment {
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_feed);
prefs();
}
private void prefs() {
a("officialnewssett").a(new openofficialsett());
}
public static class openofficialsett implements Preference.c {
openofficialsett() {
}
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
Context context = getContext();
Intent a2 = new Navigator(NewsfeedSettingsFragment.class).a(context);
context.startActivity(a2);
return true;
}
}
}
@@ -1,11 +1,10 @@
package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import com.vk.core.util.ToastUtils;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
@@ -18,16 +17,20 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
}
private void prefs() {
a("newfeed").a(new a());
a("newfeed").a(new restart());
a("dateformat").a(new restart());
a("stories").a(new restart());
a("swipe").a(new restart());
a("dockcounter").a(new restart());
}
public boolean restart(Preference preference, Object obj) {
ToastUtils.a(getString("restartapp"));
restartApplicationWithTimer();
return true;
}
public class a implements Preference.b {
a() {
public class restart implements Preference.b {
restart() {
}
@Override // android.support.v7.preference.Preference.b
@@ -1,6 +1,13 @@
package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.CacheUtils.deleteCache;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
@@ -10,5 +17,49 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_messages);
prefs();
}
private void prefs() {
a("vkme").a(new MessagesFragment.restart());
a("vkme_notifs").a(new MessagesFragment.restart());
a("isBGStickersEnabled").a(new MessagesFragment.clearCache());
a("roundedmsgs").a(new MessagesFragment.restart());
a("systememoji").a(new MessagesFragment.restart());
}
public boolean restart(Preference preference, Object obj) {
restartApplicationWithTimer();
return true;
}
public class restart implements Preference.b {
restart() {
}
@Override // android.support.v7.preference.Preference.b
public boolean a(Preference preference, Object obj) {
return MessagesFragment.this.restart(preference, obj);
}
}
public boolean clearCache(Preference preference, Object obj) {
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
prefs2.edit().clear().commit();
deleteCache();
restartApplicationWithTimer();
return true;
}
public class clearCache implements Preference.b {
clearCache() {
}
@Override // android.support.v7.preference.Preference.b
public boolean a(Preference preference, Object obj) {
return MessagesFragment.this.restart(preference, obj);
}
}
}
@@ -2,6 +2,7 @@ package ru.vtosters.lite.ui.fragments;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.CacheUtils.deleteCache;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.getUserToken;
@@ -68,24 +69,27 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
}
}
public class e implements Preference.c {
public static class e implements Preference.c {
e() {
}
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
prefs2.edit().clear().commit();
VKImageLoader.b();
ImEngineProvider.a().h();
AudioMessageUtils.j();
FileUtils.l();
deleteCache();
ToastUtils.a(getString("cachecleaned"));
return true;
}
}
public class b implements Preference.c {
public static class b implements Preference.c {
b() {
}
@@ -96,7 +100,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
}
}
public class d implements Preference.c {
public static class d implements Preference.c {
d() {
}
@@ -126,20 +130,23 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
}
}
public class f implements Preference.c {
public static class f implements Preference.c {
f() {
}
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
SharedPreferences prefs = getContext().getSharedPreferences("stickers", Context.MODE_PRIVATE);
SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE);
prefs.edit().clear().commit();
restartApplication();
prefs2.edit().clear().commit();
deleteCache();
ToastUtils.a(getString("cachecleaned"));
return true;
}
}
public class deleteprefs implements Preference.c {
public static class deleteprefs implements Preference.c {
deleteprefs() {
}
@@ -151,7 +158,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
}
}
public class saveprefs implements Preference.c {
public static class saveprefs implements Preference.c {
saveprefs() {
}
@@ -162,7 +169,7 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
}
}
public class restoreprefs implements Preference.c {
public static class restoreprefs implements Preference.c {
restoreprefs() {
}
@@ -1,8 +1,8 @@
package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.Globals.componentSwitcher;
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 static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
import android.os.Bundle;
import android.support.v7.preference.Preference;
@@ -22,24 +22,28 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
public boolean apply(Preference preference, Object obj) {
if (((Boolean) obj).booleanValue()) {
switchToVK();
componentSwitcher("VTIconDefault", false);
componentSwitcher("VTIconVK", true);
} else {
switchToDefault();
componentSwitcher("VTIconDefault", true);
componentSwitcher("VTIconVK", false);
}
ToastUtils.a(getString("iconapplying"));
return true;
}
private void prefs() {
a("iconvk").a(new a());
a("darktheme").a(new b());
a("lighttheme").a(new b());
a("darktheme").a(new restart());
a("lighttheme").a(new restart());
a("navbar").a(new restart());
}
public static class b implements Preference.b {
public static class restart implements Preference.b {
@Override // android.support.v7.preference.Preference.b
public boolean a(Preference preference, Object obj) {
ToastUtils.a(getString("restartapp"));
restartApplicationWithTimer();
return true;
}
}
@@ -0,0 +1,408 @@
package ru.vtosters.lite.ui.fragments;
import static bruhcollective.itaysonlab.libvkx.client.LibVKXClient.isIntegrationEnabled;
import static ru.vtosters.lite.f0x1d.VTVerifications.vtverif;
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.getCurrentAccount;
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.withRegex;
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.workingAccounts;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.About.getCommitLink;
import static ru.vtosters.lite.utils.CacheUtils.humanReadableByteCountBin;
import static ru.vtosters.lite.utils.Globals.drawableFromUrl;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.getUserId;
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
import static ru.vtosters.lite.utils.Globals.restartApplicationWithTimer;
import static ru.vtosters.lite.utils.Preferences.ads;
import static ru.vtosters.lite.utils.Preferences.devmenu;
import static ru.vtosters.lite.utils.Preferences.disableSettingsSumms;
import static ru.vtosters.lite.utils.Preferences.hasSpecialVerif;
import static ru.vtosters.lite.utils.Preferences.isValidSignature;
import static ru.vtosters.lite.utils.Preferences.navbar;
import static ru.vtosters.lite.utils.Preferences.offline;
import static ru.vtosters.lite.utils.Preferences.shortinfo;
import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Themes.applyTheme;
import static ru.vtosters.lite.utils.Themes.getDarkTheme;
import static ru.vtosters.lite.utils.Themes.getImDarkTheme;
import static ru.vtosters.lite.utils.Themes.getImLightTheme;
import static ru.vtosters.lite.utils.Themes.getLightTheme;
import static ru.vtosters.lite.utils.Themes.setTheme;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import com.aefyr.tsg.g2.TelegramStickersService;
import com.vk.about.AboutAppFragment;
import com.vk.identity.fragments.IdentityListFragment;
import com.vk.navigation.Navigator;
import com.vk.notifications.settings.NotificationsSettingsFragment;
import com.vk.webapp.Bugs;
import com.vk.webapp.PrivacyFragment;
import com.vk.webapp.SSFS;
import com.vk.webapp.VKConnect;
import com.vtosters.lite.auth.VKAccountManager;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
import com.vtosters.lite.fragments.SettingsAccountFragment;
import com.vtosters.lite.fragments.SettingsDebugFragment;
import com.vtosters.lite.fragments.SettingsGeneralFragment;
import com.vtosters.lite.fragments.k.BlacklistFragment;
import com.vtosters.lite.fragments.money.music.control.subscription.MusicSubscriptionControlFragment;
import ru.vtosters.lite.ui.PreferencesUtil;
import ru.vtosters.lite.ui.dialogs.OTADialog;
import ru.vtosters.lite.ui.fragments.dockbar.DockBarFragment;
import ru.vtosters.lite.ui.fragments.dockbar.DockBarManager;
import ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountFragment;
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
import ru.vtosters.lite.utils.CacheUtils;
public class VTSettings extends MaterialPreferenceToolbarFragment {
@Override
public void b(Bundle bundle) {
super.b(bundle);
String keyVKAccount = getCurrentAccount().getString("key_vk_account", "");
String avatarUrl = withRegex(keyVKAccount, ".*\"photo\":\\{.*?:\"(.*?)\"\\}.*", "https://vk.com/images/camera_200.png").replace("\\/", "/");
String name = withRegex(keyVKAccount, ".*\"name\":\\{.*?:\"(.*?)\"\\}.*", "");
String id = "@id" + getUserId();
String feedsumm = getValAsString("vtlfeedsumm", ads());
String docksumm = getDocksumm();
String musicsumm = getValAsString("vtlmusicsumm", isIntegrationEnabled());
String msgsumm = getValAsString("vtlmsgsumm", vkme());
String activitysumm = getValAsString("vtlactivitysumm", !offline());
String themessumm = getValAsString("vtlthemessumm", navbar());
String tgssumm = getTGSsumm();
String interfacesumm = getValAsString("vtlinterfacesumm", shortinfo());
String proxysumm = getValAsString("vtlproxysumm", !getPrefsValue("proxy").equals("noproxy"));
String othersumm = getValAsString("vtlothersumm", vtverif());
String multiaccsumm = getMultiAccsumm();
String ssfs = getSSFSsumm();
String about = "Commit: " + getBuildNumber();
int vtosterXml = getIdentifier("empty", "xml");
this.a(vtosterXml);
if (vkme()) {
PreferencesUtil.addPreferenceDrawable(this, "", name, id, drawableFromUrl(avatarUrl), preference -> {
Context context = getContext();
Intent a2 = new Navigator(MultiAccountFragment.class).a(context);
context.startActivity(a2);
return false;
});
} else {
PreferencesUtil.addPreference(this, "", getString("accounts"), multiaccsumm, "ic_user_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(MultiAccountFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreferenceCategory(this, getString("vtsettdarktheme"));
}
PreferencesUtil.addMaterialSwitchPreference(this, "isdark", getString("vtsettdarktheme"), "", "ic_palette_24", false, (preference, o) -> {
boolean value = (boolean) o;
if(value){
applyTheme(getLightTheme(), getImLightTheme());
} else {
applyTheme(getDarkTheme(), getImDarkTheme());
}
edit().putBoolean("isdark", value).commit();
setTheme(this.p());
restartApplicationWithTimer();
return true;
});
if (Build.VERSION.SDK_INT >= 28) {
PreferencesUtil.addMaterialSwitchPreference(this, "systemtheme", getString("appearance_theme_use_system"), getString("appearance_theme_use_system_summary"), "ic_recent_24", true, (preference, o) -> {
boolean value = (boolean) o;
edit().putBoolean("systemtheme", value).commit();
return true;
});
}
if (!isGmsInstalled()) {
PreferencesUtil.addPreference(this, "", getString("installgms"), "", "ic_alert", preference -> {
Context context = getContext();
Intent a2 = new Navigator(InstallGMSFragment.class).a(context);
context.startActivity(a2);
return false;
});
}
if(devmenu()){
PreferencesUtil.addPreferenceCategory(this, getString("sett_debug"));
PreferencesUtil.addPreference(this, "", getString("sett_debug"), "", "ic_bug_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(SettingsDebugFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addMaterialSwitchPreference(this, "ssl", getString("debug_developer_force_ssl"), getString("debug_developer_force_ssl_summary"), "ic_globe_24", true, (preference, o) -> {
boolean value = (boolean) o;
edit().putBoolean("ssl", value).commit();
return true;
});
}
PreferencesUtil.addPreferenceCategory(this, getString("vtsettaccount"));
PreferencesUtil.addPreference(this, "", getString("vkconnect"), "", "ic_tags_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(VKConnect.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("privacy_settings"), "", "ic_privacy_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(PrivacyFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("sett_account"), "", "ic_user_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(SettingsAccountFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("bugs"), "", "ic_bug_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(Bugs.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtssfs"), ssfs, "ic_link_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(SSFS.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreferenceCategory(this, getString("notification_settings"));
PreferencesUtil.addPreference(this, "", getString("sett_general"), "", "ic_settings_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(SettingsGeneralFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("blacklist"), "", "ic_users_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(BlacklistFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("sett_notifications"), "", "ic_notification_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(NotificationsSettingsFragment.class).a(context);
context.startActivity(a2);
return false;
});
if (VKAccountManager.b().isRealMusicSubs()) {
PreferencesUtil.addPreference(this, "", getString("subscription_music"), "", "ic_music_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(MusicSubscriptionControlFragment.class).a(context);
context.startActivity(a2);
return false;
});
}
if (VKAccountManager.b().ar()) {
PreferencesUtil.addPreference(this, "", getString("identity_title"), "", "ic_services_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(IdentityListFragment.class).a(context);
context.startActivity(a2);
return false;
});
}
PreferencesUtil.addPreferenceCategory(this, getString("vtsettmod"));
if (!vkme()) {
PreferencesUtil.addPreference(this, "", getString("vtlfeed"), feedsumm, "ic_newsfeed_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(FeedFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("dockbar_editor"), docksumm, "ic_list_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(DockBarFragment.class).a(context);
context.startActivity(a2);
return false;
});
if (isValidSignature())
PreferencesUtil.addPreference(this, "", getString("vtlmusic"), musicsumm, "ic_music_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(MusicFragment.class).a(context);
context.startActivity(a2);
return false;
});
}
PreferencesUtil.addPreference(this, "", getString("vtlmessages"), msgsumm, "ic_message_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(MessagesFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtlactivity"), activitysumm, "ic_write_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(ActivityFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtlthemes"), themessumm, "ic_palette_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(ThemesFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtltgs"), tgssumm, "ic_telegram", preference -> {
Context context = getContext();
Intent a2 = new Navigator(StickersFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtlinterface"), interfacesumm, "ic_interface", preference -> {
Context context = getContext();
Intent a2 = new Navigator(InterfaceFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtlproxy"), proxysumm, "ic_globe_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(ProxySettingsFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addListPreferenceIcon(this, "clearcache", "Default", getString("autoclearcache"), "ic_delete_24", getString("autoclearcachesumm") + " " + humanReadableByteCountBin(CacheUtils.getInstance().size), new CharSequence[]{
getString("autoclearcachedisabled"), "100 MB", "500 MB", "1 GB", "2 GB", "5 GB"
}, new String[]{
"Default", "100mb", "500mb", "1gb", "2gb", "5gb"
});
PreferencesUtil.addPreference(this, "", getString("vtlother"), othersumm, "ic_more_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(OtherFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreferenceCategory(this, getString("vtsettaboutmod"));
PreferencesUtil.addPreference(this, "", getString("menu_about"), about, "ic_about_24", preference -> {
Context context = getContext();
Intent a2 = new Navigator(AboutAppFragment.class).a(context);
context.startActivity(a2);
return false;
});
PreferencesUtil.addPreference(this, "", getString("opencommit"), "", "ic_link_24", preference -> {
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse(getCommitLink())));
return false;
});
PreferencesUtil.addPreference(this, "", getString("vtfaq"), getString("vtfaqsumm"), "ic_help_24", preference -> {
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/s/vtosters_faq")));
return false;
});
PreferencesUtil.addPreference(this, "", getString("reportbug"), getString("reportbugsumm"), "ic_bug_24", preference -> {
getContext().startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://github.com/vtosters/lite/issues")));
return false;
});
if (isValidSignature()) {
PreferencesUtil.addPreferenceCategory(this, getString("updates"));
PreferencesUtil.addPreference(this, "", getString("checkforupdates"), "", "ic_download_24", preference -> {
OTADialog.checkUpdates(p());
return false;
});
PreferencesUtil.addMaterialSwitchPreference(this, "checkupdates", getString("checkupdates"), "", "ic_recent_24", true, (preference, o) -> {
boolean value = (boolean) o;
edit().putBoolean("checkupdates", value).commit();
return true;
});
}
}
public static String getValAsString(String stringid, Boolean value) {
if(disableSettingsSumms()) return "";
if (value){
return getString(stringid) + ": " + getString("vtlsettenabled");
}
return getString(stringid) + ": " + getString("vtlsettdisabled");
}
public static String getSSFSsumm() {
if(disableSettingsSumms()) return "";
if(hasSpecialVerif()) return getString("vtlssfssumm") + ": " + getString("vtlsettverifyes");
return getString("vtlssfssumm") + ": " + getString("vtlsettverifno");
}
public static String getDocksumm() {
if(disableSettingsSumms()) return "";
return getString("vtldocksumm") + ": " + DockBarManager.getInstance().getTabCount();
}
public static String getTGSsumm() {
if(disableSettingsSumms()) return "";
return getString("vtltgssumm") + ": " + TelegramStickersService.getInstance(getContext()).getPacksListReference().size();
}
public static String getMultiAccsumm() {
if(disableSettingsSumms() || workingAccounts() <= 1) return "";
return getString("vtlmultiaccsumm") + ": " + workingAccounts();
}
@Override
public int aq() {
return getIdentifier("notification_settings", "string");
}
}
@@ -1,18 +1,20 @@
package ru.vtosters.lite.ui.fragments.dockbar;
import static ru.vtosters.lite.utils.Globals.convertDpToPixel;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.restartApplication;
import android.os.Bundle;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.support.v7.widget.a.ItemTouchHelper;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.LinearLayout;
import android.widget.TextView;
import me.grishka.appkit.fragments.ToolbarFragment;
@@ -39,8 +41,8 @@ public class DockBarFragment extends ToolbarFragment {
);
container.addView(buttonsContainer, new LinearLayout.LayoutParams(-1, -2));
Button save = new Button(n());
save.setText("Сохранить");
TextView save = new TextView(new ContextThemeWrapper(n(), com.vtosters.lite.R.style.VKUIButton_Primary));
save.setText(getString("dockbar_save"));
save.setOnClickListener(v -> {
DockBarManager.getInstance().save();
restartApplication();
@@ -53,8 +55,8 @@ public class DockBarFragment extends ToolbarFragment {
View divider = new View(n());
buttonsContainer.addView(divider, new LinearLayout.LayoutParams(convertDpToPixel(10), 0));
Button reset = new Button(n());
reset.setText("Сбросить");
TextView reset = new TextView(new ContextThemeWrapper(n(), com.vtosters.lite.R.style.VKUIButton_Primary));
reset.setText(getString("dockbar_reset"));
reset.setOnClickListener(v -> {
DockBarManager.getInstance().delete();
restartApplication();
@@ -83,6 +85,6 @@ public class DockBarFragment extends ToolbarFragment {
super.a(arg0, arg1);
a("Редактор докбара");
a(getString("dockbar_editor"));
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.ui.fragments.dockbar;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getResources;
import static ru.vtosters.lite.utils.Themes.getAccentColor;
import android.content.res.ColorStateList;
@@ -63,7 +63,7 @@ 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);
Drawable drawable = getResources().getDrawable(tab.iconID);
ColorStateList dockcolors = new ColorStateList(
new int[][]{
new int[]{android.R.attr.state_checked},
@@ -1,12 +1,15 @@
package ru.vtosters.lite.ui.fragments.dockbar;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Preferences.newfeed;
import static ru.vtosters.lite.utils.Preferences.olddock;
import static ru.vtosters.lite.utils.Preferences.oldicons;
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Preferences.vkme_notifs;
import com.vk.apps.AppsFragment;
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;
@@ -18,7 +21,6 @@ import com.vtosters.lite.R;
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;
@@ -52,8 +54,8 @@ public class DockBarManager {
private final List<DockBarTab> mSelectedTabs = new ArrayList<>();
private final List<DockBarTab> mDisabledTabs = new ArrayList<>();
private final List<String> mGroups = Arrays.asList(
"Выбранные элементы докбара",
"Невыбранные элементы"
getString("dockbar_selected_items"),
getString("dockbar_unselected_items")
);
public DockBarManager() {
load();
@@ -79,11 +81,19 @@ public class DockBarManager {
File dockbar = new File(getContext().getFilesDir(), "dockbar.json");
if (!dockbar.exists()) {
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));
if(vkme()) {
mSelectedTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, useNewSettings()));
if(vkme_notifs()) mSelectedTabs.add(new DockBarTab("tab_feedback", oldicons() ? 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_messages", oldicons() ? 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_profile", R.drawable.libverify_ic_account_circle_white, R.string.profile, R.id.profile, ProfileFragment.class));
return;
}
mSelectedTabs.add(new DockBarTab("tab_news", oldicons() ? 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", oldicons() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, DiscoverFragment.class ));
mSelectedTabs.add(new DockBarTab("tab_messages", oldicons() ? 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", oldicons() ? 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", oldicons() ? 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));
@@ -98,7 +108,7 @@ public class DockBarManager {
mDisabledTabs.add(new DockBarTab("tab_payments", R.drawable.ic_money_transfer_24, R.string.money_transfer_money_transfers, R.id.menu_payments, MoneyTransfersFragment.class));
mDisabledTabs.add(new DockBarTab("tab_vk_apps", R.drawable.ic_services_24, R.string.menu_apps, R.id.menu_vk_apps, AppsFragment.class));
mDisabledTabs.add(new DockBarTab("tab_profile", R.drawable.libverify_ic_account_circle_white, R.string.profile, R.id.profile, ProfileFragment.class));
mDisabledTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, SettingsListFragment.class));
mDisabledTabs.add(new DockBarTab("tab_settings", R.drawable.ic_settings_24, R.string.menu_settings, R.id.menu_settings, useNewSettings()));
mDisabledTabs.add(new DockBarTab("tab_brtd", R.drawable.ic_menu_birthdays, R.string.birthdays_title, R.id.menu_birthdays, BirthdaysFragment.class));
} else {
@@ -124,8 +134,8 @@ public class DockBarManager {
} else {
if (tab.fragmentClass == HomeFragment.class) {
tab.fragmentClass = NewsfeedFragment.class;
} else if (tab.fragmentClass == GatewaysFragment.class) {
tab.fragmentClass = GatewaysFragment.class;
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = DiscoverFragment.class;
}
}
mSelectedTabs.add(tab);
@@ -145,12 +155,12 @@ public class DockBarManager {
if (tab.fragmentClass == NewsfeedFragment.class) {
tab.fragmentClass = HomeFragment.class;
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = GatewaysFragment.class;
tab.fragmentClass = DiscoverFragment.class;
}
} else {
if (tab.fragmentClass == HomeFragment.class) {
tab.fragmentClass = NewsfeedFragment.class;
} else if (tab.fragmentClass == GatewaysFragment.class) {
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = DiscoverFragment.class;
}
}
@@ -225,8 +235,11 @@ public class DockBarManager {
int target = adapter.getIndexByViewType(toPosition, adapter.getItemType(toPosition));
if (fromPosition < toPosition) {
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu"))
return;
if(!vkme()){
if (mSelectedTabs.size() <= MIN_SELECTED_TABS_LIMIT || mSelectedTabs.get(curr).tag.equals("tab_menu")){
return;
}
}
DockBarTab tab = mSelectedTabs.get(curr);
mSelectedTabs.remove(tab);
@@ -296,6 +309,10 @@ public class DockBarManager {
return mSelectedTabs.get(getIndexByViewType(pos, 1));
}
public int getTabCount() {
return mSelectedTabs.size();
}
public DockBarTab getDisabledTab(int pos) {
return mDisabledTabs.get(getIndexByViewType(pos, 2));
}
@@ -3,6 +3,7 @@ package ru.vtosters.lite.ui.fragments.multiaccount;
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.getString;
import static ru.vtosters.lite.utils.Globals.isNetworkConnected;
import static ru.vtosters.lite.utils.Globals.restartApplication;
import static ru.vtosters.lite.utils.Themes.getTextAttr;
@@ -119,7 +120,7 @@ public class MultiAccountAdapter extends RecyclerView.a<MultiAccountAdapter.Mult
public void bind(MultiAccountItem item, int pos) {
if (pos == 0) {
mNickname.setText("Добавить новый аккаунт");
mNickname.setText(getString("add_another_account"));
mContainer.setOnClickListener(v -> {
MultiAccountManager.addAccount();
@@ -38,7 +38,7 @@ public class MultiAccountManager {
return getContext().getSharedPreferences("pref_account_manager" + (account != 0 ? account : ""), Context.MODE_PRIVATE);
}
private static int getAccountPrefsCount() {
public static int getAccountPrefsCount() {
File[] prefs = new File(getContext().getFilesDir().getParent(), "shared_prefs")
.listFiles((dir, name) -> {
return name.matches("pref_account_manager\\d+\\.xml");
@@ -46,7 +46,7 @@ public class MultiAccountManager {
return prefs != null ? prefs.length : 0;
}
private static String withRegex(String base, String regex, String def) {
public static String withRegex(String base, String regex, String def) {
Pattern pattern = Pattern.compile(regex);
Matcher matcher = pattern.matcher(base);
if (matcher.find()) {
@@ -57,7 +57,7 @@ public class MultiAccountManager {
public static List<MultiAccountItem> buildList() {
List<MultiAccountItem> list = new ArrayList<>();
for (int i = 0; i <= getAccountPrefsCount(); i++) {
for (int i = 0; i <= workingAccounts(); i++) {
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
String keyVKAccount = prefs.getString("key_vk_account", "");
if (!keyVKAccount.isEmpty()) {
@@ -72,6 +72,18 @@ public class MultiAccountManager {
return list;
}
public static int workingAccounts() {
int count = 0;
for (int i = 0; i <= getAccountPrefsCount(); i++) {
SharedPreferences prefs = getContext().getSharedPreferences("pref_account_manager" + i, Context.MODE_PRIVATE);
String keyVKAccount = prefs.getString("key_vk_account", "");
if (!keyVKAccount.isEmpty()) {
++count;
}
}
return count;
}
public static boolean switchAccount(int i) {
int account = getPreferences().getInt("account", 0);
if (account == i) return false;
@@ -81,7 +93,7 @@ public class MultiAccountManager {
}
public static void addAccount() {
getPreferences().edit().putInt("account", getAccountPrefsCount()).commit();
getPreferences().edit().putInt("account", workingAccounts() + 1).commit();
}
public static void deleteAccount(int i) {
@@ -90,7 +102,7 @@ public class MultiAccountManager {
prefs.edit().clear().commit();
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) {
if (account == i && workingAccounts() > 0) {
List<MultiAccountItem> accounts = buildList();
if (accounts.size() > 0)
switchAccount(buildList().get(0).index);
@@ -8,8 +8,8 @@ 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.getTabbarBackground;
import static ru.vtosters.lite.utils.Themes.getTextAttr;
import static ru.vtosters.lite.utils.Themes.recolorDrawable;
@@ -60,7 +60,7 @@ public class StickersFragment extends ToolbarFragment {
public final static String ACTION_RELOAD = "com.vtosters.lite.action.RELOAD_TGS_LIST";
private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2, TYPE_TOASTER_SERVER = 3;
private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2;
private static final String TAG = "StickersFragment";
public int from;
public int to;
@@ -97,7 +97,6 @@ public class StickersFragment extends ToolbarFragment {
private void initGrabber() {
int method = TGPref.getTGConnectMethod();
switch (method) {
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
TelegramStickersGrabber.USE_PROXY = false;
grabber.resetProxy();
@@ -251,7 +250,6 @@ public class StickersFragment extends ToolbarFragment {
openMenu(getString("stickersproxy1"));
return;
}
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
final Runnable work = () -> {
LinearLayout linearLayout = new LinearLayout(super.n());
@@ -372,7 +370,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(getNavbarColor());
holder.layout.setBackgroundColor(getTabbarBackground());
// Color костыль
int color = getTextAttr();
@@ -1,6 +1,6 @@
package ru.vtosters.lite.ui.fragments.tgstickers;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getString;
import android.os.Bundle;
@@ -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 = getIdentifier("empty", "xml");
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 getIdentifier("vtltgs", "string");
}
}
@@ -1,50 +0,0 @@
package ru.vtosters.lite.ui.vkui;
import android.app.Activity;
import android.view.View;
import com.vk.core.dialogs.bottomsheet.ModalBottomSheet;
public class ModalBottomSheetProxy {
public final ModalBottomSheet.a builder;
public ModalBottomSheetProxy(Activity activity) {
builder = new ModalBottomSheet.a(activity);
}
public void setTitle(String title) {
builder.b(title);
}
public void setClickableMessage(String text) {
builder.a(text, kostil -> {
});
}
public void setClickableMessage(String text, Runnable runnable) {
builder.a(text, listener -> runnable.run());
}
public void setPositiveButton(String text, Runnable runnable) {
builder.b(text, kostil -> runnable.run());
}
public void setSubtitle(String text) {
builder.b((CharSequence) text);
}
public void setView(View view) {
builder.a(view);
}
public ModalBottomSheet show() {
return builder.c(null);
}
public ModalBottomSheet show(boolean isCancellable) {
var sheet = builder.c(null);
sheet.b(isCancellable);
return sheet;
}
}
@@ -0,0 +1,97 @@
package ru.vtosters.lite.ui.vkui;
import static ru.vtosters.lite.utils.Globals.getString;
import android.app.Activity;
import android.graphics.Typeface;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;
import com.vk.core.dialogs.bottomsheet.ModalBottomSheet;
import ru.vtosters.lite.utils.Globals;
import ru.vtosters.lite.utils.Themes;
public class ModalBottomSheetWrapper {
public final ModalBottomSheet.a builder;
public ModalBottomSheetWrapper(Activity activity) {
builder = new ModalBottomSheet.a(activity);
}
public ModalBottomSheetWrapper setTitle(String title) {
builder.b(title);
return this;
}
public ModalBottomSheetWrapper setUpdateInfoView(String version, String changelog) {
var context = Globals.getContext();
var container = new LinearLayout(context);
var title = new TextView(context);
var changelogView = new TextView(context);
container.setOrientation(LinearLayout.VERTICAL);
title.setText(getString("newversion") + " " + version);
title.setTypeface(title.getTypeface(), Typeface.BOLD);
title.setSingleLine(true);
title.setTextAlignment(View.TEXT_ALIGNMENT_CENTER);
title.setTextColor(Themes.getTextAttr());
title.setTextSize(24.0f);
container.addView(title, new LinearLayout.LayoutParams(-1, -2));
changelogView.setPadding(0, Globals.convertDpToPixel(8), 0, 0);
changelogView.setText(getString("changelog") + ": \n" + changelog);
changelogView.setTextColor(Themes.getTextAttr());
container.addView(changelogView, new LinearLayout.LayoutParams(-1, -2));
builder.a(container);
return this;
}
// try to call a true function and you will understand my pain
public ModalBottomSheetWrapper setMessage(
String text
) {
builder.a(text, listener -> {});
return this;
}
public ModalBottomSheetWrapper setClickableMessage(
String text,
Runnable callback
) {
builder.a(text, listener -> callback.run());
return this;
}
public ModalBottomSheetWrapper setPositiveButton(
String text,
Runnable callback
) {
builder.b(text, kostil -> callback.run());
return this;
}
public ModalBottomSheetWrapper setSubtitle(String text) {
builder.b((CharSequence) text);
return this;
}
public ModalBottomSheetWrapper setView(View view) {
builder.a(view);
return this;
}
public ModalBottomSheet show() {
return builder.c(null);
}
public ModalBottomSheet show(boolean isCancellable) {
var sheet = builder.c(null);
sheet.b(isCancellable);
return sheet;
}
}
@@ -2,6 +2,7 @@ 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.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Preferences.VERSIONNAME;
import static ru.vtosters.lite.utils.Preferences.oldabout;
@@ -19,32 +20,34 @@ 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));
list.add(new Items(21, getIdentifier("opencommit", "string")));
list.add(new Items(8, getIdentifier("tgchannel", "string")));
list.add(new Items(9, getIdentifier("tgchat", "string")));
list.add(new Items(16, getIdentifier("vtfaq", "string")));
list.add(new Items(19, getIdentifier("vtsite", "string")));
list.add(new Items(20, getIdentifier("donate", "string")));
list.add(new Items(17, getIdentifier("vkgroup", "string")));
list.add(new Items(18, getIdentifier("sett_debug", "string")));
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));
list.add(new Items(0, getIdentifier("about_app_feedback", "string")));
list.add(new Items(1, getIdentifier("about_app_estimate", "string")));
list.add(new Items(2, getIdentifier("about_app_privacy", "string")));
list.add(new Items(5, getIdentifier("about_app_cookie", "string")));
list.add(new Items(3, getIdentifier("about_app_terms_to_use", "string")));
list.add(new Items(4, getIdentifier("about_app_license", "string")));
list.add(new Items(6, getIdentifier("about_app_data_protect", "string")));
list.add(new Items(8, getIdentifier("sett_debug", "string")));
}
public static String getBuildNumber() {
return getBuild(getContext(), "version.properties");
}
public static String getCommitLink() {
return "https://github.com/vtosters/lite/commit/" + getBuild(getContext(), "version.properties");
return "https://git.maki.su/gdlbo/lite/commit/" + getBuild(getContext(), "version.properties"); // https://github.com/vtosters/lite/commit/ github repo
}
public static String getBuild(Context context, String name) {
@@ -0,0 +1,88 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.sendToast;
import static ru.vtosters.lite.utils.Preferences.dev;
import static ru.vtosters.lite.utils.Preferences.getSizeForDelete;
import android.annotation.SuppressLint;
import java.io.File;
import java.text.CharacterIterator;
import java.text.StringCharacterIterator;
import java.util.Objects;
public class CacheUtils {
private static CacheUtils sInstance = new CacheUtils();
public long size = 0;
public static CacheUtils getInstance() {
if (sInstance == null)
sInstance = new CacheUtils();
return sInstance;
}
public void autoCleaningCache() {
size = getDirSize(getContext().getCacheDir());
if(size >= getSizeForDelete()) {
if(dev()) sendToast("Кэш очищен");
deleteCache();
size = 0;
}
}
public long getDirSize(File dir){
long size = 0;
for (File file : Objects.requireNonNull(dir.listFiles())) {
if (file != null && file.isDirectory()) {
size += getDirSize(file);
} else if (file != null && file.isFile()) {
size += file.length();
}
}
return size;
}
public static void deleteCache() {
try {
File dir = getContext().getCacheDir();
deleteDir(dir);
} catch (Exception e) {
e.printStackTrace();
}
}
public static boolean deleteDir(File dir) {
if (dir != null && dir.isDirectory()) {
String[] children = dir.list();
for (int i=0; i < Objects.requireNonNull(children).length; i++) {
boolean success = deleteDir(new File(dir, children[i]));
if (!success) {
return false;
}
}
return dir.delete();
} else if(dir!= null && dir.isFile()) {
return dir.delete();
} else {
return false;
}
}
@SuppressLint("DefaultLocale")
public static String humanReadableByteCountBin(long bytes) {
long absB = bytes == Long.MIN_VALUE ? Long.MAX_VALUE : Math.abs(bytes);
if (absB < 1024) {
return bytes + " B";
}
long value = absB;
CharacterIterator ci = new StringCharacterIterator("KMGTPE");
for (int i = 40; i >= 0 && absB > 0xfffccccccccccccL >> i; i -= 10) {
value >>= 10;
ci.next();
}
value *= Long.signum(bytes);
return String.format("%.1f %cB", value / 1024.0, ci.current());
}
}
@@ -1,8 +1,8 @@
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 static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.ContentValues;
import android.database.Cursor;
@@ -25,7 +25,6 @@ import java.util.List;
import ru.vtosters.lite.encryption.EncryptProvider;
public class DeletedMessagesHandler {
private static List<Integer> sDeletedMessagesList = new ArrayList<>();
private static SQLiteDatabase sVKSQLiteDatabase;
@@ -44,7 +43,7 @@ public class DeletedMessagesHandler {
}
public static boolean hook() {
return BooleanFalse("undeletemsg");
return getBoolValue("undeletemsg", true);
}
public static void setBodyDBParser(Msg msg) {
@@ -76,17 +75,7 @@ public class DeletedMessagesHandler {
}
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 "[Удалено] ";
return getPrefsValue("undeletemsg_prefix_value") + " ";
}
public static void updateDialog(MsgDeleteLpTask msgDeleteLpTask) {
@@ -128,7 +117,6 @@ public class DeletedMessagesHandler {
}
public static class DeletedMessagesDBHelper extends SQLiteOpenHelper {
public DeletedMessagesDBHelper() {
super(getContext(), "deleted_msgs", null, 1);
}
@@ -0,0 +1,71 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import android.content.res.Resources;
import android.support.v4.app.FragmentTransaction;
public class FragAnimationKit {
// Q
private static final int actOpenEnter = getIdentifier("q_enter", "anim");
private static final int actCloseExit = getIdentifier("q_pop_exit", "anim");
// Slide
private static final int SactOpenEnter = getIdentifier("legacy_enter", "anim");
private static final int SactCloseExit = getIdentifier("legacy_pop_exit", "anim");
// Fade
private static final int FadeOpenEnter = getIdentifier("vkme_enter_slide_up", "anim");
private static final int FadeCloseExit = getIdentifier("vkme_enter_slide_down", "anim");
// System
private static final Resources resources = Resources.getSystem();
private static final int SSactOpenEnter = resources.getIdentifier("activity_open_enter", "anim","android");
private static final int SSactCloseExit = resources.getIdentifier("activity_close_exit", "anim", "android");
// System [task]
private static final int SSTactOpenEnter = resources.getIdentifier("task_open_enter", "anim","android");
private static final int SSTactCloseExit = resources.getIdentifier("task_close_exit", "anim", "android");
public static void animateOpen(FragmentTransaction transaction) {
setAnimations(transaction);
}
public static void animateClose(FragmentTransaction transaction) {
setAnimations(transaction);
}
public static void setAnimations(FragmentTransaction transaction) {
if (transaction != null && !getPrefsValue("anim_rtrn_type").equals("noanim")) {
switch (getPrefsValue("anim_rtrn_type")) {
case "q":
transaction.a(
actOpenEnter,
actCloseExit
);
break;
case "fade":
transaction.a(
FadeOpenEnter,
FadeCloseExit
);
break;
case "slide":
transaction.a(
SactOpenEnter,
SactCloseExit
);
break;
case "system":
transaction.a(
SSactOpenEnter,
SSactCloseExit
);
break;
case "system_task":
transaction.a(
SSTactOpenEnter,
SSTactCloseExit
);
break;
}
}
}
}
@@ -1,50 +1,89 @@
package ru.vtosters.lite.utils;
import static androidx.core.content.ContextCompat.getDrawable;
import static ru.vtosters.lite.utils.Preferences.checkupdates;
import static ru.vtosters.lite.utils.Preferences.getLocale;
import static ru.vtosters.lite.utils.Preferences.preferences;
import static ru.vtosters.lite.utils.Themes.isDarkTheme;
import android.app.Activity;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.pm.PackageManager;
import android.content.res.Resources;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Canvas;
import android.graphics.Path;
import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.os.Build;
import android.os.Bundle;
import android.os.Handler;
import android.os.StrictMode;
import android.preference.PreferenceManager;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import com.vk.navigation.Navigator;
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.io.InputStream;
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.List;
import java.util.Locale;
import ru.vtosters.lite.ui.dialogs.DisableBattery;
import ru.vtosters.lite.ui.dialogs.InstallGMS;
import ru.vtosters.lite.ui.dialogs.OTADialog;
import ru.vtosters.lite.ui.dialogs.Start;
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;
public static SharedPreferences getDefprefs() {
if (preferences == null) preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
return preferences;
}
// Current UserId
public static void MainActivityInit(Activity activity){
if(checkupdates())
OTADialog.checkUpdates(activity);
Start.alert(activity);
InstallGMS.alert(activity);
DisableBattery.alert(activity);
// VKIDProtection.alert(activity);
}
public static void componentSwitcher(String component, Boolean enabled) {
var packageManager = getContext().getPackageManager();
packageManager.setComponentEnabledSetting(new ComponentName(getPackageName(), getPackageName() + "." + component), enabled? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
} // Component switcher for changing app icon
public static String getPrefsValue(String pref) {
return getPreferences().getString(pref, "");
} // Get pref value as string
public static int getUserId() {
return VKAccountManager.b().a();
}
} // Current UserId
public static String getUserSecret() {
return VKAccountManager.b().c();
@@ -56,17 +95,15 @@ public class Globals {
public static SharedPreferences.Editor edit() {
return PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
}
} // Edit SharedPreferences
// Delete and reload msg cache
public static void reloadMSG() {
ImEngineProvider.a().h();
}
} // Delete and reload msg cache
// UserId Profile via userProfile
public static int getUserID(UserProfile userProfile) {
return userProfile.n;
}
} // UserId Profile via userProfile
public static String getUserFirstName(UserProfile userProfile) {
return userProfile.p;
@@ -76,26 +113,80 @@ public class Globals {
return userProfile.o;
}
// UserId Profile via extendedUserProfile
public static int getUserID(ExtendedUserProfile extendedUserProfile) {
return getUserID(fromEup(extendedUserProfile));
}
} // UserId Profile via extendedUserProfile
public static UserProfile fromEup(ExtendedUserProfile extendedUserProfile) {
return extendedUserProfile.a;
}
// Application restart (works on sdk 29+ too)
@SuppressWarnings("deprecation")
public static Drawable drawableFromUrl(String url) {
try {
URL aryURI = new URL(url);
StrictMode.ThreadPolicy policy = new StrictMode.ThreadPolicy.Builder().permitAll().build();
StrictMode.setThreadPolicy(policy);
URLConnection conn = aryURI.openConnection();
InputStream is = conn.getInputStream();
Bitmap bmp = BitmapFactory.decodeStream(is);
return new BitmapDrawable(getResources(), Bitmap.createScaledBitmap(getBitmapClippedCircle(bmp), convertDpToPixel(48), convertDpToPixel(48), true));
} catch (Exception e) {
return getDrawable(getContext(), com.vtosters.lite.R.drawable.libverify_ic_account_circle_white);
}
}
public static Bitmap getBitmapClippedCircle(Bitmap bitmap) {
final int width = bitmap.getWidth();
final int height = bitmap.getHeight();
final Bitmap outputBitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888);
final Path path = new Path();
path.addCircle(
(float)(width / 2)
, (float)(height / 2)
, (float) Math.min(width, (height / 2))
, Path.Direction.CCW);
final Canvas canvas = new Canvas(outputBitmap);
canvas.clipPath(path);
canvas.drawBitmap(bitmap, 0, 0, null);
return outputBitmap;
}
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);
} // Application restart (works on sdk 29+ too)
public static void restartApplicationWithTimer() {
Handler handler = new Handler();
handler.postDelayed(new Runnable() {
public void run() {
restartApplication();
}
}, 500);
}
public static void restartApplicationInto(Class Class) {
Context ctx = getContext();
PackageManager pm = ctx.getPackageManager();
Intent intent = new Navigator(Class).a(ctx);
Intent mainIntent = Intent.makeRestartActivityTask(intent.getComponent());
ctx.startActivity(mainIntent);
Runtime.getRuntime().exit(0);
}
// Global Context
@NonNull
public static Context getContext() {
try {
@@ -107,9 +198,8 @@ public class Globals {
e.printStackTrace();
}
return null;
}
} // Getting the global context through reflection to use context on application initialization
// Google Market Services check
public static boolean isGmsInstalled() {
try {
getContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
@@ -117,18 +207,28 @@ public class Globals {
} catch (Exception unused) {
return false;
}
}
} // Google Market Services check
public static Resources getResources() {
return getContext().getResources();
}
public static int getIdentifier(String str, String str2) {
return getResources().getIdentifier(str, str2, getContext().getPackageName());
}
public static int getIdentifier(String name, String type) {
try {
return getResources().getIdentifier(name, type, getContext().getPackageName());
} catch (Exception e) {
Log.d("VTLite", "Not found " + name + "as type " + type);
e.printStackTrace();
}
return 0;
} // Get res id
public static String getString(String str) {
return getContext().getString(Integer.parseInt(String.valueOf(getContext().getResources().getIdentifier(str, "string", getContext().getPackageName()))));
public static String getString(String resourcename) {
return getContext().getString(getIdentifier(resourcename, "string"));
} // Get string via getIdentifier
public static String getStringDate(@StringRes int i, Object... objArr) {
return getContext().getString(i, objArr);
}
public static String getPackageName() {
@@ -136,7 +236,7 @@ public class Globals {
}
public static int convertDpToPixel(float f) {
return (int) (f * ((float) getContext().getResources().getDisplayMetrics().densityDpi / 160.0f));
return (int) (f * ((float) getResources().getDisplayMetrics().densityDpi / 160.0f));
}
public static SharedPreferences getPreferences() {
@@ -155,28 +255,25 @@ public class Globals {
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
} // Network check
// 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;
boolean hasMusicChannel = false;
try {
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
z = true;
hasMusicChannel = 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) {}
if (!hasMusicChannel) {
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(getIdentifier("audio_message_play_error", "string")), NotificationManager.IMPORTANCE_LOW));
}
}
} catch (Exception ignored) {
}
}
} catch (Exception ignored) {}
} // Music channels fix
public static void registerActivities(Application application) {
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@@ -223,22 +320,27 @@ public class Globals {
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());
edit().putBoolean("isdark", isDarkTheme()).commit();
return context;
}
} // Language changer and BaseContext injector
public static float[] getCenterScreenCoords() {
int width = getResources().getDisplayMetrics().widthPixels;
@@ -1,23 +0,0 @@
package ru.vtosters.lite.utils;
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 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 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,53 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Preferences.donaterecomm;
import static ru.vtosters.lite.utils.Preferences.hasVerification;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.Random;
public class JsonInjectors {
public static JSONObject profileButton() throws JSONException {
String pic = "https:\\/\\/sun1-18.userapi.com\\/NLd_rNpGuSaBnPV6O-j5mqCGZk8BK8drAMd2LQ\\/5R-DEF37PFs.png";
String title = "Помоги проекту донатом и получи бонус!";
String link = "https:\\/\\/vk.com\\/vtosters_official";
String text_color = "2D81E0";
JSONObject jsonObj = new JSONObject("{\"action\":{\"target\":\"internal\",\"type\":\"open_url\",\"url\":\"" + link + "\"},\"title\":\"" + title + "\",\"icons\":[{\"url\":\"" + pic + "\",\"width\":20,\"height\":20},{\"url\":\"" + pic + "\",\"width\":40,\"height\":40},{\"url\":\"" + pic + "\",\"width\":60,\"height\":60},{\"url\":\"" + pic + "\",\"width\":80,\"height\":80}],\"text_color\":\"" + text_color + "\"}");
return jsonObj;
}
public static JSONObject discoverBanner() throws JSONException {
String smallimg = "https:\\/\\/sun1-25.userapi.com\\/3D4YtNHjgwoyxav3FksnYRINp_FhWULuDKYdcA\\/zfCUgKMS0O4.png";
String background = "https:\\/\\/images.wsj.net\\/im-501403";
String title = "Задонать";
String desc = "Помоги проекту донатом и получи приятные бонусы на аккаунт";
String text_color = "ffffff";
JSONObject jsonObj = new JSONObject("{\"title\":\"" + title + "\",\"description\":\"" + desc + "\",\"text_color\":\"#" + text_color + "\",\"image\":[{\"url\":\"" + smallimg + "\",\"width\":72,\"height\":72},{\"url\":\"" + smallimg + "\",\"width\":108,\"height\":108},{\"url\":\"" + smallimg + "\",\"width\":144,\"height\":144},{\"url\":\"" + smallimg + "\",\"width\":216,\"height\":216},{\"url\":\"" + smallimg + "\",\"width\":288,\"height\":288}],\"background\":[{\"url\":\"" + background + "\",\"width\":344,\"height\":215},{\"url\":\"" + background + "\",\"width\":516,\"height\":323},{\"url\":\"" + background + "\",\"width\":680,\"height\":426},{\"url\":\"" + background + "\",\"width\":1032,\"height\":645},{\"url\":\"" + background + "\",\"width\":1376,\"height\":860}]}");
return jsonObj;
}
public static JSONObject discoverBannerButton() throws JSONException {
String link = "vk.com\\/vtosters_official";
JSONObject jsonObj = new JSONObject("{\"type\":\"open_url\",\"url\":\"" + link + "\",\"target\":\"internal\"}");
return jsonObj;
}
public static String haveDonateBanner() {
Random random = new Random();
int randomshower = random.nextInt(8);
return hasVerification() || donaterecomm() || randomshower != 1 ? "null" : "info";
}
public static String haveDonateButton() {
Random random = new Random();
int randomshower = random.nextInt(10);
return hasVerification() || donaterecomm() || randomshower != 1 ? "null" : "buttons";
}
}
@@ -3,20 +3,22 @@ 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.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.CommentsSort;
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.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.newfeed;
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import static ru.vtosters.lite.utils.Preferences.useNewSettings;
import static ru.vtosters.lite.utils.Preferences.vkme;
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;
@@ -27,7 +29,6 @@ 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;
@@ -65,16 +66,16 @@ public class Newsfeed {
getFilter("default_ad_list", "StandartFilter.txt");
getFilter("shitposting", "IDontWantToReadIt.txt");
String string = getPreferences().getString("spamfilters", "");
String customfilters = getPrefsValue("spamfilters");
if (!string.isEmpty()) {
mFilters.addAll(Arrays.asList(string.split(", ")));
if (!customfilters.isEmpty()) {
mFilters.addAll(Arrays.asList(customfilters.split(", ")));
}
}
public static void getFilter(String boolname, String filename) {
if (BooleanTrue(boolname)) {
if (getBoolValue(boolname, true)) {
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open(filename)));
while (true) {
@@ -90,34 +91,34 @@ public class Newsfeed {
e.printStackTrace();
}
}
}
} // Get needed filter list from assets
public static boolean injectFilters(JSONObject jSONObject) {
String optString = jSONObject.optString(NavigatorKeys.j, "");
if (!ads(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
if (!ads(optString) && !checkCopyright(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)) {
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || captions(jSONObject)) {
return false;
}
return !AD(jSONObject);
}
}
return false;
}
} // json newsfeed/posts injector to detect and delete posts
public static boolean authors_rec(String str) {
return str.equals("authors_rec") && !authorsrecomm();
return str.equals("authors_rec") && authorsrecomm();
}
public static boolean captions(JSONObject jSONObject) {
try {
JSONObject jSONObject2 = jSONObject.getJSONObject("caption");
if (!Preferences.captions()) {
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()))));
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;
}
@@ -131,31 +132,31 @@ public class Newsfeed {
}
public static boolean recomm(String str) {
return (str.equals("user_rec") || str.equals("live_recommended") || str.equals("inline_user_rec")) && !postsrecomm();
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();
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 boolean checkCopyright(String str) {
return str.equals("copyright") && copyright_post();
}
public static String friendsads() {
return postsrecomm() ? "user_rec" : "null";
return postsrecomm() ? "null" : "user_rec";
}
public static String getFriendRecomm() {
return friendsrecomm() ? "friends_recommendations" : "null";
return friendsrecomm() ? "null" : "friends_recommendations";
}
public static String authorsads() {
return authorsrecomm() ? "authors_rec" : "null";
return authorsrecomm() ? "null" : "authors_rec";
}
public static String widgetads() {
@@ -170,19 +171,15 @@ public class Newsfeed {
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 String getCommentsSort(int value) {
return !CommentsSort() && value == 2 || value == 1 ? "desc" : "asc";
}
public static long getUpdateNewsfeed(boolean refresh_timeout) {
switch (getPreferences().getString("newsupdate", "")) {
if (vkme()) {
return MAX_VALUE;
}
switch (getPrefsValue("newsupdate")) {
case "no_update":
return MAX_VALUE;
case "imd_update":
@@ -193,7 +190,10 @@ public class Newsfeed {
}
public static Class getStartFragment() {
switch (getPreferences().getString("start_values", "")) {
if (vkme()) {
return DialogsFragment.class;
}
switch (getPrefsValue("start_values")) {
case "newsfeed":
return newfeed() ? HomeFragment.class : NewsfeedFragment.class;
case "messenger":
@@ -209,11 +209,11 @@ public class Newsfeed {
case "videos":
return VideosFragment.class;
case "settings":
return SettingsListFragment.class;
return useNewSettings();
case "apps":
return AppsFragment.class;
case "discover":
return newfeed() ? GatewaysFragment.class : DiscoverFragment.class;
return DiscoverFragment.class;
case "notifications":
return NotificationsContainerFragment.class;
case "money":
@@ -37,18 +37,15 @@ public class OEMDetector {
private static String getSystemProperty(String str) {
BufferedReader bufferedReader;
Throwable th;
BufferedReader bufferedReader2 = null;
try {
bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("getprop " + str).getInputStream()), 1024);
try {
String readLine = bufferedReader.readLine();
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return readLine;
return bufferedReader.readLine();
} catch (IOException ignored) {
}
} catch (Throwable ignored) {
@@ -0,0 +1,126 @@
package ru.vtosters.lite.utils;
import android.util.Log;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.IOException;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.Response;
public class OTAHelper {
private static final String LATEST_RELEASE_URL = "https://api.github.com/repositories/473685743/releases/latest";
private static final String LATEST_RELEASE_COMMIT_URL = "https://api.github.com/repositories/473685743/git/ref/tags/%s";
private OTAListener mListener;
private final OkHttpClient mClient = new OkHttpClient();
private JSONObject mReleaseJson;
private JSONObject mCommitJson;
public OTAHelper(OTAListener listener) {
this.mListener = listener;
}
public void loadData() {
Request release = new Request.Builder()
.url(LATEST_RELEASE_URL)
.build();
mClient.newCall(release).a(new Callback() {
@Override
public void a(Call call, IOException e) {
Log.d("OTAHelper", "Error while getting latest release info: " + e);
mListener.onUpdateCanceled();
}
@Override
public void a(Call call, Response response) throws IOException {
try {
setData(response);
} catch (JSONException | NullPointerException e) {
e.printStackTrace();
}
}
});
}
void setData(Response response) throws IOException, JSONException {
mReleaseJson = new JSONObject(response.body().string());
String tag = mReleaseJson.getString("tag_name");
Request commit = new Request.Builder()
.url(String.format(LATEST_RELEASE_COMMIT_URL, tag))
.build();
mClient.newCall(commit).a(new Callback() {
@Override
public void a(Call call, IOException e) {
Log.d("OTAHelper", "Error while getting latest commit info: " + e);
mListener.onUpdateCanceled();
}
@Override
public void a(Call call, Response response) throws IOException {
try {
mCommitJson = new JSONObject(response.body().string());
if (isNewVersion())
mListener.onUpdateApplied();
else mListener.onUpdateCanceled();
} catch (NullPointerException | JSONException e) {
e.printStackTrace();
mListener.onUpdateCanceled();
}
}
});
}
public boolean isNewVersion() {
try {
String commitSHA = mCommitJson.getJSONObject("object").getString("sha");
return !commitSHA.startsWith(About.getBuildNumber());
} catch (Exception e) {
return false;
}
}
public String getNewVersionName() {
try {
return mReleaseJson.getString("name");
} catch (JSONException e) {
return null;
}
}
public String getUpdateDescription() {
try {
return mReleaseJson.getString("body");
} catch (JSONException e) {
return null;
}
}
public String getDownloadUrl() {
try {
return mReleaseJson.getJSONArray("assets")
.getJSONObject(0)
.getString("browser_download_url");
} catch (JSONException e) {
return null;
}
}
public interface OTAListener {
void onUpdateApplied();
void onUpdateCanceled();
}
}
@@ -1,28 +1,49 @@
package ru.vtosters.lite.utils;
import static android.os.Build.VERSION;
import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.f0x1d.VTVerifications.hasPrometheus;
import static ru.vtosters.lite.f0x1d.VTVerifications.isVerified;
import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.migrate;
import static ru.vtosters.lite.utils.CacheUtils.getInstance;
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.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Globals.getStringDate;
import static ru.vtosters.lite.utils.Globals.getUserId;
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 static ru.vtosters.lite.utils.SignatureChecker.validateAppSignature;
import static ru.vtosters.lite.utils.Themes.systemThemeChanger;
import android.annotation.SuppressLint;
import android.app.Application;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.content.pm.PackageManager;
import android.preference.PreferenceManager;
import android.util.Log;
import com.vk.core.util.Screen;
import com.vk.im.engine.models.users.UserSex;
import com.vtosters.lite.data.Users;
import com.vtosters.lite.fragments.SettingsListFragment;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import ru.vtosters.lite.ui.fragments.VTSettings;
public class Preferences {
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
public static String VERSIONNAME = "Beta";
public static Integer VKBUILD = 12116; // 3439 orig
@@ -35,75 +56,91 @@ public class Preferences {
migrate();
reloadMessagesList();
registerActivities(application);
LoadLibrary("vkopustest");
if(dev()){
LoadLibrary("vkopustest");
}
systemThemeChanger();
getInstance().autoCleaningCache();
} // VK Init
public static void forceOffline() {
setupFilters();
getInstance().autoCleaningCache();
if (setoffline() && !offline()) {
Users.b();
}
}
public static boolean getBoolValue(String key, Boolean value) {
if (preferences == null) {
preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
}
return preferences.getBoolean(key, value);
} // Set bool by default and get value
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 SharedPreferences getPrefsFromFile(String filename) {
return getContext().getSharedPreferences(filename, Context.MODE_PRIVATE);
}
public static boolean opusmodule() {
return BooleanTrue("opusmodule");
return getBoolValue("opusmodule", true);
}
public static boolean systemtheme() {
return BooleanTrue("systemtheme");
return getBoolValue("systemtheme", true) && VERSION.SDK_INT >= 28;
}
public static boolean authorsrecomm() {
return BooleanTrue("authorsrecomm");
return getBoolValue("authorsrecomm", false);
}
public static boolean captions() {
return BooleanTrue("captions");
return getBoolValue("captions", false);
}
public static boolean copyright_post() {
return BooleanFalse("copyright_post");
return getBoolValue("copyright_post", false);
}
public static boolean default_ad_list() {
return BooleanFalse("default_ad_list");
return getBoolValue("default_ad_list", false);
}
public static boolean shitposting() {
return BooleanFalse("shitposting");
return getBoolValue("shitposting", false);
}
public static boolean friendsrecomm() {
return BooleanTrue("friendsrecomm");
return getBoolValue("friendsrecomm", false);
}
public static boolean isBGStickersEnabled() {
return BooleanTrue("isBGStickersEnabled");
return getBoolValue("isBGStickersEnabled", true);
}
public static boolean ads() {
return BooleanFalse("__dbg_no_ads");
return getBoolValue("__dbg_no_ads", false);
}
public static boolean adsgroup() {
return BooleanFalse("adsgroup");
return getBoolValue("adsgroup", false);
}
public static boolean olddock() {
return BooleanFalse("olddock");
public static boolean oldicons() {
return getBoolValue("oldicons", false);
}
public static boolean vkme() {
return getBoolValue("vkme", false);
}
public static boolean adsslider() {
return BooleanFalse("__dbg_no_slider_ads");
return getBoolValue("__dbg_no_slider_ads", false);
}
public static boolean adsstories() {
return BooleanFalse("adsstories");
return getBoolValue("adsstories", false);
}
public static boolean alteremoji(Context context) {
@@ -111,186 +148,192 @@ public class Preferences {
}
public static boolean alteremojipref() {
return BooleanFalse("alteremoji");
return getBoolValue("alteremoji", false);
}
public static boolean awayphp() {
return BooleanTrue("awayphp");
return getBoolValue("awayphp", true);
}
public static boolean musicFixNew() {
return getBoolValue("musicFixNew", true);
}
public static Class useNewSettings() {
boolean bool = getBoolValue("useNewSettings", true);
return bool? VTSettings.class : SettingsListFragment.class;
}
public static boolean VKUI_INJ() {
return BooleanTrue("VKUI_INJ");
return getBoolValue("VKUI_INJ", true);
}
public static boolean benchmark() {
return BooleanFalse("benchmark");
return getBoolValue("benchmark", false);
}
public static boolean calls() {
return BooleanTrue("calls");
return getBoolValue("calls", false);
}
public static boolean convUsersOnline() {
return BooleanFalse("convUsersOnline");
return getBoolValue("convUsersOnline", false);
}
public static boolean darkmode() {
return BooleanTrue("darkmode");
return getBoolValue("darkmode", true);
}
public static boolean dev() {
return BooleanFalse("dev");
return getBoolValue("dev", false);
}
public static boolean devmenu() {
return BooleanFalse("devmenu");
return getBoolValue("devmenu", false);
}
public static boolean dnr() {
return BooleanTrue("dnr");
return getBoolValue("dnr", true);
}
public static boolean dns() {
return BooleanTrue("dns");
return getBoolValue("dns", true);
}
public static boolean libverify() {
return BooleanFalse("libverify");
return getBoolValue("libverify", false);
}
public static boolean dnt() {
return BooleanTrue("dnt");
return getBoolValue("dnt", true);
}
public static boolean dockcounter() {
return BooleanTrue("dockcounter");
return getBoolValue("dockcounter", true);
}
public static boolean feedcache() {
return BooleanTrue("feedcache");
return getBoolValue("feedcache", true);
}
public static void forceOffline() {
if (setoffline()) {
Users.b();
}
setupFilters();
}
public static boolean fulltime() {
return BooleanTrue("fulltime");
public static boolean CommentsSort() {
return getBoolValue("commentssorting", false);
}
public static boolean gcmfix() {
return BooleanTrue("gcmfix");
return getBoolValue("gcmfix", true) && isValidSignature();
}
public static boolean hasMusicSubscription() {
return BooleanTrue("hasMusicSubscription");
return getBoolValue("hasMusicSubscription", true);
}
public static boolean isEnableExternalOpening() {
return BooleanFalse("isEnableExternalOpening");
return getBoolValue("isEnableExternalOpening", false);
}
public static boolean iconvk() {
return BooleanFalse("iconvk");
return getBoolValue("iconvk", false);
}
public static boolean iconvkru() {
return BooleanFalse("iconvkru");
return getBoolValue("iconvkru", false);
}
public static boolean isMusicRestricted() {
return BooleanTrue("isMusicRestricted");
return getBoolValue("isMusicRestricted", true);
}
public static boolean msgflat() {
return BooleanFalse("msgflat");
return getBoolValue("msgflat", false);
}
public static boolean msgtails() {
return BooleanTrue("msgtails");
return getBoolValue("msgtails", true);
}
public static boolean navbar() {
return BooleanTrue("navbar");
return getBoolValue("navbar", true);
}
public static boolean newfeed() {
return BooleanTrue("newfeed");
return getBoolValue("newfeed", true);
}
public static boolean offline() {
return BooleanTrue("offline");
return getBoolValue("offline", true);
}
public static boolean oldabout() {
return BooleanFalse("oldabout");
return getBoolValue("oldabout", false);
}
public static boolean postsrecomm() {
return BooleanTrue("postsrecomm");
return getBoolValue("postsrecomm", false);
}
public static String readstatus() {
return dnr() ? "messages.markAsRead" : "null";
}
public static String copyrightfix() {
return copyright_post() ? "copyright" : "ads_easy_promote";
}
public static boolean refsfilter() {
return BooleanFalse("refsfilter");
return getBoolValue("refsfilter", false);
}
public static boolean setoffline() {
return BooleanFalse("setoffline");
return getBoolValue("setoffline", true);
}
public static boolean shortinfo() {
return BooleanTrue("shortinfo");
return getBoolValue("shortinfo", true);
}
public static boolean shortlinkfilter() {
return BooleanFalse("shortlinkfilter");
return getBoolValue("shortlinkfilter", false);
}
public static boolean shortpost() {
return BooleanTrue("shortpost");
return getBoolValue("shortpost", true);
}
public static boolean showmenu() {
return BooleanFalse("showmenu");
return getBoolValue("showmenu", false);
}
public static boolean ssl() {
return BooleanTrue("ssl");
return getBoolValue("ssl", true);
}
public static boolean stories() {
return BooleanTrue("stories");
return getBoolValue("stories", true);
}
public static boolean swipe() {
return BooleanTrue("swipe");
return getBoolValue("swipe", true);
}
public static boolean systememoji() {
return BooleanFalse("systememoji");
return getBoolValue("systememoji", false);
}
public static boolean unlockstats() {
return BooleanFalse("unlockstats");
return getBoolValue("unlockstats", false);
}
public static boolean usevkui() {
return BooleanTrue("usevkui");
return getBoolValue("usevkui", true);
}
public static boolean vksans() {
return BooleanFalse("vksans");
return getBoolValue("vksans", false);
}
public static boolean voice() {
return BooleanTrue("voice");
return getBoolValue("voice", true);
}
public static boolean newvideo() {
@@ -298,49 +341,155 @@ public class Preferences {
}
public static int getMsgCount() {
String customvalue = getPreferences().getString("msgcount", "");
String customvalue = getPrefsValue("msgcount");
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
}
public static String MediacontentFix() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
}
return VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
} // Fix photo picker for sdk 29+
public static String MediacontentFix2() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
}
return VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
} // Fix photo picker for sdk 29+
public static String MediacontentFix3() {
return Build.VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
}
return VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
} // Fix photo picker for sdk 29+
public static boolean color_grishka() {
return BooleanTrue("color_grishka");
return getBoolValue("color_grishka", true);
}
public static boolean vkme_msg() {
return BooleanFalse("vkme_msg");
return getBoolValue("vkme_msg", false);
}
public static boolean vkme_notifs() {
return getBoolValue("vkme_notifs", false);
}
public static boolean roundedmsgs() {
return getBoolValue("roundedmsgs", false);
}
public static boolean checkupdates() {
return getBoolValue("checkupdates", true) && isValidSignature();
}
public static boolean disableanimstickers() {
return getBoolValue("disableanimstickers", true);
}
public static boolean isValidSignature() {
try {
return validateAppSignature();
} catch (PackageManager.NameNotFoundException | NoSuchAlgorithmException e) {
e.printStackTrace();
}
return false;
}
public static boolean disableSettingsSumms() {
return getBoolValue("disableSettingsSumms", false);
}
public static boolean donaterecomm() {
return getBoolValue("donaterecomm", false);
}
public static String VKVersion() {
String string = getPreferences().getString("vkver", "");
return !string.isEmpty() ? string : VKVER;
return VKVER;
}
public static int VKVersionBuild() {
String string = getPreferences().getString("vkbuild", "");
return !string.isEmpty() ? Integer.parseInt(string) : VKBUILD;
return VKBUILD;
}
public static long VKVersionBuildLong() {
return (long) VKVersionBuild();
return VKVersionBuild();
}
public static boolean hasVerification() {
return isVerified(getUserId());
}
public static boolean hasSpecialVerif() {
return hasPrometheus(getUserId());
}
public static String getLocale() {
String string = getPreferences().getString("lang_value", "");
String string = getPrefsValue("lang_value");
if (string.equals("system")) {
return Locale.getDefault().getLanguage();
}
return string.isEmpty() ? Locale.getDefault().getLanguage() : string;
}
public static boolean fulltime() {
return getPrefsValue("dateformat").equals("noyear") || getPrefsValue("dateformat").equals("full") || getPrefsValue("dateformat").equals("noseconds");
}
public static String getDateFormat() {
switch (getPrefsValue("dateformat")) {
case "noyear":
return getString("fulltime2");
case "full":
return getString("fulltime");
default:
return getString("fulltime3");
}
}
public static long getSizeForDelete() {
switch (getPrefsValue("clearcache")) {
case "100mb":
return 104857600L;
case "500mb":
return 524288000L;
case "1gb":
return 1073741824L;
case "2gb":
return 2147483648L;
case "5gb":
return 5368709120L;
default:
return MAX_VALUE;
}
}
public static int compress(int origquality) {
if(getBoolValue("shakal", false)) return 5;
if(!getBoolValue("compressPhotos", true)) return 100;
return origquality;
}
public static String nullOnline() {
return getString("onlineNull");
}
public static boolean isOnlineNull(int status) {
return status == 0;
}
@SuppressLint("SimpleDateFormat")
public static SimpleDateFormat setDateFormat() {
return new SimpleDateFormat(getDateFormat());
}
public static String getFormattedDate(UserSex type, long time){
SimpleDateFormat date = new SimpleDateFormat(getDateFormat(), Locale.getDefault());
if(!fulltime()) return null;
try {
return getStringDate(type == UserSex.FEMALE ? getIdentifier("last_seen_profile_f", "string") : getIdentifier("last_seen_profile_m", "string"), date.format(new Date(time)));
} catch (Throwable th) {
Log.d("VTLite", "Format data error, type " + type + " , time " + time);
th.printStackTrace();
return null;
}
}
}
@@ -1,25 +1,23 @@
package ru.vtosters.lite.utils;
import static java.lang.System.*;
import static ru.vtosters.lite.utils.Globals.*;
import static ru.vtosters.lite.utils.Preferences.*;
import static java.lang.System.clearProperty;
import static java.lang.System.getProperties;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import java.util.Properties;
public class Proxy {
public static String getOauthComAuth() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/authorize";
return getOauthComHttps() + "/authorize";
}
public static String getOauthComAuthClient() {
String oauthComAuth = getOauthComAuth();
return oauthComAuth + "?client_id=";
return getOauthComAuth() + "?client_id=";
}
public static String getOauthComBlank() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/blank.html";
return getOauthComHttps() + "/blank.html";
}
public static String getOauthComBlankRedirect() {
@@ -31,8 +29,7 @@ public class Proxy {
}
public static String getStaticComSupport() {
String staticCom = getStaticCom();
return staticCom + "/support";
return getStaticCom() + "/support";
}
public static String oauthFix() {
@@ -40,50 +37,43 @@ public class Proxy {
}
public static String getApiCom() {
String string = getPreferences().getString("proxyapi", "");
if (!proxy() & string.isEmpty()) {
return "api.vk.com";
}
String string = getPrefsValue("proxyapi");
if (!proxy() & string.isEmpty()) return "api.vk.com";
return string;
}
public static String getAwayPhpCom() {
String string = getPreferences().getString("proxyapi", "");
if (!proxy() & string.isEmpty()) {
return "m.vk.com";
}
String string = getPrefsValue("proxyapi");
if (!proxy() & string.isEmpty()) return "m.vk.com";
return string;
}
public static String getOauthCom() {
String string = getPreferences().getString("proxyoauth", "");
if (!proxy() & string.isEmpty()) {
return "oauth.vk.com";
}
String string = getPrefsValue("proxyoauth");
if (!proxy() & string.isEmpty()) return "oauth.vk.com";
return string;
}
public static String getStaticCom() {
String string = getPreferences().getString("proxystatic", "");
if (!proxy() & string.isEmpty()) {
return "static.vk.com";
}
String string = getPrefsValue("proxystatic");
if (!proxy() & string.isEmpty()) return "static.vk.com";
return string;
}
public static String staticFix(String str) {
String str2;
String string = getPreferences().getString("proxystatic", "");
if (!proxy() & string.isEmpty()) {
return str;
}
String string = getPrefsValue("proxystatic");
if (!proxy() & string.isEmpty()) return str;
str2 = string;
return str.replace(str2, "static.vk.com");
}
public static void setProxy() {
Properties properties = getProperties();
switch (getPreferences().getString("proxy", "")) {
switch (getPrefsValue("proxy")) {
case "zaborona":
properties.setProperty("socksProxyHost", "socks.zaboronahelp.pp.ua");
properties.setProperty("socksProxyPort", "1488");
@@ -125,7 +115,7 @@ public class Proxy {
clearProperty("http.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all proxies
public static void resetProxySocks() {
clearProperty("https.proxyHost");
@@ -136,7 +126,7 @@ public class Proxy {
clearProperty("http.proxyPort");
clearProperty("http.proxyUser");
clearProperty("http.proxyPassword");
}
} // Reset all except socks
public static void resetProxyHttp() {
clearProperty("https.proxyHost");
@@ -145,7 +135,7 @@ public class Proxy {
clearProperty("https.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all except http
public static void resetProxyHttps() {
clearProperty("http.proxyHost");
@@ -154,64 +144,63 @@ public class Proxy {
clearProperty("http.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all except https
public static String proxyHostHTTP() {
String string = getPreferences().getString("proxyHostHTTP", "");
String string = getPrefsValue("proxyHostHTTP");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostHTTPS() {
String string = getPreferences().getString("proxyHostHTTPS", "");
String string = getPrefsValue("proxyHostHTTPS");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostSocks() {
String string = getPreferences().getString("proxyHostSocks", "");
String string = getPrefsValue("proxyHostSocks");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyPortHTTP() {
String string = getPreferences().getString("proxyPortHTTP", "");
String string = getPrefsValue("proxyPortHTTP");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortHTTPS() {
String string = getPreferences().getString("proxyPortHTTPS", "");
String string = getPrefsValue("proxyPortHTTPS");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortSocks() {
String string = getPreferences().getString("proxyPortSocks", "");
String string = getPrefsValue("proxyPortSocks");
return string.isEmpty() ? "8888" : string;
}
public static String proxyUserHTTP() {
String string = getPreferences().getString("proxyUserHTTP", "");
String string = getPrefsValue("proxyUserHTTP");
return string.isEmpty() ? "" : string;
}
public static String proxyUserHTTPS() {
String string = getPreferences().getString("proxyUserHTTPS", "");
String string = getPrefsValue("proxyUserHTTPS");
return string.isEmpty() ? "" : string;
}
public static String proxyPassHTTP() {
String string = getPreferences().getString("proxyPassHTTP", "");
String string = getPrefsValue("proxyPassHTTP");
return string.isEmpty() ? "" : string;
}
public static String proxyPassHTTPS() {
String string = getPreferences().getString("proxyPassHTTPS", "");
String string = getPrefsValue("proxyPassHTTPS");
return string.isEmpty() ? "" : string;
}
public static boolean proxy() {
return getPreferences().getString("proxy", "").equals("apiproxy");
return getPrefsValue("proxy").equals("apiproxy");
}
// Official vk proxy enforcer
public static boolean proxyvk() {
return BooleanFalse("proxyvk");
}
return getBoolValue("proxyvk", false);
} // Official vk proxy enforcer
}
@@ -1,15 +1,14 @@
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.getPrefsValue;
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;
import static ru.vtosters.lite.utils.Themes.isDarkTheme;
public class SSFS {
public static String getSSFSLink() {
@@ -17,20 +16,19 @@ public class SSFS {
}
public static String SSFSDomain() {
String string = getPreferences().getString("ssfscustom", "");
if (!string.isEmpty()) {
return string;
}
String string = getPrefsValue("ssfscustom");
if (!string.isEmpty()) return string;
return "https://vtsf.vknext.net";
}
public static String getDarkVKUI() {
return !VKThemeHelper.d() ? "1" : "0";
return isDarkTheme() ? "1" : "0";
}
public static String getAmoledVKUI() {
String string = getPreferences().getString("darktheme", "");
return string.equals("amoled") ? "1" : "0";
return getPrefsValue("darktheme").equals("amoled") && isDarkTheme() ? "1" : "0";
}
public static String getUserProxy() {
@@ -8,7 +8,6 @@ import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Base64;
@@ -32,7 +31,7 @@ public class SettBackup {
public static void backupSettings() {
SimpleDateFormat date = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault());
String currentDateandTime = date.format(new Date());
var directory = getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS) + "/VTLBackup_" + currentDateandTime + ".txt";
var directory = getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS + "/VTLBackups/") + "/Backup_" + currentDateandTime + ".txt";
var file = new File(directory);
try {
var exists = file.createNewFile();
@@ -63,9 +62,7 @@ public class SettBackup {
}
public static void restoreBackup() {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("text/plain");
getContext().startActivity(intent);
File dir = new File(getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS + "/VTLBackups/").getPath());;
// TODO Make restore backup from file list
}
}
@@ -0,0 +1,47 @@
package ru.vtosters.lite.utils;
import static android.content.pm.PackageManager.GET_SIGNATURES;
import static android.content.pm.PackageManager.NameNotFoundException;
import static ru.vtosters.lite.f0x1d.VTVerifications.decode;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPackageName;
import android.annotation.SuppressLint;
import android.content.pm.PackageInfo;
import android.content.pm.Signature;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
public class SignatureChecker {
private static final String APP_SIGNATURE = "QzNFQTI3Q0ExNEJENzJFM0U2QUUyMDM0OTdCNDQ0NUFEQUMxRjk0NQ==";
public static String getSHA1(byte[] sig) throws NoSuchAlgorithmException{
MessageDigest digest = MessageDigest.getInstance("SHA1");
digest.update(sig);
byte[] hashtext = digest.digest();
return bytesToHex(hashtext);
}
public static String bytesToHex(byte[] bytes){
final char[] hexArray = {'0', '1', '2', '3', '4', '5', '6', '7', '8',
'9', 'A', 'B', 'C', 'D', 'E', 'F'};
char[] hexChars = new char[bytes.length * 2];
int v;
for (int j = 0; j < bytes.length; j++) {
v = bytes[j] & 0xFF;
hexChars[j * 2] = hexArray[v >>> 4];
hexChars[j * 2 + 1] = hexArray[v & 0x0F];
}
return new String(hexChars);
}
public static boolean validateAppSignature() throws NameNotFoundException, NoSuchAlgorithmException{
@SuppressLint("PackageManagerGetSignatures") PackageInfo packageInfo = getContext().getPackageManager().getPackageInfo(getPackageName(), GET_SIGNATURES);
for (Signature signature : packageInfo.signatures) {
String sha1 = getSHA1(signature.toByteArray());
return decode(APP_SIGNATURE).equals(sha1);
}
return false;
} // Sig check to detect actions builds and etc
}
@@ -1,22 +1,39 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static com.vk.im.ui.themes.ImTheme.VKAPP_AMOLED;
import static com.vk.im.ui.themes.ImTheme.VKAPP_DARK;
import static com.vk.im.ui.themes.ImTheme.VKAPP_LIGHT;
import static com.vk.im.ui.themes.ImTheme.VKME_AMOLED;
import static com.vk.im.ui.themes.ImTheme.VKME_DARK;
import static com.vk.im.ui.themes.ImTheme.VKME_LIGHT;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.getResources;
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.roundedmsgs;
import static ru.vtosters.lite.utils.Preferences.systemtheme;
import static ru.vtosters.lite.utils.Preferences.vkme;
import static ru.vtosters.lite.utils.Preferences.vksans;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import androidx.core.graphics.ColorUtils;
import com.vk.core.d.RecoloredDrawable;
import com.vk.core.ui.themes.VKTheme;
import com.vk.core.ui.themes.VKThemeHelper;
@@ -24,86 +41,138 @@ import com.vk.im.ui.themes.ImTheme;
import com.vk.im.ui.themes.ImThemeHelper;
import com.vtosters.lite.R;
import java.util.Arrays;
import java.util.List;
public class Themes {
public static List<String> accentColors = Arrays.asList(
"5692d7", "528bcc", "7aa0cc", "518bcc", "6296d0", "2f68aa", "638ebf", "5181b8", "71aaeb", "4774a8", "5baaf4", "4186c8", "add3ff", "4774a8", "718198", "5a9eff", "99a2ad", "74a2d6", "e9eef3", "dfe3e7", "eff1f3", "5c9ce6", "4986cc", "4680c2"
);
public static void applyTheme(VKTheme theme, ImTheme imtheme) {
VKThemeHelper.b.a(theme); // VKThemeHelper.b.a(VKTheme value) VK Theme apply
ImThemeHelper.b.a(imtheme); // ImThemeHelper.b.a(ImTheme value) VK Theme Msg apply
} // Apply VKTheme and ImTheme (hard applying without dynamic theme changing)
public static void setTheme(Activity activity) {
VKThemeHelper.a(activity); // apply changed theme
}
public static boolean isDarkTheme() {
return !VKThemeHelper.d();
}
public static int getAccentColor() {
return VKThemeHelper.a(R.attr.accent);
}
} // Color accent
public static int getTextAttr() {
return VKThemeHelper.a(R.attr.text_primary);
}
} // Text Primary color
public static int getSTextAttr() {
return VKThemeHelper.a(R.attr.text_secondary);
}
} // Text Secondary color
public static int getTabbarBackground() {
return VKThemeHelper.a(R.attr.tabbar_background);
}
} // Tabbar/Navbar background
public static int getBackgroundContent() {
return VKThemeHelper.a(R.attr.background_content);
} // Background color in app
public static int getHeaderBackground() {
return VKThemeHelper.a(R.attr.header_background);
}
} // Toolbar/Header background
public static int getHeaderText() {
return VKThemeHelper.a(R.attr.header_text);
} // Header/Toolbar color text
public static int getAmoledTheme() {
return getContext().getResources().getIdentifier("BaseAmoledStyle", "style", getContext().getPackageName());
}
return getIdentifier("BaseAmoledStyle", "style");
} // Get Amoled theme id
public static int picFix() {
return getContext().getResources().getIdentifier("ActionBarThemeFix", "style", getContext().getPackageName());
}
return getIdentifier("ActionBarThemeFix", "style");
} // Fix tabbar color in photo viewer
public static int getAmoledImTheme() {
return getContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", getContext().getPackageName());
return getIdentifier("VkIm.Theme.VkApp.Amoled", "style");
} // Get Amoled theme id for messages
public static int getAmoledMeTheme() {
return getIdentifier("VkIm.Theme.VkMe.Amoled", "style");
} // Get Amoled theme id for messages with rounded msg
public static int getAttrId(String attr) {
return getIdentifier(attr, "attr");
}
public static void setBarTheme(View getview) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getview.setSystemUiVisibility(getNeededColorNavbar() | getNeededColorStatusbar());
}
} // Set white/dark statusbar/navbar icons
public static int getNeededColorStatusbar() {
return VKThemeHelper.d() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? 8192 : 0;
}
public static int getNeededColorNavbar() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? VKThemeHelper.d() ? SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR : 0 : 0;
}
public static int getNeededColorStatusbarFix() {
return VKThemeHelper.d() ? 8192 : 0;
}
public static VKTheme getDarkTheme() {
switch (getPreferences().getString("darktheme", "")) {
switch (getPrefsValue("darktheme")) {
case "amoled":
return VKTheme.AMOLED;
default:
return VKTheme.DARK;
}
}
} // Return needed theme for theme changer
public static ImTheme getImDarkTheme() {
switch (getPreferences().getString("darktheme", "")) {
switch (getPrefsValue("darktheme")) {
case "amoled":
return ImTheme.VKAPP_AMOLED;
return roundedmsgs() ? VKME_AMOLED : VKAPP_AMOLED;
default:
return ImTheme.VKAPP_DARK;
return roundedmsgs() ? VKME_DARK : VKAPP_DARK;
}
}
} // Return needed theme for theme changer
public static VKTheme getLightTheme() {
switch (getPreferences().getString("lighttheme", "")) {
switch (getPrefsValue("lighttheme")) {
default:
return VKTheme.DEFAULT_LIGHT;
}
}
} // Return needed theme for theme changer
public static ImTheme getImLightTheme() {
switch (getPreferences().getString("lighttheme", "")) {
switch (getPrefsValue("lighttheme")) {
default:
return ImTheme.VKAPP_LIGHT;
return roundedmsgs() ? VKME_LIGHT : VKAPP_LIGHT;
}
}
} // Return needed theme for theme changer
public static int getColorFromAttr(int attr) {
return VKThemeHelper.a(attr);
}
public static int getHeaderText() {
return VKThemeHelper.a(R.attr.header_text);
}
} // Get needed attr color
public static boolean isAndroidMonet() {
return color_grishka() && Build.VERSION.SDK_INT >= 31;
}
public static boolean isColorRefAccented(int i) {
return i == R.color.cornflower_blue || i == R.color.cornflower_blue_two || i == R.color.dot_unread || i == R.color.fave_promo_btn_pressed || i == R.color.im_back_to_vk_gradient_start || i == R.color.live_emoji_butt_hide || i == R.color.picker_tab_bg_selected || i == R.color.sky_300 || i == R.color.text_blue || i == R.color.tw__blue_default || i == R.color.tw__blue_pressed || i == R.color.white_blue32 || i == R.color.name || i == R.color.picker_blue || i == R.color.picker_blue_pressed || i == R.color.picker_tab_text_selected || i == R.color.sharing_blue_btn_pressed || i == R.color.sharing_blue_btn_normal || i == R.color.tip_background || i == R.color.vkim_msg_sending_ic || i == R.color.vkim_playing_drawable_rect || i == R.color.accent_blue || i == R.color.light_blue_gray || i == R.color.light_blue || i == R.color.blue_200 || i == R.color.header_blue || i == R.color.blue_200_muted || i == R.color.im_old_accent || i == R.color.im_old_accent_muted || i == R.color.im_dark_accent || i == R.color.im_dark_accent_muted || i == R.color.azure_A400 || i == R.color.blue || i == R.color.blue_400 || i == R.color.blue_300 || i == R.color.cool_blue;
}
public static boolean isColorRefAccented(int color) {
for (int accent : new int[]{R.color.accent_blue, R.color.azure_A400, R.color.blue, R.color.blue_200, R.color.blue_200_muted, R.color.blue_300, R.color.blue_400, R.color.cool_blue, R.color.cornflower_blue, R.color.cornflower_blue_two, R.color.dot_unread, R.color.fave_promo_btn_pressed, R.color.header_blue, R.color.im_back_to_vk_gradient_start, R.color.im_dark_accent, R.color.im_dark_accent_muted, R.color.im_old_accent, R.color.im_old_accent_muted, R.color.light_blue, R.color.light_blue_gray, R.color.live_emoji_butt_hide, R.color.music_action_button_blue, R.color.name, R.color.picker_blue, R.color.picker_blue_pressed, R.color.picker_tab_bg_selected, R.color.picker_tab_text_selected, R.color.sharing_blue_btn_normal, R.color.sharing_blue_btn_pressed, R.color.sky_300, R.color.text_blue, R.color.tip_background, R.color.tw__blue_default, R.color.tw__blue_pressed, R.color.vkim_msg_sending_ic, R.color.vkim_playing_drawable_rect, R.color.white_blue32}) {
if(color == accent) return true;
}
return false;
} // Accent colors
public static void themeMonetToolbar(ImageButton imageButton, Toolbar toolbar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -113,24 +182,114 @@ public class Themes {
}
public static Drawable recolorDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable == null) return null;
return new RecoloredDrawable(drawable, getAccentColor());
}
} // Recolor drawable to accent color
public static Drawable recolorVKIconMenu(Drawable drawable) {
int accent = getHeaderText();
if (drawable == null) return null;
if(isAndroidMonet() || isDarkTheme()) accent = getAccentColor();
return new RecoloredDrawable(drawable, accent);
} // Recolor vk icon to accent color
public static Drawable recolorDrawableToolbar(Drawable drawable) {
if (drawable == null) {
return null;
}
if (drawable == null) return null;
if(!isAndroidMonet()) return drawable;
return new RecoloredDrawable(drawable, getHeaderText());
}
} // Recolor toolbar drawable to accent color
@SuppressLint("UseCompatLoadingForDrawables")
public static Drawable recolorDrawableInt(int drawable) {
if(!isAndroidMonet()) return getResources().getDrawable(drawable);
@SuppressLint("UseCompatLoadingForDrawables") Drawable res = getResources().getDrawable(drawable);
return new RecoloredDrawable(res, getAccentColor());
} // Get res drawable via id and coloring to accent
public static ColorStateList recolorCSL(ColorStateList colorStateList) {
if (colorStateList == null) {
if (colorStateList == null) return null;
if(!isAndroidMonet()) return colorStateList;
return ColorStateList.valueOf(getAccentColor());
} // Recolor ColorStateList to accent color
@SuppressLint("UseCompatLoadingForColorStateLists")
public static ColorStateList themeCSL(Context context, int color) {
if (isColorRefAccented(color) && isAndroidMonet()) {
return ColorStateList.valueOf(getAccentColor());
}
ColorStateList csl;
if (Build.VERSION.SDK_INT >= 23) {
csl = context.getColorStateList(color);
} else {
csl = context.getResources().getColorStateList(color);
}
try {
int unsel = csl.getColorForState(new int[]{-android.R.attr.state_selected}, Color.BLACK);
int sel = csl.getColorForState(new int[]{android.R.attr.state_selected}, Color.BLACK);
boolean isUnselAccent = isAccentedColor(unsel);
boolean isSelAccent = isAccentedColor(sel);
if (isUnselAccent || isSelAccent) {
return new ColorStateList(new int[][] {
new int[]{android.R.attr.state_selected}, new int[]{-android.R.attr.state_selected}
}, new int[] {isSelAccent ? getAccentColor() : sel, isUnselAccent ? getAccentColor() : unsel});
}
return csl;
} catch (Exception e) {
e.printStackTrace();
return null;
}
return ColorStateList.valueOf(getAccentColor());
} // Recolor ColorStateList
public static int darken(int color, float by) {
float[] hsl = new float[3];
ColorUtils.colorToHSL(color, hsl);
hsl[2] -= by;
hsl[2] = Math.max(0f, Math.min(hsl[2], 1f));
return ColorUtils.HSLToColor(hsl);
}
public static int lighten(int color, float factor) {
int red = (int) ((Color.red(color) * (1 - factor) / 255 + factor) * 255);
int green = (int) ((Color.green(color) * (1 - factor) / 255 + factor) * 255);
int blue = (int) ((Color.blue(color) * (1 - factor) / 255 + factor) * 255);
return Color.argb(Color.alpha(color), red, green, blue);
}
public static int fixTextColor(int resid) {
if (resid == R.color.music_action_button_gray || resid == R.color.cool_grey || resid == R.color.accent_blue){
return isDarkTheme()? R.color.white : R.color.cool_grey;
}
return resid;
}
public static int halfAlpha(int src) {
return ColorUtils.setAlphaComponent(src, 169);
}
public static boolean isAccentedColor(ColorStateList target) {
return target != null && isAccentedColor(target.getDefaultColor());
}
public static boolean isAccentedColor(int target) {
return accentColors.contains(hex(target).toLowerCase());
}
public static int getColor(Context context, int i) {
@@ -140,25 +299,27 @@ public class Themes {
if (Build.VERSION.SDK_INT >= 23) {
return context.getColor(i);
}
return context.getResources().getColor(i);
}
return getResources().getColor(i);
} // Android Support color injector + accent color checker
public static int getColor2(int i) {
if (isColorRefAccented(i) && isAndroidMonet()) {
return getAccentColor();
}
return getContext().getResources().getColor(i);
}
return getResources().getColor(i);
} // Android Support color injector + accent color checker
public static void setNavbarColor(Window window, int i) {
if (navbar() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setNavigationBarColor(getNavbarColor());
window.setNavigationBarColor(getTabbarBackground());
window.getDecorView().setSystemUiVisibility(getNeededColorNavbar());
}
}
public static String hex(int i) {
return String.format("#%06X", Integer.valueOf(i & 16777215));
}
} // Get color as hex string
public static int vk_sans_display_demibold() {
return vksans() ? R.font.vk_sans_display_demibold : R.font.tt_commons_demi_bold;
}
@@ -187,10 +348,6 @@ public class Themes {
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";
@@ -198,25 +355,43 @@ public class Themes {
return "images";
}
public static int getNavigationHeight(int Default) {
int VKME = R.dimen.design_bottom_sheet_peek_height_min;
return vkme()? VKME : Default;
}
public static int getNavigationWidth(int Default) {
int VKME = R.dimen.app_minimumsize_h;
return vkme()? VKME : Default;
}
public static void systemThemeChanger() {
if (!systemtheme())
boolean isDarkTheme = isDarkTheme();
if (isDarkTheme){
applyTheme(getDarkTheme(), getImDarkTheme());
} else {
applyTheme(getLightTheme(), getImLightTheme());
}
if (!systemtheme()){
edit().putBoolean("isdark", isDarkTheme).commit();
return;
int currentNightMode = getContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
}
int currentNightMode = getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
switch (currentNightMode) {
case Configuration.UI_MODE_NIGHT_UNDEFINED:
changeTheme(getLightTheme(), getImLightTheme());
break;
case Configuration.UI_MODE_NIGHT_NO:
changeTheme(getLightTheme(), getImLightTheme());
edit().putBoolean("isdark", false).commit();
applyTheme(getLightTheme(), getImLightTheme());
break;
case Configuration.UI_MODE_NIGHT_YES:
changeTheme(getDarkTheme(), getImDarkTheme());
edit().putBoolean("isdark", true).commit();
applyTheme(getDarkTheme(), getImDarkTheme());
break;
}
}
public static void changeTheme(VKTheme theme, ImTheme imtheme) {
VKThemeHelper.b.a(theme);
ImThemeHelper.b.a(imtheme);
}
}
@@ -1,11 +1,12 @@
package ru.vtosters.lite.utils;
import static android.util.Base64.encodeToString;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Themes.getColorFromAttr;
import static ru.vtosters.lite.utils.Themes.hex;
import android.util.Base64;
import android.webkit.WebView;
import com.vtosters.lite.R;
@@ -21,17 +22,13 @@ public class VKUIInjector {
private static String loadedCSS = "";
private static String loadedCSSAmoled = "";
static {
}
public VKUIInjector() {
}
private static String load(String str) {
try {
InputStream open = getContext().getAssets().open(str);
StringBuilder sb = new StringBuilder();
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(open, StandardCharsets.UTF_8));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
@@ -41,7 +38,9 @@ public class VKUIInjector {
return sb.toString();
}
}
} catch (IOException e) {
e.printStackTrace();
return "";
}
@@ -66,21 +65,27 @@ public class VKUIInjector {
}
public static void inject(WebView webView) {
String string = getPreferences().getString("darktheme", "");
if (Preferences.BooleanTrue("VKUI_INJ")) {
String string = getPrefsValue("darktheme");
if (getBoolValue("VKUI_INJ", true)) {
if (!isLoaded) {
load();
}
StringBuilder sb = new StringBuilder();
if (true/*Themes.isAccentedCache()*/) {
sb.append("\n\n");
sb.append(loadedCSS);
}
if (string.equals("amoled")) {
sb.append("\n\n");
sb.append(loadedCSSAmoled);
}
inject(webView, Base64.encodeToString(sb.toString().getBytes(), 2));
inject(webView, encodeToString(sb.toString().getBytes(), 2));
}
}
}
+1 -1
View File
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Vtoasters Shit</string>
<string name="app_name">VTosters Lite</string>
</resources>
+1 -1
View File
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
+15 -1
View File
@@ -1,3 +1,17 @@
## For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html
#
# Specifies the JVM arguments used for the daemon process.
# The setting is particularly useful for tweaking memory settings.
# Default value: -Xmx1024m -XX:MaxPermSize=256m
# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
#
# When configured, Gradle will run in incubating parallel mode.
# This option should only be used with decoupled projects. More details, visit
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
# org.gradle.parallel=true
#Fri Jun 03 17:38:03 MSK 2022
org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M"
android.useAndroidX=true
android.enableJetifier=true
android.jetifier.ignorelist=classes-dex2jar.jar, classes2-dex2jar.jar, classes3-dex2jar.jar, classes4-dex2jar.jar, classes5-dex2jar.jar, classes6-dex2jar.jar, classes7-dex2jar.jar
android.jetifier.ignorelist=classes-dex2jar.jar, classes2-dex2jar.jar, classes3-dex2jar.jar, classes4-dex2jar.jar, classes5-dex2jar.jar, classes6-dex2jar.jar, classes7-dex2jar.jar
+2 -1
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="23" android:compileSdkVersionCodename="6.0-2438415" package="com.vtosters.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<?xml version="1.0" encoding="utf-8" standalone="no"?><manifest xmlns:android="http://schemas.android.com/apk/res/android" android:compileSdkVersion="23" android:minSdkVersion="20" android:compileSdkVersionCodename="6.0-2438415" package="com.vtosters.lite" platformBuildVersionCode="23" platformBuildVersionName="6.0-2438415">
<supports-screens android:anyDensity="true" android:largeScreens="true" android:normalScreens="true" android:resizeable="true" android:smallScreens="true" android:xlargeScreens="true"/>
<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.CAMERA"/>
@@ -75,6 +75,7 @@
<meta-data android:name="com.facebook.sdk.CodelessDebugLogEnabled" android:value="false"/>
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version"/>
<meta-data android:name="com.google.firebase.messaging.default_notification_color" android:resource="@color/cornflower_blue"/>
<activity android:name="ru.vtosters.lite.ui.activities.APKInstallActivity" />
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize" android:label="@string/app_name" android:launchMode="singleTask" android:name="com.vtosters.lite.MainActivity" android:theme="@style/SplashTheme">
<intent-filter>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
+4 -4
View File
@@ -58,15 +58,15 @@ body[scheme=space_gray] {
--counter_secondary_text: #000000 !important;
--loader_background: #000000 !important;
--overlay_status_background: #000000 !important;
--header_background: #19191a !important;
--header_alternate_background: #19191a !important;
--header_background: #000000 !important;
--header_alternate_background: #000000 !important;
--separator_alternate: #000000 !important;
--segmented_control_bar_background: #000000 !important;
--search_bar_background: #000000 !important;
/* background */
--background_page: #000000 !important;
--header_background_before_blur: #19191a !important;
--header_background_before_blur_alternate: #19191a !important;
--header_background_before_blur: #000000 !important;
--header_background_before_blur_alternate: #000000 !important;
/* lighter BG (text fields) */
--attach_picker_tab_inactive_background: #121212 !important;
--background_keyboard: #121212 !important;
Binary file not shown.
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityDefaultDur"
android:fromXScale="0.9"
android:fromYScale="0.9"
android:interpolator="@android:anim/decelerate_interpolator"
android:pivotX="50.0%"
android:pivotY="100.0%"
android:fromXScale="0.9"
android:toXScale="1.0"
android:fromYScale="0.9"
android:toYScale="1.0" />
<alpha
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityShortDur"
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />
</set>
+3 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityShortDur"
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />
</set>
+3 -3
View File
@@ -1,9 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<alpha
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityShortDur"
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />
</set>
@@ -1,18 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityDefaultDur"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:pivotX="50.0%"
android:pivotY="100.0%"
android:fromXScale="1.0"
android:toXScale="0.9"
android:fromYScale="1.0"
android:toYScale="0.9" />
<alpha
android:interpolator="@android:anim/decelerate_interpolator"
android:duration="@integer/abc_config_activityShortDur"
android:fromAlpha="1.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="0.0" />
</set>
+3 -3
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha android:interpolator="@android:interpolator/decelerate_quad"
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/config_tooltipAnimTime"
android:fromAlpha="0.0"
android:toAlpha="1.0"
xmlns:android="http://schemas.android.com/apk/res/android" />
android:interpolator="@android:interpolator/decelerate_quad"
android:toAlpha="1.0" />
+3 -3
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha android:interpolator="@android:interpolator/accelerate_quad"
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/config_tooltipAnimTime"
android:fromAlpha="1.0"
android:toAlpha="0.0"
xmlns:android="http://schemas.android.com/apk/res/android" />
android:interpolator="@android:interpolator/accelerate_quad"
android:toAlpha="0.0" />
+5 -5
View File
@@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:zAdjustment="normal"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:zAdjustment="normal">
<alpha
android:duration="300"
android:fillBefore="true"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromAlpha="1.0"
android:toAlpha="1.0"
android:fillEnabled="true" />
android:toAlpha="1.0" />
</set>
+14 -14
View File
@@ -1,25 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:shareInterpolator="false"
android:zAdjustment="top"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false"
android:zAdjustment="top">
<alpha
android:interpolator="@android:interpolator/decelerate_cubic"
android:duration="300"
android:fillBefore="true"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromAlpha="1.0"
android:toAlpha="0.0"
android:fillEnabled="true" />
<scale
android:interpolator="@android:interpolator/decelerate_cubic"
android:toAlpha="0.0" />
<scale
android:duration="300"
android:fillAfter="true"
android:fillBefore="true"
android:fillEnabled="true"
android:fromXScale="1.0"
android:fromYScale="1.0"
android:interpolator="@android:interpolator/decelerate_cubic"
android:pivotX="50.0%p"
android:pivotY="50.0%p"
android:fillBefore="true"
android:fillAfter="true"
android:fromXScale="1.0"
android:toXScale="0.8"
android:fromYScale="1.0"
android:toYScale="0.8"
android:fillEnabled="true" />
android:toYScale="0.8" />
</set>
+2 -2
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:interpolator="@android:anim/decelerate_interpolator"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/decelerate_interpolator">
<translate
android:duration="300"
android:fromYDelta="100.0%p"
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:interpolator="@android:anim/accelerate_interpolator"
xmlns:android="http://schemas.android.com/apk/res/android">
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:interpolator="@android:anim/accelerate_interpolator">
<translate
android:duration="300"
android:fromYDelta="0.0%p"
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="225"
android:interpolator="@android:interpolator/linear_out_slow_in">
<translate
android:fromYDelta="100.0%p"
android:toYDelta="0.0" />
</set>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="195"
android:interpolator="@android:interpolator/fast_out_linear_in">
<translate
android:fromYDelta="0.0%p"
android:toYDelta="100.0%p" />
</set>
+4 -4
View File
@@ -5,15 +5,15 @@
android:state_pressed="true">
<objectAnimator
android:duration="200"
android:propertyName="translationZ"
android:valueTo="2.0dip"
android:valueType="floatType"
android:propertyName="translationZ" />
android:valueType="floatType" />
</item>
<item>
<objectAnimator
android:duration="200"
android:propertyName="translationZ"
android:valueTo="1.0dip"
android:valueType="floatType"
android:propertyName="translationZ" />
android:valueType="floatType" />
</item>
</selector>
+4 -4
View File
@@ -5,15 +5,15 @@
android:state_pressed="true">
<objectAnimator
android:duration="200"
android:propertyName="translationZ"
android:valueTo="4.0dip"
android:valueType="floatType"
android:propertyName="translationZ" />
android:valueType="floatType" />
</item>
<item>
<objectAnimator
android:duration="200"
android:propertyName="translationZ"
android:valueTo="2.0dip"
android:valueType="floatType"
android:propertyName="translationZ" />
android:valueType="floatType" />
</item>
</selector>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:interpolator="@android:anim/accelerate_decelerate_interpolator"
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/bottom_sheet_slide_duration"
xmlns:android="http://schemas.android.com/apk/res/android">
android:interpolator="@android:interpolator/fast_out_linear_in">
<translate
android:fromYDelta="20.000004%p"
android:toYDelta="0.0" />
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<set android:interpolator="@android:anim/accelerate_interpolator"
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="@integer/bottom_sheet_slide_duration"
xmlns:android="http://schemas.android.com/apk/res/android">
android:interpolator="@android:interpolator/fast_out_slow_in">
<translate
android:fromYDelta="0.0"
android:toYDelta="20.000004%p" />
+3 -3
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<translate android:fromYDelta="100.0%"
android:toYDelta="0.0"
xmlns:android="http://schemas.android.com/apk/res/android" />
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="100.0%"
android:toYDelta="0.0" />
+3 -3
View File
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<translate android:fromYDelta="0.0"
android:toYDelta="100.0%"
xmlns:android="http://schemas.android.com/apk/res/android" />
<translate xmlns:android="http://schemas.android.com/apk/res/android"
android:fromYDelta="0.0"
android:toYDelta="100.0%" />
+3 -3
View File
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<alpha android:interpolator="@android:anim/accelerate_interpolator"
<alpha xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="200"
android:fromAlpha="1.0"
android:toAlpha="0.0"
xmlns:android="http://schemas.android.com/apk/res/android" />
android:interpolator="@android:anim/accelerate_interpolator"
android:toAlpha="0.0" />
@@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:pathData="M 0,0 C 0.05, 0, 0.133333, 0.06, 0.166666, 0.4 C 0.208333, 0.82, 0.25, 1, 1, 1" />
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<pathInterpolator xmlns:android="http://schemas.android.com/apk/res/android"
android:controlX1="0.4"
android:controlX2="1.0"
android:controlY1="0.0"
android:controlY2="1.0" />
+16
View File
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<scale
android:duration="@android:integer/config_shortAnimTime"
android:fromXScale="0.9"
android:fromYScale="0.9"
android:pivotX="50.0%"
android:pivotY="0.0%"
android:toXScale="1.0"
android:toYScale="1.0" />
<alpha
android:duration="@android:integer/config_shortAnimTime"
android:fromAlpha="0.0"
android:toAlpha="1.0" />
</set>
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="100">
<translate
android:fromYDelta="-20.000004%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toYDelta="0.0" />
<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />
</set>
+12
View File
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:duration="100">
<translate
android:fromYDelta="20.000004%"
android:interpolator="@android:anim/decelerate_interpolator"
android:toYDelta="0.0" />
<alpha
android:fromAlpha="0.0"
android:interpolator="@android:anim/decelerate_interpolator"
android:toAlpha="1.0" />
</set>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:animation="@anim/item_animation_fall_down"
android:animationOrder="normal"
android:delay="14.999998%" />
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<layoutAnimation xmlns:android="http://schemas.android.com/apk/res/android"
android:animation="@anim/item_animation_fall_up"
android:animationOrder="reverse"
android:delay="14.999998%" />
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="250"
android:fromXDelta="100.0%"
android:fromYDelta="0.0%"
android:toXDelta="0.0%"
android:toYDelta="0.0%" />
</set>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<set xmlns:android="http://schemas.android.com/apk/res/android"
android:shareInterpolator="false">
<translate
android:duration="250"
android:fromXDelta="0.0%"
android:fromYDelta="0.0%"
android:toXDelta="-100.0%"
android:toYDelta="0.0%" />
</set>

Some files were not shown because too many files have changed in this diff Show More