Compare commits

...
Author SHA1 Message Date
Vologhat 235b287a36 fix telegram stickers notification crash 2022-10-18 16:14:47 +03:00
Vologhat 9317e86d66 Update build.gradle 2022-10-15 21:46:21 +03:00
aliveoutside 23f1b6c26b load ffmpeg-kit directly from libs folder via System.loadLibrary
add arm64 libs
2022-10-15 21:43:03 +03:00
aliveoutside a7d50bca26 remove ffmpeg libs from assets 2022-10-15 21:40:23 +03:00
aliveoutside 92fbd071de reduce ffmpeg-kit size 2022-10-15 21:12:56 +03:00
Vologhat b7860b857f Updated arm32-v7a libs 2022-10-15 20:20:36 +03:00
Vologhat cd0914041d arm64-v8a support 2022-10-15 15:05:41 +03:00
Vologhat 9f0230d935 Update R.java 2022-10-14 22:19:38 +03:00
Vologhat a05865c6a8 Added R.java generator and executing scripts 2022-10-14 22:14:56 +03:00
k1zn d678ff5e9b translate 2022-10-14 19:35:37 +05:00
gdlbo 4829acd869 fix slow stickers load + some imp 2022-10-14 00:43:17 +03:00
gdlbo 6df6fdf01c miniapps ban 2022-10-14 00:08:23 +03:00
k1zn 4a2e73d676 fix context crash 2022-10-13 21:44:37 +05:00
aliveoutside 4c5a1c5a17 download track synchronously 2022-10-13 03:17:17 +03:00
aliveoutside 1aedacf401 remove useless ffmpeg banner in logs 2022-10-13 03:17:05 +03:00
aliveoutside 9d4bffd8aa use an executor to download tracks 2022-10-13 02:52:23 +03:00
aliveoutside ede17b31a2 move vkexecutors receiving to separate package 2022-10-13 02:52:23 +03:00
aliveoutside e94f93facb update telegram stickers entry icons 2022-10-13 02:52:23 +03:00
gdlbo 2460b27af1 Update LastFMScrobbler.java 2022-10-12 23:59:50 +03:00
gdlbo 9cb9bf4167 max quality for external videos 2022-10-12 22:04:08 +03:00
gdlbo 6753dc9a8c superapp restart app 2022-10-12 21:34:05 +03:00
gdlbo c257e3a5ce refactored video alert adapter 2022-10-12 21:28:02 +03:00
k1zn a055656424 в 2022-10-12 18:30:06 +05:00
k1zn 4882315bf4 another translate 2022-10-12 18:27:31 +05:00
k1zn 1d8f998a5f translate 2022-10-12 18:08:13 +05:00
k1zn ff945b76b8 fix localization bug 2022-10-12 17:50:34 +05:00
gdlbo 2d14c78a90 fixed some long titles 2022-10-12 03:13:52 +03:00
gdlbo 10d1a40bd8 some code imp 2022-10-12 02:35:36 +03:00
gdlbo 78e3757cf4 deleted unused code 2022-10-12 01:58:02 +03:00
gdlbo 2aef797efe some dev fixes 2022-10-12 01:24:50 +03:00
gdlbo 20999810ab fixed load verifs from notif 2022-10-12 00:48:03 +03:00
gdlbo d8c45ffeff fix #695 2022-10-12 00:33:40 +03:00
gdlbo 05d339eeb0 fix #695 2022-10-12 00:29:01 +03:00
gdlbo e50366da8a added #701 2022-10-12 00:02:53 +03:00
gdlbo 915b31477b fix 700 2022-10-11 23:50:15 +03:00
aliveoutside 9d2878b9dc revert "fixed redundant thread creation" b9a55799
it breaks Telegram stickers downloading, we'll investigate later
2022-10-09 15:54:26 +03:00
gdlbo bcfefe777d fix executer 2022-10-09 01:38:47 +03:00
k1zn b69e55606a fix some mistake 2022-10-09 02:32:17 +05:00
k1zn 2f06d2a008 refactoring autocache code 2022-10-09 02:31:08 +05:00
aliveoutside d151d27063 fix #831 2022-10-09 00:23:35 +03:00
gdlbo ad128f1e7e Update OTADownloader.java 2022-10-08 23:52:22 +03:00
gdlbo efe8a2c883 fix toast dl dialogs 2022-10-08 23:11:19 +03:00
aliveoutside 5def26131b [foaf] fix regexes and run the dialog from ui thread 2022-10-08 23:06:53 +03:00
gdlbo a586e4e240 Update FoafBase.java 2022-10-08 22:46:31 +03:00
97 changed files with 483 additions and 243 deletions
+1 -3
View File
@@ -91,8 +91,6 @@ android {
dependencies {
coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5'
implementation 'net.sourceforge.streamsupport:streamsupport-minifuture:1.7.4'
implementation 'com.google.android.material:material:1.6.1'
implementation 'androidx.preference:preference:1.2.0'
implementation fileTree(dir: 'libs', include: ['*.aar'])
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
}
@@ -2,6 +2,7 @@ package bruhcollective.itaysonlab.libvkx.client;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.isValidSignature;
import android.annotation.SuppressLint;
import android.content.Context;
@@ -34,7 +35,7 @@ public class LibVKXClient {
public static boolean isVkxInstalled() {
try {
getGlobalContext().getPackageManager().getPackageInfo("ua.itaysonlab.vkx", 0);
return true;
return isValidSignature();
} catch (Exception unused) {
return false;
}
@@ -12,7 +12,8 @@ import androidx.core.app.NotificationManagerCompat;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
import com.vtosters.lite.R;
import java.util.HashMap;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicLong;
import ru.vtosters.lite.utils.AndroidUtils;
@@ -21,22 +22,22 @@ import ru.vtosters.lite.utils.AndroidUtils;
* Created by Aefyr on 20.05.2018.
*/
public class NotificationsHelper {
private static final int NOTIFICATION_ID_BASE = 3921337;
// private static final int NOTIFICATION_ID_BASE = 3921337;
private static final String NOTIFICATION_CHANNEL_ID = "tgss_chan_v5";
private static final int MAX_UPDATE_NOTIFICATIONS_PER_SECOND = 3;
private static final int MIN_TIME_BETWEEN_UPDATE_NOTIFICATIONS = 1000 / MAX_UPDATE_NOTIFICATIONS_PER_SECOND;
private final HashMap<TelegramStickersPack, Integer> downloadingPacksNotificationsIds;
private final List<Integer> downloadingPacksNotificationsIds;
private final Context c;
private final NotificationManagerCompat manager;
private final AtomicLong lastNotificationTime = new AtomicLong(0);
private int currentNotificationN = 0;
// private int currentNotificationN = 0;
public NotificationsHelper(Context c) {
this.c = c;
manager = NotificationManagerCompat.from(c);
downloadingPacksNotificationsIds = new HashMap<>();
downloadingPacksNotificationsIds = new ArrayList<>();
if (oreo()) {
NotificationChannel notificationChan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, AndroidUtils.getString(R.string.telegram_stickers_service), NotificationManager.IMPORTANCE_HIGH);
@@ -45,19 +46,19 @@ public class NotificationsHelper {
}
public void packStartedDownloading(TelegramStickersPack pack) {
int notificationId = NOTIFICATION_ID_BASE + currentNotificationN++;
downloadingPacksNotificationsIds.put(pack, notificationId);
downloadingPacksNotificationsIds.add(pack.hash);
Notification.Builder builder = commonBuilder();
builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + AndroidUtils.getString(R.string.telegram_stickers_downloading) : pack.title + AndroidUtils.getString(R.string.telegram_stickers_updating));
builder.setContentText(AndroidUtils.getString(R.string.telegram_stickers_gettinginfo));
builder.setOngoing(true);
manager.notify(notificationId, builder.build());
manager.notify(pack.hash, builder.build());
}
public void packDownloadUpdated(TelegramStickersPack pack, int downloadProgress) {
if (System.currentTimeMillis() - lastNotificationTime.get() < MIN_TIME_BETWEEN_UPDATE_NOTIFICATIONS)
if (System.currentTimeMillis() - lastNotificationTime.get() < MIN_TIME_BETWEEN_UPDATE_NOTIFICATIONS
|| !downloadingPacksNotificationsIds.contains(pack.hash))
return;
lastNotificationTime.set(System.currentTimeMillis());
@@ -69,11 +70,13 @@ public class NotificationsHelper {
builder.setOngoing(true);
builder.setOnlyAlertOnce(true);
if (downloadingPacksNotificationsIds.containsKey(pack))
manager.notify(downloadingPacksNotificationsIds.get(pack), builder.build());
manager.notify(pack.hash, builder.build());
}
public void packDoneDownloading(TelegramStickersPack pack, boolean success, boolean wasUpdate, @Nullable Exception e) {
if (!downloadingPacksNotificationsIds.remove(pack.hash))
return;
Notification.Builder builder = commonBuilder();
builder.setProgress(0, 0, false);
builder.setOngoing(false);
@@ -81,9 +84,9 @@ public class NotificationsHelper {
String text;
if (success)
text = wasUpdate ? pack.title + AndroidUtils.getString(R.string.telegram_stickers_updated) : pack.title + AndroidUtils.getString(R.string.telegram_stickers_downloaded);
text = pack.title + " " + AndroidUtils.getString(wasUpdate ? R.string.telegram_stickers_updated : R.string.telegram_stickers_downloaded);
else
text = wasUpdate ? pack.title + AndroidUtils.getString(R.string.telegram_stickers_error_update) : pack.title + AndroidUtils.getString(R.string.telegram_stickers_error_download);
text = pack.title + " " + AndroidUtils.getString(wasUpdate ? R.string.telegram_stickers_error_update : R.string.telegram_stickers_error_download);
if (e instanceof TelegramStickersGrabber.TSGException) {
text = pack.title + ": " + e.getMessage();
@@ -91,11 +94,12 @@ public class NotificationsHelper {
builder.setContentText(String.format(text, pack.title));
manager.notify(downloadingPacksNotificationsIds.remove(pack), builder.build());
manager.notify(pack.hash, builder.build());
}
public void removePackNotification(TelegramStickersPack pack) {
manager.cancel(downloadingPacksNotificationsIds.remove(pack));
if (downloadingPacksNotificationsIds.remove(pack.hash))
manager.cancel(pack.hash);
}
private Notification.Builder commonBuilder() {
@@ -32,11 +32,14 @@ public class TelegramStickersPack extends CustomStickersPack {
public int stickersCount = -1;
public String version;
public int index = -1;
public Integer hash;
public HashMap<String, List<Integer>> emojis = new HashMap<>();
public TelegramStickersPack(String id) {
this.id = id.toLowerCase();
final var idLowerCase = id.toLowerCase();
this.id = idLowerCase;
this.hash = idLowerCase.hashCode();
title = id;
}
@@ -106,7 +109,7 @@ public class TelegramStickersPack extends CustomStickersPack {
@Override
public int hashCode() {
return id.toLowerCase().hashCode();
return hash;
}
@Override
@@ -235,7 +235,7 @@ public class TelegramStickersService {
runOnUiThread(() -> {
newPack.state = TelegramStickersPack.DOWNLOADED;
notifyPackChanged(newPack, packs.indexOf(newPack));
currentlyDownloading.remove(newPack.id.toLowerCase());
currentlyDownloading.remove(newPack.id);
syncPack(newPack);
if (isUpdate) {
@@ -8,29 +8,24 @@ import com.arthenica.smartexception.java.Exceptions;
import java.util.Collections;
import java.util.List;
import ru.vtosters.lite.utils.AndroidUtils;
public class NativeLoader {
static final String[] FFMPEG_LIBRARIES = {"avutil", "swscale", "swresample", "avcodec", "avformat", "avfilter", "avdevice"};
static final String[] FFMPEG_LIBRARIES = {"avutil", "swresample", "avcodec", "avformat", "avfilter", "avdevice"};
private static void loadLibrary(String libraryName) {
String path = AndroidUtils.getGlobalContext().getFilesDir() + "/lib" + libraryName + ".so";
System.load(path);
System.loadLibrary(libraryName);
}
private static List<String> loadExternalLibraries() {
// return Packages.getExternalLibraries();
//return Packages.getExternalLibraries();
return Collections.emptyList();
}
private static String loadNativeAbi() {
// return AbiDetect.getNativeAbi();
return Abi.ABI_ARMV7A_NEON.getName();
return AbiDetect.getNativeAbi();
}
static String loadAbi() {
// return AbiDetect.getAbi();
return Abi.ABI_ARMV7A_NEON.getName();
return AbiDetect.getAbi();
}
static String loadPackageName() {
@@ -14,7 +14,6 @@ import android.util.Log;
import com.facebook.common.i.MediaUtils;
import com.facebook.x.g.EncodedImage;
import com.vk.core.concurrent.VkExecutors;
import com.vk.imageloader.VKImageLoader;
import com.vk.log.L;
import com.vk.metrics.eventtracking.VkTracker;
@@ -29,6 +28,7 @@ import java.util.HashSet;
import b.h.g.m.CameraUtils;
import b.h.g.m.FileUtils;
import ru.vtosters.lite.concurrent.VTExecutors;
public class DownloadUtils {
public static final HashSet<Long> a = new HashSet<>();
@@ -81,7 +81,7 @@ public class DownloadUtils {
file.createNewFile();
}
if (file.exists()) {
VkExecutors.x.e().execute(() -> {
VTExecutors.getIoExecutor().execute(() -> {
try {
FileUtils.b.a(h, new FileOutputStream(file), h.available(), null);
ToastUtils.a(context.getString(R.string.file_saved, file.getAbsoluteFile()));
+15 -1
View File
@@ -1,6 +1,7 @@
package com.vtosters.lite;
public class R {
public final class R {
public static final class anim {
public static final int abc_fade_in = 0x7f010000; // 2130771968
public static final int abc_fade_out = 0x7f010001; // 2130771969
@@ -220,6 +221,8 @@ public class R {
public static final int targetlang_value = 0x7f030074; // 2130903156
public static final int undel_value = 0x7f030075; // 2130903157
public static final int wallpaper_change_dialog = 0x7f030076; // 2130903158
public static final int theme_type_name = 0x7f030077; // 2130903159
public static final int theme_type_name_checkbox = 0x7f030078; // 2130903160
}
public static final class attr {
@@ -19514,6 +19517,17 @@ public class R {
public static final int whitelisted_filters_groups_title = 0x7f121838; // 2131892280
public static final int why_news_not_updated_summ = 0x7f121839; // 2131892281
public static final int why_news_not_updated_title = 0x7f12183a; // 2131892282
public static final int blockminiapps_summ = 0x7f12183b; // 2131892283
public static final int blockminiapps_title = 0x7f12183c; // 2131892284
public static final int current_theme = 0x7f12183d; // 2131892285
public static final int invalid_pack_link = 0x7f12183e; // 2131892286
public static final int maxquality_summ = 0x7f12183f; // 2131892287
public static final int maxquality_title = 0x7f121840; // 2131892288
public static final int newsfeed_notif_summ = 0x7f121841; // 2131892289
public static final int newsfeed_notif_title = 0x7f121842; // 2131892290
public static final int promotedstickers_title = 0x7f121843; // 2131892291
public static final int vkx_integration_enabled_info = 0x7f121844; // 2131892292
public static final int writebar_ios_title = 0x7f121845; // 2131892293
}
public static final class style {
@@ -0,0 +1,38 @@
package ru.vtosters.lite.concurrent;
import com.vk.core.concurrent.VkExecutors;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import io.reactivex.Scheduler;
public class VTExecutors {
public static ExecutorService getMusicDownloadExecutor() {
return VTMusicDownloadExecutor.getInstance();
}
public static ExecutorService getIoExecutor() {
return VkExecutors.x.e();
}
public static Scheduler getIoScheduler() {
return VkExecutors.x.f();
}
public static Scheduler getSlowTasksScheduler() {
return VkExecutors.x.q();
}
static class VTMusicDownloadExecutor {
private VTMusicDownloadExecutor() {}
private static class LazyHolder {
public static final ExecutorService INSTANCE = Executors.newSingleThreadExecutor();
}
public static ExecutorService getInstance() {
return LazyHolder.INSTANCE;
}
}
}
@@ -10,6 +10,8 @@ import com.vk.dto.music.Playlist;
import com.vtosters.lite.R;
import java.io.File;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import ru.vtosters.lite.music.cache.CacheDatabaseDelegate;
@@ -30,6 +32,7 @@ import ru.vtosters.lite.utils.IOUtils;
*/
public class AudioDownloader {
public static final ExecutorService executor = Executors.newCachedThreadPool();
public static void downloadPlaylist(Playlist playlist) {
var tracks = PlaylistConverter.getPlaylist(playlist);
@@ -66,7 +69,7 @@ public class AudioDownloader {
var trackFile = FileCacheImplementation.getTrackFile(trackId);
if (!trackFile.exists())
trackFile.getParentFile().mkdirs();
downloadM3U8(track, true);
executor.submit(() -> downloadM3U8(track, true));
}
public static void cachePlaylist(Playlist playlist) {
@@ -1,5 +1,7 @@
package ru.vtosters.lite.downloaders;
import static android.widget.Toast.LENGTH_SHORT;
import static android.widget.Toast.makeText;
import static ru.vtosters.lite.encryption.EncryptProvider.decryptMessage;
import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.proxy.ProxyUtils.getApi;
@@ -33,6 +35,7 @@ import java.util.Objects;
import java.util.regex.Pattern;
import ru.vtosters.lite.utils.AndroidUtils;
import ru.vtosters.lite.utils.LifecycleUtils;
public class MessagesDownloader {
private static final String VK_DOMAIN = "vk.com";
@@ -119,7 +122,7 @@ public class MessagesDownloader {
}
fos.write(format.provideDocumentEnd().getBytes(StandardCharsets.UTF_8));
fos.close();
Toast.makeText(getGlobalContext(), AndroidUtils.getString(R.string.saved_as) + " " + out.getAbsolutePath(), Toast.LENGTH_SHORT).show();
LifecycleUtils.getCurrentActivity().runOnUiThread(() -> makeText(getGlobalContext(), AndroidUtils.getString(R.string.saved_as) + " " + out.getAbsolutePath(), LENGTH_SHORT).show());
} catch (IOException | JSONException e) {
e.printStackTrace();
}
@@ -65,7 +65,7 @@ public class OTADownloader {
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");
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_DOWNLOADS, "VTLite_" + System.currentTimeMillis() / 1000 + ".apk");
var manager = (DownloadManager) AndroidUtils.getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE);
manager.enqueue(request);
@@ -4,12 +4,17 @@ import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.proxy.ProxyUtils.getApi;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr;
import android.app.DownloadManager;
import android.app.ProgressDialog;
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import android.widget.Toast;
import com.vk.core.dialogs.alert.VkAlertDialog;
@@ -27,6 +32,7 @@ import java.util.List;
import java.util.Objects;
import ru.vtosters.lite.utils.ExternalLinkParser;
import ru.vtosters.lite.utils.LifecycleUtils;
public class VideoDownloader {
private static final int DOWNLOAD_ID = 0;
@@ -97,29 +103,28 @@ public class VideoDownloader {
max[i] = list.get(i);
}
if (context == null) {
var url = urls.get(urls.size() - 1);
if (context == null) context = LifecycleUtils.getCurrentActivity();
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString());
request.allowScanningByMediaScanner();
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
return;
}
var adapter = new ArrayAdapter(context, android.R.layout.simple_list_item_1, max) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = (TextView) super.getView(position, convertView, parent);
textView.setTextColor(getTextAttr());
return textView;
}
};
new VkAlertDialog.Builder(context)
.setItems(max, ((dialog, which) -> {
var url = urls.get(which);
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString());
request.allowScanningByMediaScanner();
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
}))
.show();
.setAdapter(adapter, (dialog, which) -> {
var url = urls.get(which);
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setNotificationVisibility(DownloadManager.Request.VISIBILITY_VISIBLE_NOTIFY_COMPLETED);
request.setTitle(videoFile.toString());
request.allowScanningByMediaScanner();
request.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile + ".mp4");
((DownloadManager) getGlobalContext().getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
})
.show();
}
public static void parseVideoLink(String url, Context ctx) {
@@ -32,15 +32,15 @@ import java.util.regex.Pattern;
import okhttp3.Headers;
import okhttp3.OkHttpClient;
import ru.vtosters.lite.net.Request;
import ru.vtosters.lite.utils.LifecycleUtils;
public class FoafBase {
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
private static final Pattern FOAF_REGEX_LAST_SEEN = Pattern.compile("<ya:lastLoggedIn dc:date=\"(.*)(((\\+|-)\\d\\d):(\\d\\d))\"\\/>");
private static final Pattern FOAF_REGEX_LOGIN = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"");
private static final Pattern FOAF_REGEX_LAST_SEEN = Pattern.compile("<ya:lastLoggedIn dc:date=\"(.*)(((\\+|-)\\d\\d):(\\d\\d))\"");
private static final String API_VKNEXT = "https://api.vtosters.app/v1/getBypassedOnlineInfo?json=1&ids=";
private static final OkHttpClient client = new OkHttpClient();
public static long getLastSeen(long origtime, int id) throws ParseException, IOException {
public static long getLastSeen(long origtime, int id) throws ParseException {
var request = new okhttp3.Request.a()
.b(getLink(id))
.a(Headers.a("User-Agent", Network.l.c().a(), "Content-Type", "application/x-www-form-urlencoded; charset=utf-8")).a();
@@ -87,14 +87,13 @@ public class FoafBase {
}
}
public static JSONObject getBypassedOnlineInfo(String ids) throws JSONException {
public static JSONObject getBypassedOnlineInfo(String ids) {
var request = new okhttp3.Request.a()
.b(API_VKNEXT + ids)
.a();
String response = null;
String response;
var dummy = new JSONObject();
@@ -137,23 +136,20 @@ public class FoafBase {
try {
progressDialog.cancel();
Matcher matcher = FOAF_REGEX.matcher(str);
Matcher matcher2 = FOAF_REGEX_LOGIN.matcher(str);
matcher.find();
matcher2.find();
String normalHumanDate = getNormalHumanDate(Objects.requireNonNull(matcher.group(1)));
getNormalHumanDate(Objects.requireNonNull(matcher2.group(1)));
new VkAlertDialog.Builder(context)
LifecycleUtils.getCurrentActivity().runOnUiThread(() -> new VkAlertDialog.Builder(context)
.setTitle(R.string.addinf)
.setMessage(context.getString(R.string.foafid) +
" " + i + context.getString(R.string.foafregdate)
+ " " + normalHumanDate + context.getString(R.string.foafdate)
+ " " + daysPassedFromFoafDate(normalHumanDate))
.setPositiveButton(android.R.string.ok, null)
.show();
.show());
} catch (Exception e) {
e.printStackTrace();
makeText(getGlobalContext(), context.getString(R.string.foaferr), LENGTH_SHORT).show();
LifecycleUtils.getCurrentActivity().runOnUiThread(() -> makeText(getGlobalContext(), context.getString(R.string.foaferr), LENGTH_SHORT).show());
}
}
@@ -9,6 +9,7 @@ import static ru.vtosters.lite.utils.Preferences.adsstories;
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
import static ru.vtosters.lite.utils.Preferences.dev;
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import android.util.Log;
@@ -224,6 +225,12 @@ public class AdBlockHook {
continue;
}
if (hasMiniAppAds(list) && !isWhitelistedFilters(list)) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: MiniApp filters");
continue;
}
if (NewsFeedFiltersUtils.injectFiltersReposts(list) && !isWhitelistedFilters(list)) {
if (dev())
Log.d("NewsfeedAdBlockV2", "Removed post " + list.optInt("post_id") + " from feed, Reason: repost ad");
@@ -360,4 +367,17 @@ public class AdBlockHook {
return whitelist.contains(id);
}
public static Boolean hasMiniAppAds(JSONObject list) {
var attachments = list.optJSONArray("attachments");
if (attachments != null && getBoolValue("blockminiapps", false)) {
for (int j = 0; j < attachments.length(); j++) {
var type = attachments.optJSONObject(j).optString("type");
if (type.contains("mini_app")) return true;
}
}
return false;
}
}
@@ -11,9 +11,8 @@ import android.app.Activity;
import android.os.Build;
import android.preference.PreferenceManager;
import com.vk.core.concurrent.VkExecutors;
import ru.vtosters.lite.downloaders.notifications.NotificationChannels;
import ru.vtosters.lite.concurrent.VTExecutors;
import ru.vtosters.lite.ui.dialogs.DisableBattery;
import ru.vtosters.lite.ui.dialogs.InstallGMS;
import ru.vtosters.lite.ui.dialogs.OTADialog;
@@ -25,17 +24,12 @@ public class MainActivityInjector {
setNeededTheme(activity);
sendRequest();
if (checkupdates()) OTADialog.checkUpdates(activity);
VkExecutors.x.f().a(DeletedMessagesHandler::reloadMessagesList); // ioScheduler
VTExecutors.getIoScheduler().a(DeletedMessagesHandler::reloadMessagesList); // ioScheduler
Start.alert(activity);
InstallGMS.alert(activity);
DisableBattery.alert(activity);
PreferenceManager.getDefaultSharedPreferences(activity)
.edit()
.putBoolean("isdark", isDarkTheme())
.commit();
VkExecutors.x.q().a(() -> {
VTExecutors.getSlowTasksScheduler().a(() -> {
getInstance().autoCleaningCache();
}); // slowTasksScheduler
@@ -0,0 +1,9 @@
package ru.vtosters.lite.hooks;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
public class PromoStickersHook {
public static String hook(){
return getBoolValue("promotedstickers", true) ? "purchased,active" : "purchased,active,promoted";
}
}
@@ -19,15 +19,11 @@ import com.vk.music.common.MusicPlaybackLaunchContext;
import com.vtosters.lite.R;
import java.util.ArrayList;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClientImpl;
import ru.vtosters.lite.downloaders.AudioDownloader;
public class MusicBottomSheetHook {
private static final ExecutorService executor = Executors.newCachedThreadPool();
public static ArrayList<MusicAction> hook(ArrayList<MusicAction> actions, MusicTrack musicTrack) {
if (musicTrack.F1()) return actions;
@@ -149,7 +145,7 @@ public class MusicBottomSheetHook {
return tryPlayInVKX(null, null, playlist);
if (actionId == R.id.add_to_cache) {
executor.submit(() -> AudioDownloader.cachePlaylist(playlist));
AudioDownloader.cachePlaylist(playlist);
return true;
}
@@ -183,7 +179,7 @@ public class MusicBottomSheetHook {
}
});
} else {
executor.submit(() -> AudioDownloader.downloadPlaylist(playlist));
AudioDownloader.downloadPlaylist(playlist);
}
return true;
}
@@ -199,7 +199,7 @@ public class LastFMScrobbler {
}
public static boolean needScrobbling(String uid) {
return isLoggedIn() && isScrobblingEnabled() && !SCROBBLED_UUIDS.contains(uid);
return isLoggedIn() && isScrobblingEnabled() && (SCROBBLED_UUIDS.isEmpty() || !SCROBBLED_UUIDS.get(SCROBBLED_UUIDS.size() - 1).contains(uid));
}
public static boolean isLoggedIn() {
@@ -10,8 +10,6 @@ import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.atomic.AtomicInteger;
import javax.crypto.NoSuchPaddingException;
@@ -28,7 +26,6 @@ import ru.vtosters.lite.utils.IOUtils;
public class M3UDownloader implements ITrackDownloader {
private static final OkHttpClient client = new OkHttpClient();
private ExecutorService executorService = Executors.newSingleThreadExecutor();
public static M3UDownloader getInstance() {
return Holder.INSTANCE;
@@ -99,6 +96,7 @@ public class M3UDownloader implements ITrackDownloader {
}));
}
var future = CompletableFuture.allOf(futures.toArray(new CompletableFuture[0]));
future.join();
future.exceptionally(throwable -> {
callback.onFailure();
return null;
@@ -13,6 +13,8 @@ import org.json.JSONObject;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import io.reactivex.Observable;
@@ -23,11 +25,12 @@ import ru.vtosters.lite.music.cache.helpers.PlaylistHelper;
import ru.vtosters.lite.music.cache.helpers.TracklistHelper;
public class PlaylistInjector {
private static final ExecutorService executor = Executors.newCachedThreadPool();
public final static String CHANNEL_NAME = "VTCH";
public static void injectDownloadPlaylist(Playlist playlist) {
AudioDownloader.cachePlaylist(playlist);
executor.submit(() -> AudioDownloader.cachePlaylist(playlist));
}
public static boolean eligibleForOfflineCaching() {
@@ -28,15 +28,13 @@ public class FFMpeg {
* @return True if success, else false
*/
public static boolean convert(File in, String out, MusicTrack track) {
checkFFMpegLibs();
// convert .ts file to .mp3 file via ffmpeg
var sb = new StringBuilder();
sb.append("-y -i \"").append(in.getAbsolutePath()).append("\"");
sb.append(" -map 0 -dn ");
//sb.append(" -loglevel error");
sb.append(" -hide_banner");
//sb.append(" -hide_banner");
sb.append(" -write_id3v2 1");
String title = null;
@@ -7,6 +7,7 @@ import com.vk.dto.music.MusicTrack;
import java.io.File;
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
import ru.vtosters.lite.concurrent.VTExecutors;
import ru.vtosters.lite.music.Callback;
import ru.vtosters.lite.music.M3UDownloader;
import ru.vtosters.lite.music.cache.CacheDatabaseDelegate;
@@ -36,6 +37,9 @@ public class TrackDownloader {
Log.v("TrackDownloader", "Directory created");
else
Log.e("TrackDownloader", "Directory creation failed");
downloader.downloadTrack(track, outDir, callback, cache);
VTExecutors.getMusicDownloadExecutor().execute(
() -> downloader.downloadTrack(track, outDir, callback, cache)
);
}
}
@@ -1,6 +1,7 @@
package ru.vtosters.lite.net;
import android.util.Base64;
import android.util.Log;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
@@ -14,30 +15,24 @@ import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.Executor;
public final class NetCall {
private final NetRequest req;
private final NetClient cl;
private final Executor executor;
protected NetCall(NetClient cl, NetRequest req, Executor executor) {
protected NetCall(NetClient cl, NetRequest req) {
this.req = req;
this.cl = cl;
this.executor = executor;
}
private static String constructArgs(Map<String, String> args) throws UnsupportedEncodingException {
args = new TreeMap<>(args);
StringBuilder str = new StringBuilder();
String str = "";
for (Map.Entry<String, String> en : args.entrySet()) {
if (str.length() > 0)
str.append("&");
str.append(URLEncoder.encode(en.getKey(), "UTF-8"))
.append("=")
.append(URLEncoder.encode(en.getValue(), "UTF-8"));
if (!str.isEmpty()) str += "&";
str += URLEncoder.encode(en.getKey(), "UTF-8") + "=" + URLEncoder.encode(en.getValue(), "UTF-8");
}
return str.toString();
return str;
}
public NetRequest request() {
@@ -82,13 +77,22 @@ public final class NetCall {
}
public void enqueue(NetCallback cb) {
executor.execute(() -> {
try {
NetResponse resp = execute();
cb.onResponse(NetCall.this, resp);
} catch (IOException e) {
cb.onFailure(NetCall.this, e);
new Thread() {
@Override
public void run() {
try {
NetResponse resp = execute();
cb.onResponse(NetCall.this, resp);
} catch (IOException e) {
cb.onFailure(NetCall.this, e);
}
try {
interrupt();
join();
} catch (Exception e) {
Log.e("NetCall", "Failed to interrupt and join thread", e);
}
}
});
}.start();
}
}
@@ -2,16 +2,12 @@ package ru.vtosters.lite.net;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
import java.util.concurrent.TimeUnit;
public class NetClient {
private final long timeout;
private final Proxy proxy;
private final PasswordAuthentication authenticator;
private final Executor executor
= Executors.newSingleThreadExecutor();
protected NetClient(Builder b) {
timeout = b.timeout;
@@ -28,7 +24,7 @@ public class NetClient {
}
public NetCall newCall(NetRequest req) {
return new NetCall(this, req, executor);
return new NetCall(this, req);
}
public PasswordAuthentication getAuthenticator() {
@@ -2,77 +2,75 @@ package ru.vtosters.lite.net;
import static ru.vtosters.lite.utils.AccountManagerUtils.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;
import java.util.concurrent.Executor;
import java.util.concurrent.Executors;
public class Request {
private static final Executor EXECUTOR =
Executors.newSingleThreadExecutor();
public static void makeRequest(byte[] bArr, RequestCallback callback) {
EXECUTOR.execute(new MakeRequestTask(bArr, callback));
public static void makeRequest(byte[] bArr, RequestCallback RequestCallback) {
new MakeRequestTask(bArr, RequestCallback).execute();
}
public static void makeRequest(String str, RequestCallback callback) {
makeRequest(str.getBytes(), callback);
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 implements Runnable {
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private final RequestCallback callback;
private final byte[] url;
private final boolean mIsPut;
private final boolean mIsVTostersRequest;
public MakeRequestTask(byte[] bArr, RequestCallback callback) {
this.mIsVTostersRequest = false;
this.mIsPut = false;
this.callback = callback;
this.url = bArr;
public MakeRequestTask(byte[] bArr, RequestCallback RequestCallback) {
mIsVTostersRequest = false;
mIsPut = false;
callback = RequestCallback;
url = bArr;
}
@Override
public void run() {
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());
} else {
}
if (!mIsVTostersRequest) {
httpURLConnection.setRequestProperty("User-Agent", Network.l.c().a());
}
httpURLConnection.setRequestProperty("Content-Type", mIsVTostersRequest
? "Content-Type"
: "application/x-www-form-urlencoded");
httpURLConnection.setRequestProperty("Content-Type", mIsVTostersRequest ? "Content-Type" : "application/x-www-form-urlencoded");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuilder builder = new StringBuilder();
StringBuffer stringBuffer = new StringBuffer();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
builder.append(readLine);
stringBuffer.append(readLine);
} else {
bufferedReader.close();
callback.onResponse(builder.toString());
break;
return stringBuffer.toString();
}
}
} catch (Exception e) {
callback.onResponse(e.getLocalizedMessage());
return e.getLocalizedMessage();
}
}
public void onPostExecute(String str) {
super.onPostExecute(str);
callback.onResponse(str);
}
}
}
@@ -39,8 +39,8 @@ public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.
var holder = new StickerPackViewHolder(view);
holder.mStickerPreview.setImageResource(R.drawable.icon_vk_104);
holder.mUpdateButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.ic_camera_switch_48)));
holder.mDeleteButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.vkim_ic_msg_delete)));
holder.mUpdateButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.ic_camera_switch_outline_24)));
holder.mDeleteButton.setImageDrawable(recolorDrawable(getResources().getDrawable(R.drawable.ic_delete_outline_28)));
return holder;
}
@@ -26,6 +26,7 @@ public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
findPreference("stories").setOnPreferenceClickListener(new restart());
findPreference("swipe").setOnPreferenceClickListener(new restart());
findPreference("is_likes_on_right").setOnPreferenceClickListener(new restart());
findPreference("superapp").setOnPreferenceClickListener(new restart());
if (isTablet()) {
findPreference("menusett").setVisible(false);
@@ -212,7 +212,7 @@ public class MediaFragment extends MaterialPreferenceToolbarFragment {
private void dlaudio(Context ctx) {
if (LibVKXClient.isIntegrationEnabled()) {
sendToast("Включена интеграция VKX. Глобальное кеширование доступно внутри VKX");
sendToast(AndroidUtils.getString("vkx_integration_enabled_info"));
return;
}
@@ -11,12 +11,14 @@ import static ru.vtosters.lite.utils.ThemesUtils.recolorDrawable;
import android.annotation.SuppressLint;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import androidx.preference.Preference;
import com.vk.core.dialogs.alert.VkAlertDialog;
import com.vk.navigation.Navigator;
import com.vk.stickers.Stickers;
import com.vtosters.lite.R;
import com.vtosters.lite.general.fragments.MaterialPreferenceToolbarFragment;
@@ -39,6 +41,7 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
findPreference("vkme_notifs").setOnPreferenceClickListener(new MessagesFragment.restart());
findPreference("systememoji").setOnPreferenceClickListener(new MessagesFragment.restart());
findPreference("wallpapers").setOnPreferenceClickListener(new MessagesFragment.openwp());
findPreference("promotedstickers").setOnPreferenceChangeListener(new clearStickersCache());
findPreference("autotranslate").setEnabled(!autoalltranslate());
@@ -76,6 +79,7 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
public boolean onPreferenceTreeClick(Preference preference) {
findPreference("autotranslate").setEnabled(!autoalltranslate());
findPreference("vkme_notifs").setEnabled(vkme());
findPreference("promotedstickers").setOnPreferenceChangeListener(new clearStickersCache());
return super.onPreferenceTreeClick(preference);
}
@@ -98,6 +102,16 @@ public class MessagesFragment extends MaterialPreferenceToolbarFragment {
}
}
public class clearStickersCache implements Preference.OnPreferenceChangeListener {
@Override
public boolean onPreferenceChange(Preference preference, Object o) {
SharedPreferences prefs2 = getContext().getSharedPreferences("stickers_storage", Context.MODE_PRIVATE);
prefs2.edit().clear().commit();
Stickers.l.c();
return true;
}
}
public class openwp implements Preference.OnPreferenceClickListener {
@Override
public boolean onPreferenceClick(Preference preference) {
@@ -10,7 +10,9 @@ import static ru.vtosters.lite.ui.components.BackupManager.restoreBackup;
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
import static ru.vtosters.lite.utils.AndroidUtils.dp2px;
import static ru.vtosters.lite.utils.AndroidUtils.getDefaultPrefs;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.LifecycleUtils.restartApplication;
import static ru.vtosters.lite.utils.LifecycleUtils.restartApplicationWithTimer;
import static ru.vtosters.lite.utils.ThemesUtils.getTextAttr;
import android.annotation.SuppressLint;
@@ -23,10 +25,13 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.util.Log;
import android.util.TypedValue;
import android.view.View;
import android.view.ViewGroup;
import android.webkit.WebView;
import android.widget.ArrayAdapter;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.TextView;
import android.widget.Toast;
import androidx.appcompat.view.ContextThemeWrapper;
@@ -155,52 +160,25 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
@SuppressLint({"CommitPrefEdits", "SetTextI18n"})
private void cacheAutoCleanDialog() {
String[] cacheText = {null, "100 MB", "500 MB", "1 GB", "2 GB", "5 GB"};
var val = getDefaultPrefs().getInt("autoclearcache_size", 0);
RadioGroup rg = new RadioGroup(getContext());
rg.setPadding(dp2px(18f), dp2px(12f), dp2px(18f), 0);
RadioButton zero = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
RadioButton one = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
RadioButton two = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
RadioButton three = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
RadioButton four = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
RadioButton five = new RadioButton(new ContextThemeWrapper(getContext(), R.style.Widget_AppCompat_CompoundButton_RadioButton));
for (int item = 0; item <= 5; item++) {
RadioButton rb = new RadioButton(new ContextThemeWrapper(getContext(), com.vtosters.lite.R.style.Widget_AppCompat_CompoundButton_RadioButton));
rg.addView(rb);
rb.setId(item);
rb.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
rg.addView(zero);
rg.addView(one);
rg.addView(two);
rg.addView(three);
rg.addView(four);
rg.addView(five);
var text = cacheText[item];
rb.setText(text != null ? text : AndroidUtils.getString("autoclearcachedisabled"));
zero.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
one.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
two.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
three.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
four.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
five.setTextSize(TypedValue.COMPLEX_UNIT_PX, dp2px(14f));
zero.setText(requireContext().getString(R.string.autoclearcachedisabled));
one.setText("100 MB");
two.setText("500 MB");
three.setText("1 GB");
four.setText("2 GB");
five.setText("5 GB");
zero.setTextColor(getTextAttr());
one.setTextColor(getTextAttr());
two.setTextColor(getTextAttr());
three.setTextColor(getTextAttr());
four.setTextColor(getTextAttr());
five.setTextColor(getTextAttr());
zero.setChecked(val == 0);
one.setChecked(val == 1);
two.setChecked(val == 2);
three.setChecked(val == 3);
four.setChecked(val == 4);
five.setChecked(val == 5);
rb.setTextColor(getTextAttr());
rb.setChecked(val == item);
}
new VkAlertDialog.Builder(getContext())
.setTitle(requireContext().getString(R.string.cache_clean_title))
@@ -346,8 +324,17 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
AndroidUtils.getGlobalContext().getSharedPreferences("gcm", 0).edit().clear().apply();
OtherFragment.this.getListView().postDelayed(() -> {
PushSubscriber.e.a(true);
ToastUtils.a(requireContext().getString(R.string.fcmtokenget));
ToastUtils.a(requireContext().getString(R.string.fcmtokenfixed));
Context ctx;
try {
ctx = requireContext();
} catch (Exception unused) {
ctx = getGlobalContext();
}
ToastUtils.a(ctx.getString(R.string.fcmtokenget));
ToastUtils.a(ctx.getString(R.string.fcmtokenfixed));
}, 1000);
return true;
}
@@ -357,12 +344,20 @@ public class OtherFragment extends MaterialPreferenceToolbarFragment {
@Override // android.support.v7.preference.Preference.c
public boolean onPreferenceClick(Preference preference) {
var arr = BackupManager.getBackupsNames();
var adapter = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, arr);
var adapter = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, arr) {
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView textView = (TextView) super.getView(position, convertView, parent);
textView.setTextColor(getTextAttr());
return textView;
}
};
new VkAlertDialog.Builder(getContext())
.setTitle(requireContext().getString(R.string.select_backup))
.setAdapter(adapter, (dialog, which) -> {
try {
restoreBackup(arr[which]);
restartApplicationWithTimer();
Toast.makeText(getContext(), requireContext().getString(R.string.backup_success), LENGTH_LONG).show();
} catch (IOException e) {
e.printStackTrace();
@@ -18,6 +18,7 @@ import static ru.vtosters.lite.utils.GmsUtils.isGmsInstalled;
import static ru.vtosters.lite.utils.ImageUtils.getDrawableFromUrl;
import static ru.vtosters.lite.utils.Preferences.ads;
import static ru.vtosters.lite.utils.Preferences.autotranslate;
import static ru.vtosters.lite.utils.Preferences.dev;
import static ru.vtosters.lite.utils.Preferences.devmenu;
import static ru.vtosters.lite.utils.Preferences.disableSettingsSumms;
import static ru.vtosters.lite.utils.Preferences.hasSpecialVerif;
@@ -119,25 +120,22 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
if (disableSettingsSumms()) return null;
String str;
String[] themeTypeName = AndroidUtils.getArray("theme_type_name");
switch (getPrefsValue("currsystemtheme")) {
default:
case "system":
str = "Системная";
str = themeTypeName[0];
break;
case "dark":
str = "Темная";
str = themeTypeName[1];
break;
case "light":
str = "Светлая";
str = themeTypeName[2];
break;
}
return "Текущая тема" + ": " + str;
}
public static SharedPreferences getCurrentAccount() {
return AndroidUtils.getGlobalContext().getSharedPreferences("pref_account_manager", Context.MODE_PRIVATE);
return AndroidUtils.getString("current_theme") + ": " + str;
}
public static String getSuperappsumm() {
@@ -146,15 +144,8 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
return AndroidUtils.getString(R.string.elements_hidden_count) + ": " + SuperAppEditorManager.getInstance().getDisabledTabs().size();
}
public static String getCachesumm() {
if (disableSettingsSumms()) return null;
return AndroidUtils.getString(R.string.autoclearcachesumm) + " " + humanReadableByteCountBin(CacheUtils.getInstance().size);
}
private void switchTheme(boolean isDarkTheme) {
setTheme(isDarkTheme ? getDarkTheme() : getLightTheme(), requireActivity());
edit().putBoolean("isdark", isDarkTheme).commit();
}
@Override
@@ -210,7 +201,7 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
"system",
requireContext().getString(R.string.appearance_theme_use_system),
R.drawable.ic_palette_outline_28, getThemesumm(),
new String[] { "Системная тема", "Тёмная тема", "Светлая тема" },
AndroidUtils.getArray("theme_type_name_checkbox"),
new String[] { "system", "dark", "light" },
(preference, o) -> {
String value = (String) o;
@@ -259,6 +250,14 @@ public class VTSettings extends MaterialPreferenceToolbarFragment {
edit().putBoolean("ssl", value).commit();
return true;
});
if (dev()) {
addMaterialSwitchPreference(this, "autoupdates", requireContext().getString(R.string.checkupdates), "", R.drawable.ic_camera_switch_outline_24, true, (preference, o) -> {
boolean value = (boolean) o;
edit().putBoolean("autoupdates", value).commit();
return true;
});
}
}
addPreferenceCategory(this, requireContext().getString(R.string.vtsettaccount));
@@ -45,6 +45,7 @@ import ru.vtosters.lite.tgs.TGPref;
import ru.vtosters.lite.ui.adapters.StickerPackAdapter;
import ru.vtosters.lite.ui.components.StickerTouchHelperCallback;
import ru.vtosters.lite.ui.fragments.BaseToolbarFragment;
import ru.vtosters.lite.utils.AndroidUtils;
public class StickersFragment extends BaseToolbarFragment {
public final static String ACTION_RELOAD = "com.vtosters.lite.action.RELOAD_TGS_LIST";
@@ -189,7 +190,7 @@ public class StickersFragment extends BaseToolbarFragment {
if (!pack.startsWith("https://")) {
pack = "https://" + pack;
} else if (!pack.contains("addstickers")) {
sendToast("Invalid pack name");
sendToast(AndroidUtils.getString("invalid_pack_link"));
}
pack = parsePack(pack);
mService.requestPackDownload(pack, new File(getContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
@@ -52,8 +52,7 @@ public class About {
return "0000000";
}
public static String getAppVersion() throws IOException {
var appver = isValidSignature() ? VERSIONNAME : "Dev";
return getApplicationName() + " " + appver + " | " + getBuildNumber();
public static String getAppVersion() {
return getApplicationName() + " " + (isValidSignature() ? VERSIONNAME : "Dev") + " | " + getBuildNumber();
}
}
@@ -14,9 +14,13 @@ public class AccountManagerUtils {
} // Current UserId
public static boolean isVKTester() {
return VKAccountManager.d().i();
return VKAccountManager.d().k0().equals("tester");
} // is vk tester
public static boolean isVKWorker() {
return VKAccountManager.d().k0().equals("worker");
}
public static String getUserSecret() {
return VKAccountManager.d().l0();
}
@@ -72,6 +72,10 @@ public class AndroidUtils {
return getResources().getStringArray(arrayId);
} // Get array from arrays.xml
public static String[] getArray(String resourcename) {
return getResources().getStringArray(getIdentifier(resourcename, "array"));
}
public static String getString(int id) {
return getGlobalContext().getString(id);
}
@@ -2,6 +2,7 @@ package ru.vtosters.lite.utils;
import static android.text.TextUtils.isEmpty;
import static ru.vtosters.lite.utils.AndroidUtils.getGlobalContext;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.isEnableExternalOpening;
import android.annotation.SuppressLint;
@@ -59,7 +60,7 @@ public class ExternalLinkParser {
if (!isEnabled || file.isEmpty()) return false;
if (checkVkVideo(file)) {
if (qualities.size() == 1) {
if (qualities.size() == 1 || getBoolValue("maxquality", false)) {
startExternalVideo((String) qualities.values().toArray()[0], context);
} else {
String[] titles = qualities.keySet().toArray(new String[0]);
@@ -37,12 +37,11 @@ public class Preferences {
GmsUtils.fixGapps();
setProxy();
VTVerifications.load(application);
LifecycleUtils.registerActivities(application);
} // VK Init
public static void forceOffline() {
edit().putBoolean("isdark", isDarkTheme()).commit();
setupFilters();
if (setoffline() && offline()) {
@@ -329,7 +328,7 @@ public class Preferences {
}
public static boolean checkupdates() {
return !getBoolValue("isRoamingState", false) && isValidSignature();
return !getBoolValue("isRoamingState", false) && isValidSignature() && (!dev() || getBoolValue("autoupdates", true));
}
public static boolean isValidSignature() {
Binary file not shown.
+36
View File
@@ -0,0 +1,36 @@
@echo off
cd scripts
echo.
echo Decompile release APK...
echo.
call java -jar apktool.jar d VTLite.apk -f -o tmp -s --use-aapt2 -p ../scripts/framework/
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo Generate R.java
echo.
call java -jar rclass-generator.jar -f tmp/res/values/public.xml -o ..\app\src\main\java\com\vtosters\lite\R.java -p com.vtosters.lite --comments
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo Clean temp dir
echo.
call rmdir /s/q tmp
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
+35
View File
@@ -0,0 +1,35 @@
#!/bin/bash
RED='\033[31m'
GREEN='\033[92m'
NC='\033[0m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
cd ../
echo -e "${BOLD}${UNDERLINE}Decompile release APK...${NC}\n"
java -jar ../scripts/apktool.jar d VTLite.apk -f -o tmp -s --use-aapt2 -p ../scripts/framework/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Regenerate R.java file...${NC}\n"
java -jar ../scripts/rclass-generator.jar -f ../scripts/tmp/res/values/public.xml -o ../scripts/app/src/main/java/com/vtosters/lite/R.java -p com.vtosters.lite --comments
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Clean temp dir...${NC}\n"
rm -rf ../scripts/tmp
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+10
View File
@@ -679,4 +679,14 @@
<item>сообщения</item>
<item>сообщений</item>
</string-array>
<string-array name="theme_type_name">
<item>Системная</item>
<item>Темная</item>
<item>Светлая</item>
</string-array>
<string-array name="theme_type_name_checkbox">
<item>Системная тема</item>
<item>Темная тема</item>
<item>Светлая тема</item>
</string-array>
</resources>
+27 -11
View File
@@ -5428,7 +5428,7 @@
<string name="vtlrecommend">Рекомендации</string>
<string name="vtlrecommendfriend">Отключить рекомендации друзей</string>
<string name="vtlrecommendauthor">Отключить рекомендации авторов</string>
<string name="vtlrecommendfriendpost">Отключить рекомендации постов друзей</string>
<string name="vtlrecommendfriendpost">Отключить рекомендации постов</string>
<string name="BGStickers">Обводка стикеров</string>
<string name="vtlrecommendmarksummary">Посты по типу Вам может быть интересно и тд</string>
<string name="vtlfeedwork">Прочее</string>
@@ -5456,7 +5456,7 @@
<string name="act_bot">Для ботов/групп</string>
<string name="act_cnv">Для бесед</string>
<string name="act_pm">Для личных сообщений</string>
<string name="alteremoji">Альтернативный дизайн меню с эмодзи</string>
<string name="alteremoji">Альтернативное меню с эмодзи</string>
<string name="alteremojisum">Альтернативный вид выбора эмодзи и стикеров в миниатюрном меню</string>
<string name="altnewsfeed">Альтернативный дизайн ленты</string>
<string name="altnewsfeedsum">Дизайн с динамическими вкладками в ленте</string>
@@ -5479,7 +5479,7 @@
<string name="dnw">Неписалка</string>
<string name="docknumbers">Счётчики в докбаре</string>
<string name="docknumberssum">Отключение не работает в интерфейсе для планшетов</string>
<string name="dockbar_tab_titles">Показ заголовков вкладок в докбаре</string>
<string name="dockbar_tab_titles">Показ заголовков в докбаре</string>
<string name="superapp_editor_message">Для отключения/включения неподвижного элемента проведите по нему вправо или влево</string>
<string name="fcmtokenfixed">Уведомления были восстановлены!</string>
<string name="fcmtokenget">FCM токен получен</string>
@@ -5569,7 +5569,7 @@
<string name="interfacestartfrsum">Выберите стартовый фрагмент</string>
<string name="interfacevideo">Видео</string>
<string name="interfacevideoext_short">Внешний плеер</string>
<string name="interfacevideoext">Использовать внешний видеоплеер</string>
<string name="interfacevideoext">Внешний видеоплеер</string>
<string name="interfacevideoextsum">Использовать внешний видеоплеер для воспроизведения видео</string>
<string name="interfacevideorec">Отключение рекомендаций видео</string>
<string name="interfacevideorecsum">Отключение рекомендаций видео внизу видеоплеера с рекомендациями видео</string>
@@ -5655,7 +5655,7 @@
<string name="musicFixNew_title">Фикс музыки v2</string>
<string name="new_music_downloading_way_title">Новый способ скачивания музыки</string>
<string name="dialogrecomm">Отключить рекомендации</string>
<string name="showvtfire">Показывать специальные верификации</string>
<string name="showvtfire">Показывать файрочки</string>
<string name="showvtverify">Показывать верификации</string>
<string name="sprefsctype">Тип подключения</string>
<string name="sprefsdelkey">Удалить ключ бота Telegram</string>
@@ -5710,7 +5710,7 @@
<string name="feed_ads_regular_summary">Обычные рекламные вставки в ленте между постами</string>
<string name="feed_ads_carousel_summary">Реклама со списком (товаров)</string>
<string name="feed_ads_stories_summary">Реклама при переходе между историями</string>
<string name="feed_ads_sources">Отключить все посты с источником</string>
<string name="feed_ads_sources">Отключить посты с источником</string>
<string name="feed_ads_sources_summary">В большинстве случаев - рекламные посты с пометкой источника рекламодателя</string>
<string name="feed_recommendations_friends_summary">Рекомендации возможных друзей</string>
@@ -5755,7 +5755,7 @@
<string name="messages_interface_calls_summary">Иконка звонков в сообщениях</string>
<string name="messages_interface_tails_summary">Может некорректно работать с вложениями</string>
<string name="messages_other_choose_count">Выберите количество</string>
<string name="messages_other_download_first">Количество сообщений, загружаемых сразу</string>
<string name="messages_other_download_first">Количество загружаемых сообщений</string>
<string name="vkx_why">Зачем?</string>
<string name="vkx_why_summary">Интеграция позволит использовать возможности VK X прямиком в VTosters Lite\n\nКроме воспроизведения, в клиенте будет работать и кеш из плеера</string>
@@ -5789,7 +5789,7 @@
<string name="warning">Внимание!</string>
<string name="debug_warning_summary">Данное меню предназначено только для тестирования работоспособности приложения. Если вы являетесь рядовым юзером, то вам не следует ничего не трогать в данных настройках (пожалуйста)</string>
<string name="debug_show_settings_item">Показывать пункт дебага в настройках</string>
<string name="debug_show_settings_item">Показывать дебаг меню</string>
<string name="debug_experimental">Experimental</string>
<string name="debug_experimental_usevkui">Редактирование страницы?</string>
@@ -5975,8 +5975,8 @@
<string name="telegram_stickers_downloading">: загрузка</string>
<string name="telegram_stickers_updating">: обновление</string>
<string name="telegram_stickers_gettinginfo">Получение информации</string>
<string name="telegram_stickers_updated"> успешно обновлен</string>
<string name="telegram_stickers_downloaded"> успешно загружен</string>
<string name="telegram_stickers_updated">успешно обновлен</string>
<string name="telegram_stickers_downloaded">успешно загружен</string>
<string name="telegram_stickers_error_update">: ошибка при обновлении</string>
<string name="telegram_stickers_error_download">: ошибка при загрузке</string>
@@ -6254,7 +6254,7 @@
<string name="contact_sync_enabled">Включена</string>
<string name="contact_sync_disabled">Отключена</string>
<string name="force_disable_psm_title">Не отправлять информацию о батарее</string>
<string name="force_disable_psm_title">Скрыть информацию о батарее</string>
<string name="force_disable_psm_summ">Включение этой функции скроет информацию о состоянии вашего устройства в режиме экономии батареи и ВКонтакте будет отправлять вам медиаконтент без сильного сжатия и блюра</string>
<string name="track_bd_insert_err">Ошибка при записи трека в базу данных!</string>
@@ -6301,4 +6301,20 @@
<string name="audio_download_title">Скачивание всех своих аудио</string>
<string name="app_activities_error">Ошибка в работе приложения. Перезапустите приложение</string>
<string name="vkx_integration_enabled_info">Включена интеграция VK X. Глобальное кеширование доступно внутри VK X</string>
<string name="current_theme">Текущая тема</string>
<string name="writebar_ios_title">Панель ввода с iOS</string>
<string name="newsfeed_notif_title">Уведомления в новостях</string>
<string name="newsfeed_notif_summ">Показывать счетчик уведомлений в докбаре на иконке новостей</string>
<string name="invalid_pack_link">Неверная ссылка на набор</string>
<string name="blockminiapps_title">Посты с MiniApp</string>
<string name="blockminiapps_summ">Блокировать посты с мини-приложениями</string>
<string name="maxquality_title">Максимальное качество</string>
<string name="maxquality_summ">Открывать видео в максимальном качестве через внешний видеоплеер</string>
<string name="promotedstickers_title">Не получать промостикеры</string>
</resources>
+10
View File
@@ -879,4 +879,14 @@
<item>messages</item>
<item>messages</item>
</string-array>
<string-array name="theme_type_name">
<item>System</item>
<item>Dark</item>
<item>Light</item>
</string-array>
<string-array name="theme_type_name_checkbox">
<item>System theme</item>
<item>Dark theme</item>
<item>Light theme</item>
</string-array>
</resources>
+27 -11
View File
@@ -5562,7 +5562,7 @@ Does not affect vk.cc links"</string>
<string name="vtlrecommend">Recommendations</string>
<string name="vtlrecommendfriend">Disable friends recommendations</string>
<string name="vtlrecommendauthor">Disable authors recommendations</string>
<string name="vtlrecommendfriendpost">Disable recommended friends posts</string>
<string name="vtlrecommendfriendpost">Disable recommended posts</string>
<string name="BGStickers">Sticker outlines</string>
<string name="vtlrecommendmarksummary">Posts like You may be interested</string>
<string name="vtlfeedwork">Other</string>
@@ -5590,7 +5590,7 @@ Does not affect vk.cc links"</string>
<string name="act_bot">For Bots/Groups</string>
<string name="act_cnv">For Conversations</string>
<string name="act_pm">For Private messages</string>
<string name="alteremoji">Alternative type of emoji menu</string>
<string name="alteremoji">Alternative emoji menu</string>
<string name="alteremojisum">Alternative selection of emojis and stickers in the miniature menu</string>
<string name="altnewsfeed">Alternative design of newsfeed</string>
<string name="altnewsfeedsum">Design with dynamic tabs in the feed</string>
@@ -5703,7 +5703,7 @@ Expand text..."</string>
<string name="interfacestartfrsum">Select start fragment</string>
<string name="interfacevideo">Video</string>
<string name="interfacevideoext_short">External player</string>
<string name="interfacevideoext">Use external video player</string>
<string name="interfacevideoext">External video player</string>
<string name="interfacevideoextsum">Use an external video player to play videos</string>
<string name="interfacevideorec">Disable recommended videos</string>
<string name="interfacevideorecsum">Disable video recommendations at the bottom of the video player with video recommendations</string>
@@ -5760,8 +5760,8 @@ You need to restart the application to apply proxy settings"</string>
<string name="customrounding_title">Image rounding size</string>
<string name="postsredesign_title">Video post redesign</string>
<string name="postsredesign_summ">The text for the video will be displayed below the video</string>
<string name="miniapps_title">Miniapps section</string>
<string name="miniapps_summ">Show Miniapps/Games in menu</string>
<string name="miniapps_title">MiniApps section</string>
<string name="miniapps_summ">Show MiniApps/Games in menu</string>
<string name="show_vkpay_title">VK Pay section</string>
<string name="show_vkpay_summ">Show VK Pay in the menu</string>
<string name="show_superapps_title">Superapps</string>
@@ -5843,7 +5843,7 @@ May look like a fake leaving the online"</string>
<string name="feed_ads_regular_summary">Regular ads in feed between posts</string>
<string name="feed_ads_carousel_summary">Ads with list (of goods)</string>
<string name="feed_ads_stories_summary">Ads in stories</string>
<string name="feed_ads_sources">Disable all posts with source</string>
<string name="feed_ads_sources">Disable posts with source</string>
<string name="feed_ads_sources_summary">More often posts ad posts with advertiser source tag</string>
<string name="feed_recommendations_friends_summary">Recommend potential friends</string>
@@ -5888,7 +5888,7 @@ May look like a fake leaving the online"</string>
<string name="messages_interface_calls_summary">Call icon in messages</string>
<string name="messages_interface_tails_summary">May not work correctly with attachments</string>
<string name="messages_other_choose_count">Choose count</string>
<string name="messages_other_download_first">Amount of messages downloaded at once</string>
<string name="messages_other_download_first">Amount of downloaded messages</string>
<string name="vkx_title" translatable="false">VK X</string>
<string name="vkx_why">Why?</string>
@@ -5921,7 +5921,7 @@ May look like a fake leaving the online"</string>
<string name="warning">Warning!</string>
<string name="debug_warning_summary">These options are for testing this app only. If you are a regular user, please, don\'t use them</string>
<string name="debug_show_settings_item">Show debug category in settings</string>
<string name="debug_show_settings_item">Show debug menu</string>
<string name="debug_experimental">Experimental</string>
<string name="debug_experimental_usevkui">Profile editing?</string>
@@ -6113,8 +6113,8 @@ May look like a fake leaving the online"</string>
<string name="telegram_stickers_downloading">: downloading</string>
<string name="telegram_stickers_updating">: update</string>
<string name="telegram_stickers_gettinginfo">Getting info</string>
<string name="telegram_stickers_updated"> updated successfully</string>
<string name="telegram_stickers_downloaded"> downloaded successfully</string>
<string name="telegram_stickers_updated">updated successfully</string>
<string name="telegram_stickers_downloaded">downloaded successfully</string>
<string name="telegram_stickers_error_update">: update failed</string>
<string name="telegram_stickers_error_download">: download failed</string>
@@ -6392,7 +6392,7 @@ May look like a fake leaving the online"</string>
<string name="contact_sync_enabled">Enabled</string>
<string name="contact_sync_disabled">Disabled</string>
<string name="force_disable_psm_title">Don\'t send battery information</string>
<string name="force_disable_psm_title">Hide battery information</string>
<string name="force_disable_psm_summ">Enabling this feature will hide information about the state of your device in battery saving mode and VK will send you media content without strong compression and blur</string>
<string name="track_bd_insert_err">Error writing track to database!</string>
@@ -6439,4 +6439,20 @@ May look like a fake leaving the online"</string>
<string name="audio_download_title">Download all your audio</string>
<string name="app_activities_error">An application error has occurred. Restart the application</string>
<string name="vkx_integration_enabled_info">VK X integration is enabled. Global caching is available inside VK X</string>
<string name="current_theme">Current theme</string>
<string name="writebar_ios_title">iOS writebar</string>
<string name="newsfeed_notif_title">Newsfeed notifications</string>
<string name="newsfeed_notif_summ">Show notification counter in dockbar on news icon</string>
<string name="invalid_pack_link">Invalid pack link</string>
<string name="blockminiapps_title">MiniApp posts</string>
<string name="blockminiapps_summ">Block posts with MiniApps</string>
<string name="maxquality_title">Maximum quality</string>
<string name="maxquality_summ">Open video in maximum quality through an external video player</string>
<string name="promotedstickers_title">Don\'t receive promoted stickers</string>
</resources>
+5
View File
@@ -77,6 +77,11 @@
android:key="copyright_post"
android:summary="@string/feed_ads_sources_summary"
android:title="@string/feed_ads_sources" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="blockminiapps"
android:summary="@string/blockminiapps_summ"
android:title="@string/blockminiapps_title" />
<Preference
android:key="whitelisted_filters_groups"
android:title="@string/whitelisted_filters_groups_title" />
+5
View File
@@ -76,6 +76,11 @@
android:key="isEnableExternalOpening"
android:summary="@string/interfacevideoextsum"
android:title="@string/interfacevideoext" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="maxquality"
android:summary="@string/maxquality_summ"
android:title="@string/maxquality_title" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="__dbg_disable_video_feed"
+5 -1
View File
@@ -17,7 +17,7 @@
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="wbios"
android:title="Панель ввода с iOS" />
android:title="@string/writebar_ios_title"/>
</PreferenceCategory>
<PreferenceCategory android:title="@string/vk_messenger" android:key="vkmesett">
<com.vtosters.lite.ui.MaterialSwitchPreference
@@ -63,6 +63,10 @@
android:key="systememoji"
android:summary="@string/systememojisum"
android:title="@string/systememoji" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="true"
android:key="promotedstickers"
android:title="@string/promotedstickers_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/vtlother">
<com.vtosters.lite.ui.MaterialSwitchPreference
+2 -2
View File
@@ -42,8 +42,8 @@
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="true"
android:key="newsfeed_notif"
android:summary="Показывать счетчик уведомлений в докбаре на иконке новостей"
android:title="Уведомления в новостях" />
android:summary="@string/newsfeed_notif_summ"
android:title="@string/newsfeed_notif_title" />
</PreferenceCategory>
<PreferenceCategory android:title="@string/vtlother">
<Preference
@@ -40,7 +40,9 @@
const-string v0, "filters"
const-string v1, "purchased,active,promoted"
invoke-static {}, Lru/vtosters/lite/hooks/PromoStickersHook;->hook()Ljava/lang/String;
move-result-object v1
.line 4
invoke-virtual {p0, v0, v1}, Lcom/vk/api/base/ApiRequest;->c(Ljava/lang/String;Ljava/lang/String;)Lcom/vk/api/base/ApiRequest;
@@ -4855,6 +4855,8 @@
move-result v1
const v1, 0x0
invoke-virtual {v0, v1}, Lcom/vk/auth/api/VKAccount;->h(I)V
return-void
@@ -356,6 +356,10 @@
iput-object p3, p0, Lcom/vk/core/view/search/ModernSearchView;->c:Landroid/widget/ImageView;
const/16 v4, 0x8
invoke-virtual {p3, v4}, Landroid/widget/ImageView;->setVisibility(I)V
.line 13
sget v2, Lb/h/z/g;->iv_icon_params:I
@@ -358,8 +358,6 @@
invoke-static {p0}, Lru/vtosters/lite/ui/components/CrashReporter;->init(Landroid/app/Activity;)V
invoke-static {p0}, Lru/vtosters/lite/utils/VTVerifications;->load(Landroid/content/Context;)V
.line 2
invoke-virtual {p0}, Landroid/app/Activity;->isTaskRoot()Z