This commit is contained in:
aliveoutside
2022-03-24 19:37:43 +03:00
commit aa972fa5b3
37643 changed files with 6680801 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.idea
.externalNativeBuild
.cxx
local.properties
*.apk
/smali/build/apk/
/smali/VTLite.jobf
/smali/VTLite.apk.idsig
.idea/gradle.xml
.idea/compiler.xml
apksigner.jar
apktool_2.6.0.jar
debug.jks
smali/VTLite_signed.apk.idsig
local.properties
gradle.properties
smali/lib/armeabi-v7a/liblite.so
smali/assets/version.properties
app/src/main/assets/version.properties
smali/build/resources.zip
+8
View File
@@ -0,0 +1,8 @@
# VTosters Lite
### Компиляция
Требуется установленная **Java** >11 версии
Скрипты для сборки лежат в папке **scripts**
Linux/Unix: ```./build.sh```
Windows: ```./build.bat```
О багах сообщать в issues, **просьба не создавать дубликаты и воспользоваться поиском**
+1
View File
@@ -0,0 +1 @@
/build
+97
View File
@@ -0,0 +1,97 @@
import java.util.zip.ZipEntry
import java.util.zip.ZipFile
import java.util.zip.ZipInputStream
plugins {
id 'com.android.application'
id 'net.nemerosa.versioning' version '2.15.1'
}
versionFile {
File moduleDir = projectDir
file = new File(moduleDir.getAbsolutePath() + "/src/main/assets/version.properties")
}
task exportDex {
doLast {
try {
File moduleDir = projectDir
ZipInputStream inputStream = new ZipInputStream(new FileInputStream(moduleDir.getAbsolutePath() + "/build/outputs/apk/debug/app-debug.apk"))
ZipFile file = new ZipFile(moduleDir.getAbsolutePath() + "/build/outputs/apk/debug/app-debug.apk");
ZipEntry entry
while ((entry = inputStream.nextEntry) != null) {
if (entry.getName().equals("classes.dex")) {
print('classes.dex found!')
FileOutputStream output = new FileOutputStream(new File(moduleDir.getAbsoluteFile(), "classes6.dex"))
byte[] buffer = new byte[1024]
int len = 0
while ((len = inputStream.read(buffer)) > 0) {
output.write(buffer, 0, len)
}
output.close()
}
if (entry.getName().equals("classes2.dex")) {
print('\nclasses2.dex found!')
FileOutputStream output = new FileOutputStream(new File(moduleDir.getAbsoluteFile(), "classes8.dex"))
byte[] buffer = new byte[1024]
int len = 0
while ((len = inputStream.read(buffer)) > 0) {
output.write(buffer, 0, len)
}
output.close()
}
}
for (ZipEntry e : Collections.list(file.entries())) {
if (e.getName().endsWith("assets/version.properties")) {
var is = file.getInputStream(e)
FileOutputStream output = new FileOutputStream(new File(moduleDir.getAbsoluteFile(), "version.properties"))
byte[] buffer = new byte[1024]
int len = 0
while ((len = is.read(buffer)) > 0) {
output.write(buffer, 0, len)
}
output.close()
print('\nversion.properties found!')
}
}
} catch (Exception e) {
e.printStackTrace()
}
}
}
android {
compileSdkVersion 31
buildToolsVersion '32.0.0'
defaultConfig {
applicationId "ru.vtosters.lite.utils.lite"
minSdkVersion 19
targetSdkVersion 31
versionCode 1
versionName "1.0"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
}
dependencies {
implementation "androidx.multidex:multidex:2.0.1"
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.exifinterface:exifinterface:1.3.3'
implementation 'androidx.preference:preference:1.1.1'
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
}
+21
View File
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html
# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:cn.of.javascript.interface.for.webview {
## public *;
##}
#
## Uncomment this to preserve the line number information for
## debugging stack traces.
##-keepattributes SourceFile,LineNumberTable
#
## If you keep the line number information, uncomment this to
## hide the original source file name.
##-renamesourcefileattribute SourceFile
#-keepclassmembers class fq
+20
View File
@@ -0,0 +1,20 @@
{
"version": 3,
"artifactType": {
"type": "APK",
"kind": "Directory"
},
"applicationId": "ru.vtosters.lite.utils.lite",
"variantName": "release",
"elements": [
{
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 1,
"versionName": "1.0",
"outputFile": "app-release.apk"
}
],
"elementType": "File"
}
+15
View File
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="ru.vtosters.lite">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.BLUETOOTH_CONNECT" />
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"></application>
</manifest>
@@ -0,0 +1,340 @@
/*
* This file is auto-generated. DO NOT MODIFY.
*/
package bruhcollective.itaysonlab.libvkx;
public interface ILibVkxService extends android.os.IInterface {
/**
* Default implementation for ILibVkxService.
*/
public static class Default implements ILibVkxService {
// Starts playback. playbackContext can be "other" if you don't sure what it is
@Override
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException {
}
// A UserID. CHECK FOR THIS TO BE EQUAL BEFORE SENDING ANYTHING TO SERVICE!
@Override
public int getUserId() throws android.os.RemoteException {
return 0;
}
// Cache add/remove
@Override
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException {
}
@Override
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException {
}
@Override
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException {
return false;
}
// Get a list of cached tracks. The response is close to VK's original response (an audio list)
// Also, the items in the list are JSON ones.
@Override
public java.util.List<String> getCache() throws android.os.RemoteException {
return null;
}
@Override
public android.os.IBinder asBinder() {
return null;
}
}
/**
* Local-side IPC implementation stub class.
*/
public static abstract class Stub extends android.os.Binder implements ILibVkxService {
private static final String DESCRIPTOR = "bruhcollective.itaysonlab.libvkx.ILibVkxService";
/**
* Construct the stub at attach it to the interface.
*/
public Stub() {
this.attachInterface(this, DESCRIPTOR);
}
/**
* Cast an IBinder object into an bruhcollective.itaysonlab.libvkx.ILibVkxService interface,
* generating a proxy if needed.
*/
public static ILibVkxService asInterface(android.os.IBinder obj) {
if ((obj == null)) {
return null;
}
android.os.IInterface iin = obj.queryLocalInterface(DESCRIPTOR);
if (((iin != null) && (iin instanceof ILibVkxService))) {
return ((ILibVkxService) iin);
}
return new Proxy(obj);
}
@Override
public android.os.IBinder asBinder() {
return this;
}
@Override
public boolean onTransact(int code, android.os.Parcel data, android.os.Parcel reply, int flags) throws android.os.RemoteException {
String descriptor = DESCRIPTOR;
switch (code) {
case INTERFACE_TRANSACTION: {
reply.writeString(descriptor);
return true;
}
case TRANSACTION_play: {
data.enforceInterface(descriptor);
java.util.List<String> _arg0;
_arg0 = data.createStringArrayList();
int _arg1;
_arg1 = data.readInt();
String _arg2;
_arg2 = data.readString();
this.play(_arg0, _arg1, _arg2);
reply.writeNoException();
return true;
}
case TRANSACTION_getUserId: {
data.enforceInterface(descriptor);
int _result = this.getUserId();
reply.writeNoException();
reply.writeInt(_result);
return true;
}
case TRANSACTION_addTrackToCache: {
data.enforceInterface(descriptor);
int _arg0;
_arg0 = data.readInt();
int _arg1;
_arg1 = data.readInt();
String _arg2;
_arg2 = data.readString();
this.addTrackToCache(_arg0, _arg1, _arg2);
reply.writeNoException();
return true;
}
case TRANSACTION_deleteTrackFromCache: {
data.enforceInterface(descriptor);
int _arg0;
_arg0 = data.readInt();
int _arg1;
_arg1 = data.readInt();
this.deleteTrackFromCache(_arg0, _arg1);
reply.writeNoException();
return true;
}
case TRANSACTION_isTrackCached: {
data.enforceInterface(descriptor);
int _arg0;
_arg0 = data.readInt();
int _arg1;
_arg1 = data.readInt();
boolean _result = this.isTrackCached(_arg0, _arg1);
reply.writeNoException();
reply.writeInt(((_result) ? (1) : (0)));
return true;
}
case TRANSACTION_getCache: {
data.enforceInterface(descriptor);
java.util.List<String> _result = this.getCache();
reply.writeNoException();
reply.writeStringList(_result);
return true;
}
default: {
return super.onTransact(code, data, reply, flags);
}
}
}
private static class Proxy implements ILibVkxService {
private android.os.IBinder mRemote;
Proxy(android.os.IBinder remote) {
mRemote = remote;
}
@Override
public android.os.IBinder asBinder() {
return mRemote;
}
public String getInterfaceDescriptor() {
return DESCRIPTOR;
}
// Starts playback. playbackContext can be "other" if you don't sure what it is
@Override
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeStringList(audio_ids);
_data.writeInt(index);
_data.writeString(playbackContext);
boolean _status = mRemote.transact(Stub.TRANSACTION_play, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
getDefaultImpl().play(audio_ids, index, playbackContext);
return;
}
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
// A UserID. CHECK FOR THIS TO BE EQUAL BEFORE SENDING ANYTHING TO SERVICE!
@Override
public int getUserId() throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
int _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getUserId, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
return getDefaultImpl().getUserId();
}
_reply.readException();
_result = _reply.readInt();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
// Cache add/remove
@Override
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(track_id);
_data.writeInt(owner_id);
_data.writeString(access_key);
boolean _status = mRemote.transact(Stub.TRANSACTION_addTrackToCache, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
getDefaultImpl().addTrackToCache(track_id, owner_id, access_key);
return;
}
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(track_id);
_data.writeInt(owner_id);
boolean _status = mRemote.transact(Stub.TRANSACTION_deleteTrackFromCache, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
getDefaultImpl().deleteTrackFromCache(track_id, owner_id);
return;
}
_reply.readException();
} finally {
_reply.recycle();
_data.recycle();
}
}
@Override
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
boolean _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
_data.writeInt(track_id);
_data.writeInt(owner_id);
boolean _status = mRemote.transact(Stub.TRANSACTION_isTrackCached, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
return getDefaultImpl().isTrackCached(track_id, owner_id);
}
_reply.readException();
_result = (0 != _reply.readInt());
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
// Get a list of cached tracks. The response is close to VK's original response (an audio list)
// Also, the items in the list are JSON ones.
@Override
public java.util.List<String> getCache() throws android.os.RemoteException {
android.os.Parcel _data = android.os.Parcel.obtain();
android.os.Parcel _reply = android.os.Parcel.obtain();
java.util.List<String> _result;
try {
_data.writeInterfaceToken(DESCRIPTOR);
boolean _status = mRemote.transact(Stub.TRANSACTION_getCache, _data, _reply, 0);
if (!_status && getDefaultImpl() != null) {
return getDefaultImpl().getCache();
}
_reply.readException();
_result = _reply.createStringArrayList();
} finally {
_reply.recycle();
_data.recycle();
}
return _result;
}
public static ILibVkxService sDefaultImpl;
}
static final int TRANSACTION_play = (android.os.IBinder.FIRST_CALL_TRANSACTION + 1);
static final int TRANSACTION_getUserId = (android.os.IBinder.FIRST_CALL_TRANSACTION + 2);
static final int TRANSACTION_addTrackToCache = (android.os.IBinder.FIRST_CALL_TRANSACTION + 3);
static final int TRANSACTION_deleteTrackFromCache = (android.os.IBinder.FIRST_CALL_TRANSACTION + 4);
static final int TRANSACTION_isTrackCached = (android.os.IBinder.FIRST_CALL_TRANSACTION + 5);
static final int TRANSACTION_getCache = (android.os.IBinder.FIRST_CALL_TRANSACTION + 6);
public static boolean setDefaultImpl(ILibVkxService impl) {
if (Proxy.sDefaultImpl == null && impl != null) {
Proxy.sDefaultImpl = impl;
return true;
}
return false;
}
public static ILibVkxService getDefaultImpl() {
return Proxy.sDefaultImpl;
}
}
// Starts playback. playbackContext can be "other" if you don't sure what it is
public void play(java.util.List<String> audio_ids, int index, String playbackContext) throws android.os.RemoteException;
// A UserID. CHECK FOR THIS TO BE EQUAL BEFORE SENDING ANYTHING TO SERVICE!
public int getUserId() throws android.os.RemoteException;
// Cache add/remove
public void addTrackToCache(int track_id, int owner_id, String access_key) throws android.os.RemoteException;
public void deleteTrackFromCache(int track_id, int owner_id) throws android.os.RemoteException;
public boolean isTrackCached(int track_id, int owner_id) throws android.os.RemoteException;
// Get a list of cached tracks. The response is close to VK's original response (an audio list)
// Also, the items in the list are JSON ones.
public java.util.List<String> getCache() throws android.os.RemoteException;
}
@@ -0,0 +1,6 @@
package bruhcollective.itaysonlab.libvkx.client;
public class ClientConstants {
public final static String ACTION = "bruhcollective.itaysonlab.libvkx.LIBVKX_SERVICE";
public final static String PACKAGE = "ua.itaysonlab.vkx";
}
@@ -0,0 +1,80 @@
package bruhcollective.itaysonlab.libvkx.client;
import android.content.Context;
import android.os.RemoteException;
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
import com.vk.core.b.PackageManagerHelper;
import com.vk.dto.music.MusicTrack;
import com.vk.music.PlayerRefer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Prefs;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Prefs;
/* loaded from: classes6.dex */
public class LibVKXClient {
private static LibVKXClientImpl impl;
public static LibVKXClientImpl getInstance(Context context) {
if (impl == null) {
impl = new LibVKXClientImpl(context);
}
return impl;
}
public static LibVKXClientImpl getInstance() {
LibVKXClientImpl libVKXClientImpl = impl;
return libVKXClientImpl == null ? getInstance(Helper.GetContext()) : libVKXClientImpl;
}
public static boolean isVkxInstalled() {
return PackageManagerHelper.b(ClientConstants.PACKAGE, 128) != null;
}
public static boolean isIntegrationEnabled() {
return Prefs.BooleanFalse("libvkx_integration") && isVkxInstalled();
}
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, PlayerRefer playerRefer) {
if (!isIntegrationEnabled()) {
return false;
}
LibVKXClientImpl.LibVKXAction action = iLibVkxService -> LibVKXClient.lambdaplay(list, musicTrack, playerRefer, iLibVkxService);
return getInstance().runOnService(action);
}
/* JADX INFO: Access modifiers changed from: package-private */
public static /* synthetic */ void lambdaplay(List list, MusicTrack musicTrack, PlayerRefer playerRefer, ILibVkxService iLibVkxService) {
int indexOf = list.indexOf(musicTrack);
ArrayList arrayList = new ArrayList();
Iterator it = list.iterator();
while (it.hasNext()) {
arrayList.add(asId((MusicTrack) it.next()));
}
if (indexOf == -1) {
indexOf = 0;
}
try {
iLibVkxService.play(arrayList, indexOf, "");
} catch (RemoteException e) {
e.printStackTrace();
}
}
private static String asId(MusicTrack musicTrack) {
String str = musicTrack.c + "_" + musicTrack.b;
if (musicTrack.s == null || musicTrack.s.equals("")) {
return str;
}
return str + "_" + musicTrack.s;
}
}
@@ -0,0 +1,128 @@
package bruhcollective.itaysonlab.libvkx.client;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.ServiceConnection;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.os.IBinder;
import android.os.RemoteException;
import java.util.List;
import bruhcollective.itaysonlab.libvkx.ILibVkxService;
import ru.vtosters.lite.utils.Helper;
public class LibVKXClientImpl {
private ILibVkxService serviceInstance;
private PackageManager pm;
private Context ctx;
private ServiceConnection cn;
private boolean isBindFailed = false;
private LibVKXClientImpl() {
}
public LibVKXClientImpl(Context ctx) {
this.ctx = ctx;
this.pm = ctx.getPackageManager();
}
public void finish() {
if (cn != null) {
ctx.unbindService(cn);
}
serviceInstance = null;
}
public <T> T runOnServiceSync(LibVKXActionGeneric<T> action) {
if (serviceInstance != null) {
return action.run(serviceInstance);
} else {
return action.defaultValue();
}
}
// true - action is ran
// false - action is failed, should fallback to default UI/UX
public boolean runOnService(LibVKXAction action) {
if (serviceInstance != null) {
try {
if (serviceInstance.getUserId() != Helper.GetUserId()) return false;
action.run(serviceInstance);
return true;
} catch (RemoteException e) {
e.printStackTrace();
return false;
}
} else {
return requestServiceInit(action);
}
}
private boolean requestServiceInit(LibVKXAction runAfterBind) {
if (!verifyBindActuality()) return false;
cn = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName name, IBinder service) {
serviceInstance = ILibVkxService.Stub.asInterface(service);
if (serviceInstance == null) {
// op mycopok...
isBindFailed = true;
} else {
try {
if (serviceInstance.getUserId() != Helper.GetUserId()) return;
runAfterBind.run(serviceInstance);
} catch (RemoteException e) {
e.printStackTrace();
}
}
}
@Override
public void onServiceDisconnected(ComponentName name) {
serviceInstance = null;
}
};
ctx.bindService(getIntent(), cn, Context.BIND_AUTO_CREATE);
return true;
}
private boolean verifyBindActuality() {
if (!checkIfAppExists()) return false; // no need
if (isBindFailed) return false;
return true;
}
private Intent getIntent() {
return new Intent(ClientConstants.ACTION).setPackage(ClientConstants.PACKAGE);
}
private boolean checkIfAppExists() {
List<ResolveInfo> resolveInfos = pm.queryIntentServices(getIntent(), 0);
if (resolveInfos == null || resolveInfos.isEmpty()) return false;
for (ResolveInfo rs : resolveInfos) {
if (rs.serviceInfo.packageName.equals(ClientConstants.PACKAGE)) return true;
}
return false;
}
public interface LibVKXAction {
void run(ILibVkxService service);
}
public interface LibVKXActionGeneric<T> {
T run(ILibVkxService service);
default T defaultValue() {
return null;
}
}
}
@@ -0,0 +1,37 @@
package com.aefyr.tsg.g2;
/**
* Created by Aefyr on 19.05.2018.
*/
public abstract class CustomStickersEventsListener implements TelegramStickersService.StickersEventsListener {
@Override
public void onPackAdded(TelegramStickersPack pack, int atIndex) {
}
@Override
public void onPackChanged(TelegramStickersPack pack, int atIndex) {
}
@Override
public void onPackRemoved(TelegramStickersPack pack, int atIndex) {
}
@Override
public void onPackDownloadError(TelegramStickersPack pack, Exception error) {
}
@Override
public void onActivePacksListChanged() {
}
@Override
public void onInactivePacksListChanged() {
}
}
+23
View File
@@ -0,0 +1,23 @@
package com.aefyr.tsg.g2;
import android.graphics.Bitmap;
import java.io.File;
/**
* Created by Aefyr on 20.05.2018.
*/
public abstract class CustomStickersPack {
public abstract File folder();
public abstract int stickersCount();
public abstract String name();
public abstract Bitmap getIconBitmap();
public abstract Bitmap getStickerBitmap(int index);
public abstract File getStickerFile(int index);
}
+116
View File
@@ -0,0 +1,116 @@
package com.aefyr.tsg.g2;
import java.util.HashMap;
import java.util.concurrent.atomic.AtomicLong;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Build;
import androidx.annotation.Nullable;
import androidx.core.app.NotificationCompat;
import androidx.core.app.NotificationManagerCompat;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
/**
* Created by Aefyr on 20.05.2018.
*/
public class NotificationsHelper {
private static final int NOTIFICATION_ID_BASE = 3921337;
private static final String NOTIFICATION_CHANNEL_ID = "tgss_chan_v5";
private HashMap<TelegramStickersPack, Integer> downloadingPacksNotificationsIds;
private Context c;
private NotificationManagerCompat manager;
private int currentNotificationN = 0;
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 AtomicLong lastNotificationTime = new AtomicLong(0);
public NotificationsHelper(Context c) {
this.c = c;
manager = NotificationManagerCompat.from(c);
downloadingPacksNotificationsIds = new HashMap<>();
if (oreo()) {
NotificationChannel notificationChan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "Сервис стикеров Telegram в VTosters", NotificationManager.IMPORTANCE_HIGH);
((NotificationManager) c.getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChan);
}
}
public void packStartedDownloading(TelegramStickersPack pack) {
int notificationId = NOTIFICATION_ID_BASE + currentNotificationN++;
downloadingPacksNotificationsIds.put(pack, notificationId);
Notification.Builder builder = commonBuilder();
builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + ": загрузка" : pack.title + ": обновление");
builder.setContentText("Получение информации");
builder.setOngoing(true);
manager.notify(notificationId, builder.build());
}
public void packDownloadUpdated(TelegramStickersPack pack, int downloadProgress) {
if (System.currentTimeMillis() - lastNotificationTime.get() < MIN_TIME_BETWEEN_UPDATE_NOTIFICATIONS)
return;
lastNotificationTime.set(System.currentTimeMillis());
Notification.Builder builder = commonBuilder();
builder.setContentTitle(pack.state == TelegramStickersPack.DOWNLOADING ? pack.title + ": загрузка" : pack.title + ": обновление");
builder.setContentText(downloadProgress + "/" + pack.stickersCount);
builder.setProgress(pack.stickersCount, downloadProgress, false);
builder.setOngoing(true);
builder.setOnlyAlertOnce(true);
if (downloadingPacksNotificationsIds.containsKey(pack))
manager.notify(downloadingPacksNotificationsIds.get(pack), builder.build());
}
public void packDoneDownloading(TelegramStickersPack pack, boolean success, boolean wasUpdate, @Nullable Exception e) {
Notification.Builder builder = commonBuilder();
builder.setProgress(0, 0, false);
builder.setOngoing(false);
builder.setContentTitle("Сервис стикеров Telegram в VTosters");
String text;
if (success)
text = wasUpdate ? pack.title + " успешно обновлен" : pack.title + " успешно загружен";
else
text = wasUpdate ? pack.title + ": ошибка при обновлении" : pack.title + ": ошибка при загрузке";
if (e instanceof TelegramStickersGrabber.TSGException) {
text = pack.title + ": " + e.getMessage();
}
builder.setContentText(String.format(text, pack.title));
manager.notify(downloadingPacksNotificationsIds.remove(pack), builder.build());
}
public void removePackNotification(TelegramStickersPack pack) {
manager.cancel(downloadingPacksNotificationsIds.remove(pack));
}
private Notification.Builder commonBuilder() {
var builder = new Notification.Builder(c).setPriority(Notification.PRIORITY_MAX).setSmallIcon(com.vtosters.lite.R.drawable.icon_vk_104);
if (oreo()) {
builder.setChannelId(NOTIFICATION_CHANNEL_ID);
}
return builder;
}
private boolean oreo() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
}
}
+37
View File
@@ -0,0 +1,37 @@
package com.aefyr.tsg.g2;
import android.os.AsyncTask;
import android.util.Log;
import java.io.File;
/**
* Created by Aefyr on 20.05.2018.
*/
class PackDeletionTask extends AsyncTask<Void, Void, Boolean> {
private static final String TAG = "TGSSAnnihilator";
private TelegramStickersPack pack;
PackDeletionTask(TelegramStickersPack pack) {
this.pack = pack;
}
@Override
protected Boolean doInBackground(Void... voids) {
boolean success = true;
for (File f : pack.folder.listFiles()) {
success = success && f.delete();
}
success = success && pack.folder.delete();
return success;
}
@Override
protected void onPostExecute(Boolean aBoolean) {
Log.d(TAG, String.format("Attempted deleting pack %s, success?%s", pack.id, aBoolean));
}
}
@@ -0,0 +1,145 @@
package com.aefyr.tsg.g2;
import java.io.File;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
/**
* Created by Aefyr on 18.05.2018.
*/
public class TelegramStickersPack extends CustomStickersPack {
public static final int UNKNOWN = -1;
public static final int DOWNLOADED = 0;
public static final int DOWNLOADING = 1;
public static final int UPDATING = 2;
public String id;
public String title;
public int state = UNKNOWN;
public boolean enabled = true;
public File folder;
public int stickersCount = -1;
public String version;
public int index = -1;
public HashMap<String, List<Integer>> emojis = new HashMap<>();
public TelegramStickersPack(String id) {
this.id = id.toLowerCase();
title = id;
}
public JSONObject encodeEmojis() throws JSONException {
JSONObject obj = new JSONObject();
for (HashMap.Entry<String, List<Integer>> en : emojis.entrySet()) {
JSONArray arr = new JSONArray();
for (int i : en.getValue()) arr.put(i);
obj.put(en.getKey(), arr);
}
return obj;
}
public void loadEmojis(JSONObject obj) throws JSONException {
Iterator<String> it = obj.keys();
while (it.hasNext()) {
String key = it.next();
//emojis.put(key, obj.getInt(key));
List<Integer> list = emojis.get(key);
if (list == null) list = new ArrayList<>();
JSONArray arr = obj.getJSONArray(key);
for (int i = 0; i < arr.length(); i++)
list.add(arr.getInt(i));
emojis.put(key, list);
}
}
public Bitmap getIcon(int targetMaxSideSize) {
if (state != DOWNLOADED && state != UPDATING)
throw new IllegalStateException("Unable to get an icon of a pack that hasn't been downloaded yet");
File icon = new File(folder, "001.png");
return getScaledBitmap(icon, targetMaxSideSize);
}
private Bitmap getScaledBitmap(File bitmapFile, int targetMaxSideSize) {
BitmapFactory.Options op = new BitmapFactory.Options();
op.inJustDecodeBounds = true;
op.inPreferredConfig = Bitmap.Config.ARGB_8888;
BitmapFactory.decodeFile(bitmapFile.getAbsolutePath(), op);
int oW = op.outWidth;
int oH = op.outHeight;
int maxSideSize = op.outWidth > op.outHeight ? op.outWidth : op.outHeight;
if (maxSideSize > targetMaxSideSize) {
op.inScaled = true;
op.inDensity = maxSideSize;
op.inTargetDensity = targetMaxSideSize;
}
op.inJustDecodeBounds = false;
Bitmap loadedBitmap = BitmapFactory.decodeFile(bitmapFile.getAbsolutePath(), op);
Log.d("AYAYA", String.format("maxside=%d, from %dx%d to %dx%d", targetMaxSideSize, oW, oH, loadedBitmap.getWidth(), loadedBitmap.getHeight()));
return loadedBitmap;
}
@Override
public boolean equals(Object obj) {
return obj instanceof TelegramStickersPack && ((TelegramStickersPack) obj).id.toLowerCase().equals(id.toLowerCase());
}
@Override
public int hashCode() {
return id.toLowerCase().hashCode();
}
@Override
public File folder() {
return folder;
}
@Override
public int stickersCount() {
return stickersCount;
}
@Override
public String name() {
return title;
}
@Override
public Bitmap getIconBitmap() {
return getIcon(128);
}
@Override
public Bitmap getStickerBitmap(int index) {
return BitmapFactory.decodeFile(new File(folder, String.format("%03d.png", index + 1)).getAbsolutePath());
}
@Override
public File getStickerFile(int index) {
return new File(folder, String.format("%03d.png", index + 1));
}
public Bitmap getStickerBitmap(int index, int maxSize) {
return getScaledBitmap(new File(folder, String.format("%03d.png", index + 1)), maxSize);
}
}
@@ -0,0 +1,402 @@
package com.aefyr.tsg.g2;
import java.io.File;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;
import com.aefyr.tsg.g2.sql.TelegramStickersDbHelper;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersPackInfo;
import android.content.Context;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.ui.fragments.tgstickers.StickersFragment;
/**
* Created by Aefyr on 19.05.2018.
*/
public class TelegramStickersService {
private static final String TAG = "TGStickersService";
private static TelegramStickersService instance;
private Context c;
private ArrayList<TelegramStickersPack> packs;
private ArrayList<TelegramStickersPack> activePacks;
private ArrayList<TelegramStickersPack> inactivePacks;
private ArrayList<StickersEventsListener> listeners;
private HashSet<String> currentlyDownloading;
private Handler uiThreadHandler;
private TelegramStickersGrabber grabber;
private TelegramStickersDbHelper dbHelper;
private boolean ready = false;
private ArrayList<Runnable> queuedTasks;
private ThreadPoolExecutor executor;
private NotificationsHelper notificationsHelper;
public static TelegramStickersService getInstance(Context c) {
return instance == null ? new TelegramStickersService(c) : instance;
}
private TelegramStickersService(Context context) {
instance = this;
this.c = context.getApplicationContext();
listeners = new ArrayList<>();
currentlyDownloading = new HashSet<>();
uiThreadHandler = new Handler(Looper.getMainLooper());
grabber = new TelegramStickersGrabber(null);
dbHelper = new TelegramStickersDbHelper(c);
queuedTasks = new ArrayList<>();
executor = (ThreadPoolExecutor) Executors.newFixedThreadPool(2);
notificationsHelper = new NotificationsHelper(c);
packs = new ArrayList<>();
activePacks = new ArrayList<>();
inactivePacks = new ArrayList<>();
updatePacks(true);
}
private void updatePacks(final boolean notify) {
packs.clear();
dbHelper.getAllPacks(new TelegramStickersDbHelper.PacksLoadingListener() {
@Override
public void onPackLoaded(final TelegramStickersPack pack) {
runOnUiThread(() -> {
packs.add(pack);
if (pack.enabled)
activePacks.add(pack);
else
inactivePacks.add(pack);
if (notify) notifyPackAdded(pack, packs.size() - 1);
});
}
@Override
public void onAllPacksLoaded(ArrayList<TelegramStickersPack> packs) {
ready = true;
if (notify) {
notifyActivePacksListChanged();
notifyInactivePacksListChanged();
}
Log.d(TAG, String.format("Packs list loaded, running %d queued tasks...", queuedTasks.size()));
while (!queuedTasks.isEmpty())
queuedTasks.remove(0).run();
}
});
}
interface StickersEventsListener {
void onPackAdded(TelegramStickersPack pack, int atIndex);
void onPackRemoved(TelegramStickersPack pack, int atIndex);
void onPackChanged(TelegramStickersPack pack, int atIndex);
void onPackDownloadError(TelegramStickersPack pack, Exception error);
void onActivePacksListChanged();
void onInactivePacksListChanged();
}
public void addStickersEventsListener(StickersEventsListener listener) {
listeners.add(listener);
}
public void removeStickersEventsListener(StickersEventsListener listener) {
listeners.remove(listener);
}
private void notifyPackAdded(TelegramStickersPack pack, int atIndex) {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onPackAdded(pack, atIndex);
}
}
private void notifyPackChanged(TelegramStickersPack pack, int atIndex) {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onPackChanged(pack, atIndex);
}
}
private void notifyPackRemoved(TelegramStickersPack pack, int atIndex) {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onPackRemoved(pack, atIndex);
}
}
private void notifyPackDownloadError(TelegramStickersPack pack, Exception error) {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onPackDownloadError(pack, error);
}
}
private void notifyActivePacksListChanged() {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onActivePacksListChanged();
}
}
private void notifyInactivePacksListChanged() {
Helper.GetContext().sendBroadcast(new Intent(StickersFragment.ACTION_RELOAD));
if (listeners.isEmpty())
return;
for (StickersEventsListener listener : listeners) {
listener.onInactivePacksListChanged();
}
}
public void setBotKey(String botKey) {
grabber.setBotApiKey(botKey);
}
public ArrayList<TelegramStickersPack> getPacksListReference() {
return packs;
}
public ArrayList<TelegramStickersPack> getActivePacksListReference() {
return activePacks;
}
public ArrayList<TelegramStickersPack> getInactivePacksListReference() {
return inactivePacks;
}
public boolean isDoneLoading() {
return ready;
}
public boolean requestPackDownload(final String id, File packFolder) {
if (currentlyDownloading.contains(id)) {
Log.e(TAG, String.format("Got request to download pack %s which is already downloading", id));
return false;
}
if (!ready) {
final File folder = packFolder;
queuedTasks.add(() -> requestPackDownload(id, folder));
return true;
}
TelegramStickersPack pack = new TelegramStickersPack(id);
boolean update = false;
int index = packs.indexOf(pack);
if (index != -1) {
pack = packs.get(index);
pack.state = TelegramStickersPack.UPDATING;
update = true;
packFolder = pack.folder;
notifyPackChanged(pack, index);
} else {
pack.state = TelegramStickersPack.DOWNLOADING;
pack.folder = packFolder;
packs.add(pack);
notifyPackAdded(pack, packs.size() - 1);
}
final TelegramStickersPack newPack = pack;
final boolean isUpdate = update;
currentlyDownloading.add(id.toLowerCase());
notificationsHelper.packStartedDownloading(newPack);
grabber.enableProxy();
grabber.grabPack(id, packFolder, pack.version, new TelegramStickersGrabber.PackDownloadListener() {
@Override
public void onPackDownloaded(TelegramStickersPackInfo packInfo, boolean newVersionFound) {
runOnUiThread(() -> {
newPack.state = TelegramStickersPack.DOWNLOADED;
notifyPackChanged(newPack, packs.indexOf(newPack));
currentlyDownloading.remove(newPack.id.toLowerCase());
syncPack(newPack);
if (isUpdate) {
if (newPack.enabled)
notifyActivePacksListChanged();
} else {
activePacks.add(newPack);
notifyActivePacksListChanged();
}
});
notificationsHelper.packDoneDownloading(newPack, true, isUpdate, null);
}
@Override
public void onPackDownloadError(final Exception e) {
runOnUiThread(() -> {
Log.e(TAG, "Error while downloading pack " + newPack.id);
e.printStackTrace();
if (!isUpdate) {
int index = packs.indexOf(newPack);
packs.remove(index);
notifyPackRemoved(newPack, index);
} else {
newPack.state = TelegramStickersPack.DOWNLOADED;
notifyPackChanged(newPack, packs.indexOf(newPack));
}
notifyPackDownloadError(newPack, e);
currentlyDownloading.remove(newPack.id);
});
notificationsHelper.packDoneDownloading(newPack, false, isUpdate, e);
}
@Override
public void onGotPackInfo(final TelegramStickersPackInfo packInfo) {
runOnUiThread(() -> {
newPack.title = packInfo.title;
newPack.stickersCount = packInfo.stickersCount;
newPack.version = packInfo.version;
notifyPackChanged(newPack, packs.indexOf(newPack));
});
notificationsHelper.packDownloadUpdated(newPack, 0);
}
@Override
public void onStickerDownloaded(String pack, File sticker, String boundEmoji, int stickerIndex, int downloadedStickersCount, int totalStickersCount) {
stickerIndex--;
List<Integer> list = newPack.emojis.get(boundEmoji);
if (list == null) list = new ArrayList<>();
list.add(stickerIndex);
newPack.emojis.put(boundEmoji, list);
notificationsHelper.packDownloadUpdated(newPack, downloadedStickersCount);
}
});
return true;
}
public void setPackEnabled(final TelegramStickersPack pack, final boolean enabled, final boolean notify) {
if (!ready) {
queuedTasks.add(() -> setPackEnabled(pack, enabled, notify));
return;
}
if (pack.enabled == enabled)
return;
pack.enabled = enabled;
syncPack(pack);
if (notify) notifyPackChanged(pack, packs.indexOf(pack));
if (pack.enabled) {
inactivePacks.remove(pack);
activePacks.add(pack);
} else {
activePacks.remove(pack);
inactivePacks.add(pack);
}
if (notify) {
notifyActivePacksListChanged();
notifyInactivePacksListChanged();
}
}
public void deletePack(final TelegramStickersPack pack) {
if (!ready) {
queuedTasks.add(() -> deletePack(pack));
return;
}
boolean d = dbHelper.deletePack(pack);
Log.d(TAG, "Delete from DB=" + d);
int index = packs.indexOf(pack);
packs.remove(index);
notifyPackRemoved(pack, index);
if (pack.enabled) {
activePacks.remove(pack);
notifyActivePacksListChanged();
} else {
inactivePacks.remove(pack);
notifyInactivePacksListChanged();
}
if (d)
new PackDeletionTask(pack).executeOnExecutor(executor);
}
private void runOnUiThread(Runnable r) {
uiThreadHandler.post(r);
}
private void syncPack(final TelegramStickersPack pack) {
if (!ready) {
queuedTasks.add(() -> syncPack(pack));
return;
}
Log.d(TAG, "Sync=" + dbHelper.syncPack(pack));
}
public void swap(TelegramStickersPack p1, TelegramStickersPack p2) {
int i1 = p1.index;
int i2 = p2.index;
p1.index = i2;
p2.index = i1;
syncPack(p1);
syncPack(p2);
if (getActivePacksListReference().contains(p1) && getActivePacksListReference().contains(p2) || getInactivePacksListReference().contains(p1) && getInactivePacksListReference().contains(p2)) {
int li1 = getActivePacksListReference().indexOf(p1);
int li2 = getActivePacksListReference().indexOf(p2);
getActivePacksListReference().set(li2, p1);
getActivePacksListReference().set(li1, p2);
}
int li1 = getPacksListReference().indexOf(p1);
int li2 = getPacksListReference().indexOf(p2);
getPacksListReference().set(li2, p1);
getPacksListReference().set(li1, p2);
}
}
@@ -0,0 +1,31 @@
package com.aefyr.tsg.g2.sql;
import android.provider.BaseColumns;
/**
* Created by Aefyr on 19.05.2018.
*/
public final class TelegramStickersContract {
private TelegramStickersContract() {
}
public static class StickersTableEntry implements BaseColumns {
public static final String TABLE_NAME = "packs";
public static final String COLUMN_NAME_ID = "id";
public static final String COLUMN_NAME_INDEX = "pack_index";
public static final String COLUMN_NAME_NAME = "name";
public static final String COLUMN_NAME_FOLDER = "folder";
public static final String COLUMN_NAME_STICKERS_COUNT = "stickers_count";
public static final String COLUMN_NAME_ENABLED = "enabled";
public static final String COLUMN_NAME_VERSION = "version";
public static final String COLUMN_NAME_EMOJIS = "emojis";
}
public static final String SQL_CREATE_ENTRIES = String.format("CREATE TABLE %s (%s INTEGER PRIMARY KEY, %s INTEGER AUTO_INCREMENT, %s TEXT, %s TEXT, %s TEXT, %s INTEGER, %s INTEGER, %s TEXT, %s TEXT)",
StickersTableEntry.TABLE_NAME, StickersTableEntry._ID, StickersTableEntry.COLUMN_NAME_INDEX, StickersTableEntry.COLUMN_NAME_ID, StickersTableEntry.COLUMN_NAME_NAME,
StickersTableEntry.COLUMN_NAME_FOLDER, StickersTableEntry.COLUMN_NAME_STICKERS_COUNT, StickersTableEntry.COLUMN_NAME_ENABLED, StickersTableEntry.COLUMN_NAME_VERSION, StickersTableEntry.COLUMN_NAME_EMOJIS);
}
@@ -0,0 +1,168 @@
package com.aefyr.tsg.g2.sql;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.CursorIndexOutOfBoundsException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.os.AsyncTask;
import android.util.Log;
import com.aefyr.tsg.g2.TelegramStickersPack;
import java.io.File;
import java.util.ArrayList;
import org.json.JSONException;
import org.json.JSONObject;
/**
* Created by Aefyr on 19.05.2018.
*/
public class TelegramStickersDbHelper extends SQLiteOpenHelper {
private static final int DB_VERSION = 2;
private static final String DB_NAME = "TelegramStickers.db";
private SQLiteDatabase writableDb;
private SQLiteDatabase readableDb;
public interface PacksLoadingListener {
void onPackLoaded(TelegramStickersPack pack);
void onAllPacksLoaded(ArrayList<TelegramStickersPack> packs);
}
public TelegramStickersDbHelper(Context context) {
super(context, DB_NAME, null, DB_VERSION);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL(TelegramStickersContract.SQL_CREATE_ENTRIES);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
if (oldVersion == 1 && newVersion == 2) {
db.execSQL(String.format("ALTER TABLE %s ADD COLUMN %s TEXT", TelegramStickersContract.StickersTableEntry.TABLE_NAME, TelegramStickersContract.StickersTableEntry.COLUMN_NAME_EMOJIS));
}
}
public void loadDatabases() {
writableDb = getWritableDatabase();
readableDb = getReadableDatabase();
}
public boolean syncPack(TelegramStickersPack pack) {
ContentValues sqlPack = new ContentValues();
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID, pack.id);
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_NAME, pack.title);
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_FOLDER, pack.folder.getAbsolutePath());
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_STICKERS_COUNT, pack.stickersCount);
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ENABLED, pack.enabled ? 1 : 0);
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_VERSION, pack.version);
try {
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_EMOJIS, pack.encodeEmojis().toString());
} catch (JSONException e) {
e.printStackTrace();
}
if (pack.index == -1) pack.index = getNewIndex();
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX, pack.index);
int s = writableDb.updateWithOnConflict(TelegramStickersContract.StickersTableEntry.TABLE_NAME, sqlPack, TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID + "='" + pack.id + "'", null, SQLiteDatabase.CONFLICT_IGNORE);
if (s == 0) {
sqlPack.put(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX, getNewIndex());
Log.d("DB", "INSERTED!");
return writableDb.insert(TelegramStickersContract.StickersTableEntry.TABLE_NAME, null, sqlPack) != -1;
}
Log.d("DB", "UPDATED!");
return true;
}
private int getNewIndex() {
Cursor c = readableDb.rawQuery("SELECT MAX(" + TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX + ") FROM " + TelegramStickersContract.StickersTableEntry.TABLE_NAME, new String[0]);
c.moveToLast();
int max;
try {
max = c.getInt(0);
c.close();
} catch (CursorIndexOutOfBoundsException e) {
e.printStackTrace();
max = 0;
}
Log.d("sova", "Found last index: " + max);
return max + 1;
}
public boolean deletePack(TelegramStickersPack pack) {
return writableDb.delete(TelegramStickersContract.StickersTableEntry.TABLE_NAME, TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID + "='" + pack.id + "'", null) == 1;
}
public void getAllPacks(PacksLoadingListener listener) {
new PacksLoadingTask(listener).execute();
}
private class PacksLoadingTask extends AsyncTask<Void, Void, ArrayList<TelegramStickersPack>> {
PacksLoadingListener listener;
PacksLoadingTask(PacksLoadingListener listener) {
this.listener = listener;
}
@Override
protected ArrayList<TelegramStickersPack> doInBackground(Void... voids) {
if (readableDb == null)
loadDatabases();
String sortOrder = TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX + " ASC";
Cursor cursor = readableDb.query(TelegramStickersContract.StickersTableEntry.TABLE_NAME, null, null, null, null, null, sortOrder);
Log.d("DB", String.format("LOADING %d PACKS", cursor.getCount()));
ArrayList<TelegramStickersPack> packs = new ArrayList<>(cursor.getCount() + 8);
while (cursor.moveToNext()) {
Log.d("DB", "PACK LOADED");
String id = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ID));
String name = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_NAME));
String folder = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_FOLDER));
int stickersCount = cursor.getInt(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_STICKERS_COUNT));
boolean enabled = cursor.getInt(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_ENABLED)) == 1;
String version = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_VERSION));
int index = cursor.getInt(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_INDEX));
String emojisEncoded = cursor.getString(cursor.getColumnIndexOrThrow(TelegramStickersContract.StickersTableEntry.COLUMN_NAME_EMOJIS));
TelegramStickersPack pack = new TelegramStickersPack(id);
pack.state = TelegramStickersPack.DOWNLOADED;
pack.title = name;
pack.folder = new File(folder);
pack.stickersCount = stickersCount;
pack.enabled = enabled;
pack.version = version;
pack.index = index;
try {
if (emojisEncoded != null) pack.loadEmojis(new JSONObject(emojisEncoded));
} catch (JSONException e) {
e.printStackTrace();
}
packs.add(pack);
listener.onPackLoaded(pack);
}
cursor.close();
return packs;
}
@Override
protected void onPostExecute(ArrayList<TelegramStickersPack> packs) {
listener.onAllPacksLoaded(packs);
}
}
}
@@ -0,0 +1,481 @@
package com.aefyr.tsg.g2.stickersgrabber;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.os.Handler;
import android.os.Looper;
import android.util.Log;
import com.aefyr.tsg.g2.stickersgrabber.util.Flag;
import com.aefyr.tsg.g2.stickersgrabber.util.GoalCounter;
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 org.json.JSONArray;
import org.json.JSONObject;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.Socket;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
/**
* Created by Aefyr on 11.05.2018.
*/
public class TelegramStickersGrabber {
private static final String TAG = "TSG";
private static String BOT_API_BASE_URL;
private static String GET_STICKER_SET_URL;
private static String GET_FILE_URL;
private static String BOT_API_BASE_FILE_URL;
public static String REAL_TG_IP = null;
public static String PROXY_IP = null;
public static int PROXY_PORT = -1;
public static String PROXY_USER = null;
public static String PROXY_PASS = null;
public static boolean PROXY_SOCKS = true;
public static boolean HAS_PASS = false;
public static boolean USE_PROXY = false;
static {
updateURLs();
}
public static void updateURLs() {
BOT_API_BASE_FILE_URL = "https://api.telegram.org/file/bot%s/%s";
BOT_API_BASE_URL = REAL_TG_IP != null ? "https://" + REAL_TG_IP + "/bot%s/" : "https://api.telegram.org/bot%s/";
GET_STICKER_SET_URL = BOT_API_BASE_URL + "getStickerSet?name=%s";
GET_FILE_URL = BOT_API_BASE_URL + "getFile?file_id=%s";
}
private String botApiKey = "";
private NetClient httpClient;
private final MessageDigest sha256;
private final Handler uiThreadHandler;
public static boolean isTelegramBlocked() {
NetClient client = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
try {
if (PROXY_IP != null) {
Socket socket = new Socket(PROXY_IP, PROXY_PORT);
Proxy proxy = new Proxy(Proxy.Type.SOCKS, socket.getRemoteSocketAddress());
NetClient.Builder b = new NetClient.Builder().proxy(proxy);
if (PROXY_USER != null) {
b = b.proxyAuthenticator(new PasswordAuthentication(PROXY_USER, PROXY_PASS.toCharArray()));
}
client = b.build();
socket.close();
}
} catch (IOException e) {
e.printStackTrace();
}
NetRequest req = new NetRequest.Builder().url(REAL_TG_IP != null ? "https://" + REAL_TG_IP + "/test/" : "https://api.telegram.org/test/").build();
try {
NetResponse res = client.newCall(req).execute();
String s = res.getDataString();
if (!s.equals("{\"ok\":false,\"error_code\":404,\"description\":\"Not Found\"}"))
return true;
} catch (Exception e) {
return true;
}
return false;
}
public interface PackDownloadListener {
void onPackDownloaded(TelegramStickersPackInfo pack, boolean newVersionFound);
void onPackDownloadError(Exception e);
void onGotPackInfo(TelegramStickersPackInfo packInfo);
void onStickerDownloaded(String pack, File sticker, String boundEmoji, int stickerIndex, int downloadedStickersCount, int totalStickerCount);
}
public interface KeyCheckListener {
void onKeyChecked(boolean ok);
void onNetError();
}
public class TSGException extends Exception {
private static final long serialVersionUID = 7866915509988422944L;
private TSGException(String message) {
super(message);
}
}
public TelegramStickersGrabber(String botApiKey) {
this.botApiKey = botApiKey;
httpClient = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
uiThreadHandler = new Handler(Looper.getMainLooper());
try {
sha256 = MessageDigest.getInstance("SHA-256");
} catch (NoSuchAlgorithmException e) {
Log.wtf(TAG, "No support for SHA-256");
e.printStackTrace();
throw new RuntimeException(e);
}
}
public void resetProxy() {
httpClient = new NetClient.Builder().connectTimeout(5, TimeUnit.SECONDS).build();
}
public void enableProxy() {
Thread kostil = new Thread() {
@Override
public void run() {
try {
if (PROXY_IP != null) {
Socket socket = new Socket(PROXY_IP, PROXY_PORT);
Proxy proxy = new Proxy(Proxy.Type.SOCKS, socket.getRemoteSocketAddress());
NetClient.Builder b = httpClient.newBuilder().proxy(proxy);
if (PROXY_USER != null) {
httpClient = b.proxyAuthenticator(new PasswordAuthentication(PROXY_USER, PROXY_PASS.toCharArray())).build();
}
httpClient = b.build();
socket.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
};
kostil.start();
try {
kostil.join();
Log.d(TAG, "Proxy set");
} catch (InterruptedException e) {
Log.e(TAG, "Unable to set proxy:");
e.printStackTrace();
}
}
public void grabPack(String id, File packFolder, String installedVersion, final PackDownloadListener listener) {
getPackInfo(id, packFolder, installedVersion, listener);
}
public void setBotApiKey(String key) {
botApiKey = key;
}
public void checkKey(final KeyCheckListener listener) {
Log.d(TAG, "Checking key: " + botApiKey);
NetRequest request = new NetRequest.Builder().get().url(String.format(BOT_API_BASE_URL + "getMe", botApiKey)).build();
httpClient.newCall(request).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
e.printStackTrace();
runOnUiThread(listener::onNetError);
}
@Override
public void onResponse(NetCall call, final NetResponse response) throws IOException {
runOnUiThread(() -> listener.onKeyChecked(response.code() == 200));
}
});
}
private class StickerSet {
String id;
String name;
String version;
ArrayList<Sticker> stickers;
StickerSet(String id, String name, String version, ArrayList<Sticker> stickers) {
this.name = name;
this.stickers = stickers;
this.id = id;
this.version = version;
}
}
private class Sticker {
String emoji;
String fileId;
Sticker(String fileId, String emoji) {
this.fileId = fileId;
this.emoji = emoji;
}
@Override
public boolean equals(Object obj) {
return obj instanceof Sticker && ((Sticker) obj).fileId.equals(fileId);
}
@Override
public int hashCode() {
return (17 * emoji.hashCode()) << 32 + fileId.hashCode();
}
}
private void getPackInfo(final String packName, final File packFolder, final String installedVersion, final PackDownloadListener listener) {
NetRequest packInfoRequest = new NetRequest.Builder().get().url(String.format(GET_STICKER_SET_URL, botApiKey, packName)).build();
httpClient.newCall(packInfoRequest).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
listener.onPackDownloadError(e);
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
if (!response.isSuccessful()) {
if (response.getData() != null)
listener.onPackDownloadError(new TSGException(response.getDataString() + "\nURL: " + call.request().url()));
else
listener.onPackDownloadError(new TSGException("Unknown Exception, no response body"));
return;
}
StickerSet set;
try {
JSONObject jPackInfo = new JSONObject(response.getDataString()).getJSONObject("result");
String packVersion = new String(sha256.digest(jPackInfo.toString().getBytes(StandardCharsets.UTF_8)));
if (packVersion.equals(installedVersion)) {
listener.onPackDownloaded(null, false);
return;
}
JSONArray jStickers = jPackInfo.getJSONArray("stickers");
if (jStickers.length() == 0) {
listener.onPackDownloadError(new TSGException("No stickers in pack"));
return;
}
if (jPackInfo.optBoolean("is_animated")) {
listener.onPackDownloadError(new TSGException("Animated stickerpacks are not supported!"));
return;
}
ArrayList<Sticker> stickers = new ArrayList<>(jStickers.length());
Log.d(TAG, String.format("Parsing stickers in pack %s", packName));
for (int i = 0; i < jStickers.length(); i++) {
JSONObject jSticker = jStickers.getJSONObject(i);
stickers.add(new Sticker(jSticker.getString("file_id"), jSticker.getString("emoji")));
}
set = new StickerSet(jPackInfo.getString("name"), jPackInfo.getString("title"), packVersion, stickers);
} catch (Exception e) {
listener.onPackDownloadError(e);
return;
}
if (!packFolder.exists() && !packFolder.mkdirs()) {
listener.onPackDownloadError(new IOException("Can't create folder for the pack!"));
return;
}
Log.d(TAG, String.format("Got info for pack %s, now downloading stickers to %s", packName, packFolder.getAbsolutePath()));
TelegramStickersPackInfo packInfo = new TelegramStickersPackInfo(packName, set.name, set.stickers.size(), set.version);
listener.onGotPackInfo(packInfo);
getPack(set, packFolder, packInfo, listener);
}
});
}
private void getPack(final StickerSet set, final File packFolder, final TelegramStickersPackInfo packInfo, final PackDownloadListener listener) {
final GoalCounter downloadedStickers = new GoalCounter(set.stickers.size(), () -> {
Log.d(TAG, String.format("Pack %s has been downloaded to %s", set.id, packFolder.getAbsolutePath()));
listener.onPackDownloaded(packInfo, true);
});
final Flag deathFlag = new Flag();
AtomicInteger retryed = new AtomicInteger();
for (int i = 0; i < set.stickers.size(); i++) {
final Sticker sticker = set.stickers.get(i);
NetRequest fileInfoRequest = new NetRequest.Builder().get().url(String.format(GET_FILE_URL, botApiKey, sticker.fileId)).build();
final int stickerIndex = i + 1;
AtomicBoolean sync = new AtomicBoolean();
httpClient.newCall(fileInfoRequest).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
if (deathFlag.up())
return;
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
if (deathFlag.up())
return;
if (response.code() != 200) {
retryed.incrementAndGet();
if (retryed.get() > 5)
onFailure(call, new IOException());
else httpClient.newCall(fileInfoRequest)
.enqueue(this);
return;
}
String filePath;
try {
JSONObject jFileInfo = new JSONObject(response.getDataString()).getJSONObject("result");
filePath = jFileInfo.getString("file_path");
} catch (Exception e) {
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
return;
}
if (botApiKey == null) botApiKey = "";
NetRequest fileDownloadRequest = new NetRequest.Builder().get().url(String.format(BOT_API_BASE_FILE_URL, botApiKey, filePath)).build();
httpClient.newCall(fileDownloadRequest).enqueue(new NetCallback() {
@Override
public void onFailure(NetCall call, IOException e) {
if (deathFlag.up())
return;
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
}
@Override
public void onResponse(NetCall call, NetResponse response) throws IOException {
if (deathFlag.up())
return;
if (response.code() != 200) {
retryed.incrementAndGet();
if (retryed.get() > 5)
onFailure(call, new IOException());
else httpClient.newCall(fileDownloadRequest)
.enqueue(this);
return;
}
if (response.getData() == null) {
deathFlag.raise();
listener.onPackDownloadError(new TSGException("Response body for a sticker is null :/"));
sync.set(true);
return;
}
InputStream stickerInputStream = response.getDataStream();
Bitmap stickerImage = BitmapFactory.decodeStream(stickerInputStream);
try {
stickerInputStream.close();
} catch (IOException e) {
e.printStackTrace();
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
return;
}
if (stickerImage == null) {
deathFlag.raise();
listener.onPackDownloadError(new TSGException("Unable to decode sticker image"));
sync.set(true);
return;
}
File stickerFile = new File(packFolder, String.format("%03d.png", stickerIndex));
FileOutputStream fileOutputStream;
try {
fileOutputStream = new FileOutputStream(stickerFile);
} catch (Exception e) {
e.printStackTrace();
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
return;
}
if (!stickerImage.compress(Bitmap.CompressFormat.PNG, 100, fileOutputStream)) {
stickerImage.recycle();
deathFlag.raise();
listener.onPackDownloadError(new TSGException("Unable to compress sticker to a png file at path: " + stickerFile.getAbsolutePath()));
sync.set(true);
return;
}
stickerImage.recycle();
try {
fileOutputStream.close();
} catch (IOException e) {
e.printStackTrace();
deathFlag.raise();
listener.onPackDownloadError(e);
sync.set(true);
return;
}
listener.onStickerDownloaded(set.name, stickerFile, sticker.emoji, stickerIndex, downloadedStickers.value() + 1, set.stickers.size());
downloadedStickers.increase();
sync.set(true);
}
});
}
});
while (!sync.get())
try {
Thread.sleep(100);
} catch (InterruptedException e1) {
}
}
}
private void runOnUiThread(Runnable r) {
uiThreadHandler.post(r);
}
}
@@ -0,0 +1,18 @@
package com.aefyr.tsg.g2.stickersgrabber;
/**
* Created by Aefyr on 22.05.2018.
*/
public class TelegramStickersPackInfo {
public String id;
public String title;
public String version;
public int stickersCount;
TelegramStickersPackInfo(String id, String title, int stickersCount, String version) {
this.id = id;
this.title = title;
this.version = version;
this.stickersCount = stickersCount;
}
}
@@ -0,0 +1,20 @@
package com.aefyr.tsg.g2.stickersgrabber.util;
/**
* Created by Aefyr on 11.05.2018.
*/
public class Flag {
private boolean up = false;
public synchronized boolean up() {
return up;
}
public synchronized void raise() {
up = true;
}
public synchronized void lower() {
up = false;
}
}
@@ -0,0 +1,39 @@
package com.aefyr.tsg.g2.stickersgrabber.util;
import android.util.Log;
/**
* Created by Aefyr on 11.05.2018.
*/
public class GoalCounter {
public interface OnGoalReachListener {
void onGoalReached();
}
private int goal;
private int i = 0;
private OnGoalReachListener listener;
public GoalCounter(int goal, OnGoalReachListener listener) {
this.goal = goal;
this.listener = listener;
}
public synchronized void increase() {
if (++i == goal)
listener.onGoalReached();
Log.d("COUNTER", "G=" + goal + ", I=" + i);
}
public synchronized void increase(int delta) {
if ((i += delta) == goal)
listener.onGoalReached();
}
public synchronized int value() {
return i;
}
}
File diff suppressed because it is too large Load Diff
+207
View File
@@ -0,0 +1,207 @@
package okhttp3;
import androidx.annotation.Nullable;
import java.util.Collections;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import okhttp3.Headers;
import okhttp3.internal.Util;
import okhttp3.internal.b.HttpMethod;
import okhttp3.Request;
public final class Request {
/* renamed from: a reason: collision with root package name */
final HttpUrl a;
final String b;
final Headers c;
final Map<Class<?>, Object> e;
private volatile CacheControl f;
@Nullable
final RequestBody requestBody;
Request(Builder builder) {
this.a = builder.a;
this.b = builder.b;
this.c = builder.c.a();
this.requestBody = builder.d;
this.e = Util.a(builder.e);
}
public HttpUrl a() {
return this.a;
}
public String b() {
return this.b;
}
public Headers c() {
return this.c;
}
@Nullable
public String header(String str) {
return this.c.a(str);
}
public List<String> b(String str) {
return this.c.b(str);
}
@Nullable
public RequestBody d() {
return this.requestBody;
}
@Nullable
public <T> T a(Class<? extends T> cls) {
return (T) cls.cast(this.e.get(cls));
}
public Builder e() {
return new Builder(this);
}
public CacheControl f() {
CacheControl cacheControl = this.f;
if (cacheControl != null) {
return cacheControl;
}
CacheControl a2 = CacheControl.a(this.c);
this.f = a2;
return a2;
}
public boolean g() {
return this.a.d();
}
public String toString() {
return "Request{method=" + this.b + ", url=" + this.a + ", tags=" + this.e + '}';
}
public static class Builder {
/* renamed from: a reason: collision with root package name */
HttpUrl a;
String b;
Headers.a c;
RequestBody d;
Map<Class<?>, Object> e;
public Builder() {
this.e = Collections.emptyMap();
this.b = "GET";
this.c = new Headers.a();
}
Builder(Request request) {
Map<Class<?>, Object> map;
this.e = Collections.emptyMap();
this.a = request.a;
this.b = request.b;
this.d = request.requestBody;
if (request.e.isEmpty()) {
map = Collections.emptyMap();
} else {
map = new LinkedHashMap<>(request.e);
}
this.e = map;
this.c = request.c.b();
}
public Builder a(HttpUrl httpUrl) {
if (httpUrl == null) {
throw new NullPointerException("url == null");
}
this.a = httpUrl;
return this;
}
public Builder url(String str) {
if (str == null) {
throw new NullPointerException("url == null");
}
if (str.regionMatches(true, 0, "ws:", 0, 3)) {
str = "http:" + str.substring(3);
} else if (str.regionMatches(true, 0, "wss:", 0, 4)) {
str = "https:" + str.substring(4);
}
return a(HttpUrl.f(str));
}
public Builder a(String str, String str2) {
this.c.c(str, str2);
return this;
}
public Builder b(String str, String str2) {
this.c.a(str, str2);
return this;
}
public Builder b(String str) {
this.c.b(str);
return this;
}
public Builder a(Headers headers) {
this.c = headers.b();
return this;
}
public Builder a(CacheControl cacheControl) {
String cacheControl2 = cacheControl.toString();
return cacheControl2.isEmpty() ? b("Cache-Control") : a("Cache-Control", cacheControl2);
}
public Builder a() {
return a("GET", (RequestBody) null);
}
public Builder a(RequestBody requestBody) {
return a("POST", requestBody);
}
public Builder a(String str, @Nullable RequestBody requestBody) {
if (str == null) {
throw new NullPointerException("method == null");
} else if (str.length() == 0) {
throw new IllegalArgumentException("method.length() == 0");
} else if (requestBody != null && !HttpMethod.c(str)) {
throw new IllegalArgumentException("method " + str + " must not have a request body.");
} else if (requestBody != null || !HttpMethod.b(str)) {
this.b = str;
this.d = requestBody;
return this;
} else {
throw new IllegalArgumentException("method " + str + " must have a request body.");
}
}
public <T> Builder a(Class<? super T> cls, @Nullable T t) {
if (cls == null) {
throw new NullPointerException("type == null");
}
if (t == null) {
this.e.remove(cls);
} else {
if (this.e.isEmpty()) {
this.e = new LinkedHashMap();
}
this.e.put(cls, cls.cast(t));
}
return this;
}
public Request build() {
if (this.a != null) {
return new Request(this);
}
throw new IllegalStateException("url == null");
}
}
}
@@ -0,0 +1,87 @@
package ru.f0x1d.net;
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 ru.vtosters.lite.utils.Helper;
public class F0x1dRequest {
public interface F0x1dRequestCallback {
void onResponse(String str);
}
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();
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private F0x1dRequestCallback callback;
private boolean mIsPut;
private boolean mIsVkToasterRequest;
private 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;
}
/* JADX INFO: Access modifiers changed from: protected */
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", Helper.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);
}
}
}
@@ -0,0 +1,96 @@
package ru.f0x1d.net;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.Map;
import java.util.TreeMap;
import android.util.Base64;
public final class NetCall {
private NetRequest req;
private NetClient cl;
protected NetCall(NetClient cl, NetRequest req) {
this.req = req;
this.cl = cl;
}
public NetRequest request() {
return req;
}
public NetResponse execute() throws IOException {
Proxy proxy = cl.getProxy();
PasswordAuthentication auth = cl.getAuthenticator();
HttpURLConnection con = (HttpURLConnection) new URL(req.url()).openConnection(proxy != null ? proxy : Proxy.NO_PROXY);
if (proxy != null && auth != null) {
String authStr = "Basic " + Base64.encodeToString((auth.getUserName() + new String(auth.getPassword())).getBytes(), Base64.NO_WRAP);
con.setRequestProperty("Proxy-Connection", "Keep-Alive");
con.setRequestProperty("Proxy-Authorization", authStr);
}
con.setConnectTimeout((int) cl.getTimeout());
con.setRequestMethod(req.getRequestMethod());
if (req.getRequestMethod().equals("POST")) {
con.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
}
Map<String, String> params = req.getRequestParams();
if (params != null) {
String strArgs = constructArgs(params);
con.setRequestProperty("Content-Length", String.valueOf(strArgs.getBytes(StandardCharsets.UTF_8).length));
con.setDoOutput(true);
con.getOutputStream().write(strArgs.getBytes(StandardCharsets.UTF_8));
con.getOutputStream().close();
}
con.connect();
InputStream in;
if (con.getResponseCode() == 200) in = con.getInputStream();
else in = con.getErrorStream();
ByteArrayOutputStream bos = new ByteArrayOutputStream();
byte[] buffer = new byte[1024 * 1024];
int c;
while ((c = in.read(buffer)) != -1) bos.write(buffer, 0, c);
in.close();
bos.close();
NetResponse r = new NetResponse(bos.toByteArray());
r.setCode(con.getResponseCode());
return r;
}
private static String constructArgs(Map<String, String> args) throws UnsupportedEncodingException {
args = new TreeMap<>(args);
String str = "";
for (Map.Entry<String, String> en : args.entrySet()) {
if (!str.isEmpty()) str += "&";
str += URLEncoder.encode(en.getKey(), "UTF-8") + "=" + URLEncoder.encode(en.getValue(), "UTF-8");
}
return str;
}
public void enqueue(NetCallback cb) {
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) {
}
}
}.start();
}
}
@@ -0,0 +1,9 @@
package ru.f0x1d.net;
import java.io.IOException;
public interface NetCallback {
void onFailure(NetCall netCall, IOException iOException);
void onResponse(NetCall netCall, NetResponse netResponse) throws IOException;
}
@@ -0,0 +1,87 @@
package ru.f0x1d.net;
import java.net.PasswordAuthentication;
import java.net.Proxy;
import java.util.concurrent.TimeUnit;
public class NetClient {
private long timeout;
private Proxy proxy;
private PasswordAuthentication authenticator;
public static final class Builder {
private long timeout;
private Proxy proxy;
private PasswordAuthentication auth;
public Builder connectTimeout(long l, TimeUnit unit) {
int m;
switch (unit) {
case SECONDS:
m = 1000;
break;
case MILLISECONDS:
m = 1;
break;
case HOURS:
m = 1000 * 60 * 60;
break;
case DAYS:
m = 1000 * 60 * 60 * 24;
break;
case MINUTES:
m = 1000 * 60;
break;
default:
m = 1;
break;
}
timeout = l * m;
return this;
}
public Builder proxyAuthenticator(PasswordAuthentication auth) {
this.auth = auth;
return this;
}
public Builder proxy(Proxy proxy) {
this.proxy = proxy;
return this;
}
public NetClient build() {
return new NetClient(this);
}
}
public Builder newBuilder() {
Builder b = new Builder();
b.timeout = timeout;
b.proxy = proxy;
b.auth = authenticator;
return b;
}
protected NetClient(Builder b) {
timeout = b.timeout;
proxy = b.proxy;
authenticator = b.auth;
}
public NetCall newCall(NetRequest req) {
return new NetCall(this, req);
}
public PasswordAuthentication getAuthenticator() {
return authenticator;
}
public Proxy getProxy() {
return proxy;
}
public long getTimeout() {
return timeout;
}
}
+64
View File
@@ -0,0 +1,64 @@
package ru.f0x1d.net;
import java.util.Map;
import java.util.TreeMap;
public class NetRequest {
private String url;
private String requestMethod;
private Map<String, String> params;
public static final class Builder {
private String url;
private String req = "GET";
private Map<String, String> params;
public NetRequest build() {
return new NetRequest(this);
}
public Builder url(String url) {
this.url = url;
return this;
}
public Builder get() {
req = "GET";
return this;
}
public Builder post() {
req = "POST";
return this;
}
public Builder params(Map<String, String> params) {
this.params = params;
return this;
}
public Builder param(String param, String value) {
if (params == null) params = new TreeMap<>();
params.put(param, value);
return this;
}
}
protected NetRequest(Builder b) {
url = b.url;
requestMethod = b.req;
params = b.params;
}
public Map<String, String> getRequestParams() {
return params;
}
public String url() {
return url;
}
public String getRequestMethod() {
return requestMethod;
}
}
+38
View File
@@ -0,0 +1,38 @@
package ru.f0x1d.net;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import java.nio.charset.StandardCharsets;
public final class NetResponse {
private byte[] data;
private int code;
protected NetResponse(byte[] data) {
this.data = data;
}
protected void setCode(int code) {
this.code = code;
}
public boolean isSuccessful() {
return code() == 200;
}
public int code() {
return code;
}
public byte[] getData() {
return data;
}
public InputStream getDataStream() {
return new ByteArrayInputStream(data);
}
public String getDataString() {
return new String(data, StandardCharsets.UTF_8);
}
}
@@ -0,0 +1,199 @@
package ru.vtosters.lite.audio.gcm;
import android.os.Build;
import android.util.Base64;
import java.io.BufferedReader;
import java.io.DataOutputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.nio.charset.StandardCharsets;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import java.security.PrivateKey;
import java.security.Signature;
import java.security.interfaces.RSAPrivateKey;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
import java.util.concurrent.atomic.AtomicBoolean;
import javax.net.ssl.HttpsURLConnection;
public class GCMFix {
private static String agent = String.format("Android-GCM/1.5 (%s %s)", Build.MODEL, Build.MODEL);
public static ArrayList<String> langs = new ArrayList<>();
private static KeyPair pair;
private static int rid = 0;
/* access modifiers changed from: private */
public interface Callback {
void doCallback(String str);
}
static {
genNewKey();
}
public static String requestToken() {
String xappide;
try {
String[] aidarr = {"3974055026275073921", "4418584909973341826", "4585634953328772978"};
int r = new Random().nextInt(aidarr.length - 1);
String aid = "AidLogin " + aidarr[r] + ":" + new String[]{"1932960345884890854", "6594645578425092292", "1792344590975444730"}[r];
String pub2 = genNewKey();
String sig = getSig(pub2);
String xappide2 = null;
byte[] bytes = pair.getPublic().getEncoded();
try {
bytes = MessageDigest.getInstance("SHA1").digest(bytes);
} catch (NoSuchAlgorithmException e) {
xappide2 = "";
}
if (xappide2 == null) {
bytes[0] = (byte) (((bytes[0] & 15) + 112) & 255);
xappide = Base64.encodeToString(bytes, 2).substring(0, 11);
} else {
xappide = xappide2;
}
AtomicBoolean wait = new AtomicBoolean(false);
StringBuilder sb = new StringBuilder();
List<String> params = new ArrayList<>();
fillParams(params, sig, pub2, xappide, Long.parseLong(aid.split(" ")[1].split(":")[0]), false);
Callback callback = str -> GCMFix.lambdaRequestToken(sb, wait, str);
doRequest("https://android.clients.google.com/c2dm/register3", "POST", params, aid, callback);
while (!wait.get()) {
Thread.sleep(100);
}
String token = sb.toString();
if (token.equals("EGISTRATION_ERROR")) {
return requestToken();
}
rid = 0;
String pub22 = genNewKey();
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);
}
});
return token;
} catch (FileNotFoundException e2) {
return requestToken();
} catch (Exception e3) {
return null;
}
}
static /* synthetic */ void lambdaRequestToken(StringBuilder sb, AtomicBoolean wait, String s) {
sb.append(s.substring(20));
wait.set(true);
}
static /* synthetic */ void lambda$requestToken$1(String str) {
}
private static void fillParams(List<String> params, String sig, String pub2, String xappid, long androidId, boolean del) {
rid++;
params.add("X-subtype=841415684880");
if (del) {
params.add("X-delete=1");
params.add("X-X-delete=1");
} else {
params.add("X-X-subscription=841415684880");
}
params.add("X-X-subtype=841415684880");
params.add("X-app_ver=3439");
params.add("X-kid=|ID|" + rid + "|");
params.add("X-osv=30");
params.add("X-sig=" + sig);
params.add("X-cliv=fiid-9877000");
params.add("X-gmsv=11949480");
params.add("X-pub2=" + pub2);
params.add("X-X-kid=|ID|" + rid + "|");
StringBuilder sb = new StringBuilder();
sb.append("X-appid=");
sb.append(xappid);
params.add(sb.toString());
if (del) {
params.add("X-scope=GCM");
} else {
params.add("X-scope=*");
}
params.add("X-subscription=841415684880");
if (!del) {
params.add("X-gmp_app_id=1:841415684880:android:632f429381141121");
}
params.add("X-app_ver_name=5.29");
params.add("app=com.vkontakte.android");
params.add("sender=841415684880");
params.add("device=" + androidId);
params.add("cert=48761eef50ee53afc4cc9c5f10e6bde7f8f5b82f");
params.add("app_ver=3439");
params.add("gcm_ver=11949470");
}
private static String join(String chr, Iterable<String> arr) {
String str = "";
for (String s : arr) {
str = str.isEmpty() ? s : str + chr + s;
}
return str;
}
private static String join(String chr, String[] arr) {
return join(chr, Arrays.asList(arr));
}
private static void doRequest(String url, String method, List<String> params, String aidlogin, Callback callback) throws IOException {
HttpsURLConnection con = (HttpsURLConnection) new URL(url).openConnection();
con.setRequestMethod(method);
con.setRequestProperty("Authorization", aidlogin);
con.setRequestProperty("app", "com.vkontakte.android");
con.setRequestProperty("Gcm-ver", "11947470");
con.setRequestProperty("Gcm-cert", "48761eef50ee53afc4cc9c5f10e6bde7f8f5b82f");
con.setRequestProperty("User-Agent", agent);
String uparams = join("&", params);
con.setDoOutput(true);
DataOutputStream out = new DataOutputStream(con.getOutputStream());
out.writeBytes(uparams);
out.flush();
out.close();
callback.doCallback(new BufferedReader(new InputStreamReader(con.getInputStream())).readLine());
con.getInputStream().close();
}
private static String genNewKey() {
try {
KeyPairGenerator gen = KeyPairGenerator.getInstance("RSA");
gen.initialize(2048);
pair = gen.generateKeyPair();
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return Base64.encodeToString(pair.getPublic().getEncoded(), 0);
}
private static String getSig(String pub2) {
try {
PrivateKey key = pair.getPrivate();
Signature sign = Signature.getInstance(key instanceof RSAPrivateKey ? "SHA256withRSA" : "SHA256withECDSA");
sign.initSign(key);
sign.update(join("\n", new String[]{"com.vkontakte.android", pub2}).getBytes(StandardCharsets.UTF_8));
return Base64.encodeToString(sign.sign(), 0);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
}
@@ -0,0 +1,96 @@
package ru.vtosters.lite.badmanners;
public class Device {
private String androidId;
private String bluetoothMac;
private String boardName;
private String brandName;
private String cpuAbi;
private String deviceName;
private String firmwareDisplay;
private String firmwareId;
private String manufacturerName;
private String modelName;
private String productName;
private int sdkVersion;
private String serialId;
private String wifiMac;
public Device withSerialId(String str) {
this.serialId = str;
return this;
}
public Device withAndroidId(String str) {
this.androidId = str;
return this;
}
public Device withWifiMac(String str) {
this.wifiMac = str;
return this;
}
public Device withBluetoothMac(String str) {
this.bluetoothMac = str;
return this;
}
public Device withSdkVersion(int i) {
this.sdkVersion = i;
return this;
}
public Device withFirmwareId(String str) {
this.firmwareId = str;
return this;
}
public Device withFirmwareDisplay(String str) {
this.firmwareDisplay = str;
return this;
}
public Device withProductName(String str) {
this.productName = str;
return this;
}
public Device withDeviceName(String str) {
this.deviceName = str;
return this;
}
public Device withBoardName(String str) {
this.boardName = str;
return this;
}
public Device withCpuAbi(String str) {
this.cpuAbi = str;
return this;
}
public Device withManufacturerName(String str) {
this.manufacturerName = str;
return this;
}
public Device withBrandName(String str) {
this.brandName = str;
return this;
}
public Device withModelName(String str) {
this.modelName = str;
return this;
}
public String toString() {
return "Device{serialId='" + this.serialId + "', androidId='" + this.androidId + "', wifiMac='" + this.wifiMac + "', bluetoothMac='" + this.bluetoothMac + "'}";
}
public String toDeviceName() {
return "Device{sdkVersion=" + this.sdkVersion + ", productName='" + this.productName + "', deviceName='" + this.deviceName + "', boardName='" + this.boardName + "', cpuAbi='" + this.cpuAbi + "', manufacturerName='" + this.manufacturerName + "', brandName='" + this.brandName + "', modelName='" + this.modelName + "'}";
}
}
@@ -0,0 +1,192 @@
package ru.vtosters.lite.badmanners;
import android.bluetooth.BluetoothAdapter;
import android.content.Context;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiManager;
import android.os.Build;
import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import androidx.core.os.EnvironmentCompat;
import java.io.BufferedReader;
import java.io.FileReader;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.NetworkInterface;
import java.util.Collections;
public class DeviceInfoCollector {
private static final String TAG = "DeviceInfoCollector";
public Device collect(Context context) {
return new Device().withSerialId(serialId()).withAndroidId(androidId(context)).withWifiMac(wifiMac(context)).withBluetoothMac(bluetoothMac(context)).withSdkVersion(Build.VERSION.SDK_INT).withFirmwareId(Build.ID).withFirmwareDisplay(Build.DISPLAY).withProductName(Build.PRODUCT).withDeviceName(Build.DEVICE).withBoardName(Build.BOARD).withCpuAbi(Build.CPU_ABI).withManufacturerName(Build.MANUFACTURER).withBrandName(Build.BRAND).withModelName(Build.MODEL);
}
private String serialId() {
String str;
try {
Class<?> cls = Class.forName("android.os.SystemProperties");
Method method = cls.getMethod("get", String.class);
str = (String) method.invoke(cls, "gsm.sn1");
if (isInvalidSerial(str)) {
str = (String) method.invoke(cls, "ril.serialnumber");
}
if (isInvalidSerial(str)) {
str = (String) method.invoke(cls, "ro.serialno");
}
if (isInvalidSerial(str)) {
str = (String) method.invoke(cls, "sys.serialnumber");
}
if (isInvalidSerial(str)) {
str = Build.SERIAL;
}
} catch (Exception e) {
Log.d(TAG, "Serial ID obtaining failed: ", e);
}
str = null;
if (str != null) {
return str.toLowerCase();
}
return null;
}
private String androidId(Context context) {
return Settings.Secure.getString(context.getContentResolver(), "android_id").toLowerCase();
}
private String wifiMac(Context context) {
String wifiMacFromManager = wifiMacFromManager(context);
if (isInvalidMac(wifiMacFromManager)) {
wifiMacFromManager = wifiMacFromNetworkInterfaces();
}
if (isInvalidMac(wifiMacFromManager)) {
wifiMacFromManager = wifiMacFromFileSystem();
}
if (isInvalidMac(wifiMacFromManager)) {
wifiMacFromManager = null;
}
if (wifiMacFromManager != null) {
return wifiMacFromManager.toLowerCase();
}
return null;
}
private String wifiMacFromManager(Context context) {
WifiInfo connectionInfo;
try {
WifiManager wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
if (wifiManager == null || (connectionInfo = wifiManager.getConnectionInfo()) == null) {
return null;
}
return null;
} catch (Exception e) {
Log.d(TAG, "WiFi MAC obtaining from manager failed: ", e);
return null;
}
}
private String wifiMacFromNetworkInterfaces() {
try {
for (NetworkInterface networkInterface : Collections.list(NetworkInterface.getNetworkInterfaces())) {
if ("wlan0".equalsIgnoreCase(networkInterface.getName())) {
byte[] hardwareAddress = networkInterface.getHardwareAddress();
if (hardwareAddress == null) {
return null;
}
StringBuilder sb = new StringBuilder();
int length = hardwareAddress.length;
for (int i = 0; i < length; i++) {
sb.append(String.format("%02X:", Byte.valueOf(hardwareAddress[i])));
}
if (sb.length() > 0) {
sb.deleteCharAt(sb.length() - 1);
}
return sb.toString();
}
}
return null;
} catch (Exception e) {
Log.d(TAG, "WiFi MAC obtaining from network interfaces failed: ", e);
return null;
}
}
private String wifiMacFromFileSystem() {
try {
FileReader fileReader = new FileReader("/sys/class/net/wlan0/address");
try {
BufferedReader bufferedReader = new BufferedReader(fileReader);
try {
String readLine = bufferedReader.readLine();
bufferedReader.close();
fileReader.close();
return readLine;
} catch (Throwable th) {
th.addSuppressed(th);
}
} catch (Throwable th2) {
throw th2;
}
} catch (Exception e) {
Log.d(TAG, "WiFi MAC obtaining from file system failed: ", e);
return null;
}
return null;
}
private String bluetoothMac(Context context) {
String bluetoothMacFromAdapter = bluetoothMacFromAdapter();
if (isInvalidMac(bluetoothMacFromAdapter)) {
bluetoothMacFromAdapter = bluetoothMacFromContentResolver(context);
}
if (isInvalidMac(bluetoothMacFromAdapter)) {
bluetoothMacFromAdapter = null;
}
if (bluetoothMacFromAdapter != null) {
return bluetoothMacFromAdapter.toLowerCase();
}
return null;
}
private String bluetoothMacFromAdapter() {
try {
BluetoothAdapter defaultAdapter = BluetoothAdapter.getDefaultAdapter();
if (defaultAdapter == null) {
return null;
}
if (Build.VERSION.SDK_INT < 23) {
return null;
}
Field declaredField = defaultAdapter.getClass().getDeclaredField("mService");
declaredField.setAccessible(true);
Object obj = declaredField.get(defaultAdapter);
if (obj != null) {
return (String) obj.getClass().getMethod("getAddress", new Class[0]).invoke(obj, new Object[0]);
}
return null;
} catch (Exception e) {
Log.d(TAG, "BT MAC obtaining from adapter failed: ", e);
return null;
}
}
private String bluetoothMacFromContentResolver(Context context) {
try {
return Settings.Secure.getString(context.getContentResolver(), "bluetooth_address");
} catch (Exception e) {
Log.d(TAG, "BT MAC obtaining from content resolver failed: ", e);
return null;
}
}
private boolean isInvalidSerial(String str) {
return TextUtils.isEmpty(str) || EnvironmentCompat.MEDIA_UNKNOWN.equalsIgnoreCase(str);
}
private boolean isInvalidMac(String str) {
return TextUtils.isEmpty(str) || "02:00:00:00:00:00".equalsIgnoreCase(str) || "00:00:00:00:00:00".equalsIgnoreCase(str);
}
}
@@ -0,0 +1,68 @@
package ru.vtosters.lite.dnr;
import android.util.Log;
import com.vk.im.engine.models.dialogs.Dialog;
import com.vk.im.ui.components.common.DialogAction;
import java.util.LinkedHashMap;
import java.util.List;
import ru.vtosters.lite.utils.Helper;
public class DNRInjector {
public static void inject(Dialog dialog, List<DialogAction> list) {
int peerId = dialog.a();
if (DNRModule.isDnrEnabledFor(peerId)) {
list.add(DialogAction.valueOf("DNR_OFF"));
} else {
list.add(DialogAction.valueOf("DNR_ON"));
}
if (DNRModule.isDntEnabledFor(peerId)) {
list.add(DialogAction.valueOf("DNT_OFF"));
} else {
list.add(DialogAction.valueOf("DNT_ON"));
}
}
public static LinkedHashMap<DialogAction, Integer> injectToHashMap(LinkedHashMap<DialogAction, Integer> hashMap) {
hashMap.put(DialogAction.valueOf("DNR_ON"), Helper.getIdentifier("DNR_ON", "string"));
hashMap.put(DialogAction.valueOf("DNR_OFF"), Helper.getIdentifier("DNR_OFF", "string"));
hashMap.put(DialogAction.valueOf("DNT_ON"), Helper.getIdentifier("DNT_ON", "string"));
hashMap.put(DialogAction.valueOf("DNT_OFF"), Helper.getIdentifier("DNT_OFF", "string"));
return hashMap;
}
public static boolean onClick(Dialog dialog, DialogAction action) {
var id = dialog.a();
if (action == DialogAction.valueOf("DNR_ON")) {
setDnr(dialog, true);
return true;
} else if (action == DialogAction.valueOf("DNR_OFF")) {
setDnr(dialog, false);
return true;
}
if (action == DialogAction.valueOf("DNT_ON")) {
setDnt(dialog, true);
return true;
} else if (action == DialogAction.valueOf("DNT_OFF")) {
setDnt(dialog, false);
return true;
}
return false;
}
public static void setDnr(Dialog dialog, boolean value) {
DNRModule.hookDNR(dialog.a());
}
public static void setDnt(Dialog dialog, boolean value) {
DNRModule.hookDNT(dialog.a());
}
}
@@ -0,0 +1,68 @@
package ru.vtosters.lite.dnr;
import android.util.Log;
import com.vk.core.util.ToastUtils;
import com.vk.im.engine.commands.messages.SetUserActivityCmd;
import com.vk.im.engine.models.dialogs.Dialog;
import java.util.List;
import ru.f0x1d.net.F0x1dRequest;
import ru.vtosters.lite.dnr.helpers.DoNotReadDBHelper;
import ru.vtosters.lite.dnr.helpers.DoNotTypeDBHelper;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Proxy;
public class DNRModule {
public static DoNotReadDBHelper mDoNotReadDBHelper = new DoNotReadDBHelper();
public static DoNotTypeDBHelper mDoNotTypeDBHelper = new DoNotTypeDBHelper();
public static boolean isDnrEnabledFor(int id) {
var isEnabled = mDoNotReadDBHelper.isEnabledForPeerId(id);
return isEnabled;
}
public static List<Integer> getDnrEnabled() {
return mDoNotReadDBHelper.get();
}
public static List<Integer> getDntEnabled() {
return mDoNotTypeDBHelper.get();
}
public static boolean isDntEnabledFor(int id) {
var isEnabled = mDoNotTypeDBHelper.isEnabledForPeerId(id);
return isEnabled;
}
public static boolean isDntEnabledFor(SetUserActivityCmd cmd) {
return isDntEnabledFor(cmd.b);
}
public static boolean isDnrEnabledFor(Dialog dialog) {
if (dialog == null) return false;
return isDnrEnabledFor(dialog.a());
}
public static boolean isDntEnabledFor(Dialog dialog) {
if (dialog == null) return false;
return isDntEnabledFor(dialog.a());
}
public static void hookRead(Dialog dialog) {
F0x1dRequest.makeRequest("https://" + Proxy.getApiCom() + "/method/messages.markAsRead?start_message_id=" + dialog.lastMsgVkId + "&peer_id=" + dialog.a() + "&v=5.91&access_token=" + Helper.GetUserToken(), response -> {
ToastUtils.a("Чат помечен как прочитанный!");
});
}
public static Dialog mDialog;
public static void hookDNR(int peerId) {
mDoNotReadDBHelper.setEnabledForPeerId(peerId, !mDoNotReadDBHelper.isEnabledForPeerId(peerId));
}
public static void hookDNT(int peerId) {
mDoNotTypeDBHelper.setEnabledForPeerId(peerId, !mDoNotTypeDBHelper.isEnabledForPeerId(peerId));
}
}
@@ -0,0 +1,66 @@
package ru.vtosters.lite.dnr;
import ru.vtosters.lite.utils.Prefs;
// Настройки Донецкой Народной Республики
public class DNRPrefs {
public static boolean getStoriesRead() {
return Prefs.BooleanFalse("read_s");
}
public static boolean getMarkAsReadWithoutExceptions(int peerId) {
if (readPM(peerId))
return true;
if (readConversations(peerId))
return true;
return readBots(peerId);
}
public static boolean getMarkAsRead(int peerId) {
return isInDNRExceptions(peerId);
}
public static boolean isInDNRExceptions(int peerId) {
return DNRModule.mDoNotReadDBHelper.isEnabledForPeerId(peerId);
}
public static boolean isInDNTExceptions(int peerId) {
return DNRModule.mDoNotTypeDBHelper.isEnabledForPeerId(peerId);
}
public static boolean readPM(int peer) {
return (peer > 0 && peer < 2000000000) && Prefs.BooleanFalse("read_pm");
}
public static boolean readConversations(int peer) {
return (peer > 2000000000) && Prefs.BooleanFalse("read_conversations");
}
public static boolean readBots(int peer) {
return (peer < 0) && Prefs.BooleanFalse("read_bot");
}
public static boolean writePM(int peer) {
return (peer > 0 && peer < 2000000000) && Prefs.BooleanFalse("write_pm");
}
public static boolean writeConversations(int peer) {
return (peer > 2000000000) && Prefs.BooleanFalse("write_conversations");
}
public static boolean writeBots(int peer) {
return (peer < 0) && Prefs.BooleanFalse("write_bot");
}
public static boolean getActivityWithoutExceptions(int peerId) {
if (writePM(peerId))
return true;
if (writeConversations(peerId))
return true;
return writeBots(peerId);
}
public static boolean getActivity(int peerId) {
return isInDNTExceptions(peerId);
}
}
@@ -0,0 +1,78 @@
package ru.vtosters.lite.dnr.helpers;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
import ru.vtosters.lite.dnr.DNRPrefs;
import ru.vtosters.lite.utils.Helper;
public class DoNotReadDBHelper extends SQLiteOpenHelper {
public DoNotReadDBHelper() {
super(Helper.GetContext(), "dnr", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dnr (peerId integer primary key, enabled integer)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public boolean isEnabledForPeerId(int peerId) {
try (Cursor c = getReadableDatabase().query("dnr", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
int enabledIndex = c.getColumnIndex("enabled");
do {
if (c.getInt(peerIdIndex) == peerId)
return c.getInt(enabledIndex) == 1;
} while (c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
}
return DNRPrefs.getMarkAsReadWithoutExceptions(peerId);
}
public List<Integer> get() {
ArrayList<Integer> rs = new ArrayList<>();
try (Cursor c = getReadableDatabase().query("dnr", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
int enabledIndex = c.getColumnIndex("enabled");
do {
if (c.getInt(enabledIndex) == 1) {
rs.add(c.getInt(peerIdIndex));
}
} while (c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
}
return rs;
}
public void setEnabledForPeerId(int peerId, boolean enabled) {
ContentValues cv = new ContentValues();
cv.put("enabled", enabled ? 1 : 0);
int i = getWritableDatabase().update("dnr", cv, "peerId = " + peerId, null);
if (i == 0) {
cv.put("peerId", peerId);
getWritableDatabase().insert("dnr", null, cv);
}
}
}
@@ -0,0 +1,78 @@
package ru.vtosters.lite.dnr.helpers;
import android.content.ContentValues;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import java.util.ArrayList;
import java.util.List;
import ru.vtosters.lite.dnr.DNRPrefs;
import ru.vtosters.lite.utils.Helper;
public class DoNotTypeDBHelper extends SQLiteOpenHelper {
public DoNotTypeDBHelper() {
super(Helper.GetContext(), "dnt", null, 1);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL("create table dnt (peerId integer primary key, enabled integer)");
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
public List<Integer> get() {
ArrayList<Integer> rs = new ArrayList<>();
try (Cursor c = getReadableDatabase().query("dnt", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
int enabledIndex = c.getColumnIndex("enabled");
do {
if (c.getInt(enabledIndex) == 1) {
rs.add(c.getInt(peerIdIndex));
}
} while (c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
}
return rs;
}
public boolean isEnabledForPeerId(int peerId) {
try (Cursor c = getReadableDatabase().query("dnt", null, null, null, null, null, null)) {
if (c.moveToFirst()) {
int peerIdIndex = c.getColumnIndex("peerId");
int enabledIndex = c.getColumnIndex("enabled");
do {
if (c.getInt(peerIdIndex) == peerId)
return c.getInt(enabledIndex) == 1;
} while (c.moveToNext());
}
} catch (Exception e) {
e.printStackTrace();
}
return DNRPrefs.getActivityWithoutExceptions(peerId);
}
public void setEnabledForPeerId(int peerId, boolean enabled) {
ContentValues cv = new ContentValues();
cv.put("enabled", enabled ? 1 : 0);
int i = getWritableDatabase().update("dnt", cv, "peerId = " + peerId, null);
if (i == 0) {
cv.put("peerId", peerId);
getWritableDatabase().insert("dnt", null, cv);
}
}
}
@@ -0,0 +1,74 @@
package ru.vtosters.lite.downloaders;
import android.app.AlertDialog;
import android.app.DownloadManager;
import android.content.Context;
import android.net.Uri;
import android.os.Environment;
import com.vk.core.util.ToastUtils;
import com.vk.dto.common.VideoFile;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import ru.vtosters.lite.R;
public class VideoDownloader {
public static void downloadVideo(VideoFile videoFile, Context context) {
final List<String> list = new ArrayList<>();
final List<String> urls = new ArrayList<>();
if (!Objects.equals(videoFile.e, "")) {
list.add("240p");
urls.add(videoFile.e);
}
if (!Objects.equals(videoFile.f, "")) {
list.add("360p");
urls.add(videoFile.f);
}
if (!Objects.equals(videoFile.g, "")) {
list.add("480p");
urls.add(videoFile.g);
}
if (!Objects.equals(videoFile.h, "")) {
list.add("720p");
urls.add(videoFile.h);
}
if (!Objects.equals(videoFile.i, "")) {
list.add("1080p");
urls.add(videoFile.i);
}
if (!Objects.equals(videoFile.j, "")) {
list.add("1440p");
urls.add(videoFile.j);
}
if (!Objects.equals(videoFile.k, "")) {
list.add("2160p");
urls.add(videoFile.k);
}
if (list.isEmpty()) {
ToastUtils.a("Данное видео невозможно скачать");
return;
}
var max = new String[list.size()];
for (int i = 0; i < list.size(); i++) {
max[i] = list.get(i);
}
var builder = new AlertDialog.Builder(context);
builder.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.setDestinationInExternalPublicDir(Environment.DIRECTORY_MOVIES, videoFile.s + ".mp4");
((DownloadManager) context.getSystemService(Context.DOWNLOAD_SERVICE)).enqueue(request);
}));
builder.show();
}
}
@@ -0,0 +1,95 @@
package ru.vtosters.lite.f0x1d;
import android.app.Activity;
import android.app.Notification;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import com.vtosters.lite.R;
import java.io.PrintWriter;
import java.io.StringWriter;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.badmanners.DeviceInfoCollector;
import ru.vtosters.lite.utils.Prefs;
public class Crashreporter {
protected static String logString;
public static String getStackTrace(Throwable th) {
StringWriter stringWriter = new StringWriter();
th.printStackTrace(new PrintWriter(stringWriter));
return stringWriter.toString();
}
public static void init(Activity activity) {
final var defaultUncaughtExceptionHandler = Thread.getDefaultUncaughtExceptionHandler();
Thread.setDefaultUncaughtExceptionHandler((thread, th) -> Crashreporter.start(defaultUncaughtExceptionHandler, thread, th, activity));
}
static void start(Thread.UncaughtExceptionHandler uncaughtExceptionHandler, Thread thread, Throwable th, Activity activity) {
logString = getStackTrace(th) + "\n\n" + new DeviceInfoCollector().collect(Helper.GetContext()).toDeviceName() + "\n VTL Version: " + Prefs.VERSIONNAME + ", build: " + Prefs.getBuildNumber();
if (Build.VERSION.SDK_INT >= 26) {
var notificationChannel = new NotificationChannel("crashes", "crash", NotificationManager.IMPORTANCE_DEFAULT);
notificationChannel.enableVibration(true);
notificationChannel.enableLights(true);
((NotificationManager) Helper.GetContext().getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(notificationChannel);
}
var foxbinIntent = new Intent("com.f0x1d.dogbin.ACTION_UPLOAD_TO_FOXBIN");
foxbinIntent.putExtra("android.intent.extra.TEXT", logString);
foxbinIntent.setType("text/plain");
if (!isFoxbinInstalled()) {
foxbinIntent = new Intent("android.intent.action.VIEW");
foxbinIntent.setData(Uri.parse("https://play.google.com/store/apps/details?id=com.f0x1d.dogbin"));
foxbinIntent.addFlags(Intent.FLAG_ACTIVITY_NO_USER_ACTION);
}
var saveLogIntent = new Intent(Helper.GetContext(), LogWriterService.class);
saveLogIntent.putExtra("log", logString);
saveLogIntent.putExtra("notificationId", 1);
var psaveLogIntent = PendingIntent.getService(Helper.GetContext(), 0, saveLogIntent, PendingIntent.FLAG_CANCEL_CURRENT);
var builder = new Notification.Builder(Helper.GetContext());
builder.setSmallIcon(R.drawable.ic_bug_24);
builder.setContentTitle("VTL Крашнулся!");
builder.setContentText(logString);
builder.setStyle(new Notification.BigTextStyle().bigText(logString));
builder.setAutoCancel(true);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT_WATCH) {
builder.addAction(new Notification.Action(0, "Загрузить логи", PendingIntent.getActivity(Helper.GetContext(), (int) (Math.random() * 100.0d), foxbinIntent, PendingIntent.FLAG_CANCEL_CURRENT)));
builder.addAction(new Notification.Action(0, "Сохранить в файл", psaveLogIntent));
} else {
builder.setContentIntent(PendingIntent.getActivity(activity, 0, foxbinIntent, PendingIntent.FLAG_ONE_SHOT));
}
if (Build.VERSION.SDK_INT >= 26) {
builder.setChannelId("crashes");
}
((NotificationManager) Helper.GetContext().getSystemService(Context.NOTIFICATION_SERVICE)).notify(-2147483548, builder.build());
Log.e("VTosters Lite", "crashed: " + th.getLocalizedMessage());
uncaughtExceptionHandler.uncaughtException(thread, th);
}
private static boolean isFoxbinInstalled() {
var pm = Helper.GetContext().getPackageManager();
try {
pm.getPackageInfo("com.f0x1d.dogbin", 0);
return true;
} catch (Exception e) {
return false;
}
}
}
@@ -0,0 +1,65 @@
package ru.vtosters.lite.f0x1d;
import android.app.NotificationManager;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Environment;
import android.os.IBinder;
import android.util.Log;
import android.widget.Toast;
import androidx.annotation.Nullable;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import ru.vtosters.lite.utils.Helper;
public class LogWriterService extends Service {
public LogWriterService() {
}
@Override
public int onStartCommand(Intent intent, int flags, int startId) {
super.onStartCommand(intent, flags, startId);
Log.d("LogWriterService", "The service has been started");
var file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS) + "/VTL_log.txt");
try {
var exists = file.createNewFile();
if (!exists) {
file.delete();
file.createNewFile();
}
writeLog(intent, file);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(Helper.GetContext(), "Не удалось сохранить лог-файл", Toast.LENGTH_SHORT).show();
}
var notificationId = intent.getIntExtra("notificationId", 1);
var manager = (NotificationManager) Helper.GetContext().getSystemService(Context.NOTIFICATION_SERVICE);
manager.cancel(notificationId);
Toast.makeText(Helper.GetContext(), "Лог-файл был сохранен", Toast.LENGTH_SHORT).show();
stopSelf();
return START_NOT_STICKY;
}
private void writeLog(Intent intent, File file) throws IOException {
FileOutputStream stream;
stream = new FileOutputStream(file);
stream.write(intent.getStringExtra("log").getBytes(StandardCharsets.UTF_8));
stream.flush();
stream.close();
}
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
}
@@ -0,0 +1,171 @@
package ru.vtosters.lite.f0x1d;
import android.content.Context;
import android.content.SharedPreferences;
import android.util.Base64;
import android.util.Log;
import android.widget.Toast;
import com.vk.dto.common.VerifyInfo;
import com.vk.navigation.NavigatorKeys;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import org.json.JSONArray;
import org.json.JSONObject;
import okhttp3.Call;
import okhttp3.Callback;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
import ru.vtosters.lite.utils.Prefs;
public class VTVerifications {
private static final String TAG = "VTVerifications";
private static final String DEVELOPERS_KEY = "VTNRS3";
private static final String PROMETHEUS_KEY = "VTNRS1";
private static final String SERVICE_ACCOUNTS_KEY = "VTNRS4";
private static final String VERIFICATIONS_KEY = "VTNRS0";
private static SharedPreferences mVerificationsCache;
private static final HashMap<Integer, Boolean> sDevelopersMap = new HashMap<>();
private static final HashMap<Integer, Boolean> sPrometheusMap = new HashMap<>();
public static final HashMap<Integer, Boolean> sServiceAccountsMap = new HashMap<>();
private static final HashMap<Integer, Boolean> sVerificationsMap = new HashMap<>();
private static OkHttpClient client = new OkHttpClient();
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);
processArray(new JSONArray(getLoaded(DEVELOPERS_KEY)), sDevelopersMap, null);
processArray(new JSONArray(getLoaded(SERVICE_ACCOUNTS_KEY)), sServiceAccountsMap, null);
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(context, e.getLocalizedMessage(), Toast.LENGTH_SHORT).show();
}
Request request = new Request.Builder()
.url("https://gdlbo.net/vktoaster/getGalo4kiBatch")
.a(RequestBody.a(MediaType.b("application/json; charset=UTF-8"), "{\"types\":[0,228,404,1337]}"))
.build();
client.newCall(request).a(new Callback() {
@Override
public void a(Call call, IOException e) {
Log.d(TAG, "" + e);
}
@Override
public void a(Call call, Response response) throws IOException {
try {
getVerifications(response.body().string());
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
private static void getVerifications(String body) throws Exception {
JSONObject jSONObject = new JSONObject(body);
processArray(jSONObject.optJSONArray("0"), sVerificationsMap, VERIFICATIONS_KEY);
processArray(jSONObject.optJSONArray("228"), sPrometheusMap, PROMETHEUS_KEY);
processArray(jSONObject.optJSONArray("404"), sDevelopersMap, DEVELOPERS_KEY);
processArray(jSONObject.optJSONArray("1337"), sServiceAccountsMap, SERVICE_ACCOUNTS_KEY);
}
private static void processArray(JSONArray jSONArray, Map<Integer, Boolean> map, String str) {
if (jSONArray != null) {
for (int i = 0; i < jSONArray.length(); i++) {
map.put(Integer.valueOf(jSONArray.optInt(i)), true);
}
if (str != null) {
setLoaded(str, jSONArray.toString());
}
}
}
public static boolean isVerified(int i) {
return sVerificationsMap.get(i) != null ? sVerificationsMap.get(i) : false;
}
public static boolean isVerifiedMSG(int i) {
return sVerificationsMap.get(i) != null ? sVerificationsMap.get(i) : false;
}
public static boolean hasPrometheus(int i) {
return sPrometheusMap.get(i) != null ? sPrometheusMap.get(i) : false;
}
public static boolean isDeveloper(int i) {
return sDevelopersMap.get(i) != null ? sDevelopersMap.get(i) : false;
}
public static boolean isServiceAccount(int i) {
return sServiceAccountsMap.get(i) != null ? sServiceAccountsMap.get(i) : false;
}
private static String getLoaded(String str) {
return decode(mVerificationsCache.getString(str, encode("[]")));
}
public static void setLoaded(String str, String str2) {
mVerificationsCache.edit().putString(str, encode(str2)).apply();
}
public static String decode(String str) {
return new String(Base64.decode(str, 1), StandardCharsets.UTF_8);
}
public static String encode(String str) {
return Base64.encodeToString(str.getBytes(), 1);
}
public static boolean isVerified(JSONObject jSONObject) {
if (jSONObject.optInt("verified", 0) == 1) {
return true;
}
if (!Prefs.BooleanTrue("VT_Verification")) {
return false;
}
if (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))) {
return true;
}
return false;
}
public static boolean hasPrometheus(JSONObject jSONObject) {
if (jSONObject.optInt("trending", 0) == 1) {
return true;
}
if (!Prefs.BooleanTrue("VT_Fire")) {
return false;
}
if (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))) {
return true;
}
return false;
}
public static boolean hasDeveloper(JSONObject jSONObject) {
if (!Prefs.BooleanTrue("VT_Dev")) {
return false;
}
return isDeveloper((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
}
public static VerifyInfo VerifyInfo(JSONObject jSONObject) {
return new VerifyInfo(isVerified(jSONObject), hasPrometheus(jSONObject));
}
}
@@ -0,0 +1,105 @@
package ru.vtosters.lite.foaf;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.support.v7.app.AlertDialog;
import android.widget.Toast;
import androidx.exifinterface.media.ExifInterface;
import com.vk.core.dialogs.alert.VkAlertDialog;
import java.io.IOException;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Locale;
import java.util.concurrent.TimeUnit;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import ru.f0x1d.net.F0x1dRequest;
import com.vtosters.lite.R;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Prefs;
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 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());
if (!matcher.find()) {
return 0;
}
return (int) (new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss", Locale.getDefault()).parse(matcher.group(1)).getTime() / 1000);
}
public static long GetLastSeenLong(int i) throws ParseException, IOException {
return GetLastSeenInt(i);
}
private static String getLink(int i) {
String str;
StringBuilder sb;
if (Prefs.proxy()) {
sb = new StringBuilder();
str = "https://vk-api-proxy.xtrafrancyz.net/_/vk.com/foaf.php?id=";
} else {
sb = new StringBuilder();
str = "https://vk.com/foaf.php?id=";
}
sb.append(str);
sb.append(i);
return sb.toString();
}
public static void loadAndShow(Context context, int i) {
ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setMessage("Загрузка...");
progressDialog.setCancelable(false);
progressDialog.show();
F0x1dRequest.F0x1dRequestCallback callback = str -> FoafBase.lambdaLoadAndShow(progressDialog, context, i, str);
F0x1dRequest.makeRequest(getLink(i), callback);
}
static /* synthetic */ void lambdaLoadAndShow(ProgressDialog progressDialog, Context context, int i, String str) {
try {
progressDialog.cancel();
Matcher matcher = FOAF_REGEX.matcher(str);
Matcher matcher2 = FOAF_REGEX_LOGIN.matcher(str);
matcher.find();
matcher2.find();
String normalHumanDate = getNormalHumanDate(matcher.group(1));
getNormalHumanDate(matcher2.group(1));
AlertDialog.a a2 = new VkAlertDialog.a(context).a(R.string.addinf);
a2.b(Helper.getString("foafid") + " " + i + Helper.getString("foafregdate") + " " + normalHumanDate + Helper.getString("foafdate") + " " + daysPassedFromFoafDate(normalHumanDate)).b(17039370, (DialogInterface.OnClickListener) null).b().show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(context, Helper.getString("foaferr"), Toast.LENGTH_SHORT).show();
}
}
private static long daysPassedFromFoafDate(String str) {
try {
Date parse = new SimpleDateFormat("yyyy-MM-dd").parse(str.split(" ")[1]);
return TimeUnit.DAYS.convert(new Date().getTime() - parse.getTime(), TimeUnit.MILLISECONDS);
} catch (ParseException e) {
e.printStackTrace();
return -1;
}
}
private static String getNormalHumanDate(String str) {
String[] split = str.split(ExifInterface.GPS_DIRECTION_TRUE);
return split[1].split("\\+")[0] + " " + split[0];
}
}
@@ -0,0 +1,7 @@
package ru.vtosters.lite.provider;
import android.support.v4.content.FileProvider;
/* compiled from: VKFileProvider.kt */
public final class VKFileProvider extends FileProvider {
}
@@ -0,0 +1,72 @@
package ru.vtosters.lite.tgs;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;
import ru.vtosters.lite.utils.Helper;
public class TGPref {
private static SharedPreferences Prefs = PreferenceManager.getDefaultSharedPreferences(Helper.GetContext());
private static String
CNCT_METHOD = "VTGS:CM",
TG_BOTKEY = "VTGS:BKey",
TG_PROXYIP = "VTGS:PIP",
TG_PROXYPORT = "VTGS:PPT",
TG_PROXYPASS = "VTGS:PPS",
TG_PROXYUSER = "VTGS:PUS",
TG_PROXYUSEPASS = "VTGS:PUsePassword";
public static int getTGConnectMethod() {
return Integer.parseInt(Prefs.getString(CNCT_METHOD, "0"));
}
public static void setTGConnectMethod(int method) {
Prefs.edit().putString(CNCT_METHOD, String.valueOf(method)).apply();
}
public static String getTGBotKey() {
return Prefs.getString(TG_BOTKEY, null);
}
public static void setTGBotKey(String key) {
Prefs.edit().putString(TG_BOTKEY, key).apply();
}
public static String getTGProxyIP() {
return Prefs.getString(TG_PROXYIP, null);
}
public static int getTGProxyPort() {
return Prefs.getInt(TG_PROXYPORT, 0);
}
public static void setTGProxyPort(int port) {
Prefs.edit().putInt(TG_PROXYPORT, port).apply();
}
public static String getTGProxyPass() {
return Prefs.getString(TG_PROXYPASS, "");
}
public static String getTGProxyUser() {
return Prefs.getString(TG_PROXYUSER, "");
}
public static void setTGProxyIP(String ip) {
Prefs.edit().putString(TG_PROXYIP, ip).apply();
}
public static void setTGProxyUserPass(String user, String pass) {
Prefs.edit().putString(TG_PROXYUSER, user).putString(TG_PROXYPASS, pass)
.apply();
}
public static boolean isTGProxyPassEnabled() {
return Prefs.getBoolean(TG_PROXYUSEPASS, false);
}
public static void setTGProxyPassEnabled(boolean en) {
Prefs.edit().putBoolean(TG_PROXYUSEPASS, en).apply();
}
}
@@ -0,0 +1,155 @@
package ru.vtosters.lite.tgs;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;
import com.aefyr.tsg.g2.TelegramStickersPack;
import com.aefyr.tsg.g2.TelegramStickersService;
import com.vk.dto.common.Attachment;
import com.vk.dto.stickers.StickerItem;
import com.vk.dto.stickers.StickerStockItem;
import com.vk.im.engine.models.attaches.Attach;
import com.vtosters.lite.attachments.PendingGraffitiAttachment;
import com.vtosters.lite.im.AppAttachToImAttachConverter;
import com.vtosters.lite.upload.Upload;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import java.util.List;
import java.util.Stack;
import ru.vtosters.lite.utils.Helper;
public class TGRoot {
private final static Stack<Integer> pendingStickers = new Stack<>();
public static final int N = 76820000;
public static final int X = 976820000;
private static String TAG = "TGRoot";
public static String getSummary() {
switch (TGPref.getTGConnectMethod()) {
case 0:
return Helper.getString("ctypedirect");
case 2:
return Helper.getString("ctypesocks");
default:
return Helper.getString("ctypedisabled");
}
}
public static Attachment processSticker(StickerItem item) {
int id = item.b();
if (id < N) return null;
int index = (id - N) / 120;
int stickerId = (id - N) % 120;
TelegramStickersPack pack = null;
for (TelegramStickersPack p : TelegramStickersService.getInstance(Helper.GetContext()).getActivePacksListReference()) {
if (p.index == index) {
pack = p;
break;
}
}
String image = pack.getStickerFile(stickerId).getAbsolutePath();
Bitmap bm = BitmapFactory.decodeFile(image);
int upid = Upload.a();
pendingStickers.push(upid);
Attachment att = new PendingGraffitiAttachment(upid, 0, image, bm.getWidth(), bm.getHeight(), null);
bm.recycle();
return att;
}
public static void injectStickers(List<StickerStockItem> list) {
try {
List<TelegramStickersPack> packs = TelegramStickersService.getInstance(Helper.GetContext()).getActivePacksListReference();
for (int i = packs.size() - 1; i >= 0; i--)
list.add(0, toStickerPack(packs.get(i)));
} catch (Exception e) {
e.printStackTrace();
}
}
public static StickerStockItem getPackBySticker(int stickerId) {
if (stickerId < N) return null;
int index = (stickerId - N) / 120;
TelegramStickersPack p = null;
for (TelegramStickersPack p_ : TelegramStickersService.getInstance(Helper.GetContext())
.getActivePacksListReference()) {
if (p_.index == index) {
p = p_;
break;
}
}
if (p == null) return null;
try {
return toStickerPack(p);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
private static StickerStockItem toStickerPack(TelegramStickersPack p) throws JSONException {
JSONArray arr = new JSONArray();
for (int j = 0; j < p.stickersCount; j++)
arr.put(new JSONObject().put("sticker_id", N + p.index * 120 + j)
.put("images", new JSONArray()
.put(new JSONObject()
.put("width", 512)
.put("height", 512)
.put("url", "file://" + p.getStickerFile(j).getAbsolutePath())))
.put("images_with_background", new JSONArray()
.put(new JSONObject()
.put("width", 512)
.put("height", 512)
.put("url", "file://" + p.getStickerFile(j).getAbsolutePath())))
);
String photo = "file://" + p.getStickerFile(0).getAbsolutePath();
return StickerStockItem.a(new JSONObject()
.put("product", new JSONObject()
.put("id", X + p.index)
.put("type", "stickers")
.put("title", p.title)
.put("purchased", 1)
.put("active", 1)
.put("promoted", 0)
.put("previews", new JSONArray()
.put(new JSONObject()
.put("url", photo)
.put("width", 102)
.put("height", 102)
))
.put("stickers", arr))
.put("free", 1)
.put("can_purchase", 1)
.put("new", 1)
.put("photo_35", photo)
.put("photo_70", photo)
.put("photo_140", photo)
.put("photo_296", photo)
.put("photo_592", photo), X + p.index);
}
public static Attach modifyStickerIM(int i, StickerItem stickerItem, String str) {
if (stickerItem.b() < 76820000) {
return AppAttachToImAttachConverter.a.a(i, stickerItem, str);
}
return AppAttachToImAttachConverter.a.a(processSticker(stickerItem));
}
}
@@ -0,0 +1,195 @@
package ru.vtosters.lite.ui;
import android.app.AlertDialog;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.PorterDuff;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.preference.PreferenceManager;
import android.support.v7.preference.ListPreference;
import android.support.v7.preference.Preference;
import android.support.v7.preference.PreferenceCategory;
import android.util.TypedValue;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.LinearLayout;
import androidx.annotation.Nullable;
import androidx.core.content.ContextCompat;
import androidx.core.view.ViewCompat;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
import com.vtosters.lite.ui.MaterialSwitchPreference;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Themes;
public class PreferencesUtil {
public interface EditTextPrefChangeListener {
boolean onChanged(Preference preference, Object obj);
}
public static Drawable setTint(Context ctx, Drawable d) {
d.setColorFilter(Themes.getAccentColor(), PorterDuff.Mode.SRC_ATOP);
return d;
}
public static void addListPreference(MaterialPreferenceToolbarFragment fragment, String key, String def, CharSequence title, CharSequence[] entries, CharSequence[] entriesValue) {
ListPreference preference = new ListPreference(Helper.GetContext());
preference.a(entries);
preference.b(entriesValue);
preference.c(title); // setTitle
preference.a(title); // setDialogTitle
preference.d(key); // setKey
preference.b(def); // setDefaultValue
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(Helper.GetContext());
materialSwitchPreference.c(title); // setTitle
materialSwitchPreference.b(summary); // setSummary
materialSwitchPreference.d(key); // setKey
materialSwitchPreference.b(Boolean.valueOf(defValue)); // setDefaultValue
materialPreferenceToolbarFragment.ay().d(materialSwitchPreference); // materialPreferenceToolbarFragment.getPreferenceScreen().addPreference(preference)
}
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, int icon, boolean defValue, Preference.b listener) {
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(Helper.GetContext());
materialSwitchPreference.c(title); // setTitle
materialSwitchPreference.b(summary); // setSummary
materialSwitchPreference.d(key); // setKey
materialSwitchPreference.b(Boolean.valueOf(defValue)); // setDefaultValue
materialSwitchPreference.a(listener); // setOnPreferenceClickListener
if (icon != 1)
materialSwitchPreference.a(setTint(Helper.GetContext(), ContextCompat.getDrawable(Helper.GetContext(), icon))); // preference.setIcon
fragment.ay().d(materialSwitchPreference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addMaterialSwitchPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, String icon, boolean defValue, Preference.b listener) {
MaterialSwitchPreference materialSwitchPreference = new MaterialSwitchPreference(Helper.GetContext());
materialSwitchPreference.c(title); // setTitle
materialSwitchPreference.b(summary); // setSummary
materialSwitchPreference.d(key); // setKey
materialSwitchPreference.b(Boolean.valueOf(defValue)); // setDefaultValue
fragment.ay().d(materialSwitchPreference); // materialPreferenceToolbarFragment.getPreferenceScreen().addPreference(preference)
if (icon != null)
materialSwitchPreference.a(setTint(Helper.GetContext(), getDrawable(Helper.GetContext(), icon))); // preference.setIcon
materialSwitchPreference.a(listener); // setOnPreferenceClickListener(listener)
fragment.ay().d(materialSwitchPreference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary) {
Preference preference = new Preference(Helper.GetContext());
preference.b(summary); // setSummary
preference.c(title); // setTitle
preference.d(key); // setKey
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreference(MaterialPreferenceToolbarFragment fragment, CharSequence title, CharSequence summary, @Nullable String icon, Preference.c listener) {
Preference preference = new Preference(Helper.GetContext());
preference.b(summary); // setSummary
preference.c(title); // setTitle
if (icon != null)
preference.a(setTint(Helper.GetContext(), getDrawable(Helper.GetContext(), icon))); // preference.setIcon
preference.a(listener); // preference.setOnPreferenceClickListener(listener)
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, CharSequence summary, @Nullable String icon, Preference.c listener) {
Preference preference = new Preference(Helper.GetContext());
preference.b(summary); // setSummary
preference.c(title); // setTitle
preference.d(key); // setKey
if (icon != null)
preference.a(setTint(Helper.GetContext(), getDrawable(Helper.GetContext(), icon))); // preference.setIcon
preference.a(listener); // preference.setOnPreferenceClickListener(listener)
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreferenceCategory(MaterialPreferenceToolbarFragment fragment, CharSequence title) {
PreferenceCategory preference = new PreferenceCategory(Helper.GetContext(), null);
preference.c(title); // setTitle
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addPreferenceCategory(MaterialPreferenceToolbarFragment fragment, CharSequence title, int collapsedSize) {
PreferenceCategory preference = new PreferenceCategory(Helper.GetContext(), null);
preference.c(title); // setTitle
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static void addEditTextPreference(MaterialPreferenceToolbarFragment fragment, String key, CharSequence title, EditTextPrefChangeListener editTextPrefChangeListener) {
Preference preference = new Preference(Helper.GetContext());
preference.c(title); // setTitle
preference.d(key); // setKey
preference.a(preference1 -> {
LinearLayout linearLayout = new LinearLayout(Helper.GetContext());
final EditText editText = new EditText(Helper.GetContext());
editText.setText(PreferenceManager.getDefaultSharedPreferences(Helper.GetContext()).getString(key, ""));
editText.setHint(title);
editText.setHintTextColor(PreferencesUtil.getSTextColor(Helper.GetContext()));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(Helper.GetContext())));
} else {
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(Helper.GetContext())));
}
linearLayout.addView(editText);
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) editText.getLayoutParams());
margin.setMargins(Helper.convertDpToPixel(24f), 0, Helper.convertDpToPixel(24f), 0);
editText.setLayoutParams(margin);
AlertDialog.Builder builder = new AlertDialog.Builder(fragment.p());
builder.setTitle(title);
builder.setView(linearLayout);
builder.setPositiveButton("OK", (dialog, which) -> {
boolean change = editTextPrefChangeListener.onChanged(preference, editText.getText().toString());
if (!change)
return;
PreferenceManager.getDefaultSharedPreferences(Helper.GetContext())
.edit()
.putString(key, editText.getText().toString())
.apply();
});
builder.show();
return false;
}); // preference.setOnPreferenceClickListener(listener)
fragment.ay().d(preference); // fragment.getPreferenceScreen().addPreference(preference)
}
public static int getTextColor(Context ctx) {
TypedValue typedValue = new TypedValue();
ctx.getTheme().resolveAttribute(Themes.getTextAttr(), typedValue, true);
return typedValue.data;
}
public static int getSTextColor(Context ctx) {
TypedValue typedValue = new TypedValue();
ctx.getTheme().resolveAttribute(Themes.getSTextAttr(), typedValue, true);
return typedValue.data;
}
private static Drawable getDrawable(Context ctx, String name) {
var id = ctx.getResources().getIdentifier(name, "drawable", ctx.getPackageName());
return ContextCompat.getDrawable(ctx, id);
}
}
@@ -0,0 +1,46 @@
package ru.vtosters.lite.ui.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.PowerManager;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.OEMDetector;
import ru.vtosters.lite.utils.Prefs;
public class DisableBattery {
public static void alert(Activity activity) {
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && Prefs.BooleanTrue("showDoze")) {
final Context context = Helper.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.setCancelable(false);
builder.setPositiveButton("Отключить оптимизацию", 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");
StringBuilder sb = new StringBuilder();
sb.append("package:");
sb.append(context.getPackageName());
intent.setData(Uri.parse(sb.toString()));
context.startActivity(intent);
}
});
builder.setNeutralButton("Игнорировать", new DialogInterface.OnClickListener() {
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
Helper.edit().putBoolean("showDoze", false).apply();
}
});
builder.show();
}
}
}
}
@@ -0,0 +1,48 @@
package ru.vtosters.lite.ui.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import com.vk.navigation.Navigator;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.Prefs;
import ru.vtosters.lite.ui.fragments.InstallGMSFragment;
public class InstallGMS {
public static void alert(final Activity activity) {
if (!Helper.IsGmsInstalled()) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setMessage(Text());
builder.setCancelable(false);
builder.setPositiveButton("Продолжить без GMS", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Helper.edit().putBoolean("showAlertGms", false).apply();
}
});
builder.setNeutralButton("Установить GMS", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialogInterface, int i) {
Helper.edit().putBoolean("showAlertGms", false).apply();
Context context = Helper.GetContext();
Intent a2 = new Navigator(InstallGMSFragment.class).a(context);
context.startActivity(a2);
}
});
if (Prefs.BooleanTrue("showAlertGms")) {
builder.show();
}
}
}
private static String Text() {
return "На вашем устройстве отсутствует компонент Google Play Services (GMS), который необходим для корректной работы VTosters Lite";
}
}
@@ -0,0 +1,51 @@
package ru.vtosters.lite.ui.dialogs;
import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.OEMDetector;
import ru.vtosters.lite.utils.Prefs;
public class Start {
public static void alert(final Activity activity) {
if (Build.VERSION.SDK_INT >= 23) {
activity.requestPermissions(new String[]{"android.permission.WRITE_EXTERNAL_STORAGE"}, 228);
}
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
builder.setTitle("Внимание!");
builder.setMessage(getWelcome());
builder.setCancelable(false);
builder.setPositiveButton("Продолжить", new DialogInterface.OnClickListener() {
/* class ru.vtosters.lite.utils.lite.dialog.Start.AnonymousClass1 */
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
Helper.edit().putBoolean("showAlert", false).apply();
}
});
builder.setNeutralButton("Новости", new DialogInterface.OnClickListener() {
/* class ru.vtosters.lite.utils.lite.dialog.Start.AnonymousClass2 */
@Override // android.content.DialogInterface.OnClickListener
public void onClick(DialogInterface dialogInterface, int i) {
Helper.edit().putBoolean("showAlert", false).apply();
activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/vtosters")));
}
});
if (Prefs.BooleanTrue("showAlert")) {
builder.show();
}
}
private static String getWelcome() {
if (!OEMDetector.isOEM()) {
return "Модификация VTosters Lite не имеет никакого отношения к VK Group!\nРаспространяется полностью бесплатно!";
}
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";
}
}
@@ -0,0 +1,16 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
import com.vtosters.lite.R;
public class ActivityFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_activity);
}
}
@@ -0,0 +1,15 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
public class FeedFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_feed);
}
}
@@ -0,0 +1,15 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
public class InstallGMSFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_gms);
}
}
@@ -0,0 +1,40 @@
package ru.vtosters.lite.ui.fragments;
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;
/* renamed from: ru.vtosters.lite.utils.lite.ui.activities.interface reason: invalid class name */
public class InterfaceFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_interface);
prefs();
}
/* access modifiers changed from: package-private */
/* renamed from: ru.vtosters.lite.utils.lite.ui.activities.interface$a */
public class a implements Preference.b {
@Override // android.support.v7.preference.Preference.b
public boolean a(Preference preference, Object obj) {
return InterfaceFragment.this.restart(preference, obj);
}
a() {
}
}
private void prefs() {
a("newfeed").a((Preference.b) new a());
}
public /* synthetic */ boolean restart(Preference preference, Object obj) {
ToastUtils.a("Пожалуйста перезапустите приложение");
return true;
}
}
@@ -0,0 +1,15 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
public class MessagesFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_messages);
}
}
@@ -0,0 +1,14 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
public class MusicFragment extends MaterialPreferenceToolbarFragment {
@Override
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_music);
}
}
@@ -0,0 +1,119 @@
package ru.vtosters.lite.ui.fragments;
import android.content.ClipData;
import android.content.ClipboardManager;
import android.content.Context;
import android.os.Bundle;
import android.support.v7.preference.Preference;
import android.widget.Toast;
import com.vk.audio.AudioMessageUtils;
import com.vk.auth.api.VKAccount;
import com.vk.core.f.FileUtils;
import com.vk.core.util.AppContextHolder;
import com.vk.core.util.ToastUtils;
import com.vk.imageloader.VKImageLoader;
import com.vk.pushes.PushSubscriber;
import com.vtosters.lite.R;
import com.vtosters.lite.auth.VKAccountManager;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
import com.vtosters.lite.im.ImEngineProvider;
import ru.vtosters.lite.utils.Helper;
public class OtherFragment extends MaterialPreferenceToolbarFragment {
/* access modifiers changed from: package-private */
static class c implements Preference.c {
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
copy(Helper.GetContext(), Helper.GetUserToken());
return true;
}
public static void copy(Context context, String str) {
((ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("MBH-ST", str));
Toast.makeText(context, Helper.getString("copybtn"), Toast.LENGTH_SHORT).show();
ToastUtils.a(Helper.getString("tokenwarning"));
}
c() {
}
}
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_other);
prefs();
}
/* access modifiers changed from: package-private */
public class e implements Preference.c {
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
VKImageLoader.b();
ImEngineProvider.a().h();
AudioMessageUtils.j();
FileUtils.l();
ToastUtils.a(Helper.getString("cachecleaned"));
return true;
}
e() {
}
}
/* access modifiers changed from: package-private */
public class b implements Preference.c {
b() {
}
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
System.exit(0);
return true;
}
}
/* access modifiers changed from: package-private */
public class d implements Preference.c {
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
Helper.restarting();
return true;
}
d() {
}
}
/* access modifiers changed from: package-private */
public class a implements Preference.c {
a() {
}
@Override // android.support.v7.preference.Preference.c
public boolean a(Preference preference) {
VKAccount b = VKAccountManager.b();
PushSubscriber.a.a(b.b(), b.c());
ToastUtils.a(Helper.getString("fcmtokenrem"));
AppContextHolder.a.getSharedPreferences("gcm", 0).edit().clear().apply();
OtherFragment.this.aB().postDelayed(() -> {
PushSubscriber.a.a(true);
ToastUtils.a(Helper.getString("fcmtokenget"));
ToastUtils.a(Helper.getString("fcmtokenfixed"));
}, 1000);
return true;
}
}
private void prefs() {
a("firebasefix").a((Preference.c) new a());
a("applicationstop").a((Preference.c) new b());
a("tokencopy").a((Preference.c) new c());
a("applicationrestart").a((Preference.c) new d());
a("clearcache").a((Preference.c) new e());
}
}
@@ -0,0 +1,15 @@
package ru.vtosters.lite.ui.fragments;
import android.os.Bundle;
import com.vtosters.lite.R;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
public class ProxySettingsFragment extends MaterialPreferenceToolbarFragment {
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_proxy);
}
}
@@ -0,0 +1,47 @@
package ru.vtosters.lite.ui.fragments;
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;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.utils.IconHelper;
public class ThemesFragment extends MaterialPreferenceToolbarFragment {
/* access modifiers changed from: package-private */
public class a implements Preference.b {
public /* synthetic */ a() {
}
@Override // android.support.v7.preference.Preference.b
public boolean a(Preference preference, Object obj) {
return ThemesFragment.this.apply(preference, obj);
}
}
@Override
// com.vtosters.lite.fragments.MaterialPreferenceFragment, android.support.v4.app.DialogFragment, android.support.v4.app.Fragment
public void b(Bundle bundle) {
super.b(bundle);
a(R.xml.preferences_themes);
prefs();
}
public /* synthetic */ boolean apply(Preference preference, Object obj) {
if (((Boolean) obj).booleanValue()) {
IconHelper.switchToVK();
} else {
IconHelper.switchToDefault();
}
ToastUtils.a(Helper.getString("iconapplying"));
return true;
}
private void prefs() {
a("iconvk").a((Preference.b) new a());
}
}
@@ -0,0 +1,407 @@
package ru.vtosters.lite.ui.fragments.tgstickers;
import android.app.AlertDialog;
import android.app.ProgressDialog;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.res.ColorStateList;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.v7.widget.SwitchCompat;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.widget.Toast;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.core.view.ViewCompat;
import androidx.recyclerview.widget.RecyclerView;
import androidx.recyclerview.widget.StaggeredGridLayoutManager;
import com.aefyr.tsg.g2.TelegramStickersPack;
import com.aefyr.tsg.g2.TelegramStickersService;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
import com.vk.navigation.Navigator;
import com.vtosters.lite.R;
import java.io.File;
import me.grishka.appkit.fragments.ToolbarFragment;
import ru.vtosters.lite.tgs.TGPref;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.ui.PreferencesUtil;
import ru.vtosters.lite.utils.Prefs;
import ru.vtosters.lite.utils.Themes;
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 TelegramStickersGrabber grabber;
private TelegramStickersService stickersService;
private FloatingActionButton fab;
private static final String TAG = "StickersFragment";
@SuppressWarnings("rawtypes")
private RecyclerView.Adapter adapter;
private boolean movePending = false;
public int from;
public int to;
private int editPadding;
private RecyclerView recycler;
private final BroadcastReceiver receiver = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
if (ACTION_RELOAD.equals(intent.getAction())) {
if (adapter != null) {
try {
if (movePending) {
movePending = false;
adapter.notifyItemMoved(from, to);
from = -1;
to = -1;
} else {
adapter.notifyDataSetChanged();
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
};
private void initGrabber() {
int method = TGPref.getTGConnectMethod();
switch (method) {
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
TelegramStickersGrabber.USE_PROXY = false;
grabber.resetProxy();
break;
case TYPE_SOCKS:
if (TGPref.getTGProxyIP() != null) {
TelegramStickersGrabber.USE_PROXY = true;
TelegramStickersGrabber.PROXY_IP = TGPref.getTGProxyIP();
TelegramStickersGrabber.PROXY_PORT = TGPref.getTGProxyPort();
if (TGPref.isTGProxyPassEnabled()) {
TelegramStickersGrabber.HAS_PASS = true;
TelegramStickersGrabber.PROXY_USER = TGPref.getTGProxyUser();
TelegramStickersGrabber.PROXY_PASS = TGPref.getTGProxyPass();
}
grabber.enableProxy();
}
break;
}
TelegramStickersGrabber.updateURLs();
}
private void openMenu(String toast) {
if (toast != null) {
Toast.makeText(super.n(), toast, Toast.LENGTH_SHORT).show();
}
var intent = new Navigator(StickersPreferencesFragment.class, new Bundle()).a(super.n());
super.n().startActivity(intent);
}
@Override
public void a(Menu menu, MenuInflater menuInflater) {
super.a(menu, menuInflater);
MenuItem add = menu.add(0, 0, 0, "");
add.setShowAsAction(MenuItem.SHOW_AS_ACTION_ALWAYS);
add.setIcon(Helper.getResources().getDrawable(com.vtosters.lite.R.drawable.ic_settings_24));
}
@Override
public boolean a_(MenuItem arg0) {
openMenu(null);
return true;
}
private void enterBotKey(Runnable r) {
LinearLayout linearLayout = new LinearLayout(super.n());
final EditText editText = new EditText(super.n());
editText.setHintTextColor(PreferencesUtil.getSTextColor(super.n()));
// Костыль для китката
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(super.n())));
} else {
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(super.n())));
}
linearLayout.addView(editText);
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) editText.getLayoutParams());
margin.setMargins(Helper.convertDpToPixel(24f), 0, Helper.convertDpToPixel(24f), 0);
editText.setLayoutParams(margin);
new AlertDialog.Builder(super.n())
.setTitle(Helper.getString("stickersapi5"))
.setMessage(Helper.getString("stickersapi6"))
.setView(linearLayout)
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
TGPref.setTGBotKey(editText.getText().toString());
if (r != null) r.run();
}).setNegativeButton(android.R.string.cancel, null).setNeutralButton(Helper.getString("stickersapi7"), (dialog, which) -> new AlertDialog.Builder(super.n())
.setTitle(Helper.getString("stickersapi8"))
.setMessage(Helper.getString("stickersapi9") +
Helper.getString("stickersapi10")).setPositiveButton(android.R.string.ok, null)
.create().show()).create().show();
}
private void checkApiKey(final Runnable r) {
grabber.setBotApiKey(TGPref.getTGBotKey());
var context = super.n();
final ProgressDialog progressDialog = new ProgressDialog(context);
progressDialog.setProgressStyle(ProgressDialog.STYLE_SPINNER);
progressDialog.setMessage(Helper.getString("stickersapi1"));
progressDialog.show();
grabber.checkKey(new TelegramStickersGrabber.KeyCheckListener() {
@Override
public void onKeyChecked(boolean ok) {
progressDialog.dismiss();
if (!ok) {
Toast.makeText(context, Helper.getString("stickersapi2"), Toast.LENGTH_SHORT).show();
return;
}
stickersService.setBotKey(TGPref.getTGBotKey());
if (r != null) r.run();
}
@Override
public void onNetError() {
progressDialog.dismiss();
new AlertDialog.Builder(context)
.setMessage(Helper.getString("stickersapi3"))
.setNegativeButton(android.R.string.cancel, null)
.setPositiveButton(Helper.getString("stickersapi4"), (arg0, arg1) -> checkApiKey(r)).create().show();
}
});
}
@SuppressWarnings("rawtypes")
@NonNull
@Override
public View d(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
grabber = new TelegramStickersGrabber(TGPref.getTGBotKey());
stickersService = TelegramStickersService.getInstance(Helper.GetContext());
editPadding = Helper.convertDpToPixel(24f);
FrameLayout v = new FrameLayout(container.getContext());
recycler = new RecyclerView(container.getContext());
recycler.setLayoutParams(new FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, FrameLayout.LayoutParams.MATCH_PARENT));
fab = new FloatingActionButton(container.getContext());
fab.setImageResource(R.drawable.ic_add_24);
fab.setBackgroundTintList(ColorStateList.valueOf(Themes.getAccentColor()));
fab.setOnClickListener(v2 -> fabClick());
FrameLayout.LayoutParams params = new FrameLayout.LayoutParams(FrameLayout.LayoutParams.WRAP_CONTENT, FrameLayout.LayoutParams.WRAP_CONTENT);
params.gravity = Gravity.BOTTOM | Gravity.CENTER_HORIZONTAL;
params.setMargins(0, 0, 0, Helper.convertDpToPixel(12f));
fab.setLayoutParams(params);
v.addView(recycler);
v.addView(fab);
recycler.setLayoutManager(new StaggeredGridLayoutManager(2, StaggeredGridLayoutManager.VERTICAL));
recycler.setAdapter(new StickerPackAdapter());
return v;
}
private void fabClick() {
int method = TGPref.getTGConnectMethod();
Runnable r = () -> {
initGrabber();
switch (method) {
case TYPE_SOCKS:
if (TGPref.getTGProxyIP() == null) {
openMenu(Helper.getString("stickersproxy1"));
return;
}
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
final Runnable work = () -> {
LinearLayout linearLayout = new LinearLayout(super.n());
final EditText editText = new EditText(super.n());
editText.setHintTextColor(PreferencesUtil.getSTextColor(Helper.GetContext()));
// Костыль для китката
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
editText.setBackgroundTintList(ColorStateList.valueOf(PreferencesUtil.getTextColor(Helper.GetContext())));
} else {
ViewCompat.setBackgroundTintList(editText, ColorStateList.valueOf(PreferencesUtil.getTextColor(Helper.GetContext())));
}
linearLayout.addView(editText);
editText.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
ViewGroup.MarginLayoutParams margin = ((ViewGroup.MarginLayoutParams) editText.getLayoutParams());
margin.setMargins(Helper.convertDpToPixel(24f), 0, Helper.convertDpToPixel(24f), 0);
editText.setLayoutParams(margin);
new AlertDialog.Builder(super.n()).setTitle(Helper.getString("stickershelp1"))
.setMessage(Helper.getString("stickershelp2"))
.setView(linearLayout)
.setPositiveButton(android.R.string.ok, (dialog, which) -> {
String pack = editText.getText().toString();
pack = parsePack(pack);
stickersService.requestPackDownload(pack, new File(Helper.GetContext().getFilesDir(), new File("VT-Stickers", pack).getAbsolutePath()));
}).setNeutralButton(android.R.string.cancel, null).create().show();
};
if (TGPref.getTGBotKey() == null) enterBotKey(() -> checkApiKey(work));
else checkApiKey(work);
break;
}
};
if (method == -1) {
openMenu(Helper.getString("stickersconnection"));
} else {
r.run();
}
}
@Override
public void b(@Nullable Bundle savedInstanceState) {
super.b(savedInstanceState);
Helper.GetContext().registerReceiver(receiver, new IntentFilter(ACTION_RELOAD));
}
@Override
public void a(View arg0, Bundle arg1) {
o_(true);
super.a(arg0, arg1);
a(Helper.getString("vtltgs"));
}
@Override
public void A_() {
super.A_();
Helper.GetContext().unregisterReceiver(receiver);
}
private String parsePack(String pack) {
if (pack.startsWith("https://t.me/addstickers/")) {
pack = pack.substring(25);
} else if (pack.startsWith("https://telegram.me/addstickers/")) {
pack = pack.substring(32);
}
return pack;
}
public class StickerPackAdapter extends RecyclerView.Adapter<StickerPackAdapter.StickerPackViewHolder> {
private String TAG = "StickerPackAdapter";
public class StickerPackViewHolder extends RecyclerView.ViewHolder {
private SwitchCompat switchCompat;
private ImageView stickerImage, updateButton, deleteButton;
private TextView name, count;
private LinearLayout layout;
StickerPackViewHolder(@NonNull View view) {
super(view);
switchCompat = (SwitchCompat) view.findViewById(R.id.choose_btn);
stickerImage = (ImageView) view.findViewById(R.id.photo);
updateButton = (ImageView) view.findViewById(R.id.button_update);
deleteButton = (ImageView) view.findViewById(R.id.action_delete);
name = (TextView) view.findViewById(R.id.vkim_cancel);
count = (TextView) view.findViewById(R.id.vkim_cancel_label_text);
layout = (LinearLayout) view.findViewById(R.id.linearLayout5);
}
}
@NonNull
@Override
public StickerPackViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
var view = LayoutInflater.from(parent.getContext()).inflate(Helper.getIdentifier("tgs_entry", "layout"), parent, false);
return new StickerPackViewHolder(view);
}
@Override
public int getItemViewType(int position) {
final TelegramStickersPack pack = stickersService.getPacksListReference().get(position);
return pack.state == TelegramStickersPack.DOWNLOADED ? 0 : 1;
}
@Override
public void onBindViewHolder(@NonNull final StickerPackViewHolder holder, int position) {
final TelegramStickersPack pack = stickersService.getPacksListReference().get(position);
if (pack.state != TelegramStickersPack.DOWNLOADED) return;
File f = new File(pack.folder, "001.png");
try {
if (f.exists()) {
holder.stickerImage.setImageURI(Uri.parse("file://" + f.getAbsolutePath()));
} else {
holder.stickerImage.setImageDrawable(Helper.getResources().getDrawable(R.drawable.icon_vk_104));
}
} catch (Exception e) {
e.printStackTrace();
}
holder.updateButton.setImageDrawable(Themes.recolorDrawable(Helper.getResources().getDrawable(R.drawable.ic_camera_switch_48)));
holder.updateButton.setOnClickListener(listener -> {
stickersService.setBotKey(TGPref.getTGBotKey());
stickersService.requestPackDownload(pack.id, new File(Helper.GetContext().getFilesDir(), new File("VT-Stickers", pack.id).getAbsolutePath()));
});
holder.deleteButton.setImageDrawable(Themes.recolorDrawable(Helper.getResources().getDrawable(R.drawable.vkim_ic_msg_delete)));
holder.deleteButton.setOnClickListener(listener -> {
stickersService.deletePack(pack);
notifyItemRemoved(position);
notifyItemRangeChanged(position, getItemCount());
});
holder.name.setText(pack.title);
holder.switchCompat.setChecked(pack.enabled);
holder.switchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> stickersService.setPackEnabled(pack, isChecked, false));
holder.count.setText(pack.stickersCount + " " + Helper.getString("stickerscount"));
holder.layout.setBackgroundColor(Prefs.getNavbarColor());
// Color костыль
int color = Themes.getTextAttr();
int secondary = Themes.getSTextAttr();
holder.name.setTextColor(color);
holder.count.setTextColor(secondary);
}
@Override
public int getItemCount() {
return stickersService.getPacksListReference().size();
}
}
}
@@ -0,0 +1,89 @@
package ru.vtosters.lite.ui.fragments.tgstickers;
import android.os.Bundle;
import com.aefyr.tsg.g2.stickersgrabber.TelegramStickersGrabber;
import com.vk.core.util.ToastUtils;
import com.vtosters.lite.fragments.MaterialPreferenceToolbarFragment;
import ru.vtosters.lite.tgs.TGPref;
import ru.vtosters.lite.tgs.TGRoot;
import ru.vtosters.lite.utils.Helper;
import ru.vtosters.lite.ui.PreferencesUtil;
public class StickersPreferencesFragment extends MaterialPreferenceToolbarFragment {
@Override
public void b(Bundle bundle) {
super.b(bundle);
int vtosterXml = Helper.GetContext().getResources().getIdentifier("empty", "xml", Helper.GetContext().getPackageName());
this.a(vtosterXml);
PreferencesUtil.addPreferenceCategory(this, Helper.getString("sprefsstickers"));
PreferencesUtil.addPreference(this, "", Helper.getString("sprefsdelkey"), "", null, preference -> {
TGPref.setTGBotKey(null);
ToastUtils.a(Helper.getString("sprefsdelkey2"));
return false;
});
PreferencesUtil.addPreferenceCategory(this, Helper.getString("sprefsnetwork"));
PreferencesUtil.addListPreference(this, "VTGS:CM", "0", Helper.getString("sprefsctype"), new CharSequence[]{
Helper.getString("ctypedirect"), Helper.getString("ctypesocks")
}, new String[]{
"0", "2"
});
a("VTGS:CM").b(TGRoot.getSummary());
a("VTGS:CM").a((preference, o) -> {
String newData = (String) o;
TGPref.setTGConnectMethod(Integer.parseInt(newData));
TelegramStickersGrabber.updateURLs();
preference.b(TGRoot.getSummary()); // setTitle
return true;
});
PreferencesUtil.addPreferenceCategory(this, Helper.getString("ssocks"));
PreferencesUtil.addEditTextPreference(this, "tg_proxy_host", Helper.getString("ssockshost"), (preference, o) -> {
TGPref.setTGProxyIP((String) o);
return true;
});
PreferencesUtil.addEditTextPreference(this, "tg_proxy_port", Helper.getString("ssocksport"), (preference, o) -> {
try {
TGPref.setTGProxyPort(Integer.parseInt((String) o));
return true;
} catch (Exception e) {
ToastUtils.a(Helper.getString("ssockswport"));
return false;
}
});
PreferencesUtil.addMaterialSwitchPreference(this, "tg_proxy_auth", Helper.getString("ssocksauth"), "", null, false, (preference, o) -> {
boolean value = (boolean) o;
a("tg_proxy_login").a(value); // findPreference("tg_proxy_login").setEnabled(value);
a("tg_proxy_pass").a(value); // findPreference("tg_proxy_pass").setEnabled(booleanValue);
TGPref.setTGProxyPassEnabled(value);
return true;
});
PreferencesUtil.addEditTextPreference(this, "tg_proxy_login", Helper.getString("ssockslogin"), (preference, o) -> {
TGPref.setTGProxyUserPass((String) o, TGPref.getTGProxyPass());
return true;
});
PreferencesUtil.addEditTextPreference(this, "tg_proxy_pass", Helper.getString("ssockspass"), (preference, o) -> {
TGPref.setTGProxyUserPass(TGPref.getTGProxyUser(), (String) o);
return true;
});
a("tg_proxy_login").a(TGPref.isTGProxyPassEnabled());
a("tg_proxy_pass").a(TGPref.isTGProxyPassEnabled());
}
@Override
public int aq() {
return Helper.GetContext().getResources().getIdentifier("vtltgs", "string", Helper.GetContext().getPackageName());
}
}
@@ -0,0 +1,55 @@
package ru.vtosters.lite.ui.vkui;
import android.app.Activity;
import android.content.DialogInterface;
import android.view.View;
import com.vk.core.dialogs.bottomsheet.ModalBottomSheet;
import com.vtosters.lite.R;
import ru.vtosters.lite.utils.Helper;
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,155 @@
package ru.vtosters.lite.utils;
import android.app.AlertDialog;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.net.Uri;
import android.os.Build;
import android.util.Log;
import com.vk.dto.common.VideoFile;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class ExternalLinkHandler {
private static final String TAG = "ExternalLinkHandler";
private static final List<String> filters = Arrays.asList(
"youtube.com",
"www.youtube.com",
"youtu.be",
"m.youtube.com"
);
private static final Map<String, String> qualities = new HashMap<>();
public static boolean parseVideoFile(VideoFile file, Context context) {
if (!Prefs.isEnableExternalOpening()) return false;
if (checkYoutubeLink(file)) {
try {
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setData(Uri.parse(file.n));
context.startActivity(intent);
} catch (Exception e) {
e.printStackTrace();
}
} else if (checkVkVideo(file)) {
if (qualities.size() == 1) {
startExternalVideo((String) qualities.values().toArray()[0]);
} else {
String[] titles = qualities.keySet().toArray(new String[0]);
new AlertDialog.Builder(context)
.setItems(titles, ((dialog, which) -> {
startExternalVideo(qualities.get(titles[which]));
}))
.show();
}
}
return true;
}
private static boolean checkYoutubeLink(VideoFile file) {
if (!Helper.isEmpty(file.n)) {
for (String filter : filters) {
if (file.n.contains(filter))
return true;
}
}
return false;
}
/**
* this.e = var3.optString("mp4_240", var3.optString("src"));
* this.f = var3.optString("mp4_360");
* this.g = var3.optString("mp4_480");
* this.h = var3.optString("mp4_720");
* this.i = var3.optString("mp4_1080");
* this.j = var3.optString("mp4_1440");
* this.k = var3.optString("mp4_2160");
*/
public static boolean checkVkVideo(VideoFile videoFile) {
if (!Helper.isEmpty(videoFile.e)) {
qualities.put("240", videoFile.e);
}
if (!Helper.isEmpty(videoFile.f)) {
qualities.put("360", videoFile.f);
}
if (!Helper.isEmpty(videoFile.g)) {
qualities.put("480", videoFile.g);
}
if (!Helper.isEmpty(videoFile.h)) {
qualities.put("720", videoFile.h);
}
if (!Helper.isEmpty(videoFile.i)) {
qualities.put("1080", videoFile.i);
}
if (!Helper.isEmpty(videoFile.j)) {
qualities.put("1440", videoFile.j);
}
if (!Helper.isEmpty(videoFile.k)) {
qualities.put("2160", videoFile.k);
}
return qualities.size() > 0;
}
public static boolean startExternalVideo(String url) {
try {
qualities.clear();
Uri uri = Uri.parse(url);
Intent intent = new Intent();
String packageName = getMXPlayerPackageName();
if (!Helper.isEmpty(packageName)) {
intent.setPackage(packageName);
intent.setDataAndType(uri, "application/mp4");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
} else {
intent.setAction(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
}
Helper.GetContext().startActivity(intent);
return true;
} catch (Exception e) {
e.printStackTrace();
}
return false;
}
private static String getMXPlayerPackageName() {
for (ApplicationInfo info : Helper.GetContext().getPackageManager().getInstalledApplications(0)) {
String packName = info.packageName;
if (packName.equals("com.mxtech.videoplayer.ad") || packName.equals("com.mxtech.videoplayer.pro"))
return packName;
}
return null;
}
}
@@ -0,0 +1,140 @@
package ru.vtosters.lite.utils;
import static android.content.Context.ACTIVITY_SERVICE;
import android.app.Activity;
import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.preference.PreferenceManager;
import android.util.Log;
import androidx.annotation.NonNull;
import androidx.annotation.StringRes;
import com.vk.core.util.ToastUtils;
import com.vtosters.lite.UserProfile;
import com.vtosters.lite.api.ExtendedUserProfile;
import com.vtosters.lite.auth.VKAccountManager;
import com.vtosters.lite.im.ImEngineProvider;
import java.lang.reflect.Method;
import java.util.List;
public class Helper {
public static int GetUserId() {
return VKAccountManager.b().a();
}
public static String GetUserSecret() {
return VKAccountManager.b().c();
}
public static String GetUserToken() {
return VKAccountManager.b().b();
}
public static SharedPreferences.Editor edit() {
return PreferenceManager.getDefaultSharedPreferences(GetContext()).edit();
}
public static String getConnectorDomain(String str) {
return Proxy.GetConnector(str);
}
public static void reloadMSG() {
ImEngineProvider.a().h();
}
public static int getUserID(UserProfile userProfile) {
return userProfile.n;
}
public static String getUserFirstName(UserProfile userProfile) {
return userProfile.p;
}
public static String getUserLastName(UserProfile userProfile) {
return userProfile.o;
}
public static int getUserID(ExtendedUserProfile extendedUserProfile) {
return getUserID(fromEup(extendedUserProfile));
}
public static UserProfile fromEup(ExtendedUserProfile extendedUserProfile) {
return extendedUserProfile.a;
}
public static void restarting() {
GetContext().startActivity(Intent.makeRestartActivityTask(GetContext().getPackageManager().getLaunchIntentForPackage(GetContext().getPackageName()).getComponent()));
Runtime.getRuntime().exit(0);
}
@NonNull
public static Context GetContext() {
try {
Class<?> appGlobalsClazz = Class.forName("android.app.AppGlobals");
Method getInitialApplication = appGlobalsClazz.getDeclaredMethod("getInitialApplication");
getInitialApplication.setAccessible(true);
return (Context) getInitialApplication.invoke(null);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
public static boolean IsGmsInstalled() {
try {
GetContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
return true;
} catch (Exception unused) {
return false;
}
}
public static Resources getResources() {
return GetContext().getResources();
}
public static int getIdentifier(String str, String str2) {
return getResources().getIdentifier(str, str2, GetContext().getPackageName());
}
public static String getString(String str) {
return Helper.GetContext().getString(Integer.parseInt(String.valueOf(Helper.GetContext().getResources().getIdentifier(str, "string", Helper.GetContext().getPackageName()))));
}
public static String getPackageName() {
return GetContext().getPackageName();
}
public static int convertDpToPixel(float f) {
return (int) (f * (((float) GetContext().getResources().getDisplayMetrics().densityDpi) / 160.0f));
}
public static String GetString(@StringRes int res, Object... args) {
return GetContext().getString(res, args);
}
public static SharedPreferences GetPrefs() {
return PreferenceManager.getDefaultSharedPreferences(GetContext());
}
public static SharedPreferences GetPreferences() {
return PreferenceManager.getDefaultSharedPreferences(GetContext());
}
public static void SendToast(String text) {
ToastUtils.a(text);
}
public static boolean isEmpty(String str) {
return str == null || str.isEmpty();
}
}
@@ -0,0 +1,20 @@
package ru.vtosters.lite.utils;
import android.content.ComponentName;
import android.content.pm.PackageManager;
public class IconHelper {
public static void switchToVK() {
var packageManager = Helper.GetContext().getPackageManager();
var packageName = Helper.getPackageName();
packageManager.setComponentEnabledSetting(new ComponentName(packageName, Helper.getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
packageManager.setComponentEnabledSetting(new ComponentName(packageName, Helper.getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
}
public static void switchToDefault() {
var packageManager = Helper.GetContext().getPackageManager();
var packageName = Helper.getPackageName();
packageManager.setComponentEnabledSetting(new ComponentName(packageName, Helper.getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
packageManager.setComponentEnabledSetting(new ComponentName(packageName, Helper.getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
}
@@ -0,0 +1,58 @@
package ru.vtosters.lite.utils;
import android.text.TextUtils;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class OEMDetector {
public static boolean isOEM() {
return isMIUI() || isEMUI() || isFlyme() || isZenUI() || isSamsung() || isVivo();
}
private static boolean isMIUI() {
return !TextUtils.isEmpty(getSystemProperty("ro.miui.ui.version.name"));
}
private static boolean isEMUI() {
return !TextUtils.isEmpty(getSystemProperty("ro.build.hw_emui_api_level"));
}
private static boolean isZenUI() {
return !TextUtils.isEmpty(getSystemProperty("ro.asus.ui"));
}
private static boolean isVivo() {
return !TextUtils.isEmpty(getSystemProperty("ro.vivo.os.version")) || !TextUtils.isEmpty(getSystemProperty("ro.vivo.rom")) || !TextUtils.isEmpty(getSystemProperty("ro.vivo.rom.version")) || !TextUtils.isEmpty(getSystemProperty("ro.vivo.build.version.sdk"));
}
private static boolean isSamsung() {
return !TextUtils.isEmpty(getSystemProperty("ro.config.knox"));
}
private static boolean isFlyme() {
return !TextUtils.isEmpty(getSystemProperty("ro.build.ro.meizu.rom.config")) || !TextUtils.isEmpty(getSystemProperty("persist.sys.static_blur_mode")) || !TextUtils.isEmpty(getSystemProperty("persist.sys.use.flyme.icon"));
}
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;
} catch (IOException ignored) {
}
} catch (Throwable ignored) {
}
return null;
}
}
@@ -0,0 +1,834 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Proxy.setProxy;
import android.app.Activity;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.view.Window;
import com.vk.about.Items;
import com.vk.about.Items1;
import com.vk.about.Items2;
import com.vk.apps.AppsFragment;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vk.core.util.Screen;
import com.vk.discover.DiscoverFragment;
import com.vk.fave.fragments.FaveTabFragment;
import com.vk.menu.MenuFragment;
import com.vk.music.fragment.MusicFragment;
import com.vk.navigation.NavigatorKeys;
import com.vk.newsfeed.Feed2049;
import com.vk.notifications.NotificationsContainerFragment;
import com.vtosters.lite.R;
import com.vtosters.lite.VKActivity;
import com.vtosters.lite.data.Users;
import com.vtosters.lite.fragments.GamesFragment;
import com.vtosters.lite.fragments.PhotosFragment;
import com.vtosters.lite.fragments.ProfileFragment;
import com.vtosters.lite.fragments.SettingsListFragment;
import com.vtosters.lite.fragments.d.DocumentsViewFragment;
import com.vtosters.lite.fragments.f.FriendsFragment;
import com.vtosters.lite.fragments.g.BirthdaysFragment;
import com.vtosters.lite.fragments.h.GroupsFragment;
import com.vtosters.lite.fragments.lives.LivesTabsFragment;
import com.vtosters.lite.fragments.m.VideosFragment;
import com.vtosters.lite.fragments.messages.dialogs.DialogsFragment;
import com.vtosters.lite.fragments.money.MoneyTransfersFragment;
import org.json.JSONException;
import org.json.JSONObject;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Locale;
import java.util.Scanner;
import kotlin.jvm.internal.Intrinsics;
public class Prefs {
public static String VERSIONNAME = "2.0 DEV";
private static List<String> mFilters;
private static List<Activity> activities = new ArrayList<>();
public static boolean BooleanFalse(String key) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(Helper.GetContext());
return prefs.getBoolean(key, false);
}
public static boolean BooleanTrue(String key) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(Helper.GetContext());
return prefs.getBoolean(key, true);
}
public static void ClearCache() {
}
public static String GetBackgroundStickers() {
if (isBGStickersEnabled()) {
return "images_with_background";
}
return "images";
}
public static boolean isBGStickersEnabled() {
return BooleanTrue("isBGStickersEnabled");
}
public static String GetCopyright() {
return copyright_post() ? "null" : "copyright";
}
public static String GetFriendRecomm() {
return friendsrecomm() ? "friends_recommendations" : "null";
}
public static String GetStories() {
return stories() ? "stories" : "null";
}
public static boolean ads() {
return BooleanFalse("__dbg_no_ads");
}
public static boolean adsgroup() {
return BooleanFalse("adsgroup");
}
public static boolean adsslider() {
return BooleanFalse("__dbg_no_slider_ads");
}
public static boolean adsstories() {
return BooleanFalse("adsstories");
}
public static boolean alteremoji(Context context) {
return alteremojipref() ? alteremojipref() : Screen.a(context);
}
public static boolean alteremojipref() {
return BooleanFalse("alteremoji");
}
public static String authorsads() {
return authorsrecomm() ? "authors_rec" : "null";
}
public static boolean authorsrecomm() {
return BooleanTrue("authorsrecomm");
}
public static boolean awayphp() {
return BooleanTrue("awayphp");
}
public static boolean VKUI_INJ() {
return BooleanTrue("VKUI_INJ");
}
public static boolean benchmark() {
return BooleanFalse("benchmark");
}
public static boolean calls() {
return BooleanTrue("calls");
}
public static boolean captions() {
return BooleanTrue("captions");
}
public static boolean convUsersOnline() {
return BooleanFalse("convUsersOnline");
}
public static boolean copyright_post() {
return BooleanTrue("copyright_post");
}
public static boolean darkmode() {
return BooleanTrue("darkmode");
}
public static boolean default_ad_list() {
return BooleanFalse("default_ad_list");
}
public static boolean dev() {
return BooleanFalse("dev");
}
public static boolean devmenu() {
return BooleanFalse("devmenu");
}
public static boolean dnr() {
return BooleanTrue("dnr");
}
public static boolean dns() {
return BooleanTrue("dns");
}
public static boolean dnt() {
return BooleanTrue("dnt");
}
public static boolean dockcounter() {
return BooleanTrue("dockcounter");
}
public static boolean feedautoupdate() {
return BooleanTrue("feedautoupdate");
}
public static boolean feedcache() {
return BooleanTrue("feedcache");
}
public static void forceOffline() {
if (setoffline()) {
Users.b();
}
setupFilters();
}
public static boolean forcenogms() {
return BooleanTrue("forcenogms");
}
public static String friendsads() {
return postsrecomm() ? "user_rec" : "null";
}
public static boolean friendsrecomm() {
return BooleanTrue("friendsrecomm");
}
public static boolean fulltime() {
return BooleanTrue("fulltime");
}
public static boolean gcmfix() {
return BooleanTrue("gcmfix");
}
public static String getAppVersion() throws IOException {
return "VTLite | " + VERSIONNAME + " | " + getBuildNumber();
}
public static String getBuildNumber() {
return Prefs.loadAssetTextAsString(Helper.GetContext(), "version.properties");
}
public static String loadAssetTextAsString(Context context, String name) {
try {
Scanner scanner = new Scanner(context.getAssets().open(name));
while (scanner.hasNextLine()) {
String line = scanner.findInLine("VERSION_BUILD=.+");
if (line != null)
return line.replace("VERSION_BUILD=", "");
}
} catch (IOException e) {
e.printStackTrace();
}
return null;
}
public static String getBranch() {
return Helper.GetPreferences().getString("ota_branches", "Stable");
}
public static String getDarkVKUI() {
return !VKThemeHelper.d() ? "1" : "0";
}
public static String getMeToken() {
return Helper.GetPreferences().getString("me_token", "");
}
public static int getNavbarColor() {
return VKThemeHelper.a((int) R.attr.tabbar_background);
}
public static String getSSFSLink() {
return SSFSDomain() + "?token=" + ru.vtosters.lite.utils.Helper.GetUserToken() + "&vt_dark=" + getDarkVKUI() + "&secret=" + ru.vtosters.lite.utils.Helper.GetUserSecret() + "&proxy=" + getUserProxy() + "&lang=" + getLocale() + "&vt=1&vtl=1&vksans=" + isVKSansEnabled() + "&vt_version=" + getBuildNumber() + "&vt_debug=" + isDEVModEnabled();
}
public static String getString(String key, String defValue) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(Helper.GetContext());
return prefs.getString(key, defValue);
}
public static String getUserProxy() {
return proxy() ? "1" : "0";
}
public static boolean hasMusicSubscription() {
return BooleanTrue("hasMusicSubscription");
}
public static boolean isEnableExternalOpening() {
return BooleanFalse("isEnableExternalOpening");
}
public static boolean iconvk() {
return BooleanFalse("iconvk");
}
public static boolean iconvkru() {
return BooleanFalse("iconvkru");
}
public static String isDEVModEnabled() {
return dev() ? "1" : "0";
}
public static boolean isOtaEnabled() {
return BooleanTrue("ota_enabled");
}
public static boolean isMusicRestricted() {
return BooleanTrue("isMusicRestricted");
}
public static String isVKSansEnabled() {
return vksans() ? "1" : "0";
}
public static boolean msgflat() {
return BooleanFalse("msgflat");
}
public static boolean msgtails() {
return BooleanTrue("msgtails");
}
public static boolean navbar() {
return BooleanTrue("navbar");
}
public static boolean newfeed() {
return BooleanFalse("newfeed");
}
public static boolean offline() {
return BooleanTrue("offline");
}
public static boolean oldabout() {
return BooleanFalse("oldabout");
}
public static boolean postsrecomm() {
return BooleanTrue("postsrecomm");
}
public static String promoads() {
return ads() ? "null" : "promo_button";
}
public static String proxyHostHTTP() {
String string = Helper.GetPreferences().getString("proxyHostHTTP", "");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostHTTPS() {
String string = Helper.GetPreferences().getString("proxyHostHTTPS", "");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostSocks() {
String string = Helper.GetPreferences().getString("proxyHostSocks", "");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyPortHTTP() {
String string = Helper.GetPreferences().getString("proxyPortHTTP", "");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortHTTPS() {
String string = ru.vtosters.lite.utils.Helper.GetPreferences().getString("proxyPortHTTPS", "");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortSocks() {
String string = Helper.GetPreferences().getString("proxyPortSocks", "");
return string.isEmpty() ? "8888" : string;
}
public static boolean proxyvk() {
return BooleanFalse("proxyvk");
}
public static String readstatus() {
return dnr() ? "messages.markAsRead" : "null";
}
public static boolean refsfilter() {
return BooleanFalse("refsfilter");
}
public static boolean rightLikes() {
return BooleanFalse("rightLikes");
}
public static void setMeToken(String str) {
ru.vtosters.lite.utils.Helper.GetPreferences().edit().putString("me_token", str).apply();
}
public static boolean setoffline() {
return BooleanFalse("setoffline");
}
public static boolean shortinfo() {
return BooleanTrue("shortinfo");
}
public static boolean shortlinkfilter() {
return BooleanFalse("shortlinkfilter");
}
public static boolean shortpost() {
return BooleanTrue("shortpost");
}
public static boolean showmenu() {
return BooleanFalse("showmenu");
}
public static boolean ssl() {
return BooleanTrue("ssl");
}
public static boolean stories() {
return BooleanTrue("stories");
}
public static String storyads() {
return adsstories() ? "null" : "ads";
}
public static boolean swipe() {
return BooleanTrue("swipe");
}
public static boolean systememoji() {
return BooleanFalse("systememoji");
}
public static boolean unlockstats() {
return BooleanFalse("unlockstats");
}
public static boolean usevkui() {
return BooleanTrue("usevkui");
}
public static boolean vksans() {
return BooleanFalse("vksans");
}
public static boolean voice() {
return BooleanTrue("voice");
}
public static String widgetads() {
return ads() ? "null" : "app_widget";
}
public static void setNavbarColor(Window window, int i) {
if (navbar()) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setNavigationBarColor(getNavbarColor());
}
}
if (Build.VERSION.SDK_INT >= 31 && VKThemeHelper.d()) {
View decorView = window.getDecorView();
Intrinsics.a((Object) decorView, "view");
decorView.setSystemUiVisibility(decorView.getSystemUiVisibility() | 8192);
}
}
public static String MediacontentFix() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
}
public static String MediacontentFix2() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
}
public static String MediacontentFix3() {
return Build.VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
}
public static boolean inject(JSONObject jSONObject) {
String optString = jSONObject.optString(NavigatorKeys.j, "");
if (!ads(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
String optString2 = jSONObject.optString("post_type", "");
if (!ads(optString2) && !authors_rec(optString2) && !recomm(optString2) && !friendrecomm(optString2)) {
String optString3 = jSONObject.optString("filters", "");
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || checkCopyright(jSONObject) || captions(jSONObject)) {
return false;
}
return !AD(jSONObject);
}
}
return false;
}
public static void setupFilters() {
mFilters = new ArrayList();
ReferalsPut();
StandardFilterPut();
ShortLinkPut();
String string = Helper.GetPreferences().getString("spamfilters", "");
if (!string.isEmpty()) {
mFilters.addAll(Arrays.asList(string.split(", ")));
}
}
public static void ReferalsPut() {
if (BooleanTrue("refsfilter")) {
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Helper.GetContext().getAssets().open("Referals.txt")));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
mFilters.add(readLine);
} else {
bufferedReader.close();
return;
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void ShortLinkPut() {
if (BooleanTrue("shortlinkfilter")) {
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Helper.GetContext().getAssets().open("LinkShorter.txt")));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
mFilters.add(readLine);
} else {
bufferedReader.close();
return;
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static void StandardFilterPut() {
if (BooleanTrue("default_ad_list")) {
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(Helper.GetContext().getAssets().open("StandartFilter.txt")));
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
mFilters.add(readLine);
} else {
bufferedReader.close();
return;
}
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
public static String SSFSDomain() {
String string = Helper.GetPreferences().getString("ssfscustom", "");
if (!string.isEmpty()) {
return string;
}
return "https://sf.vknext.ru";
}
public static String VKVersion() {
String string = Helper.GetPreferences().getString("vkversion", "");
if (!string.isEmpty()) {
return string;
}
return "5.29";
}
public static boolean isBlockedByFilter(String str) {
for (String str2 : mFilters) {
if (str.toLowerCase().contains(str2.toLowerCase())) {
return true;
}
}
return false;
}
public static void injectAbout(List<Items2> list) {
list.clear();
list.add(new Items1());
if (!oldabout()) {
list.add(new Items(8, R.string.tgchannel));
list.add(new Items(9, R.string.tgchat));
list.add(new Items(16, R.string.vtfaq));
list.add(new Items(19, R.string.vtsite));
list.add(new Items(20, R.string.donate));
list.add(new Items(17, R.string.vkgroup));
list.add(new Items(18, R.string.sett_debug));
return;
}
list.add(new Items(0, R.string.about_app_feedback));
list.add(new Items(1, R.string.about_app_estimate));
list.add(new Items(2, R.string.about_app_privacy));
list.add(new Items(5, R.string.about_app_cookie));
list.add(new Items(3, R.string.about_app_terms_to_use));
list.add(new Items(4, R.string.about_app_license));
list.add(new Items(6, R.string.about_app_data_protect));
list.add(new Items(8, R.string.sett_debug));
}
public static boolean ads(String str) {
if ((str.equals("ads_easy_promote") || str.equals("promo_button") || str.equals("app_widget") || str.equals("ads")) && ads()) {
return false;
}
return false;
}
public static String getLocale() {
String string = Helper.GetPreferences().getString("lang_value", "");
if (string.equals("system")) {
return Locale.getDefault().getLanguage();
}
return string.isEmpty() ? Locale.getDefault().getLanguage() : string;
}
public static boolean proxy() {
return ru.vtosters.lite.utils.Helper.GetPreferences().getString("proxy", "").equals("xtrafrancyz");
}
public static boolean authors_rec(String str) {
return str.equals("authors_rec") && !authorsrecomm();
}
public static boolean captions(JSONObject jSONObject) {
try {
JSONObject jSONObject2 = jSONObject.getJSONObject("caption");
if (!captions()) {
return true;
}
boolean postsrecomm = postsrecomm();
return (jSONObject2.getString(NavigatorKeys.j).equals("explorebait") && !postsrecomm) || ((jSONObject2.getString(NavigatorKeys.j).equals("shared") && postsrecomm) || ((jSONObject.getString(NavigatorKeys.j).equals("digest") && postsrecomm) || ((jSONObject2.getString(NavigatorKeys.j).equals("commented") && postsrecomm) || (jSONObject2.getString(NavigatorKeys.j).equals("voted") && postsrecomm))));
} catch (JSONException unused) {
return false;
}
}
public static boolean recomm(String str) {
return (str.equals("user_rec") || str.equals("live_recommended") || str.equals("inline_user_rec")) && !postsrecomm();
}
public static boolean friendrecomm(String str) {
return str.equals("friends_recommendations") && !friendsrecomm();
}
public static boolean AD(JSONObject jSONObject) {
return jSONObject.optInt("marked_as_ads", 0) == 1 && adsgroup();
}
public static boolean checkCopyright(JSONObject jSONObject) {
return jSONObject.optInt("copyright", 0) == 1 && copyright_post();
}
public static Activity getCurrentActivity() {
if (activities.size() == 0) {
return null;
}
return activities.get(0);
}
public static void init(Application application) {
setupFilters();
fixGapps();
setProxy();
registerActivities(application);
}
private static void registerActivities(Application application) {
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() { // from class: ru.vtoster2.VTCore.1
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityPaused(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityResumed(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivitySaveInstanceState(Activity activity, Bundle bundle) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStarted(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityStopped(Activity activity) {
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityCreated(Activity activity, Bundle bundle) {
if (activity instanceof VKActivity) {
Prefs.activities.add(activity);
}
}
@Override // android.app.Application.ActivityLifecycleCallbacks
public void onActivityDestroyed(Activity activity) {
Prefs.activities.remove(activity);
}
});
}
public static Class getStartFragment() {
String string = ru.vtosters.lite.utils.Helper.GetPreferences().getString("start_value", "");
if (string.equals("newsfeed")) {
return Feed2049.b.c();
}
if (string.equals("messenger")) {
return DialogsFragment.class;
}
if (string.equals("groups")) {
return GroupsFragment.class;
}
if (string.equals("music")) {
return MusicFragment.class;
}
if (string.equals("friends")) {
return FriendsFragment.class;
}
if (string.equals(NavigatorKeys.v)) {
return PhotosFragment.class;
}
if (string.equals("videos")) {
return VideosFragment.class;
}
if (string.equals("settings")) {
return SettingsListFragment.class;
}
if (string.equals("apps")) {
return AppsFragment.class;
}
if (string.equals("discover")) {
return DiscoverFragment.class;
}
if (string.equals("notifications")) {
return NotificationsContainerFragment.class;
}
if (string.equals("money")) {
return MoneyTransfersFragment.class;
}
if (string.equals("games")) {
return GamesFragment.class;
}
if (string.equals("liked")) {
return FaveTabFragment.class;
}
if (string.equals("menu")) {
return MenuFragment.class;
}
if (string.equals("profile")) {
return ProfileFragment.class;
}
if (string.equals("lives")) {
return LivesTabsFragment.class;
}
if (string.equals("docs")) {
return DocumentsViewFragment.class;
}
return string.equals("brtd") ? BirthdaysFragment.class : Feed2049.b.c();
}
public static Context BaseContextLocale(Context context) {
Locale locale = new Locale(getLocale());
Locale.setDefault(locale);
var resources = context.getResources();
var configuration = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= 24) {
configuration.setLocale(locale);
configuration.setLayoutDirection(locale);
return context.createConfigurationContext(configuration);
}
configuration.locale = locale;
configuration.setLayoutDirection(locale);
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return context;
}
public static int vk_sans_display_demibold() {
return vksans() ? R.font.tt_commons_demi_bold : R.font.vk_sans_display_demibold;
}
public static int vk_sans_text_black() {
return vksans() ? R.font.vk_sans_display_bold : R.font.roboto_black;
}
public static int vk_sans_text_bold() {
return vksans() ? R.font.vk_sans_text_bold : R.font.roboto_bold;
}
public static int vk_sans_text_demibold() {
return vksans() ? R.font.vk_sans_text_demibold : R.font.roboto_bold_italic;
}
public static int vk_sans_text_light() {
return vksans() ? R.font.vk_sans_text_light : R.font.roboto_light;
}
public static int vk_sans_text_medium() {
return vksans() ? R.font.vk_sans_text_medium : R.font.roboto_medium;
}
public static int vk_sans_text_regular() {
return vksans() ? R.font.vk_sans_text_regular : R.font.roboto_regular;
}
public static void fixGapps() {
try {
if (Build.VERSION.SDK_INT >= 26) {
NotificationManager notificationManager = (NotificationManager) ru.vtosters.lite.utils.Helper.GetContext().getSystemService(Context.NOTIFICATION_SERVICE);
boolean z = false;
try {
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
z = true;
}
} catch (Exception ignored) {
}
if (!z) {
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", ru.vtosters.lite.utils.Helper.getResources().getString(R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
}
}
} catch (Exception ignored) {
}
}
}
@@ -0,0 +1,46 @@
package ru.vtosters.lite.utils;
public class ProfileHide {
// private static final OkHttpClient client = new OkHttpClient();
//
// /* JADX WARN: Type inference failed for: r1v1, types: [boolean] */
// /* JADX WARNING: Unknown variable types count: 1 */
// public static void injectMap(HashMap<Integer, AdministratorProfileFragment.a.a> hashMap) {
// for (int i = 0; VTVerifications.sServiceAccountsMap.valueOf(i) < 0; i++) {
// boolean valueOf = VTVerifications.sServiceAccountsMap.valueOf(Helper.getId());
// if (valueOf) {
// hashMap.put(1, new AdministratorProfileFragment.a.C0211a(R.string.service_account_mobile_info, R.color.service_account_admin_333, R.drawable.ic_custom_avatar_id333));
// }
// }
// }
//
// public static void fetchInfo(ExtendedUserProfile extendedUserProfile) {
// int userID = Helper.getUserID(extendedUserProfile.f11298a);
// if (VTVerifications.sServiceAccountsMap.valueOf(userID)) {
// Request.Builder builder = new Request.Builder();
// try {
// String string = new JSONObject(client.newCall(builder.o(HttpUrl.l("https://sf.vknext.ru/block_text?user_id=" + userID)).build()).b().a().p()).getJSONObject(MsgSendVc.e).getString("response");
// if (!string.equals("")) {
// ExtendedUserProfile.class.getDeclaredField("z2").set(extendedUserProfile, string);
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// }
//
// public static String getInfo(ExtendedUserProfile extendedUserProfile) {
// int userID = Helper.getUserID(extendedUserProfile);
// if (VTVerifications.sServiceAccountsMap.valueOf(userID)) {
// try {
// String str = (String) ExtendedUserProfile.class.getDeclaredField("z2").get(extendedUserProfile);
// if (!TextUtils.equals(str, "") && str != null) {
// return str;
// }
// } catch (Exception e) {
// e.printStackTrace();
// }
// }
// return Helper.getContext().getString(UserPresenter.i0.a(userID).intValue());
// }
}
@@ -0,0 +1,169 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Prefs.proxyHostHTTP;
import static ru.vtosters.lite.utils.Prefs.proxyHostHTTPS;
import static ru.vtosters.lite.utils.Prefs.proxyHostSocks;
import static ru.vtosters.lite.utils.Prefs.proxyPortHTTP;
import static ru.vtosters.lite.utils.Prefs.proxyPortHTTPS;
import static ru.vtosters.lite.utils.Prefs.proxyPortSocks;
import java.util.Properties;
public class Proxy {
public static String getOauthComAuth() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/authorize";
}
public static String getOauthComAuthClient() {
String oauthComAuth = getOauthComAuth();
return oauthComAuth + "?client_id=";
}
public static String getOauthComBlank() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/blank.html";
}
public static String getOauthComBlankRedirect() {
return "&redirect_uri=" + getOauthComBlank();
}
public static String getOauthComHttps() {
return "https://" + getOauthCom();
}
public static String getStaticComSupport() {
String staticCom = getStaticCom();
return staticCom + "/support";
}
public static String oauthFix() {
return "https://oauth.vk.com/blank.html";
}
public static String getApiCom() {
if (!Prefs.proxy()) {
return "api.vk.com";
}
String string = Helper.GetPreferences().getString("proxyapi", "");
if (!string.isEmpty()) {
return string;
}
return "vk-api-proxy.xtrafrancyz.net";
}
public static String getAwayPhpCom() {
if (!Prefs.proxy()) {
return "m.vk.com";
}
String string = Helper.GetPreferences().getString("proxyapi", "");
if (!string.isEmpty()) {
return string;
}
return "vk-api-proxy.xtrafrancyz.net";
}
public static String getOauthCom() {
if (!Prefs.proxy()) {
return "oauth.vk.com";
}
String string = Helper.GetPreferences().getString("proxyoauth", "");
if (!string.isEmpty()) {
return string;
}
return "vk-oauth-proxy.xtrafrancyz.net";
}
public static String getStaticCom() {
if (!ru.vtosters.lite.utils.Prefs.proxy()) {
return "static.vk.com";
}
String string = Helper.GetPreferences().getString("proxystatic", "");
if (!string.isEmpty()) {
return string;
}
return "vk-static-proxy.xtrafrancyz.net";
}
public static String staticFix(String str) {
String str2;
String str3;
if (!Prefs.proxy()) {
return str;
}
String string = Helper.GetPreferences().getString("proxystatic", "");
if (string.isEmpty()) {
str3 = "static.vk.com";
str2 = "vk-static-proxy.xtrafrancyz.net";
} else {
str3 = "static.vk.com";
str2 = string;
}
return str.replace(str2, str3);
}
public static String GetConnector(String str) {
if (!Prefs.proxy()) {
return str;
}
if (str.startsWith("https://")) {
String replace = str.replace("https://", "");
return "https://" + getApiCom() + "/_/" + replace;
} else if (str.startsWith("http://")) {
String replace2 = str.replace("http://", "");
return "http://" + getApiCom() + "/_/" + replace2;
} else {
return getApiCom() + "/_/" + str;
}
}
public static void setProxy() {
switch (Helper.GetPreferences().getString("proxy", "")) {
case "zaborona":
Properties properties = System.getProperties();
properties.setProperty("socksProxyHost", "socks.zaborona.help");
properties.setProperty("socksProxyPort", "1488");
System.clearProperty("https.proxyHost");
System.clearProperty("https.proxyPort");
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
break;
case "socks":
Properties properties2 = System.getProperties();
properties2.setProperty("socksProxyHost", proxyHostSocks());
properties2.setProperty("socksProxyPort", proxyPortSocks());
System.clearProperty("https.proxyHost");
System.clearProperty("https.proxyPort");
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
break;
case "http":
Properties properties3 = System.getProperties();
properties3.setProperty("http.proxyHost", proxyHostHTTP());
properties3.setProperty("http.proxyPort", proxyPortHTTP());
System.clearProperty("socksProxyHost");
System.clearProperty("socksPortHost");
System.clearProperty("https.proxyHost");
System.clearProperty("https.proxyPort");
break;
case "https":
Properties properties4 = System.getProperties();
properties4.setProperty("https.proxyHost", proxyHostHTTPS());
properties4.setProperty("https.proxyPort", proxyPortHTTPS());
System.clearProperty("socksProxyHost");
System.clearProperty("socksPortHost");
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
break;
default:
System.clearProperty("socksProxyHost");
System.clearProperty("socksPortHost");
System.clearProperty("https.proxyHost");
System.clearProperty("https.proxyPort");
System.clearProperty("http.proxyHost");
System.clearProperty("http.proxyPort");
break;
}
}
}
@@ -0,0 +1,107 @@
package ru.vtosters.lite.utils;
import android.content.Context;
import android.content.res.ColorStateList;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v7.widget.Toolbar;
import android.widget.ImageButton;
import com.vk.core.d.RecoloredDrawable;
import com.vk.core.ui.themes.VKThemeHelper;
import com.vtosters.lite.R;
import com.vtosters.lite.auth.VKAccountManager;
import ru.vtosters.lite.f0x1d.VTVerifications;
public class Themes {
public static int getAccentColor() {
return VKThemeHelper.a((int) R.attr.accent);
}
public static int getTextAttr() {
return VKThemeHelper.a((int) R.attr.text_primary);
}
public static int getSTextAttr() {
return VKThemeHelper.a((int) R.attr.text_secondary);
}
public static int getTabbarBackground() {
return VKThemeHelper.a((int) R.attr.tabbar_background);
}
public static int getColorFromAttr(int attr) {
return VKThemeHelper.a(attr);
}
public static int getHeaderText() {
return VKThemeHelper.a((int) R.attr.header_text);
}
public static boolean isAndroidMonet() {
if (color_grishka()) {
return Build.VERSION.SDK_INT >= 31;
} else {
return false;
}
}
public static boolean color_grishka() {
return ru.vtosters.lite.utils.Prefs.BooleanTrue("color_grishka");
}
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 void themeMonetToolbar(ImageButton imageButton, Toolbar toolbar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
imageButton.setImageTintList(ColorStateList.valueOf(getHeaderText()));
toolbar.setElevation(0.0f);
}
}
public static boolean vkim_msg() {
return ru.vtosters.lite.utils.Prefs.BooleanFalse("vkim_msg");
}
public static boolean vkme_msg() {
return ru.vtosters.lite.utils.Prefs.BooleanFalse("vkme_msg");
}
public static Drawable recolorDrawable(Drawable drawable) {
if (drawable == null) {
return null;
}
return new RecoloredDrawable(drawable, getAccentColor());
}
public static ColorStateList recolorCSL(ColorStateList colorStateList) {
if (colorStateList == null) {
return null;
}
return ColorStateList.valueOf(getAccentColor());
}
public static int getColor(Context context, int i) {
if (isColorRefAccented(i) && isAndroidMonet()) {
return getAccentColor();
}
if (Build.VERSION.SDK_INT >= 23) {
return context.getColor(i);
}
return context.getResources().getColor(i);
}
public static int getColor2(int i) {
if (isColorRefAccented(i) && isAndroidMonet()) {
return getAccentColor();
}
return Helper.GetContext().getResources().getColor(i);
}
public static String hex(int i) {
return String.format("#%06X", new Object[]{Integer.valueOf(i & 16777215)});
}
}
@@ -0,0 +1,76 @@
package ru.vtosters.lite.utils;
import android.util.Base64;
import android.util.Log;
import android.webkit.WebView;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;
import com.vtosters.lite.R;
public class VKUIInjector {
private static boolean isLoaded = false;
private static String loadedCSS = "";
private static String loadedCSSAmoled = "";
static {
}
public VKUIInjector() {
}
private static String load(String str) {
try {
InputStream open = Helper.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) {
sb.append(readLine);
} else {
bufferedReader.close();
return sb.toString();
}
}
} catch (IOException e) {
e.printStackTrace();
return "";
}
}
public static void load() {
loadedCSS = load("vt_ui_accent.css")
.replace("%accent%", Themes.hex(Themes.getAccentColor()))
.replace("%background_page%", Themes.hex(Themes.getColorFromAttr(R.attr.background_page)))
.replace("%background_content%", Themes.hex(Themes.getColorFromAttr(R.attr.background_content)))
.replace("%text_primary%", Themes.hex(Themes.getColorFromAttr(R.attr.text_primary)));
// loadedCSSAmoled = load("vt_ui_oled.css");
isLoaded = true;
}
private static void inject(WebView webView, String str) {
webView.loadUrl("javascript:(function() {var parent = document.getElementsByTagName('head').item(0);var style = document.createElement('style');style.type = 'text/css';style.innerHTML = window.atob('" + str + "');parent.appendChild(style)})()");
}
public static void inject(WebView webView) {
if (Prefs.BooleanTrue("VKUI_INJ")) {
if (!isLoaded) {
load();
}
StringBuilder sb = new StringBuilder();
if (true/*Themes.isAccentedCache()*/) {
Log.d("VKUI", "Injecting Accent");
sb.append("\n\n");
sb.append(loadedCSS);
}
Log.d("VKUI", "Final CSS: " + sb.toString());
inject(webView, Base64.encodeToString(sb.toString().getBytes(), 2));
}
}
}
@@ -0,0 +1,30 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:aapt="http://schemas.android.com/aapt"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path android:pathData="M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z">
<aapt:attr name="android:fillColor">
<gradient
android:endX="85.84757"
android:endY="92.4963"
android:startX="42.9492"
android:startY="49.59793"
android:type="linear">
<item
android:color="#44000000"
android:offset="0.0" />
<item
android:color="#00000000"
android:offset="1.0" />
</gradient>
</aapt:attr>
</path>
<path
android:fillColor="#FFFFFF"
android:fillType="nonZero"
android:pathData="M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z"
android:strokeWidth="1"
android:strokeColor="#00000000" />
</vector>
@@ -0,0 +1,170 @@
<?xml version="1.0" encoding="utf-8"?>
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="108dp"
android:height="108dp"
android:viewportWidth="108"
android:viewportHeight="108">
<path
android:fillColor="#3DDC84"
android:pathData="M0,0h108v108h-108z" />
<path
android:fillColor="#00000000"
android:pathData="M9,0L9,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,0L19,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,0L29,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,0L39,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,0L49,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,0L59,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,0L69,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,0L79,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M89,0L89,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M99,0L99,108"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,9L108,9"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,19L108,19"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,29L108,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,39L108,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,49L108,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,59L108,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,69L108,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,79L108,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,89L108,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M0,99L108,99"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,29L89,29"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,39L89,39"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,49L89,49"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,59L89,59"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,69L89,69"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M19,79L89,79"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M29,19L29,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M39,19L39,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M49,19L49,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M59,19L59,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M69,19L69,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
<path
android:fillColor="#00000000"
android:pathData="M79,19L79,89"
android:strokeWidth="0.8"
android:strokeColor="#33FFFFFF" />
</vector>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@drawable/ic_launcher_background" />
<foreground android:drawable="@drawable/ic_launcher_foreground" />
</adaptive-icon>
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="purple_200">#FFBB86FC</color>
<color name="purple_500">#FF6200EE</color>
<color name="purple_700">#FF3700B3</color>
<color name="teal_200">#FF03DAC5</color>
<color name="teal_700">#FF018786</color>
<color name="black">#FF000000</color>
<color name="white">#FFFFFFFF</color>
</resources>
+3
View File
@@ -0,0 +1,3 @@
<resources>
<string name="app_name">Vtoasters Shit</string>
</resources>
+24
View File
@@ -0,0 +1,24 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0-alpha01'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
+6
View File
@@ -0,0 +1,6 @@
#Fri Jan 28 23:46:30 MSK 2022
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-rc-1-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Vendored Executable
+234
View File
@@ -0,0 +1,234 @@
#!/bin/sh
#
# Copyright © 2015-2021 the original authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
#
# Gradle start up script for POSIX generated by Gradle.
#
# Important for running:
#
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
# noncompliant, but you have some other compliant shell such as ksh or
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
# ksh Gradle
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
# * functions;
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
# * compound commands having a testable exit status, especially «case»;
# * various built-in commands including «command», «set», and «ulimit».
#
# Important for patching:
#
# (2) This script targets any POSIX shell, so it avoids extensions provided
# by Bash, Ksh, etc; in particular arrays are avoided.
#
# The "traditional" practice of packing multiple parameters into a
# space-separated string is a well documented source of bugs and security
# problems, so this is (mostly) avoided, by progressively accumulating
# options in "$@", and eventually passing that to Java.
#
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
# see the in-line comments for details.
#
# There are tweaks for specific operating systems such as AIX, CygWin,
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
#
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
app_path=$0
# Need this for daisy-chained symlinks.
while
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
[ -h "$app_path" ]
do
ls=$( ls -ld "$app_path" )
link=${ls#*' -> '}
case $link in #(
/*) app_path=$link ;; #(
*) app_path=$APP_HOME$link ;;
esac
done
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
APP_NAME="Gradle"
APP_BASE_NAME=${0##*/}
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
warn () {
echo "$*"
} >&2
die () {
echo
echo "$*"
echo
exit 1
} >&2
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "$( uname )" in #(
CYGWIN* ) cygwin=true ;; #(
Darwin* ) darwin=true ;; #(
MSYS* | MINGW* ) msys=true ;; #(
NONSTOP* ) nonstop=true ;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD=$JAVA_HOME/jre/sh/java
else
JAVACMD=$JAVA_HOME/bin/java
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
fi
# Collect all arguments for the java command, stacking in reverse order:
# * args from the command line
# * the main class name
# * -classpath
# * -D...appname settings
# * --module-path (only if needed)
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
# For Cygwin or MSYS, switch paths to Windows format before running java
if "$cygwin" || "$msys" ; then
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
JAVACMD=$( cygpath --unix "$JAVACMD" )
# Now convert the arguments - kludge to limit ourselves to /bin/sh
for arg do
if
case $arg in #(
-*) false ;; # don't mess with options #(
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
[ -e "$t" ] ;; #(
*) false ;;
esac
then
arg=$( cygpath --path --ignore --mixed "$arg" )
fi
# Roll the args list around exactly as many times as the number of
# args, so each arg winds up back in the position where it started, but
# possibly modified.
#
# NB: a `for` loop captures its iteration list before it begins, so
# changing the positional parameters here affects neither the number of
# iterations, nor the values presented in `arg`.
shift # remove old arg
set -- "$@" "$arg" # push replacement arg
done
fi
# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
-classpath "$CLASSPATH" \
org.gradle.wrapper.GradleWrapperMain \
"$@"
# Use "xargs" to parse quoted args.
#
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
#
# In Bash we could simply go:
#
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
# set -- "${ARGS[@]}" "$@"
#
# but POSIX shell has neither arrays nor command substitution, so instead we
# post-process each arg (as a line of input to sed) to backslash-escape any
# character that might be a shell metacharacter, then use eval to reverse
# that process (while maintaining the separation between arguments), and wrap
# the whole thing up as a single "set" statement.
#
# This will of course break if any of these variables contains a newline or
# an unmatched quote.
#
eval "set -- $(
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
xargs -n1 |
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
tr '\n' ' '
)" '"$@"'
exec "$JAVACMD" "$@"
Vendored
+89
View File
@@ -0,0 +1,89 @@
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
+97
View File
@@ -0,0 +1,97 @@
#!/bin/bash
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Set up prog to be the path of this script, including following symlinks,
# and set up progdir to be the fully-qualified pathname of its directory.
prog="$0"
while [ -h "${prog}" ]; do
newProg=`/bin/ls -ld "${prog}"`
newProg=`expr "${newProg}" : ".* -> \(.*\)$"`
if expr "x${newProg}" : 'x/' >/dev/null; then
prog="${newProg}"
else
progdir=`dirname "${prog}"`
prog="${progdir}/${newProg}"
fi
done
oldwd=`pwd`
progdir=`dirname "${prog}"`
cd "${progdir}"
progdir=`pwd`
prog="${progdir}"/`basename "${prog}"`
cd "${oldwd}"
jarfile=apksigner.jar
libdir="$progdir"
if [ ! -r "$libdir/$jarfile" ]; then
# set apksigner.jar location for the SDK case
libdir="$libdir/lib"
fi
if [ ! -r "$libdir/$jarfile" ]; then
# set apksigner.jar location for the Android tree case
libdir=`dirname "$progdir"`/framework
# also include the library directory for any provider native libraries
providerLibdir=`dirname "$progdir"`/lib64
fi
if [ ! -r "$libdir/$jarfile" ]; then
echo `basename "$prog"`": can't find $jarfile"
exit 1
fi
# By default, give apksigner a max heap size of 1 gig. This can be overridden
# by using a "-J" option (see below).
defaultMx="-Xmx1024M"
# The following will extract any initial parameters of the form
# "-J<stuff>" from the command line and pass them to the Java
# invocation (instead of to apksigner). This makes it possible for you to add
# a command-line parameter such as "-JXmx256M" in your scripts, for
# example. "java" (with no args) and "java -X" give a summary of
# available options.
javaOpts=""
while expr "x$1" : 'x-J' >/dev/null; do
opt=`expr "x$1" : 'x-J\(.*\)'`
javaOpts="${javaOpts} -${opt}"
if expr "x${opt}" : "xXmx[0-9]" >/dev/null; then
defaultMx="no"
elif expr "x${opt}" : "xDjava.library.path=" >/dev/null; then
defaultLibdir="no"
fi
shift
done
if [ "${defaultMx}" != "no" ]; then
javaOpts="${javaOpts} ${defaultMx}"
fi
if [ "${defaultLibdir}" != "no" ] && [ -n $providerLibdir ]; then
javaOpts="${javaOpts} -Djava.library.path=$providerLibdir"
fi
if [ "$OSTYPE" = "cygwin" ]; then
# For Cygwin, convert the jarfile path into native Windows style.
jarpath=`cygpath -w "$libdir/$jarfile"`
else
jarpath="$libdir/$jarfile"
fi
exec java $javaOpts -jar "$jarpath" "$@"
+1
View File
@@ -0,0 +1 @@
36732723e0484a06ee565bd2823ea44aaff52a37
+173
View File
@@ -0,0 +1,173 @@
@echo off
:: ANSI Codes (ONLY windows 10 support)
::RED - [31m
::GREEN - [92m
::NC - [0m
::BOLD - [1m
::UNDERLINE - [4m (Not supporting)
setlocal
call :setESC
cls
echo.
echo %ESC%[1;4mBuild dex...%ESC%[0m
echo.
call gradlew clean
call gradlew versionFile
call gradlew assembleDebug
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mExport dex...%ESC%[0m
echo.
call gradlew exportDex
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove dex6 to source dir...%ESC%[0m
echo.
move app\classes6.dex smali\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove dex8 to source dir...%ESC%[0m
echo.
move app\classes8.dex smali\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mMove version.properties to source dir...%ESC%[0m
echo.
move app\version.properties smali\assets\
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
echo.
echo %ESC%[1;4mBuild apk...%ESC%[0m
echo.
cd smali\
call java -jar ../scripts/apktool.jar b . -o VTLite.apk --use-aapt2 -p ../scripts/framework/
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
del classes6.dex
del classes8.dex
del assets\version.properties
echo.
echo %ESC%[1;4mSign apk...%ESC%[0m
echo.
call java -jar ../apksigner.jar sign --ks debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android VTLite.apk
del VTLite.apk
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:startinstall
SET choice=
SET /p choice=Do you want to install APK?:
IF /i '%choice%'=='Y' GOTO yesinst
IF /i '%choice%'=='yes' GOTO yesinst
IF /i '%choice%'=='Yes' GOTO yesinst
IF /i '%choice%'=='y' GOTO yesinst
IF /i '%choice%'=='N' GOTO noinst
IF /i '%choice%'=='No' GOTO noinst
IF /i '%choice%'=='n' GOTO noinst
IF /i '%choice%'=='no' GOTO noinst
ECHO "%choice%" doesn't exist
ECHO.
GOTO startinstall
:yesinst
echo.
echo %ESC%[1;4mInstall apk...%ESC%[0m
echo.
call adb install VTLite_signed.apk
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:noinst
:startapp
SET choice=
SET /p choice=Do you want to start app?:
IF /i '%choice%'=='Y' GOTO start
IF /i '%choice%'=='yes' GOTO start
IF /i '%choice%'=='Yes' GOTO start
IF /i '%choice%'=='y' GOTO start
IF /i '%choice%'=='N' GOTO skip
IF /i '%choice%'=='No' GOTO skip
IF /i '%choice%'=='n' GOTO skip
IF /i '%choice%'=='no' GOTO skip
ECHO "%choice%" doesn't exist
ECHO.
GOTO startapp
:start
echo.
echo %ESC%[1;4mOpen VTL...%ESC%[0m
echo.
call adb shell monkey -p com.vtosters.lite -c android.intent.category.LAUNCHER 1
if "%ERRORLEVEL%" == "0" (
echo %ESC%[92mSuccessful%ESC%[0m
) else (
echo %ESC%[31mFailed%ESC%[0m
exit /B 1
)
:skip
:setESC
for /F "tokens=1,2 delims=#" %%a in ('"prompt #$H#$E# & echo on & for %%b in (1) do rem"') do (
set ESC=%%b
exit /B 0
)
exit /B 0
+89
View File
@@ -0,0 +1,89 @@
#!/bin/bash
RED='\033[31m'
GREEN='\033[92m'
NC='\033[0m'
BOLD='\033[1m'
UNDERLINE='\033[4m'
echo -e "${BOLD}${UNDERLINE}Сборка dex..${NC}\n"
cd ../
./gradlew versionFile
./gradlew assembleDebug
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Экспорт dex..${NC}"
./gradlew exportDex
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос dex6 в папку с исходным кодом..${NC}"
mv app/classes6.dex smali/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос dex8 в папку с исходным кодом..${NC}"
mv app/classes8.dex smali/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Перенос version.properties в папку с исходным кодом..${NC}"
mv app/version.properties smali/assets/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "${BOLD}${UNDERLINE}Сборка apk..${NC}"
cd smali/
java -jar ../scripts/apktool.jar b . -o VTLite.apk --use-aapt2 -p ../scripts/framework/
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}\n"
else
echo -e "${RED}Провал.${NC}\n"
exit 1
fi
echo -e "\nПодписывание апк..."
cd ../scripts
./apksigner sign --ks debug.keystore --ks-key-alias androiddebugkey --ks-pass pass:android ../smali/VTLite.apk
if [ $? -eq 0 ]; then
echo -e "${GREEN}Успех!${NC}"
else
echo -e "${RED}Провал.${NC}"
fi
echo -e "${BOLD}VTosters Lite успешно собран! APK находится в папке smali${NC}"
cd ../smali
rm classes6.dex
rm classes8.dex
echo -n "Желаете установить VTosters через adb? (y/n) "
read -n 1 prompt
if [[ $prompt == "y" || $prompt == "Y" || $prompt == "yes" || $prompt == "Yes" ]]
then
echo -e "\n"
adb install VTLite.apk
else
exit 0
fi
Binary file not shown.
+2
View File
@@ -0,0 +1,2 @@
rootProject.name = "VTosters Lite"
include ':app'
+549
View File
@@ -0,0 +1,549 @@
<?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">
<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"/>
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
<uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.VIBRATE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.GET_ACCOUNTS"/>
<uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.READ_CONTACTS"/>
<uses-permission android:name="android.permission.WRITE_CONTACTS"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>
<uses-permission android:name="com.vtosters.lite.permission.MAPS_RECEIVE"/>
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/>
<uses-permission android:name="com.vtosters.lite.permission.ACCESS_DATA"/>
<uses-permission android:name="android.permission.NFC"/>
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS"/>
<uses-permission android:name="com.vk.usersstore.permission.SAVE"/>
<uses-permission android:name="com.vk.usersstore.permission.LOAD"/>
<permission android:name="com.vtosters.lite.permission.C2D_MESSAGE" android:protectionLevel="signature"/>
<permission android:name="com.vtosters.lite.permission.MAPS_RECEIVE" android:protectionLevel="signature"/>
<permission android:name="com.vtosters.lite.permission.ACCESS_DATA" android:protectionLevel="signature"/>
<uses-feature android:glEsVersion="0x00020000" android:required="true"/>
<uses-feature android:name="android.hardware.location" android:required="false"/>
<uses-feature android:name="android.hardware.location.gps" android:required="false"/>
<uses-feature android:name="android.hardware.location.network" android:required="false"/>
<uses-feature android:name="android.hardware.screen.landscape" android:required="false"/>
<uses-feature android:name="android.hardware.screen.portrait" android:required="false"/>
<uses-feature android:name="android.hardware.camera" android:required="false"/>
<uses-feature android:name="android.hardware.camera.autofocus" android:required="false"/>
<uses-feature android:name="android.hardware.microphone" android:required="false"/>
<uses-feature android:name="android.hardware.telephony" android:required="false"/>
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE"/>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.QUICKBOOT_POWERON"/>
<permission android:name="com.vtosters.lite.usersstore.permission.SAVE" android:protectionLevel="signature"/>
<permission android:name="com.vtosters.lite.usersstore.permission.LOAD" android:protectionLevel="signature"/>
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE"/>
<uses-permission android:name="com.sec.android.provider.badge.permission.READ"/>
<uses-permission android:name="com.sec.android.provider.badge.permission.WRITE"/>
<uses-permission android:name="com.htc.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.htc.launcher.permission.UPDATE_SHORTCUT"/>
<uses-permission android:name="com.sonyericsson.home.permission.BROADCAST_BADGE"/>
<uses-permission android:name="com.sonymobile.home.permission.PROVIDER_INSERT_BADGE"/>
<uses-permission android:name="com.anddoes.launcher.permission.UPDATE_COUNT"/>
<uses-permission android:name="com.majeur.launcher.permission.UPDATE_BADGE"/>
<uses-permission android:name="com.huawei.android.launcher.permission.CHANGE_BADGE"/>
<uses-permission android:name="com.huawei.android.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.huawei.android.launcher.permission.WRITE_SETTINGS"/>
<uses-permission android:name="android.permission.READ_APP_BADGE"/>
<uses-permission android:name="com.oppo.launcher.permission.READ_SETTINGS"/>
<uses-permission android:name="com.oppo.launcher.permission.WRITE_SETTINGS"/>
<uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_READ"/>
<uses-permission android:name="me.everything.badger.permission.BADGE_COUNT_WRITE"/>
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/>
<application android:allowBackup="false" android:debuggable="false" android:hardwareAccelerated="true" android:icon="@mipmap/vt_launcher" android:label="@string/app_name" android:largeHeap="true" android:name="com.vtosters.lite.VKApplication" android:networkSecurityConfig="@xml/network_security_config" android:resizeableActivity="true" android:roundIcon="@mipmap/vt_launcher_round" android:supportsRtl="true" android:theme="@style/BaseStyle">
<meta-data android:name="com.google.android.geo.API_KEY" android:value="AIzaSyBlTHhNGPj7ktPWrUo_d4YJs_Sn_zsISZg"/>
<meta-data android:name="com.google.android.geo.API_SECRET" android:value="yu6ZAA0OWO3kmr4es7fGtSmiyfk="/>
<meta-data android:name="com.facebook.sdk.ApplicationId" android:value="@string/fb_app_id"/>
<meta-data android:name="com.facebook.sdk.AdvertiserIDCollectionEnabled" android:value="false"/>
<meta-data android:name="com.facebook.sdk.AutoLogAppEventsEnabled" android:value="false"/>
<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: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"/>
</intent-filter>
</activity>
<service android:name="ru.vtosters.lite.f0x1d.LogWriterService" />
<activity-alias android:enabled="true" android:icon="@mipmap/vt_launcher" android:label="VTLite" android:name=".VTIconDefault" android:targetActivity="com.vtosters.lite.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity-alias android:enabled="false" android:icon="@mipmap/mp_launcher" android:label="@string/app_name_orig" android:name=".VTIconVK" android:targetActivity="com.vtosters.lite.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
<category android:name="android.intent.category.MULTIWINDOW_LAUNCHER"/>
</intent-filter>
</activity-alias>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.FragmentWrapperActivity" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:launchMode="singleTask" android:name="com.vtosters.lite.fragments.messages.chat.ChatActivity" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/attach_photo" android:name="com.vtosters.lite.ImagePickerActivity" android:theme="@style/AttachTransparentTheme" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/auth" android:name="com.vtosters.lite.AuthActivity" android:theme="@style/BaseStyle.Registration.Blue" android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.RepostActivity" android:theme="@style/TransparentTheme"/>
<activity android:label="" android:name="com.vk.sharing.PortraitSharingActivity" android:screenOrientation="portrait" android:theme="@style/Theme.App.Transparent" android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:configChanges="keyboardHidden|screenSize" android:label="" android:name="com.vk.sharing.SharingActivity" android:theme="@style/Theme.App.Transparent" android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.GameCardActivity" android:theme="@style/BaseStyle.NoActionBar"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.TabletDialogActivity" android:theme="@style/BaseStyle.PopupIfTablet"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.FragmentDialogActivity" android:theme="@style/BaseStyle.Dialog"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:exported="true" android:label="@string/app_name" android:name="com.vtosters.lite.LinkRedirActivity" android:theme="@style/TranslucentStyle">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW"/>
<data android:scheme="vklink"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.com" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vkontakte.ru" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="new.vk.com" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.com" android:pathPattern="/.*" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vkontakte.ru" android:pathPattern="/.*" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="new.vk.com" android:pathPattern="/.*" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.me" android:pathPattern="/.*" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.me" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.cc" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="vk.cc" android:pathPattern="/.*" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:pathPattern="/.*" android:scheme="vkontakte"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:pathPattern="/.*" android:scheme="vk"/>
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="vnd.android.cursor.item/vnd.com.vtosters.lite.sendmsg"/>
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="vnd.android.cursor.item/vnd.com.vtosters.lite.profile"/>
</intent-filter>
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW"/>
<data android:mimeType="vnd.android.cursor.item/vnd.com.vtosters.lite.voipcall"/>
</intent-filter>
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:host="m.vk.com" android:pathPattern="/.*" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="m.vk.com" android:pathPattern="/restore" android:scheme="http"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="m.vk.com" android:pathPattern="/restore" android:scheme="https"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.NOTIFICATION_PREFERENCES"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.PostPhotoActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/message" android:name="com.vtosters.lite.ValidationActivity" android:theme="@style/BaseStyle.Validation"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/live" android:name="com.vtosters.lite.live.LivePlayerActivity" android:theme="@style/LivePlayerActivityTheme" android:windowSoftInputMode="stateHidden"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/video" android:name="com.vk.video.VideoActivity" android:theme="@style/VideoPlayerTranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/video" android:name="com.vtosters.lite.activities.YouTubeVideoPlayerActivity" android:theme="@style/VideoPlayerTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/video" android:name="com.vtosters.lite.activities.VideoEmbedPlayerActivity" android:screenOrientation="sensorLandscape" android:theme="@style/VideoPlayerTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:exported="true" android:label="@string/app_name" android:name="com.vtosters.lite.SendActivity" android:theme="@style/TranslucentStyle">
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.SEND"/>
<action android:name="android.intent.action.SEND_MULTIPLE"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="*/*"/>
</intent-filter>
<meta-data android:name="android.service.chooser.chooser_target_service" android:value="com.vtosters.lite.directshare.ImDirectShareService"/>
</activity>
<activity android:label="" android:name="com.vtosters.lite.VideoUploadDialog" android:theme="@style/Theme.App.Transparent.DialogHolder"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.WelcomeActivity" android:theme="@style/TransparentTheme">
<intent-filter>
<action android:name="com.vtosters.lite.SYNC_SETTINGS"/>
<category android:name="android.intent.category.DEFAULT"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.CaptchaActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.ConfirmationActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/suggest_friends" android:name="com.vtosters.lite.SuggestionsActivity"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/report_content" android:name="com.vtosters.lite.ReportContentActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.NotificationActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/auth" android:name="com.vtosters.lite.SDKAuthActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="com.vkontakte.android.action.SDK_AUTH"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:exported="true" android:name="com.vtosters.lite.sdk.SDKInviteActivity"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/friends" android:name="com.vtosters.lite.sdk.SDKFriendPickerActivity" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="orientation|screenSize" android:excludeFromRecents="true" android:label="@string/app_name" android:launchMode="singleInstance" android:name="com.vk.voip.VoipCallActivity" android:screenOrientation="portrait" android:taskAffinity="com.vtosters.lite.voip"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/registration" android:name="com.vtosters.lite.activities.SignupActivity" android:theme="@style/BaseStyle.Registration" android:windowSoftInputMode="adjustResize"/>
<activity android:label="@string/app_name" android:name="com.vk.music.AudioPlayerActivity" android:theme="@style/BaseStyle.PopupIfTablet"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/change_password" android:name="com.vtosters.lite.ChangePasswordActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vtosters.lite.BillingActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="@string/wall" android:name="com.vtosters.lite.TestActivity">
<intent-filter>
<category android:name="android.intent.category.DEFAULT"/>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="test" android:scheme="vkontakte"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="confirmation" android:name="com.vtosters.lite.ConfirmActionActivity" android:theme="@style/TranslucentStyle"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.attachpicker.AttachActivity" android:theme="@style/AttachTransparentTheme" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.attachpicker.PhotoVideoAttachActivity" android:theme="@style/PickerPhotoVideoActivity"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.attachpicker.PhotoEditorActivity" android:theme="@style/PickerImageEditorActivity"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.attachpicker.GraffitiActivity" android:screenOrientation="portrait" android:theme="@style/PickerGraffitiActivity"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize|smallestScreenSize" android:name="com.vk.stories.CreateStoryActivity" android:screenOrientation="portrait" android:theme="@style/StoryFullscreenActivityTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.stories.ShareStoryActivity" android:screenOrientation="portrait" android:theme="@style/StoryActivityTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.stories.StoryViewActivity" android:screenOrientation="portrait" android:theme="@style/StoryFullscreenActivityTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.stories.StorySettingsActivity" android:screenOrientation="portrait" android:theme="@style/StoryActivityTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.stories.StoryPrivacySettingsActivity" android:screenOrientation="portrait" android:theme="@style/StoryActivityTheme"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vk.music.attach.AttachMusicActivity" android:theme="@style/BaseStyle.StatusBar" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="orientation" android:excludeFromRecents="true" android:label="" android:name="com.vtosters.lite.fragments.messages.chat_invite.accept.ChatInviteActivity" android:theme="@style/VkIm.Theme.ChatInvite" android:windowSoftInputMode="adjustResize|stateHidden"/>
<activity android:name="com.vk.pushes.PushOpenActivity" android:theme="@style/PushOpenTheme"/>
<activity android:name="ru.ok.android.sdk.OkAuthActivity">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:host="ok1258261760" android:scheme="okauth"/>
</intent-filter>
</activity>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vk.newsfeed.posting.attachments.PostingAttachActivity" android:theme="@style/PostingAttachScreenTheme" android:windowSoftInputMode="adjustResize"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:name="com.vk.profile.ui.details.ProfileDetailsActivity" android:theme="@style/AttachTransparentTheme" android:windowSoftInputMode="adjustResize"/>
<service android:exported="false" android:name="com.vtosters.lite.sync.online.VkOnlineService"/>
<service android:exported="false" android:name="com.vtosters.lite.sync.im.VkImSyncService"/>
<service android:name="com.vtosters.lite.audio.player.PlayerService"/>
<service android:exported="true" android:name="com.vtosters.lite.AccountAuthenticatorService">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator"/>
</intent-filter>
<meta-data android:name="android.accounts.AccountAuthenticator" android:resource="@xml/authenticator"/>
</service>
<service android:exported="true" android:name="com.vtosters.lite.ContactsSyncAdapterService">
<intent-filter>
<action android:name="android.content.SyncAdapter"/>
</intent-filter>
<meta-data android:name="android.content.SyncAdapter" android:resource="@xml/sync_contacts"/>
<meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="@xml/contacts_custom_type"/>
</service>
<service android:name="com.vk.sharing.SharingService"/>
<service android:enabled="true" android:exported="true" android:name="com.vk.pushes.FirebasePushService" android:stopWithTask="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:name="com.vk.pushes.VkFirebaseInstanceIdService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<service android:exported="true" android:name="com.vtosters.lite.directshare.ImDirectShareService" android:permission="android.permission.BIND_CHOOSER_TARGET_SERVICE">
<intent-filter>
<action android:name="android.service.chooser.ChooserTargetService"/>
</intent-filter>
</service>
<service android:name="com.vk.voip.VoipService"/>
<receiver android:name="com.vtosters.lite.audio.player.MediaButtonEventReceiver">
<intent-filter>
<action android:name="android.intent.action.MEDIA_BUTTON"/>
<action android:name="android.media.AUDIO_BECOMING_NOISY"/>
</intent-filter>
</receiver>
<receiver android:label="@string/widget_player" android:name="com.vtosters.lite.PlayerWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_player_provider"/>
</receiver>
<receiver android:label="@string/widget_player_big" android:name="com.vtosters.lite.PlayerBigWidget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider" android:resource="@xml/widget_player_big_provider"/>
</receiver>
<receiver android:name="com.vtosters.lite.LoadingBroadcastReceiver">
<intent-filter>
<action android:enabled="true" android:name="android.intent.action.DOWNLOAD_COMPLETE"/>
<action android:enabled="true" android:name="com.vtosters.lite.UPLOAD_RETRY"/>
</intent-filter>
</receiver>
<receiver android:name="com.vtosters.lite.BirthdayBroadcastReceiver"/>
<receiver android:name="com.vtosters.lite.DebugBroadcastReceiver">
<intent-filter>
<action android:name="android.provider.Telephony.SECRET_CODE"/>
<data android:host="777777" android:scheme="android_secret_code"/>
</intent-filter>
</receiver>
<receiver android:enabled="false" android:exported="true" android:name="com.vtosters.lite.PackageAddedReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
<receiver android:name="com.vk.pushes.NotificationActionsReceiver"/>
<receiver android:name="com.vk.pushes.NotificationDeleteReceiver"/>
<receiver android:name="com.vk.voip.VoipActionsReceiver"/>
<receiver android:exported="true" android:name="com.vtosters.lite.im.bridge.broadcasts.ImBroadcastReceiver" android:permission="com.vtosters.lite.permission.ACCESS_DATA"/>
<provider android:authorities="com.vtosters.lite.providers.audio" android:exported="true" android:name="com.vtosters.lite.audio.contentprovider.AudioContentProvider"/>
<provider android:authorities="com.vtosters.lite.providers.im" android:exported="true" android:name="com.vtosters.lite.im.bridge.contentprovider.ImContentProvider" android:permission="com.vtosters.lite.permission.ACCESS_DATA"/>
<provider android:authorities="ru.vtosters.lite.provider.VKFileProvider" android:exported="false" android:grantUriPermissions="true" android:name="ru.vtosters.lite.provider.VKFileProvider">
<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/provider_paths"/>
</provider>
<uses-library android:name="com.sec.android.app.multiwindow" android:required="false"/>
<meta-data android:name="android.max_aspect" android:value="3.0"/>
<meta-data android:name="com.sec.android.support.multiwindow" android:value="true"/>
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_W" android:resource="@dimen/app_defaultsize_w"/>
<meta-data android:name="com.sec.android.multiwindow.DEFAULT_SIZE_H" android:resource="@dimen/app_defaultsize_h"/>
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_W" android:resource="@dimen/app_minimumsize_w"/>
<meta-data android:name="com.sec.android.multiwindow.MINIMUM_SIZE_H" android:resource="@dimen/app_minimumsize_h"/>
<meta-data android:name="optimization_key" android:value="lONMnJymOutPww6aDtTpqGS77DtnW6hlwIrhgDPTGGyu+UvR7aR+nf8V4tSiVPyOZXgsTxne0umX209UUetCDGLXYcoMZLz/mNX4osYj/ACdI+6N7zFlO9+4L4vWJhlL59TKmQ3LDPyrd+InYdPl/WYwPBCBeeSMOPXVpUWEQsMH301NstEjSBZv+O0QzeuQS9/Jy94iop4kyFEtDkslfk6DyFEqeBLMA+D34UUhhsjwrwLC9FDtKJFTgSvfWbL0yT8GyNrUlsBlyRFsMUs6VvrMVJ9pft1rFEnn78jsaD8HrAWaIeq+DBjZ1KRokb2OI7U/XP14lbYMpLo4LgvfeQ=="/>
<meta-data android:name="com.samsung.android.icon_container.has_icon_container" android:value="true"/>
<meta-data android:name="asset_statements" android:resource="@string/asset_statements"/>
<service android:name="com.vk.audio.AudioMessagePlayerService"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:label="" android:name="com.vk.avatarpicker.AvatarPickerActivity" android:theme="@style/AvatarPickerStyle"/>
<receiver android:name="receivers.TimeSyncRequestedReceiver"/>
<service android:enabled="true" android:exported="false" android:name="com.vk.instantjobs.services.JobsBackgroundService" android:stopWithTask="false"/>
<service android:enabled="true" android:exported="false" android:name="com.vk.instantjobs.services.JobsForegroundService" android:stopWithTask="false"/>
<receiver android:enabled="true" android:exported="false" android:name="com.vk.instantjobs.receivers.BootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.QUICKBOOT_POWERON"/>
<action android:name="com.htc.intent.action.QUICKBOOT_POWERON"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<receiver android:enabled="true" android:exported="false" android:name="com.vk.instantjobs.receivers.InstantJobCancelReceiver">
<intent-filter>
<action android:name="com.vk.instantjobs.receivers.ACTION_CANCEL"/>
</intent-filter>
</receiver>
<provider android:authorities="com.vtosters.lite.UsersContentProvider" android:exported="true" android:name="com.vk.usersstore.UsersContentProvider" android:readPermission="com.vk.usersstore.permission.LOAD" android:writePermission="com.vk.usersstore.permission.SAVE"/>
<activity android:name="com.vk.api.sdk.ui.VKWebViewAuthActivity" android:theme="@style/VK.Transparent"/>
<activity android:name="com.vk.api.sdk.ui.VKCaptchaActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:name="com.vk.api.sdk.ui.VKConfirmationActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<provider android:authorities="com.vtosters.lite.VKInitProvider" android:exported="false" android:name="com.vk.api.sdk.internal.VKInitProvider"/>
<activity android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|screenSize" android:name="com.facebook.FacebookActivity" android:theme="@style/com_facebook_activity_theme"/>
<activity android:name="com.facebook.CustomTabMainActivity"/>
<activity android:name="com.facebook.CustomTabActivity"/>
<activity android:exported="false" android:label="" android:name="pub.devrel.easypermissions.AppSettingsDialogHolderActivity" android:theme="@style/EasyPermissions.Transparent"/>
<activity android:excludeFromRecents="true" android:exported="false" android:name="com.google.android.gms.auth.api.signin.internal.SignInHubActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<service android:exported="true" android:name="com.google.android.gms.auth.api.signin.RevocationBoundService" android:permission="com.google.android.gms.auth.api.signin.permission.REVOCATION_NOTIFICATION"/>
<service android:exported="false" android:name="com.google.firebase.components.ComponentDiscoveryService">
<meta-data android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" android:value="com.google.firebase.components.ComponentRegistrar"/>
</service>
<service android:exported="true" android:name="com.google.firebase.messaging.FirebaseMessagingService">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<receiver android:exported="true" android:name="com.google.firebase.iid.FirebaseInstanceIdReceiver" android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter>
<action android:name="com.google.android.c2dm.intent.RECEIVE"/>
</intent-filter>
</receiver>
<service android:exported="true" android:name="com.google.firebase.iid.FirebaseInstanceIdService">
<intent-filter android:priority="-500">
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<provider android:authorities="com.vtosters.lite.firebaseinitprovider" android:exported="false" android:initOrder="100" android:name="com.google.firebase.provider.FirebaseInitProvider"/>
<activity android:exported="false" android:name="com.google.android.gms.common.api.GoogleApiActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<activity android:configChanges="orientation|screenSize" android:excludeFromRecents="true" android:exported="false" android:name="com.twitter.sdk.android.core.identity.OAuthActivity"/>
<service android:exported="false" android:name="ru.mail.libverify.gcm.GcmMessageHandlerService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT"/>
</intent-filter>
</service>
<service android:exported="false" android:name="ru.mail.libverify.gcm.GcmInstanceIDListenerService">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT"/>
</intent-filter>
</service>
<service android:exported="false" android:name="ru.mail.libverify.gcm.GcmRegisterService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<service android:exported="false" android:name="ru.mail.libverify.gcm.GcmMessageDeliverService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<receiver android:exported="true" android:name="ru.mail.libverify.sms.SmsRetrieverReceiver">
<intent-filter>
<action android:name="com.google.android.gms.auth.api.phone.SMS_RETRIEVED"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.sms.SmsRetrieverService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<receiver android:enabled="false" android:exported="true" android:name="ru.mail.libverify.sms.IncomingSmsReceiver" android:permission="android.permission.BROADCAST_SMS">
<intent-filter android:priority="999">
<action android:name="android.provider.Telephony.SMS_RECEIVED"/>
</intent-filter>
</receiver>
<receiver android:enabled="false" android:exported="true" android:name="ru.mail.libverify.sms.IncomingCallReceiver" android:permission="android.permission.READ_PHONE_STATE">
<intent-filter android:priority="999">
<action android:name="android.intent.action.PHONE_STATE"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.sms.SmsHandlingService" android:permission="android.permission.BIND_JOB_SERVICE">
<intent-filter>
<action android:name="ru.mail.sms.SmsHandlingService"/>
</intent-filter>
</service>
<service android:enabled="true" android:exported="true" android:name="ru.mail.libverify.ipc.IpcMessageService" android:permission="android.permission.INTERNET">
<intent-filter>
<action android:name="ru.mail.libverify.ipc.IpcMessageService"/>
</intent-filter>
</service>
<service android:enabled="true" android:exported="true" android:name="ru.mail.libverify.ipc.IpcNotificationService" android:permission="android.permission.INTERNET">
<intent-filter>
<action android:name="ru.mail.libverify.ipc.IpcNotificationService"/>
</intent-filter>
</service>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.notifications.NotificationService">
<intent-filter>
<action android:name="ru.mail.notifications.NotificationService"/>
</intent-filter>
</service>
<activity android:clearTaskOnLaunch="true" android:excludeFromRecents="true" android:exported="false" android:launchMode="singleTask" android:name="ru.mail.libverify.notifications.SettingsActivity" android:noHistory="true" android:taskAffinity="ru.mail.libverify.notifications.SettingsActivity" android:theme="@style/libverify.Theme.Settings"/>
<activity android:clearTaskOnLaunch="true" android:configChanges="keyboardHidden|orientation|screenSize" android:excludeFromRecents="true" android:exported="false" android:launchMode="singleTask" android:name="ru.mail.libverify.notifications.SmsCodeNotificationActivity" android:noHistory="true" android:taskAffinity="ru.mail.libverify.notifications.SmsCodeNotificationActivity" android:theme="@style/libverify.Theme.Custom.Popup" android:windowSoftInputMode="stateAlwaysHidden"/>
<activity android:clearTaskOnLaunch="true" android:excludeFromRecents="true" android:exported="false" android:launchMode="singleTask" android:name="ru.mail.libverify.notifications.SmsDialogsActivity" android:taskAffinity="ru.mail.libverify.notifications.SmsDialogsActivity" android:theme="@style/libverify.Theme.Settings"/>
<activity android:excludeFromRecents="true" android:exported="false" android:name="ru.mail.libverify.notifications.SmsMessagesActivity" android:parentActivityName="ru.mail.libverify.notifications.SmsDialogsActivity" android:taskAffinity="ru.mail.libverify.notifications.SmsDialogsActivity" android:theme="@style/libverify.Theme.Settings">
<meta-data android:name="android.support.PARENT_ACTIVITY" android:value=".notifications.SmsDialogsActivity"/>
</activity>
<receiver android:name="ru.mail.libverify.utils.NetworkStateReceiver"/>
<receiver android:name="ru.mail.libverify.utils.network.NetworkStateReceiver">
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE"/>
</intent-filter>
</receiver>
<receiver android:name="ru.mail.libverify.utils.ScreenStateReceiver">
<intent-filter>
<action android:name="android.intent.action.SCREEN_OFF"/>
<action android:name="android.intent.action.SCREEN_ON"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.utils.VerificationService"/>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.utils.VerificationJobService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.utils.network.NetworkCheckService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<receiver android:label="PackageStateReceiver:184" android:name="ru.mail.libverify.utils.PackageStateReceiver">
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<data android:scheme="package"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
<intent-filter>
<action android:name="android.intent.action.ACTION_MY_PACKAGE_REPLACED"/>
<data android:scheme="package"/>
</intent-filter>
<intent-filter>
<action android:name="ru.mail.libverify.utils.PackageStateReceiver"/>
</intent-filter>
</receiver>
<service android:enabled="true" android:exported="false" android:label="VerificationCheckService" android:name="ru.mail.libverify.fetcher.FetcherService"/>
<service android:enabled="true" android:exported="false" android:label="VerificationCheckService" android:name="ru.mail.libverify.fetcher.FetcherJobService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.utils.SettingsCheckService"/>
<service android:enabled="true" android:exported="false" android:name="ru.mail.libverify.utils.SettingsCheckJobService" android:permission="android.permission.BIND_JOB_SERVICE"/>
<receiver android:enabled="false" android:name="ru.mail.libverify.utils.SystemRestartReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
</intent-filter>
</receiver>
<receiver android:name="ru.mail.libverify.utils.AlarmReceiver"/>
<receiver android:enabled="false" android:name="ru.mail.libverify.utils.BatteryLevelReceiver">
<intent-filter>
<action android:name="android.intent.action.BATTERY_LOW"/>
<action android:name="android.intent.action.BATTERY_OKAY"/>
<action android:name="android.intent.action.ACTION_POWER_CONNECTED"/>
<action android:name="android.intent.action.ACTION_POWER_DISCONNECTED"/>
</intent-filter>
</receiver>
<activity android:name="ru.mail.libverify.utils.permissions.ShadowActivity" android:theme="@android:style/Theme.Translucent.NoTitleBar"/>
<provider android:authorities="com.vtosters.lite.FacebookInitProvider" android:exported="false" android:name="com.facebook.internal.FacebookInitProvider"/>
<receiver android:exported="false" android:name="com.facebook.CurrentAccessTokenExpirationBroadcastReceiver">
<intent-filter>
<action android:name="com.facebook.sdk.ACTION_CURRENT_ACCESS_TOKEN_CHANGED"/>
</intent-filter>
</receiver>
<uses-library android:name="android.test.runner"/>
<activity android:label="@string/vtlproxy" android:launchMode="singleTop" android:name="ru.vtosters.lite.ui.fragments.ProxySettingsFragment" android:windowSoftInputMode="adjustPan"/>
<activity android:label="@string/vtlmusic" android:launchMode="singleTop" android:name="ru.vtosters.lite.ui.fragments.MusicFragment" android:windowSoftInputMode="adjustPan"/>
<service android:name="com.aefyr.tsg.g2.TelegramStickersService"/>
</application>
</manifest>
@@ -0,0 +1 @@
com.fasterxml.jackson.core.JsonFactory

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