Compare commits

...
28 Commits
Author SHA1 Message Date
gdlbo 9360ea4d85 Color article fixes 2022-06-02 19:45:49 +03:00
gdlbo c87d6581c8 Color fixes 2022-06-02 19:28:16 +03:00
gdlbo 7133fc6c03 Disabled discover ads 2022-06-02 19:04:24 +03:00
gdlbo 46af5af250 Fix https://github.com/vtosters/lite/issues/266 2022-06-02 17:38:28 +03:00
gdlbo 5b9cc6778c Fixes 2022-06-02 16:42:45 +03:00
gdlbo 5260ad8243 Fixed comments load 2022-06-02 14:25:32 +03:00
gdlbo 2996772020 Updated gitignore 2022-06-02 14:02:37 +03:00
gdlbo d37534cb6b Fixed icon changing 2022-06-02 13:25:19 +03:00
gdlbo 92eb48c21e Fixed crash + fixed msg cache 2022-06-02 13:06:55 +03:00
gdlbo d9e867cb6e Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 12:33:52 +03:00
gdlbo f200c6e59a Refactoring of some code that suggested what to fix in the comments in our vk group 2022-06-02 11:20:11 +03:00
gdlbo c668f3bf9a Refactoring 2022-05-31 16:55:19 +03:00
gdlbo bd7afee09b added more documentations 2022-05-31 16:43:58 +03:00
gdlbo ff09a4aec0 Added our git links 2022-05-26 20:25:51 +03:00
gdlbo 1e6c60f2ed Fixed statusbar and navbar light coloring 2022-05-17 23:08:12 +03:00
gdlbo beedb1538d Poll fix 2022-05-17 20:05:16 +03:00
gdlbo 8463f9e963 Fixes 2022-05-17 18:40:56 +03:00
gdlbo ce8f88b8d4 reworked statusbar coloring 2022-05-17 00:35:39 +03:00
gdlbo ff7d080b5a fix music tabs 2022-05-16 22:38:57 +03:00
gdlbo 12ad83c607 reworked do not read 2022-05-16 21:50:32 +03:00
gdlbo cdf5d2c37c fixes 2022-05-16 21:27:59 +03:00
gdlbo 9af8e1729e copyright posts detect 2022-05-16 21:21:39 +03:00
gdlbo d5219ed322 Fixes + some imp of custom msg loader 2022-05-16 00:11:00 +03:00
gdlbo 7af9a72e77 Fixes 2022-05-15 21:23:48 +03:00
gdlbo 08817bde7e Reworked some cringe code 2022-05-15 21:11:25 +03:00
gdlbo d1e9aadd71 fixed white screamers (maybe) 2022-05-13 20:28:20 +03:00
gdlbo b6307182cd fixes 2022-05-13 19:59:36 +03:00
gdlbo cc70e55b53 Fix summ 2022-05-13 15:36:42 +03:00
98 changed files with 679 additions and 539 deletions
+1
View File
@@ -25,3 +25,4 @@ smali/assets/version.properties
app/src/main/assets/version.properties
smali/build/resources.zip
*.idsig
/smali/VTLite.apk.cache/
+4
View File
@@ -8,6 +8,10 @@ VTosters Lite - это модифицированный клиент (деком
Стабильные сборки находятся в [Releases](https://github.com/vtosters/lite/releases)
Зеркало на нашем [Git](https://git.devshelter.su/gdlbo/lite)
Зеркало на [Github](https://github.com/vtosters/lite)
## Отладка приложения
Для отладки с помощью Android Studio необходимо пройти в `/smali/AndroidManifest.xml`
@@ -1,7 +1,7 @@
package bruhcollective.itaysonlab.libvkx.client;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.Context;
import android.os.RemoteException;
@@ -36,7 +36,7 @@ public class LibVKXClient {
}
public static boolean isIntegrationEnabled() {
return BooleanFalse("libvkx_integration") && isVkxInstalled();
return getBoolValue("libvkx_integration", false) && isVkxInstalled();
}
public static boolean play(MusicTrack musicTrack, List<MusicTrack> list, PlayerRefer playerRefer) {
@@ -27,11 +27,11 @@ import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import ru.f0x1d.net.NetCall;
import ru.f0x1d.net.NetCallback;
import ru.f0x1d.net.NetClient;
import ru.f0x1d.net.NetRequest;
import ru.f0x1d.net.NetResponse;
import ru.vtosters.lite.net.NetCall;
import ru.vtosters.lite.net.NetCallback;
import ru.vtosters.lite.net.NetClient;
import ru.vtosters.lite.net.NetRequest;
import ru.vtosters.lite.net.NetResponse;
/**
* Created by Aefyr on 11.05.2018.
@@ -1,86 +0,0 @@
package ru.f0x1d.net;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.os.AsyncTask;
import com.vk.core.network.Network;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class F0x1dRequest {
public static void makeRequest(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback) {
new MakeRequestTask(bArr, f0x1dRequestCallback).execute();
}
public static void makeRequest(String str, F0x1dRequestCallback f0x1dRequestCallback) {
new MakeRequestTask(str.getBytes(), f0x1dRequestCallback).execute();
}
public static void makeRequestToaster(String str, F0x1dRequestCallback f0x1dRequestCallback, boolean z) {
new MakeRequestTask(str.getBytes(), f0x1dRequestCallback, true, !z).execute();
}
public interface F0x1dRequestCallback {
void onResponse(String str);
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private final F0x1dRequestCallback callback;
private boolean mIsPut;
private boolean mIsVkToasterRequest;
private final byte[] url;
public MakeRequestTask(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback) {
this.mIsVkToasterRequest = false;
this.mIsPut = false;
this.callback = f0x1dRequestCallback;
this.url = bArr;
}
public MakeRequestTask(byte[] bArr, F0x1dRequestCallback f0x1dRequestCallback, boolean z, boolean z2) {
this.mIsVkToasterRequest = false;
this.mIsPut = false;
this.callback = f0x1dRequestCallback;
this.url = bArr;
this.mIsVkToasterRequest = z;
this.mIsPut = z2;
}
public String doInBackground(Void... voidArr) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(this.url)).openConnection();
httpURLConnection.setRequestMethod(this.mIsPut ? "PUT" : "GET");
if (this.mIsVkToasterRequest) {
httpURLConnection.setRequestProperty("Token", getUserToken());
}
if (!this.mIsVkToasterRequest) {
httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a());
}
httpURLConnection.setRequestProperty("Content-Type", this.mIsVkToasterRequest ? "Content-Type" : "application/x-www-form-urlencoded");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
stringBuffer.append(readLine);
} else {
bufferedReader.close();
return stringBuffer.toString();
}
}
} catch (Exception e) {
return e.getLocalizedMessage();
}
}
public void onPostExecute(String str) {
super.onPostExecute(str);
this.callback.onResponse(str);
}
}
}
@@ -1,6 +1,6 @@
package ru.vtosters.lite.dnr;
import static ru.f0x1d.net.F0x1dRequest.makeRequest;
import static ru.vtosters.lite.net.Request.makeRequest;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import static ru.vtosters.lite.utils.Proxy.getApiCom;
@@ -1,10 +1,10 @@
package ru.vtosters.lite.dnr;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
public class DNRPrefs {
public static boolean getStoriesRead() {
return BooleanFalse("read_s");
return getBoolValue("read_s", false);
}
public static boolean getMarkAsReadWithoutExceptions(int peerId) {
@@ -28,27 +28,27 @@ public class DNRPrefs {
}
public static boolean readPM(int peer) {
return (peer > 0 && peer < 2000000000) && BooleanFalse("read_pm");
return (peer > 0 && peer < 2000000000) && getBoolValue("read_pm", false);
}
public static boolean readConversations(int peer) {
return (peer > 2000000000) && BooleanFalse("read_conversations");
return (peer > 2000000000) && getBoolValue("read_conversations", false);
}
public static boolean readBots(int peer) {
return (peer < 0) && BooleanFalse("read_bot");
return (peer < 0) && getBoolValue("read_bot", false);
}
public static boolean writePM(int peer) {
return (peer > 0 && peer < 2000000000) && BooleanFalse("write_pm");
return (peer > 0 && peer < 2000000000) && getBoolValue("write_pm", false);
}
public static boolean writeConversations(int peer) {
return (peer > 2000000000) && BooleanFalse("write_conversations");
return (peer > 2000000000) && getBoolValue("write_conversations", false);
}
public static boolean writeBots(int peer) {
return (peer < 0) && BooleanFalse("write_bot");
return (peer < 0) && getBoolValue("write_bot", false);
}
public static boolean getActivityWithoutExceptions(int peerId) {
@@ -1,7 +1,6 @@
package ru.vtosters.lite.encryption.base;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
@@ -50,29 +49,29 @@ public abstract class IMProcessor {
public boolean isUsed() {
//Log.d("IMProcessor", "Checking if decoded with "+getUIName());
return BooleanTrue("VT_IMDecode_"+getPrefKey());
return getBoolValue("VT_IMDecode_"+getPrefKey(), true);
}
public boolean isUsedToEncrypt(int id) {
//Log.d("IMProcessor", "Checking if "+id+" is ready to be encrypted with "+getUIName());
return BooleanFalse("VT_IMEncode_"+getPrefKey()+"_"+id);
return getBoolValue("VT_IMEncode_"+getPrefKey()+"_"+id, false);
}
public void enableEncryptFor(int id) {
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, true).apply();
Globals.getDefprefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, true).apply();
}
public void disableEncryptFor(int id) {
Globals.getPrefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, false).apply();
Globals.getDefprefs().edit().putBoolean("VT_IMEncode_"+getPrefKey()+"_"+id, false).apply();
}
public void setEncryptionKeyFor(int id, @Nullable String key) {
if (key == null || key.isEmpty()) key = "VTAesDefault";
Globals.getPrefs().edit().putString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, key).apply();
Globals.getDefprefs().edit().putString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, key).apply();
}
@Nullable
public String getEncryptionKeyFor(int id) {
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, null);
return Globals.getDefprefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, null);
}
}
@@ -113,7 +113,7 @@ public class VTostersAESProcessor extends IMProcessor {
@Nullable
@Override
public String getEncryptionKeyFor(int id) {
return Globals.getPrefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, "VTAesDefault");
return Globals.getDefprefs().getString("VT_IMEncodeKey_"+getPrefKey()+"_"+id, "VTAesDefault");
}
public static class Triple<F, S, T> {
@@ -1,6 +1,6 @@
package ru.vtosters.lite.f0x1d;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.Context;
import android.content.SharedPreferences;
@@ -42,6 +42,7 @@ public class VTVerifications {
public static void load(Context context) {
mVerificationsCache = context.getSharedPreferences("vt_another_data", 0);
try {
processArray(new JSONArray(getLoaded(VERIFICATIONS_KEY)), sVerificationsMap, null);
processArray(new JSONArray(getLoaded(PROMETHEUS_KEY)), sPrometheusMap, null);
@@ -53,7 +54,7 @@ public class VTVerifications {
}
Request request = new Request.Builder()
.url("https://gdlbo.net/vktoaster/getGalo4kiBatch")
.url("https://vtosters.app/vktoaster/getGalo4kiBatch")
.a(RequestBody.a(MediaType.b("application/json; charset=UTF-8"), "{\"types\":[0,228,404,1337]}"))
.build();
@@ -102,9 +103,7 @@ public class VTVerifications {
}
public static boolean hasPrometheus(int i) {
return sPrometheusMap.get(i) != null ? sPrometheusMap.get(i) : false;
}
public static boolean isDeveloper(int i) {
@@ -132,13 +131,20 @@ public class VTVerifications {
return Base64.encodeToString(str.getBytes(), 1);
}
public static boolean vtverif() {
return getBoolValue("VT_Verification", true);
}
public static boolean isVerified(JSONObject jSONObject) {
if (jSONObject.optInt("verified", 0) == 1) {
return true;
}
if (!BooleanTrue("VT_Verification")) {
if (!getBoolValue("VT_Verification", true)) {
return false;
}
return isVerified((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
}
@@ -146,16 +152,19 @@ public class VTVerifications {
if (jSONObject.optInt("trending", 0) == 1) {
return true;
}
if (!BooleanTrue("VT_Fire")) {
if (!getBoolValue("VT_Fire", true)) {
return false;
}
return hasPrometheus((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
}
public static boolean hasDeveloper(JSONObject jSONObject) {
if (!BooleanTrue("VT_Dev")) {
if (!getBoolValue("VT_Dev", true)) {
return false;
}
return isDeveloper((jSONObject.optString(NavigatorKeys.j) == null || (!jSONObject.optString(NavigatorKeys.j).equals("group") && !jSONObject.optString(NavigatorKeys.j).equals("page"))) ? jSONObject.optInt("id", 0) : -jSONObject.optInt("id", 0));
}
@@ -25,9 +25,7 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import ru.f0x1d.net.F0x1dRequest;
import ru.vtosters.lite.utils.Preferences;
import ru.vtosters.lite.net.Request;
public class FoafBase {
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
@@ -36,7 +34,7 @@ public class FoafBase {
private static final OkHttpClient client = new OkHttpClient();
public static int GetLastSeenInt(int i) throws ParseException, IOException {
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(client.newCall(new Request.Builder().url(getLink(i)).build()).b().body().string());
Matcher matcher = FOAF_REGEX_LAST_SEEN.matcher(client.newCall(new okhttp3.Request.Builder().url(getLink(i)).build()).b().body().string());
if (!matcher.find()) {
return 0;
}
@@ -68,8 +66,8 @@ public class FoafBase {
progressDialog.setCancelable(false);
progressDialog.show();
F0x1dRequest.F0x1dRequestCallback callback = str -> FoafBase.lambdaLoadAndShow(progressDialog, context, i, str);
F0x1dRequest.makeRequest(getLink(i), callback);
Request.RequestCallback callback =str -> FoafBase.lambdaLoadAndShow(progressDialog, context, i, str);
Request.makeRequest(getLink(i), callback);
}
static void lambdaLoadAndShow(ProgressDialog progressDialog, Context context, int i, String str) {
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import android.util.Base64;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.io.IOException;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.net.PasswordAuthentication;
import java.net.Proxy;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.util.Map;
import java.util.TreeMap;
@@ -1,4 +1,4 @@
package ru.f0x1d.net;
package ru.vtosters.lite.net;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
@@ -0,0 +1,76 @@
package ru.vtosters.lite.net;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import android.os.AsyncTask;
import com.vk.core.network.Network;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
import java.net.URL;
public class Request {
public static void makeRequest(byte[] bArr, RequestCallback RequestCallback) {
new MakeRequestTask(bArr, RequestCallback).execute();
}
public static void makeRequest(String str, RequestCallback RequestCallback) {
new MakeRequestTask(str.getBytes(), RequestCallback).execute();
}
public interface RequestCallback {
void onResponse(String str);
}
private static class MakeRequestTask extends AsyncTask<Void, Void, String> {
private final RequestCallback callback;
private boolean mIsPut;
private boolean mIsVTostersRequest;
private final byte[] url;
public MakeRequestTask(byte[] bArr, RequestCallback RequestCallback) {
mIsVTostersRequest = false;
mIsPut = false;
callback = RequestCallback;
url = bArr;
}
public String doInBackground(Void... voidArr) {
try {
HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(new String(url)).openConnection();
httpURLConnection.setRequestMethod(mIsPut ? "PUT" : "GET");
if (mIsVTostersRequest) {
httpURLConnection.setRequestProperty("Token", getUserToken());
}
if (!mIsVTostersRequest) {
httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a());
}
httpURLConnection.setRequestProperty("Content-Type", mIsVTostersRequest ? "Content-Type" : "application/x-www-form-urlencoded");
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(httpURLConnection.getInputStream()));
StringBuffer stringBuffer = new StringBuffer();
while (true) {
String readLine = bufferedReader.readLine();
if (readLine != null) {
stringBuffer.append(readLine);
} else {
bufferedReader.close();
return stringBuffer.toString();
}
}
} catch (Exception e) {
return e.getLocalizedMessage();
}
}
public void onPostExecute(String str) {
super.onPostExecute(str);
callback.onResponse(str);
}
}
}
@@ -2,7 +2,7 @@ package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -17,7 +17,7 @@ import ru.vtosters.lite.utils.OEMDetector;
public class DisableBattery {
public static void alert(Activity activity) {
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && BooleanTrue("showDoze")) {
if (OEMDetector.isOEM() && Build.VERSION.SDK_INT >= 23 && getBoolValue("showDoze", true)) {
final Context context = getContext();
if (!((PowerManager) context.getSystemService(Context.POWER_SERVICE)).isIgnoringBatteryOptimizations(context.getPackageName())) {
AlertDialog.Builder builder = new AlertDialog.Builder(activity);
@@ -3,7 +3,7 @@ package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.isGmsInstalled;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -39,7 +39,7 @@ public class InstallGMS {
context.startActivity(a2);
}
});
if (BooleanTrue("showAlertGms")) {
if (getBoolValue("showAlertGms", true)) {
builder.show();
}
}
@@ -1,7 +1,7 @@
package ru.vtosters.lite.ui.dialogs;
import static ru.vtosters.lite.utils.Globals.edit;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.app.Activity;
import android.app.AlertDialog;
@@ -36,7 +36,7 @@ public class Start {
activity.startActivity(new Intent("android.intent.action.VIEW").setData(Uri.parse("https://t.me/vtosters")));
}
});
if (BooleanTrue("showAlert")) {
if (getBoolValue("showAlert", true)) {
builder.show();
}
}
@@ -1,8 +1,7 @@
package ru.vtosters.lite.ui.fragments;
import static ru.vtosters.lite.utils.Globals.componentSwitcher;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.IconHelper.switchToDefault;
import static ru.vtosters.lite.utils.IconHelper.switchToVK;
import android.os.Bundle;
import android.support.v7.preference.Preference;
@@ -22,10 +21,13 @@ public class ThemesFragment extends MaterialPreferenceToolbarFragment {
public boolean apply(Preference preference, Object obj) {
if (((Boolean) obj).booleanValue()) {
switchToVK();
componentSwitcher("VTIconDefault", false);
componentSwitcher("VTIconVK", true);
} else {
switchToDefault();
componentSwitcher("VTIconDefault", true);
componentSwitcher("VTIconVK", false);
}
ToastUtils.a(getString("iconapplying"));
return true;
}
@@ -6,7 +6,6 @@ import static ru.vtosters.lite.utils.Preferences.olddock;
import com.vk.apps.AppsFragment;
import com.vk.discover.DiscoverFragment;
import com.vk.discover.GatewaysFragment;
import com.vk.fave.fragments.FaveTabFragment;
import com.vk.feedlikes.fragments.FeedLikesFragment;
import com.vk.menu.MenuFragment;
@@ -80,7 +79,7 @@ public class DockBarManager {
if (!dockbar.exists()) {
mSelectedTabs.add(new DockBarTab("tab_news", olddock() ? R.drawable.ic_newsfeed_28 : R.drawable.ic_menu_newsfeed_outline_28, R.string.newsfeed, R.id.tab_news, newfeed() ? HomeFragment.class : NewsfeedFragment.class));
mSelectedTabs.add(new DockBarTab("tab_discover", olddock() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, newfeed() ? GatewaysFragment.class : DiscoverFragment.class ));
mSelectedTabs.add(new DockBarTab("tab_discover", olddock() ? R.drawable.ic_search_28 : R.drawable.ic_menu_search_outline_28, R.string.search, R.id.tab_discover, DiscoverFragment.class ));
mSelectedTabs.add(new DockBarTab("tab_messages", olddock() ? R.drawable.ic_menu_messages_28 : R.drawable.ic_message_28_outline, R.string.messages, R.id.tab_messages, DialogsFragment.class));
mSelectedTabs.add(new DockBarTab("tab_feedback", olddock() ? R.drawable.ic_menu_notifications_28 : R.drawable.ic_menu_notification_outline_28, R.string.feedback, R.id.tab_feedback, NotificationsContainerFragment.class));
mSelectedTabs.add(new DockBarTab("tab_menu", olddock() ? R.drawable.ic_menu_more_28 : R.drawable.ic_menu_more_outline_28, R.string.menu, R.id.tab_menu, MenuFragment.class));
@@ -124,8 +123,8 @@ public class DockBarManager {
} else {
if (tab.fragmentClass == HomeFragment.class) {
tab.fragmentClass = NewsfeedFragment.class;
} else if (tab.fragmentClass == GatewaysFragment.class) {
tab.fragmentClass = GatewaysFragment.class;
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = DiscoverFragment.class;
}
}
mSelectedTabs.add(tab);
@@ -145,12 +144,12 @@ public class DockBarManager {
if (tab.fragmentClass == NewsfeedFragment.class) {
tab.fragmentClass = HomeFragment.class;
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = GatewaysFragment.class;
tab.fragmentClass = DiscoverFragment.class;
}
} else {
if (tab.fragmentClass == HomeFragment.class) {
tab.fragmentClass = NewsfeedFragment.class;
} else if (tab.fragmentClass == GatewaysFragment.class) {
} else if (tab.fragmentClass == DiscoverFragment.class) {
tab.fragmentClass = DiscoverFragment.class;
}
}
@@ -8,8 +8,8 @@ import static ru.vtosters.lite.utils.Globals.getIdentifier;
import static ru.vtosters.lite.utils.Globals.getResources;
import static ru.vtosters.lite.utils.Globals.getString;
import static ru.vtosters.lite.utils.Themes.getAccentColor;
import static ru.vtosters.lite.utils.Themes.getNavbarColor;
import static ru.vtosters.lite.utils.Themes.getSTextAttr;
import static ru.vtosters.lite.utils.Themes.getTabbarBackground;
import static ru.vtosters.lite.utils.Themes.getTextAttr;
import static ru.vtosters.lite.utils.Themes.recolorDrawable;
@@ -60,7 +60,7 @@ public class StickersFragment extends ToolbarFragment {
public final static String ACTION_RELOAD = "com.vtosters.lite.action.RELOAD_TGS_LIST";
private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2, TYPE_TOASTER_SERVER = 3;
private final static int TYPE_DIRECT = 0, TYPE_SOCKS = 2;
private static final String TAG = "StickersFragment";
public int from;
public int to;
@@ -97,7 +97,6 @@ public class StickersFragment extends ToolbarFragment {
private void initGrabber() {
int method = TGPref.getTGConnectMethod();
switch (method) {
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
TelegramStickersGrabber.USE_PROXY = false;
grabber.resetProxy();
@@ -251,7 +250,6 @@ public class StickersFragment extends ToolbarFragment {
openMenu(getString("stickersproxy1"));
return;
}
case TYPE_TOASTER_SERVER:
case TYPE_DIRECT:
final Runnable work = () -> {
LinearLayout linearLayout = new LinearLayout(super.n());
@@ -372,7 +370,7 @@ public class StickersFragment extends ToolbarFragment {
holder.switchCompat.setOnCheckedChangeListener((buttonView, isChecked) -> stickersService.setPackEnabled(pack, isChecked, false));
holder.count.setText(pack.stickersCount + " " + getString("stickerscount"));
holder.layout.setBackgroundColor(getNavbarColor());
holder.layout.setBackgroundColor(getTabbarBackground());
// Color костыль
int color = getTextAttr();
@@ -44,7 +44,7 @@ public class About {
}
public static String getCommitLink() {
return "https://github.com/vtosters/lite/commit/" + getBuild(getContext(), "version.properties");
return "https://git.devshelter.su/gdlbo/lite/commit/" + getBuild(getContext(), "version.properties"); // https://github.com/vtosters/lite/commit/ github repo
}
public static String getBuild(Context context, String name) {
@@ -1,8 +1,8 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import android.content.ContentValues;
import android.database.Cursor;
@@ -25,7 +25,6 @@ import java.util.List;
import ru.vtosters.lite.encryption.EncryptProvider;
public class DeletedMessagesHandler {
private static List<Integer> sDeletedMessagesList = new ArrayList<>();
private static SQLiteDatabase sVKSQLiteDatabase;
@@ -44,7 +43,7 @@ public class DeletedMessagesHandler {
}
public static boolean hook() {
return BooleanFalse("undeletemsg");
return getBoolValue("undeletemsg", false);
}
public static void setBodyDBParser(Msg msg) {
@@ -76,17 +75,7 @@ public class DeletedMessagesHandler {
}
private static String getPreifxUndelete() {
String string = getPreferences().getString("undeletemsg_prefix", "");
if (string.isEmpty()) {
return "[Удалено] ";
}
if (string.equals("icon")) {
return "\uD83D\uDDD1 ";
}
if (string.equals("icon2")) {
return "❌ ";
}
return "[Удалено] ";
return getPrefsValue("undeletemsg_prefix") + " ";
}
public static void updateDialog(MsgDeleteLpTask msgDeleteLpTask) {
@@ -128,7 +117,6 @@ public class DeletedMessagesHandler {
}
public static class DeletedMessagesDBHelper extends SQLiteOpenHelper {
public DeletedMessagesDBHelper() {
super(getContext(), "deleted_msgs", null, 1);
}
@@ -1,11 +1,13 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Preferences.getLocale;
import static ru.vtosters.lite.utils.Preferences.preferences;
import android.app.Activity;
import android.app.Application;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
@@ -34,17 +36,23 @@ import java.util.Locale;
public class Globals {
private static final List<Activity> activities = new ArrayList<>();
static SharedPreferences prefs = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
public static SharedPreferences getPrefs() {
if (prefs == null) prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
return prefs;
public static SharedPreferences getDefprefs() {
if (preferences == null) preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
return preferences;
}
// Current UserId
public static void componentSwitcher(String component, Boolean enabled) {
var packageManager = getContext().getPackageManager();
packageManager.setComponentEnabledSetting(new ComponentName(getPackageName(), getPackageName() + "." + component), enabled? PackageManager.COMPONENT_ENABLED_STATE_ENABLED : PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
} // Component switcher for changing app icon
public static String getPrefsValue(String pref) {
return getPreferences().getString(pref, "");
} // Get pref value as string
public static int getUserId() {
return VKAccountManager.b().a();
}
} // Current UserId
public static String getUserSecret() {
return VKAccountManager.b().c();
@@ -56,17 +64,15 @@ public class Globals {
public static SharedPreferences.Editor edit() {
return PreferenceManager.getDefaultSharedPreferences(getContext()).edit();
}
} // Edit SharedPreferences
// Delete and reload msg cache
public static void reloadMSG() {
ImEngineProvider.a().h();
}
} // Delete and reload msg cache
// UserId Profile via userProfile
public static int getUserID(UserProfile userProfile) {
return userProfile.n;
}
} // UserId Profile via userProfile
public static String getUserFirstName(UserProfile userProfile) {
return userProfile.p;
@@ -76,26 +82,25 @@ public class Globals {
return userProfile.o;
}
// UserId Profile via extendedUserProfile
public static int getUserID(ExtendedUserProfile extendedUserProfile) {
return getUserID(fromEup(extendedUserProfile));
}
} // UserId Profile via extendedUserProfile
public static UserProfile fromEup(ExtendedUserProfile extendedUserProfile) {
return extendedUserProfile.a;
}
// Application restart (works on sdk 29+ too)
public static void restartApplication() {
Context ctx = getContext();
PackageManager pm = ctx.getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(ctx.getPackageName());
Intent mainIntent = Intent.makeRestartActivityTask(intent.getComponent());
ctx.startActivity(mainIntent);
Runtime.getRuntime().exit(0);
}
// Global Context
Runtime.getRuntime().exit(0);
} // Application restart (works on sdk 29+ too)
@NonNull
public static Context getContext() {
try {
@@ -107,9 +112,9 @@ public class Globals {
e.printStackTrace();
}
return null;
}
} // Getting the global context through reflection to use context on application initialization
// Google Market Services check
public static boolean isGmsInstalled() {
try {
getContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
@@ -117,19 +122,19 @@ public class Globals {
} catch (Exception unused) {
return false;
}
}
} // Google Market Services check
public static Resources getResources() {
return getContext().getResources();
}
public static int getIdentifier(String str, String str2) {
return getResources().getIdentifier(str, str2, getContext().getPackageName());
}
public static int getIdentifier(String name, String type) {
return getResources().getIdentifier(name, type, getContext().getPackageName());
} // Get res id
public static String getString(String str) {
return getContext().getString(Integer.parseInt(String.valueOf(getContext().getResources().getIdentifier(str, "string", getContext().getPackageName()))));
}
public static String getString(String resourcename) {
return getContext().getString(Integer.parseInt(String.valueOf(getContext().getResources().getIdentifier(resourcename, "string", getContext().getPackageName()))));
} // Get string via getIdentifier
public static String getPackageName() {
return getContext().getPackageName();
@@ -155,28 +160,25 @@ public class Globals {
ConnectivityManager cm = (ConnectivityManager) getContext().getSystemService(Context.CONNECTIVITY_SERVICE);
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
return activeNetwork != null && activeNetwork.isConnectedOrConnecting();
}
} // Network check
// Music channels fix
public static void fixGapps() {
try {
if (Build.VERSION.SDK_INT >= 26) {
NotificationManager notificationManager = (NotificationManager) getContext().getSystemService(Context.NOTIFICATION_SERVICE);
boolean z = false;
boolean hasMusicChannel = false;
try {
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
z = true;
hasMusicChannel = true;
}
} catch (Exception ignored) {
}
if (!z) {
} catch (Exception ignored) {}
if (!hasMusicChannel) {
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", getResources().getString(com.vtosters.lite.R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
}
}
} catch (Exception ignored) {
}
}
} catch (Exception ignored) {}
} // Music channels fix
public static void registerActivities(Application application) {
application.registerActivityLifecycleCallbacks(new Application.ActivityLifecycleCallbacks() {
@@ -223,22 +225,25 @@ public class Globals {
return getContext().getApplicationInfo().loadLabel(getContext().getPackageManager()).toString();
}
// Language changer and BaseContext inject
public static Context BaseContextLocale(Context context) {
Locale locale = new Locale(getLocale());
Locale.setDefault(locale);
var resources = context.getResources();
var configuration = resources.getConfiguration();
if (Build.VERSION.SDK_INT >= 24) {
configuration.setLocale(locale);
configuration.setLayoutDirection(locale);
return context.createConfigurationContext(configuration);
}
configuration.locale = locale;
configuration.setLayoutDirection(locale);
resources.updateConfiguration(configuration, resources.getDisplayMetrics());
return context;
}
} // Language changer and BaseContext injector
public static float[] getCenterScreenCoords() {
int width = getResources().getDisplayMetrics().widthPixels;
@@ -1,23 +0,0 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPackageName;
import android.content.ComponentName;
import android.content.pm.PackageManager;
public class IconHelper {
public static void switchToVK() {
var packageManager = getContext().getPackageManager();
var packageName = getPackageName();
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
}
public static void switchToDefault() {
var packageManager = getContext().getPackageManager();
var packageName = getPackageName();
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconDefault"), PackageManager.COMPONENT_ENABLED_STATE_ENABLED, PackageManager.DONT_KILL_APP);
packageManager.setComponentEnabledSetting(new ComponentName(packageName, getPackageName() + ".VTIconVK"), PackageManager.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP);
}
}
@@ -3,20 +3,20 @@ package ru.vtosters.lite.utils;
import static java.lang.Long.MAX_VALUE;
import static ru.vtosters.lite.ui.fragments.dockbar.DockBarManager.getInstance;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.CommentsSort;
import static ru.vtosters.lite.utils.Preferences.adsgroup;
import static ru.vtosters.lite.utils.Preferences.adsstories;
import static ru.vtosters.lite.utils.Preferences.authorsrecomm;
import static ru.vtosters.lite.utils.Preferences.copyright_post;
import static ru.vtosters.lite.utils.Preferences.friendsrecomm;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Preferences.newfeed;
import static ru.vtosters.lite.utils.Preferences.postsrecomm;
import com.vk.apps.AppsFragment;
import com.vk.core.preference.Preference;
import com.vk.discover.DiscoverFragment;
import com.vk.discover.GatewaysFragment;
import com.vk.fave.fragments.FaveTabFragment;
import com.vk.menu.MenuFragment;
import com.vk.music.fragment.MusicFragment;
@@ -65,16 +65,16 @@ public class Newsfeed {
getFilter("default_ad_list", "StandartFilter.txt");
getFilter("shitposting", "IDontWantToReadIt.txt");
String string = getPreferences().getString("spamfilters", "");
String customfilters = getPrefsValue("spamfilters");
if (!string.isEmpty()) {
mFilters.addAll(Arrays.asList(string.split(", ")));
if (!customfilters.isEmpty()) {
mFilters.addAll(Arrays.asList(customfilters.split(", ")));
}
}
public static void getFilter(String boolname, String filename) {
if (BooleanTrue(boolname)) {
if (getBoolValue(boolname, true)) {
try {
BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(getContext().getAssets().open(filename)));
while (true) {
@@ -90,22 +90,22 @@ public class Newsfeed {
e.printStackTrace();
}
}
}
} // Get needed filter list from assets
public static boolean injectFilters(JSONObject jSONObject) {
String optString = jSONObject.optString(NavigatorKeys.j, "");
if (!ads(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
if (!ads(optString) && !checkCopyright(optString) && !authors_rec(optString) && !recomm(optString) && !friendrecomm(optString)) {
String optString2 = jSONObject.optString("post_type", "");
if (!ads(optString2) && !authors_rec(optString2) && !recomm(optString2) && !friendrecomm(optString2)) {
String optString3 = jSONObject.optString("filters", "");
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || checkCopyright(jSONObject) || captions(jSONObject)) {
if (ads(optString3) || authors_rec(optString3) || recomm(optString3) || friendrecomm(optString3) || isBlockedByFilter(jSONObject.optString(NavigatorKeys.x, "")) || captions(jSONObject)) {
return false;
}
return !AD(jSONObject);
}
}
return false;
}
} // json newsfeed/posts injector to detect and delete posts
public static boolean authors_rec(String str) {
return str.equals("authors_rec") && !authorsrecomm();
@@ -142,8 +142,8 @@ public class Newsfeed {
return jSONObject.optInt("marked_as_ads", 0) == 1 && adsgroup();
}
public static boolean checkCopyright(JSONObject jSONObject) {
return jSONObject.optInt("copyright", 0) == 1 && copyright_post();
public static boolean checkCopyright(String str) {
return str.equals("copyright") && copyright_post();
}
public static String friendsads() {
@@ -170,19 +170,12 @@ public class Newsfeed {
return adsstories() ? "null" : "ads";
}
public static String getCommentsSort(String def) {
switch (getPreferences().getString("commentssort", "")) {
case "new":
return "desc";
case "old":
return "asc";
default:
return def;
}
public static String getCommentsSort(int value) {
return !CommentsSort() && value == 2 || value == 1 ? "desc" : "asc";
}
public static long getUpdateNewsfeed(boolean refresh_timeout) {
switch (getPreferences().getString("newsupdate", "")) {
switch (getPrefsValue("newsupdate")) {
case "no_update":
return MAX_VALUE;
case "imd_update":
@@ -193,7 +186,7 @@ public class Newsfeed {
}
public static Class getStartFragment() {
switch (getPreferences().getString("start_values", "")) {
switch (getPrefsValue("start_values")) {
case "newsfeed":
return newfeed() ? HomeFragment.class : NewsfeedFragment.class;
case "messenger":
@@ -213,7 +206,7 @@ public class Newsfeed {
case "apps":
return AppsFragment.class;
case "discover":
return newfeed() ? GatewaysFragment.class : DiscoverFragment.class;
return DiscoverFragment.class;
case "notifications":
return NotificationsContainerFragment.class;
case "money":
@@ -37,18 +37,15 @@ public class OEMDetector {
private static String getSystemProperty(String str) {
BufferedReader bufferedReader;
Throwable th;
BufferedReader bufferedReader2 = null;
try {
bufferedReader = new BufferedReader(new InputStreamReader(Runtime.getRuntime().exec("getprop " + str).getInputStream()), 1024);
try {
String readLine = bufferedReader.readLine();
try {
bufferedReader.close();
} catch (IOException e) {
e.printStackTrace();
}
return readLine;
return bufferedReader.readLine();
} catch (IOException ignored) {
}
} catch (Throwable ignored) {
@@ -4,7 +4,7 @@ import static ru.vtosters.lite.ui.fragments.multiaccount.MultiAccountManager.mig
import static ru.vtosters.lite.utils.DeletedMessagesHandler.reloadMessagesList;
import static ru.vtosters.lite.utils.Globals.fixGapps;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.registerActivities;
import static ru.vtosters.lite.utils.Newsfeed.setupFilters;
import static ru.vtosters.lite.utils.OpusLoader.LoadLibrary;
@@ -23,6 +23,8 @@ import com.vtosters.lite.data.Users;
import java.util.Locale;
public class Preferences {
public static SharedPreferences preferences = getContext().getSharedPreferences("com.vtosters.lite_preferences", Context.MODE_PRIVATE);
public static String VERSIONNAME = "Beta";
public static Integer VKBUILD = 12116; // 3439 orig
@@ -37,73 +39,69 @@ public class Preferences {
registerActivities(application);
LoadLibrary("vkopustest");
systemThemeChanger();
}
} // VK Init
public static boolean BooleanFalse(String key) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
return prefs.getBoolean(key, false);
}
public static boolean BooleanTrue(String key) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(getContext());
return prefs.getBoolean(key, true);
}
public static boolean getBoolValue(String key, Boolean value) {
if (preferences == null) {
preferences = PreferenceManager.getDefaultSharedPreferences(getContext());
}
return preferences.getBoolean(key, value);
} // Set bool by default and get value
public static boolean opusmodule() {
return BooleanTrue("opusmodule");
return getBoolValue("opusmodule", true);
}
public static boolean systemtheme() {
return BooleanTrue("systemtheme");
return getBoolValue("systemtheme", true);
}
public static boolean authorsrecomm() {
return BooleanTrue("authorsrecomm");
return getBoolValue("authorsrecomm", true);
}
public static boolean captions() {
return BooleanTrue("captions");
return getBoolValue("captions", true);
}
public static boolean copyright_post() {
return BooleanFalse("copyright_post");
return getBoolValue("copyright_post", false);
}
public static boolean default_ad_list() {
return BooleanFalse("default_ad_list");
return getBoolValue("default_ad_list", false);
}
public static boolean shitposting() {
return BooleanFalse("shitposting");
return getBoolValue("shitposting", false);
}
public static boolean friendsrecomm() {
return BooleanTrue("friendsrecomm");
return getBoolValue("friendsrecomm", true);
}
public static boolean isBGStickersEnabled() {
return BooleanTrue("isBGStickersEnabled");
return getBoolValue("isBGStickersEnabled", true);
}
public static boolean ads() {
return BooleanFalse("__dbg_no_ads");
return getBoolValue("__dbg_no_ads", false);
}
public static boolean adsgroup() {
return BooleanFalse("adsgroup");
return getBoolValue("adsgroup", false);
}
public static boolean olddock() {
return BooleanFalse("olddock");
return getBoolValue("olddock", false);
}
public static boolean adsslider() {
return BooleanFalse("__dbg_no_slider_ads");
return getBoolValue("__dbg_no_slider_ads", false);
}
public static boolean adsstories() {
return BooleanFalse("adsstories");
return getBoolValue("adsstories", false);
}
public static boolean alteremoji(Context context) {
@@ -111,63 +109,67 @@ public class Preferences {
}
public static boolean alteremojipref() {
return BooleanFalse("alteremoji");
return getBoolValue("alteremoji", false);
}
public static boolean awayphp() {
return BooleanTrue("awayphp");
return getBoolValue("awayphp", true);
}
public static boolean VKUI_INJ() {
return BooleanTrue("VKUI_INJ");
return getBoolValue("VKUI_INJ", true);
}
public static boolean benchmark() {
return BooleanFalse("benchmark");
return getBoolValue("benchmark", false);
}
public static boolean calls() {
return BooleanTrue("calls");
return getBoolValue("calls", true);
}
public static boolean convUsersOnline() {
return BooleanFalse("convUsersOnline");
return getBoolValue("convUsersOnline", false);
}
public static boolean darkmode() {
return BooleanTrue("darkmode");
return getBoolValue("darkmode", true);
}
public static boolean dev() {
return BooleanFalse("dev");
return getBoolValue("dev", false);
}
public static boolean devmenu() {
return BooleanFalse("devmenu");
return getBoolValue("devmenu", false);
}
public static boolean dnr() {
return BooleanTrue("dnr");
return getBoolValue("dnr", true);
}
public static boolean dns() {
return BooleanTrue("dns");
return getBoolValue("dns", true);
}
public static boolean libverify() {
return BooleanFalse("libverify");
return getBoolValue("libverify", false);
}
public static boolean dnt() {
return BooleanTrue("dnt");
return getBoolValue("dnt", true);
}
public static boolean dockcounter() {
return BooleanTrue("dockcounter");
return getBoolValue("dockcounter", true);
}
public static boolean feedcache() {
return BooleanTrue("feedcache");
return getBoolValue("feedcache", true);
}
public static boolean CommentsSort() {
return getBoolValue("commentssorting", false);
}
public static void forceOffline() {
@@ -178,119 +180,123 @@ public class Preferences {
}
public static boolean fulltime() {
return BooleanTrue("fulltime");
return getBoolValue("fulltime", true);
}
public static boolean gcmfix() {
return BooleanTrue("gcmfix");
return getBoolValue("gcmfix", true);
}
public static boolean hasMusicSubscription() {
return BooleanTrue("hasMusicSubscription");
return getBoolValue("hasMusicSubscription", true);
}
public static boolean isEnableExternalOpening() {
return BooleanFalse("isEnableExternalOpening");
return getBoolValue("isEnableExternalOpening", false);
}
public static boolean iconvk() {
return BooleanFalse("iconvk");
return getBoolValue("iconvk", false);
}
public static boolean iconvkru() {
return BooleanFalse("iconvkru");
return getBoolValue("iconvkru", false);
}
public static boolean isMusicRestricted() {
return BooleanTrue("isMusicRestricted");
return getBoolValue("isMusicRestricted", true);
}
public static boolean msgflat() {
return BooleanFalse("msgflat");
return getBoolValue("msgflat", false);
}
public static boolean msgtails() {
return BooleanTrue("msgtails");
return getBoolValue("msgtails", true);
}
public static boolean navbar() {
return BooleanTrue("navbar");
return getBoolValue("navbar", true);
}
public static boolean newfeed() {
return BooleanTrue("newfeed");
return getBoolValue("newfeed", true);
}
public static boolean offline() {
return BooleanTrue("offline");
return getBoolValue("offline", true);
}
public static boolean oldabout() {
return BooleanFalse("oldabout");
return getBoolValue("oldabout", false);
}
public static boolean postsrecomm() {
return BooleanTrue("postsrecomm");
return getBoolValue("postsrecomm", true);
}
public static String readstatus() {
return dnr() ? "messages.markAsRead" : "null";
}
public static String copyrightfix() {
return copyright_post() ? "copyright" : "ads_easy_promote";
}
public static boolean refsfilter() {
return BooleanFalse("refsfilter");
return getBoolValue("refsfilter", false);
}
public static boolean setoffline() {
return BooleanFalse("setoffline");
return getBoolValue("setoffline", false);
}
public static boolean shortinfo() {
return BooleanTrue("shortinfo");
return getBoolValue("shortinfo", true);
}
public static boolean shortlinkfilter() {
return BooleanFalse("shortlinkfilter");
return getBoolValue("shortlinkfilter", false);
}
public static boolean shortpost() {
return BooleanTrue("shortpost");
return getBoolValue("shortpost", true);
}
public static boolean showmenu() {
return BooleanFalse("showmenu");
return getBoolValue("showmenu", false);
}
public static boolean ssl() {
return BooleanTrue("ssl");
return getBoolValue("ssl", true);
}
public static boolean stories() {
return BooleanTrue("stories");
return getBoolValue("stories", true);
}
public static boolean swipe() {
return BooleanTrue("swipe");
return getBoolValue("swipe", true);
}
public static boolean systememoji() {
return BooleanFalse("systememoji");
return getBoolValue("systememoji", false);
}
public static boolean unlockstats() {
return BooleanFalse("unlockstats");
return getBoolValue("unlockstats", false);
}
public static boolean usevkui() {
return BooleanTrue("usevkui");
return getBoolValue("usevkui", true);
}
public static boolean vksans() {
return BooleanFalse("vksans");
return getBoolValue("vksans", false);
}
public static boolean voice() {
return BooleanTrue("voice");
return getBoolValue("voice", true);
}
public static boolean newvideo() {
@@ -298,46 +304,44 @@ public class Preferences {
}
public static int getMsgCount() {
String customvalue = getPreferences().getString("msgcount", "");
String customvalue = getPrefsValue("msgcount");
return customvalue.isEmpty() ? 30 : Integer.parseInt(customvalue);
}
public static String MediacontentFix() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified DESC" : "datetaken DESC";
}
} // Fix photo picker for sdk 29+
public static String MediacontentFix2() {
return Build.VERSION.SDK_INT >= 29 ? "date_modified" : "datetaken";
}
} // Fix photo picker for sdk 29+
public static String MediacontentFix3() {
return Build.VERSION.SDK_INT >= 29 ? ", date_modified=" : ", dateTaken=";
}
} // Fix photo picker for sdk 29+
public static boolean color_grishka() {
return BooleanTrue("color_grishka");
return getBoolValue("color_grishka", true);
}
public static boolean vkme_msg() {
return BooleanFalse("vkme_msg");
return getBoolValue("vkme_msg", false);
}
public static String VKVersion() {
String string = getPreferences().getString("vkver", "");
return !string.isEmpty() ? string : VKVER;
return VKVER;
}
public static int VKVersionBuild() {
String string = getPreferences().getString("vkbuild", "");
return !string.isEmpty() ? Integer.parseInt(string) : VKBUILD;
return VKBUILD;
}
public static long VKVersionBuildLong() {
return (long) VKVersionBuild();
return VKVersionBuild();
}
public static String getLocale() {
String string = getPreferences().getString("lang_value", "");
String string = getPrefsValue("lang_value");
if (string.equals("system")) {
return Locale.getDefault().getLanguage();
}
@@ -1,25 +1,23 @@
package ru.vtosters.lite.utils;
import static java.lang.System.*;
import static ru.vtosters.lite.utils.Globals.*;
import static ru.vtosters.lite.utils.Preferences.*;
import static java.lang.System.clearProperty;
import static java.lang.System.getProperties;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import java.util.Properties;
public class Proxy {
public static String getOauthComAuth() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/authorize";
return getOauthComHttps() + "/authorize";
}
public static String getOauthComAuthClient() {
String oauthComAuth = getOauthComAuth();
return oauthComAuth + "?client_id=";
return getOauthComAuth() + "?client_id=";
}
public static String getOauthComBlank() {
String oauthComHttps = getOauthComHttps();
return oauthComHttps + "/blank.html";
return getOauthComHttps() + "/blank.html";
}
public static String getOauthComBlankRedirect() {
@@ -31,8 +29,7 @@ public class Proxy {
}
public static String getStaticComSupport() {
String staticCom = getStaticCom();
return staticCom + "/support";
return getStaticCom() + "/support";
}
public static String oauthFix() {
@@ -40,7 +37,7 @@ public class Proxy {
}
public static String getApiCom() {
String string = getPreferences().getString("proxyapi", "");
String string = getPrefsValue("proxyapi");
if (!proxy() & string.isEmpty()) {
return "api.vk.com";
}
@@ -48,7 +45,7 @@ public class Proxy {
}
public static String getAwayPhpCom() {
String string = getPreferences().getString("proxyapi", "");
String string = getPrefsValue("proxyapi");
if (!proxy() & string.isEmpty()) {
return "m.vk.com";
}
@@ -56,7 +53,7 @@ public class Proxy {
}
public static String getOauthCom() {
String string = getPreferences().getString("proxyoauth", "");
String string = getPrefsValue("proxyoauth");
if (!proxy() & string.isEmpty()) {
return "oauth.vk.com";
}
@@ -64,7 +61,7 @@ public class Proxy {
}
public static String getStaticCom() {
String string = getPreferences().getString("proxystatic", "");
String string = getPrefsValue("proxystatic");
if (!proxy() & string.isEmpty()) {
return "static.vk.com";
}
@@ -73,7 +70,7 @@ public class Proxy {
public static String staticFix(String str) {
String str2;
String string = getPreferences().getString("proxystatic", "");
String string = getPrefsValue("proxystatic");
if (!proxy() & string.isEmpty()) {
return str;
}
@@ -83,7 +80,7 @@ public class Proxy {
public static void setProxy() {
Properties properties = getProperties();
switch (getPreferences().getString("proxy", "")) {
switch (getPrefsValue("proxy")) {
case "zaborona":
properties.setProperty("socksProxyHost", "socks.zaboronahelp.pp.ua");
properties.setProperty("socksProxyPort", "1488");
@@ -125,7 +122,7 @@ public class Proxy {
clearProperty("http.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all proxies
public static void resetProxySocks() {
clearProperty("https.proxyHost");
@@ -136,7 +133,7 @@ public class Proxy {
clearProperty("http.proxyPort");
clearProperty("http.proxyUser");
clearProperty("http.proxyPassword");
}
} // Reset all except socks
public static void resetProxyHttp() {
clearProperty("https.proxyHost");
@@ -145,7 +142,7 @@ public class Proxy {
clearProperty("https.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all except http
public static void resetProxyHttps() {
clearProperty("http.proxyHost");
@@ -154,64 +151,64 @@ public class Proxy {
clearProperty("http.proxyPassword");
clearProperty("socksProxyHost");
clearProperty("socksPortHost");
}
} // Reset all except https
public static String proxyHostHTTP() {
String string = getPreferences().getString("proxyHostHTTP", "");
String string = getPrefsValue("proxyHostHTTP");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostHTTPS() {
String string = getPreferences().getString("proxyHostHTTPS", "");
String string = getPrefsValue("proxyHostHTTPS");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyHostSocks() {
String string = getPreferences().getString("proxyHostSocks", "");
String string = getPrefsValue("proxyHostSocks");
return string.isEmpty() ? "192.168.0.1" : string;
}
public static String proxyPortHTTP() {
String string = getPreferences().getString("proxyPortHTTP", "");
String string = getPrefsValue("proxyPortHTTP");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortHTTPS() {
String string = getPreferences().getString("proxyPortHTTPS", "");
String string = getPrefsValue("proxyPortHTTPS");
return string.isEmpty() ? "8888" : string;
}
public static String proxyPortSocks() {
String string = getPreferences().getString("proxyPortSocks", "");
String string = getPrefsValue("proxyPortSocks");
return string.isEmpty() ? "8888" : string;
}
public static String proxyUserHTTP() {
String string = getPreferences().getString("proxyUserHTTP", "");
String string = getPrefsValue("proxyUserHTTP");
return string.isEmpty() ? "" : string;
}
public static String proxyUserHTTPS() {
String string = getPreferences().getString("proxyUserHTTPS", "");
String string = getPrefsValue("proxyUserHTTPS");
return string.isEmpty() ? "" : string;
}
public static String proxyPassHTTP() {
String string = getPreferences().getString("proxyPassHTTP", "");
String string = getPrefsValue("proxyPassHTTP");
return string.isEmpty() ? "" : string;
}
public static String proxyPassHTTPS() {
String string = getPreferences().getString("proxyPassHTTPS", "");
String string = getPrefsValue("proxyPassHTTPS");
return string.isEmpty() ? "" : string;
}
public static boolean proxy() {
return getPreferences().getString("proxy", "").equals("apiproxy");
return getPrefsValue("proxy").equals("apiproxy");
}
// Official vk proxy enforcer
public static boolean proxyvk() {
return BooleanFalse("proxyvk");
}
return getBoolValue("proxyvk", false);
} // Official vk proxy enforcer
}
@@ -1,7 +1,7 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.About.getBuildNumber;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Globals.getUserSecret;
import static ru.vtosters.lite.utils.Globals.getUserToken;
import static ru.vtosters.lite.utils.Preferences.dev;
@@ -17,7 +17,7 @@ public class SSFS {
}
public static String SSFSDomain() {
String string = getPreferences().getString("ssfscustom", "");
String string = getPrefsValue("ssfscustom");
if (!string.isEmpty()) {
return string;
}
@@ -29,8 +29,7 @@ public class SSFS {
}
public static String getAmoledVKUI() {
String string = getPreferences().getString("darktheme", "");
return string.equals("amoled") ? "1" : "0";
return getPrefsValue("darktheme").equals("amoled") ? "1" : "0";
}
public static String getUserProxy() {
@@ -8,7 +8,6 @@ import static android.widget.Toast.makeText;
import static ru.vtosters.lite.utils.Globals.getContext;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.util.Base64;
@@ -32,7 +31,7 @@ public class SettBackup {
public static void backupSettings() {
SimpleDateFormat date = new SimpleDateFormat("yyyyMMdd_HHmmss", Locale.getDefault());
String currentDateandTime = date.format(new Date());
var directory = getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS) + "/VTLBackup_" + currentDateandTime + ".txt";
var directory = getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS + "/VTLBackups/") + "/Backup_" + currentDateandTime + ".txt";
var file = new File(directory);
try {
var exists = file.createNewFile();
@@ -63,9 +62,7 @@ public class SettBackup {
}
public static void restoreBackup() {
Intent intent = new Intent();
intent.setAction(Intent.ACTION_GET_CONTENT);
intent.setType("text/plain");
getContext().startActivity(intent);
File dir = new File(getExternalStoragePublicDirectory(DIRECTORY_DOWNLOADS + "/VTLBackups/").getPath());;
// TODO Make restore backup from file list
}
}
@@ -1,7 +1,8 @@
package ru.vtosters.lite.utils;
import static android.view.View.SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.color_grishka;
import static ru.vtosters.lite.utils.Preferences.isBGStickersEnabled;
import static ru.vtosters.lite.utils.Preferences.navbar;
@@ -11,12 +12,16 @@ import static ru.vtosters.lite.utils.Preferences.vksans;
import android.content.Context;
import android.content.res.ColorStateList;
import android.content.res.Configuration;
import android.graphics.Color;
import android.graphics.drawable.Drawable;
import android.os.Build;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.view.Window;
import android.widget.ImageButton;
import androidx.core.graphics.ColorUtils;
import com.vk.core.d.RecoloredDrawable;
import com.vk.core.ui.themes.VKTheme;
import com.vk.core.ui.themes.VKThemeHelper;
@@ -24,78 +29,116 @@ import com.vk.im.ui.themes.ImTheme;
import com.vk.im.ui.themes.ImThemeHelper;
import com.vtosters.lite.R;
import java.util.Arrays;
import java.util.List;
public class Themes {
public static List<String> accentColors = Arrays.asList(
"71AAEB", "3F8AE0", "528BCC", "4986CC", "5181B8", "74A2D6", "518BCC"
);
public static void applyTheme(VKTheme theme, ImTheme imtheme) {
VKThemeHelper.b.a(theme); // VKThemeHelper.b.a(VKTheme value) VK Theme apply
ImThemeHelper.b.a(imtheme); // ImThemeHelper.b.a(ImTheme value) VK Theme Msg apply
} // Apply VKTheme and ImTheme (hard applying without dynamic theme changing)
public static int getAccentColor() {
return VKThemeHelper.a(R.attr.accent);
}
} // Color accent
public static int getTextAttr() {
return VKThemeHelper.a(R.attr.text_primary);
}
} // Text Primary color
public static int getSTextAttr() {
return VKThemeHelper.a(R.attr.text_secondary);
}
} // Text Secondary color
public static int getTabbarBackground() {
return VKThemeHelper.a(R.attr.tabbar_background);
}
} // Tabbar/Navbar background
public static int getBackgroundContent() {
return VKThemeHelper.a(R.attr.background_content);
} // Background color in app
public static int getHeaderBackground() {
return VKThemeHelper.a(R.attr.header_background);
}
} // Toolbar/Header background
public static int getHeaderText() {
return VKThemeHelper.a(R.attr.header_text);
} // Header/Toolbar color text
public static int getAmoledTheme() {
return getContext().getResources().getIdentifier("BaseAmoledStyle", "style", getContext().getPackageName());
}
} // Get Amoled theme id
public static int picFix() {
return getContext().getResources().getIdentifier("ActionBarThemeFix", "style", getContext().getPackageName());
}
} // Fix tabbar color in photo viewer
public static int getAmoledImTheme() {
return getContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", getContext().getPackageName());
} // Get Amoled theme id for messages
public static int getAttrId(String attr) {
return getContext().getResources().getIdentifier(attr, "attr", getContext().getPackageName());
}
public static void setBarTheme(View getview) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
getview.setSystemUiVisibility(getNeededColorNavbar() | getNeededColorStatusbar());
}
} // Set white/dark statusbar/navbar icons
public static int getNeededColorStatusbar() {
return VKThemeHelper.d() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S ? 8192 : 0;
}
public static int getNeededColorNavbar() {
return Build.VERSION.SDK_INT >= Build.VERSION_CODES.O ? VKThemeHelper.d() ? SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR : 0 : 0;
}
public static int getNeededColorStatusbarFix() {
return VKThemeHelper.d() ? 8192 : 0;
}
public static VKTheme getDarkTheme() {
switch (getPreferences().getString("darktheme", "")) {
switch (getPrefsValue("darktheme")) {
case "amoled":
return VKTheme.AMOLED;
default:
return VKTheme.DARK;
}
}
} // Return needed theme for theme changer
public static ImTheme getImDarkTheme() {
switch (getPreferences().getString("darktheme", "")) {
switch (getPrefsValue("darktheme")) {
case "amoled":
return ImTheme.VKAPP_AMOLED;
default:
return ImTheme.VKAPP_DARK;
}
}
} // Return needed theme for theme changer
public static VKTheme getLightTheme() {
switch (getPreferences().getString("lighttheme", "")) {
switch (getPrefsValue("lighttheme")) {
default:
return VKTheme.DEFAULT_LIGHT;
}
}
} // Return needed theme for theme changer
public static ImTheme getImLightTheme() {
switch (getPreferences().getString("lighttheme", "")) {
switch (getPrefsValue("lighttheme")) {
default:
return ImTheme.VKAPP_LIGHT;
}
}
} // Return needed theme for theme changer
public static int getColorFromAttr(int attr) {
return VKThemeHelper.a(attr);
}
public static int getHeaderText() {
return VKThemeHelper.a(R.attr.header_text);
}
} // Get needed attr color
public static boolean isAndroidMonet() {
return color_grishka() && Build.VERSION.SDK_INT >= 31;
@@ -103,7 +146,7 @@ public class Themes {
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;
}
} // Accent colors
public static void themeMonetToolbar(ImageButton imageButton, Toolbar toolbar) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
@@ -117,20 +160,69 @@ public class Themes {
return null;
}
return new RecoloredDrawable(drawable, getAccentColor());
}
} // Recolor drawable to accent color
public static Drawable recolorDrawableToolbar(Drawable drawable) {
if (drawable == null) {
return null;
}
return new RecoloredDrawable(drawable, getHeaderText());
}
} // Recolor toolbar drawable to accent color
public static ColorStateList recolorCSL(ColorStateList colorStateList) {
if (colorStateList == null) {
return null;
}
return ColorStateList.valueOf(getAccentColor());
} // Recolor ColorStateList to accent color
public static ColorStateList themeCSL(ColorStateList csl) {
int color = csl.getDefaultColor();
try {
int unsel = csl.getColorForState(new int[]{-android.R.attr.state_selected}, Color.BLACK);
int sel = csl.getColorForState(new int[]{android.R.attr.state_selected}, Color.BLACK);
boolean isUnselAccent = isAccentedColor(unsel);
boolean isSelAccent = isAccentedColor(sel);
if (isUnselAccent || isSelAccent) {
return new ColorStateList(new int[][] {
new int[]{android.R.attr.state_selected}, new int[]{-android.R.attr.state_selected}
}, new int[] {isSelAccent ? getAccentColor() : sel, isUnselAccent ? getAccentColor() : unsel});
}
return csl;
} catch (Exception e) {
e.printStackTrace();
return null;
}
} // Recolor ColorStateList
public static int darken(int color, float by) {
float[] hsl = new float[3];
ColorUtils.colorToHSL(color, hsl);
hsl[2] -= by;
hsl[2] = Math.max(0f, Math.min(hsl[2], 1f));
return ColorUtils.HSLToColor(hsl);
}
public static int lighten(int color, float factor) {
int red = (int) ((Color.red(color) * (1 - factor) / 255 + factor) * 255);
int green = (int) ((Color.green(color) * (1 - factor) / 255 + factor) * 255);
int blue = (int) ((Color.blue(color) * (1 - factor) / 255 + factor) * 255);
return Color.argb(Color.alpha(color), red, green, blue);
}
public static int halfAlpha(int src) {
return ColorUtils.setAlphaComponent(src, 169);
}
public static boolean isAccentedColor(ColorStateList target) {
return target != null && isAccentedColor(target.getDefaultColor());
}
public static boolean isAccentedColor(int target) {
return accentColors.contains(hex(target).toUpperCase());
}
public static int getColor(Context context, int i) {
@@ -141,24 +233,26 @@ public class Themes {
return context.getColor(i);
}
return context.getResources().getColor(i);
}
} // Android Support color injector + accent color checker
public static int getColor2(int i) {
if (isColorRefAccented(i) && isAndroidMonet()) {
return getAccentColor();
}
return getContext().getResources().getColor(i);
}
} // Android Support color injector + accent color checker
public static void setNavbarColor(Window window, int i) {
if (navbar() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
window.setNavigationBarColor(getNavbarColor());
window.setNavigationBarColor(getTabbarBackground());
window.getDecorView().setSystemUiVisibility(getNeededColorNavbar());
}
}
public static String hex(int i) {
return String.format("#%06X", Integer.valueOf(i & 16777215));
}
} // Get color as hex string
public static int vk_sans_display_demibold() {
return vksans() ? R.font.vk_sans_display_demibold : R.font.tt_commons_demi_bold;
}
@@ -187,10 +281,6 @@ public class Themes {
return vksans() ? R.font.vk_sans_text_regular : R.font.roboto_regular;
}
public static int getNavbarColor() {
return VKThemeHelper.a(R.attr.tabbar_background);
}
public static String getBackgroundStickers() {
if (isBGStickersEnabled()) {
return "images_with_background";
@@ -204,19 +294,14 @@ public class Themes {
int currentNightMode = getContext().getResources().getConfiguration().uiMode & Configuration.UI_MODE_NIGHT_MASK;
switch (currentNightMode) {
case Configuration.UI_MODE_NIGHT_UNDEFINED:
changeTheme(getLightTheme(), getImLightTheme());
applyTheme(getLightTheme(), getImLightTheme());
break;
case Configuration.UI_MODE_NIGHT_NO:
changeTheme(getLightTheme(), getImLightTheme());
applyTheme(getLightTheme(), getImLightTheme());
break;
case Configuration.UI_MODE_NIGHT_YES:
changeTheme(getDarkTheme(), getImDarkTheme());
applyTheme(getDarkTheme(), getImDarkTheme());
break;
}
}
public static void changeTheme(VKTheme theme, ImTheme imtheme) {
VKThemeHelper.b.a(theme);
ImThemeHelper.b.a(imtheme);
}
}
@@ -1,7 +1,8 @@
package ru.vtosters.lite.utils;
import static ru.vtosters.lite.utils.Globals.getContext;
import static ru.vtosters.lite.utils.Globals.getPreferences;
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
import static ru.vtosters.lite.utils.Themes.getColorFromAttr;
import static ru.vtosters.lite.utils.Themes.hex;
@@ -66,8 +67,8 @@ public class VKUIInjector {
}
public static void inject(WebView webView) {
String string = getPreferences().getString("darktheme", "");
if (Preferences.BooleanTrue("VKUI_INJ")) {
String string = getPrefsValue("darktheme");
if (getBoolValue("VKUI_INJ", true)) {
if (!isLoaded) {
load();
}
+1 -1
View File
@@ -1,3 +1,3 @@
<resources>
<string name="app_name">Vtoasters Shit</string>
<string name="app_name">VTosters Lite</string>
</resources>
+1 -1
View File
@@ -5,7 +5,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.0'
classpath 'com.android.tools.build:gradle:7.2.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@@ -4,7 +4,7 @@
<ripple android:color="@color/overlay">
<item>
<shape>
<solid android:color="?header_text" />
<solid android:color="?header_background" />
<corners android:radius="@dimen/vkui_button_corner_big_radius" />
</shape>
</item>
@@ -12,7 +12,7 @@
</item>
<item>
<shape>
<solid android:color="?header_text" />
<solid android:color="?header_background" />
<corners android:radius="@dimen/vkui_button_corner_big_radius" />
</shape>
</item>
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android">
<gradient
android:startColor="#fff8f8f8"
android:endColor="#ffffffff"
android:startColor="?background_content"
android:endColor="?background_content"
android:angle="90.0" />
</shape>
+1 -1
View File
@@ -14,7 +14,7 @@
</item>
<item>
<shape>
<solid android:color="?header_text" />
<solid android:color="?header_background" />
<corners android:radius="@dimen/vkui_button_corner_big_radius" />
</shape>
</item>
@@ -41,7 +41,7 @@
android:layout_height="48.0dip"
app:tabBackground="@drawable/music_tab_bg"
app:tabGravity="center"
app:tabIndicatorColor="@color/white" />
app:tabIndicatorColor="?header_tab_active_indicator" />
</android.support.design.widget.AppBarLayout>
<android.support.v4.view.ViewPager
@@ -9,7 +9,7 @@
<FrameLayout
android:id="@id/appkit_loader_content"
android:background="#ffffffff"
android:background="?background_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+1
View File
@@ -6,6 +6,7 @@
<LinearLayout
android:gravity="center"
android:background="?background_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="16.0dip"
+1
View File
@@ -14,6 +14,7 @@
android:orientation="horizontal"
android:id="@id/load_more_error"
android:padding="16.0dip"
android:background="?background_content"
android:layout_width="fill_parent"
android:layout_height="76.0dip">
+1
View File
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<FrameLayout android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="?background_content"
xmlns:android="http://schemas.android.com/apk/res/android">
<ProgressBar
@@ -24,7 +24,7 @@
android:layout_height="238.0dip"
app:contentScrim="?text_primary"
app:layout_scrollFlags="exitUntilCollapsed|scroll"
app:statusBarScrim="?tabbar_background"
app:statusBarScrim="?header_background"
app:titleEnabled="false">
<LinearLayout
+2 -2
View File
@@ -117,12 +117,12 @@
android:layout_width="16.0dip"
android:layout_height="16.0dip"
android:src="@drawable/ic_longreads_black_16"
android:tint="@color/black" />
android:tint="?header_text" />
<TextView
android:textSize="12.0sp"
android:textStyle="normal"
android:textColor="@color/black"
android:textColor="?header_text"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+2 -2
View File
@@ -100,12 +100,12 @@
android:layout_width="16.0dip"
android:layout_height="16.0dip"
android:src="@drawable/ic_longreads_black_16"
android:tint="@color/black" />
android:tint="?header_text" />
<TextView
android:textSize="12.0sp"
android:textStyle="normal"
android:textColor="@color/black"
android:textColor="?header_text"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@@ -72,12 +72,12 @@
android:layout_width="16.0dip"
android:layout_height="16.0dip"
android:src="@drawable/ic_longreads_black_16"
android:tint="@color/black" />
android:tint="?header_text" />
<TextView
android:textSize="12.0sp"
android:textStyle="normal"
android:textColor="@color/black"
android:textColor="?header_text"
android:layout_gravity="center_vertical"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
+1 -1
View File
@@ -10,7 +10,7 @@
<android.support.design.widget.CoordinatorLayout
android:id="@id/appkit_loader_content"
android:background="#ffffffff"
android:background="?background_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+1 -1
View File
@@ -55,7 +55,7 @@
<TextView
android:textSize="17.0dip"
android:textColor="?text_primary"
android:textColor="?header_text"
android:ellipsize="end"
android:gravity="center_horizontal"
android:id="@id/playlist_title"
+1 -1
View File
@@ -21,7 +21,7 @@
<TextView
android:textSize="14.0dip"
android:textStyle="normal"
android:textColor="?text_primary"
android:textColor="?header_text"
android:ellipsize="end"
android:gravity="center_vertical"
android:id="@id/playlist_title"
@@ -36,7 +36,7 @@
<TextView
android:textSize="17.0dip"
android:textColor="?text_primary"
android:textColor="?header_text"
android:ellipsize="end"
android:id="@id/playlist_title"
android:layout_width="0.0dip"
+1 -1
View File
@@ -45,7 +45,7 @@
android:minHeight="48.0dip"
app:tabBackground="@drawable/music_tab_bg"
app:tabGravity="fill"
app:tabIndicatorColor="@color/white"
app:tabIndicatorColor="?header_tab_active_indicator"
app:tabMaxWidth="0.0dip"
app:tabMode="fixed" />
</android.support.design.widget.AppBarLayout>
@@ -9,7 +9,7 @@
<FrameLayout
android:id="@id/appkit_loader_content"
android:background="#ffffffff"
android:background="?background_content"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
+1
View File
@@ -4,6 +4,7 @@
<item
android:icon="@drawable/ic_settings_24"
android:id="@id/settings"
app:menuTint="?header_text"
android:title="@string/menu_settings"
android:showAsAction="always"
app:showAsAction="always" />
+1 -1
View File
@@ -4341,7 +4341,7 @@
</style>
<style name="VKUIButton.White" parent="@style/VKUIButton">
<item name="android:textColor">@color/vkui_white_button_text</item>
<item name="android:textColor">?header_text</item>
<item name="android:background">@drawable/vkui_bg_button_white</item>
</style>
+6 -16
View File
@@ -3,8 +3,12 @@
<PreferenceCategory android:title="@string/dnr">
<Preference
android:enabled="false"
android:summary="Функция позволяет вам не отправлять статус вашего набора/написания сообщения"
android:summary="Функция позволяет вам не отправлять статус прочтения вами сообщения собеседника"
android:title="Что это за функция?" />
<Preference
android:enabled="false"
android:summary="Визуально может работать некорректно (сообщение прочиталось локально), но у собеседника оно прочитано не будет"
android:title="Внимание!" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="read_pm"
@@ -22,12 +26,8 @@
<PreferenceCategory android:title="@string/dnw">
<Preference
android:enabled="false"
android:summary="Функция позволяет вам не отправлять статус прочтения вами сообщения собеседника"
android:summary="Функция позволяет вам не отправлять статус вашего набора/написания сообщения"
android:title="Что это за функция?" />
<Preference
android:enabled="false"
android:summary="Визуально может работать некорректно (сообщение прочиталось локально), но у собеседника она прочитана не будет"
android:title="Внимание!" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="write_pm"
@@ -95,15 +95,5 @@
android:key="benchmark"
android:summary="@string/benchapisummary"
android:title="@string/benchapi" />
<EditTextPreference
android:defaultValue="7.24"
android:key="vkver"
android:summary="Требуется перезапуск"
android:title="Подмена версии ВК" />
<EditTextPreference
android:defaultValue="12116"
android:key="vkbuild"
android:summary="Требуется перезапуск"
android:title="Подмена версии билда ВК" />
</PreferenceCategory>
</PreferenceScreen>
+1 -1
View File
@@ -3,7 +3,7 @@
android:key="preferences_debug">
<Preference
android:enabled="false"
android:summary="Данное меню предназначено только для тестирования работоспособности приложения. Если вы являетесь рядовым юзером, то вам не следует ничего не трогать в данных настройках!"
android:summary="Данное меню предназначено только для тестирования работоспособности приложения. Если вы являетесь рядовым юзером, то вам не следует ничего не трогать в данных настройках (пожалуйста)"
android:title="Внимание!" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
+11 -8
View File
@@ -19,8 +19,13 @@
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="adsstories"
android:summary="Реклама при перехеходе между историями"
android:summary="Реклама при переходе между историями"
android:title="@string/vtldas" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="copyright_post"
android:summary="В большенстве случаев рекламные посты с пометкой источника рекламодателя"
android:title="Отключить посты с источником" />
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
</PreferenceCategory>
<PreferenceCategory android:title="@string/vtlfilters">
@@ -78,13 +83,6 @@
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
</PreferenceCategory>
<PreferenceCategory android:title="@string/vtlfeedwork">
<com.vtosters.lite.ui.SummaryListPreference
android:defaultValue="default"
android:dialogTitle="Выберите значение"
android:entries="@array/commentssort_value"
android:entryValues="@array/commentssort"
android:key="commentssort"
android:title="Сортировка комментариев" />
<com.vtosters.lite.ui.SummaryListPreference
android:defaultValue="default"
android:dialogTitle="Выберите значение"
@@ -92,6 +90,11 @@
android:entryValues="@array/newsupdate"
android:key="newsupdate"
android:title="Обновление новостей" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="commentssorting"
android:summary="Сортировать комментарии по новизне"
android:title="Сортировка комментариев" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="true"
android:key="feedcache"
-1
View File
@@ -14,7 +14,6 @@
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="true"
android:key="swipe"
android:summary="@string/interfacenewsfeedswipesum"
android:title="@string/interfacenewsfeedswipe" />
<com.vtosters.lite.ui.MaterialSectionDividerPreference />
</PreferenceCategory>
+1 -1
View File
@@ -43,7 +43,7 @@
android:entries="@array/msgcount_value"
android:entryValues="@array/msgcount"
android:key="msgcount"
android:title="Количество загружаемых сообщений" />
android:title="Количество загружаемых сразу сообщений" />
<com.vtosters.lite.ui.MaterialSwitchPreference
android:defaultValue="false"
android:key="convUsersOnline"
@@ -79,6 +79,8 @@
const/16 v1, 0xd04
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
@@ -1324,10 +1324,8 @@
if-eqz p2, :cond_1
const-string p2, "VT_Verification"
.line 181
invoke-static {p2}, Lru/vtosters/lite/utils/Preferences;->BooleanTrue(Ljava/lang/String;)Z
invoke-static {}, Lru/vtosters/lite/f0x1d/VTVerifications;->vtverif()Z
move-result p2
@@ -1354,10 +1352,8 @@
if-eqz p2, :cond_2
const-string p2, "VT_Verification"
.line 181
invoke-static {p2}, Lru/vtosters/lite/utils/Preferences;->BooleanTrue(Ljava/lang/String;)Z
invoke-static {}, Lru/vtosters/lite/f0x1d/VTVerifications;->vtverif()Z
move-result p2
@@ -73,10 +73,8 @@
if-eqz p2, :cond_1
const-string p2, "VT_Verification"
.line 181
invoke-static {p2}, Lru/vtosters/lite/utils/Preferences;->BooleanTrue(Ljava/lang/String;)Z
invoke-static {}, Lru/vtosters/lite/f0x1d/VTVerifications;->vtverif()Z
move-result p2
@@ -104,10 +102,8 @@
if-eqz p2, :cond_2
const-string p2, "VT_Verification"
.line 181
invoke-static {p2}, Lru/vtosters/lite/utils/Preferences;->BooleanTrue(Ljava/lang/String;)Z
invoke-static {}, Lru/vtosters/lite/f0x1d/VTVerifications;->vtverif()Z
move-result p2
@@ -1089,6 +1089,10 @@
:cond_c
const v5, -0x8e8a86
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getTextAttr()I
move-result v5
:goto_6
invoke-virtual {v1, v5}, Landroid/widget/TextView;->setTextColor(I)V
@@ -1406,7 +1410,12 @@
:cond_2
const v7, -0x8e8a86
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getTextAttr()I
move-result v7
:goto_1
.line 180
invoke-virtual {v6, v7}, Landroid/widget/TextView;->setTextColor(I)V
.line 268
@@ -1532,6 +1541,10 @@
:cond_7
const v6, -0xd3d2d2
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getTextAttr()I
move-result v6
:goto_3
invoke-virtual {v5, v6}, Lcom/vk/core/widget/AdaptiveSizeTextView;->setTextColor(I)V
@@ -1580,7 +1593,9 @@
if-eqz v0, :cond_a
const v2, -0x29000001
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getTextAttr()I
move-result v2
:cond_a
invoke-virtual {p1, v2}, Landroid/widget/TextView;->setTextColor(I)V
@@ -379,7 +379,7 @@
move-result-object v8
const/4 v9, 0x0
const/4 v9, 0x2
invoke-virtual {p0}, Lcom/vk/wall/post/CommentsListPresenter;->z()Ljava/lang/String;
@@ -389,7 +389,7 @@
move v4, p1
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
const/4 p1, 0x0
@@ -1084,7 +1084,7 @@
move-object v4, v1
invoke-direct/range {v4 .. v13}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v4 .. v13}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.line 171
invoke-virtual {p1}, Lcom/vtosters/lite/NewsComment;->h()I
@@ -1912,7 +1912,7 @@
move v8, p1
invoke-direct/range {v2 .. v11}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v2 .. v11}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
const/4 p1, 0x0
@@ -2220,11 +2220,11 @@
const/4 v6, 0x1
const/4 v8, 0x0
const/4 v8, 0x2
move-object v0, v10
invoke-direct/range {v0 .. v9}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v0 .. v9}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.line 105
invoke-virtual {p0}, Lcom/vk/wall/post/CommentsListPresenter;->v()I
@@ -956,7 +956,7 @@
move v4, p1
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.line 211
iget p1, p0, Lcom/vk/wall/thread/CommentThreadPresenter;->c:I
@@ -3087,7 +3087,7 @@
move-object v1, p1
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v1 .. v10}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.line 235
iget v1, p0, Lcom/vk/wall/thread/CommentThreadPresenter;->c:I
@@ -4222,7 +4222,7 @@
move-object v0, v10
invoke-direct/range {v0 .. v9}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
invoke-direct/range {v0 .. v9}, Lcom/vk/api/wall/WallGetComments;-><init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.line 219
iget v0, p0, Lcom/vk/wall/thread/CommentThreadPresenter;->c:I
@@ -681,6 +681,8 @@
.line 249
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_0
return-void
.end method
@@ -727,6 +729,8 @@
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_0
return-void
.end method
@@ -2419,6 +2419,8 @@
.line 3218
invoke-virtual {p0, v0}, Landroid/support/design/widget/CoordinatorLayout;->setSystemUiVisibility(I)V
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
goto :goto_0
:cond_2
@@ -358,6 +358,16 @@
.method public static b(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
.locals 2
invoke-virtual {p0, p1}, Landroid/content/Context;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object p0
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->themeCSL(Landroid/content/res/ColorStateList;)Landroid/content/res/ColorStateList;
move-result-object p0
return-object p0
.line 395
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
@@ -580,14 +580,6 @@
invoke-static {}, Lkotlin/jvm/internal/Intrinsics;->a()V
:cond_1
invoke-virtual {v0}, Landroid/app/Dialog;->getWindow()Landroid/view/Window;
move-result-object v0
const/4 v1, 0x1
invoke-virtual {v0, v1}, Landroid/view/Window;->requestFeature(I)Z
return-void
.end method
@@ -226,6 +226,17 @@
.method public b(Lcom/vk/im/engine/ImEnvironment;)V
.locals 6
iget v0, p0, Lcom/vk/im/engine/commands/messages/MsgMarkAsReadViaBgCmd;->b:I
invoke-static {v0}, Lru/vtosters/lite/dnr/DNRModule;->isDnrEnabledFor(I)Z
move-result v3
if-eqz v3, :cond_beb
return-void
:cond_beb
const-string v0, "env"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->b(Ljava/lang/Object;Ljava/lang/String;)V
@@ -80,8 +80,19 @@
.end method
.method public a(Lcom/vk/im/engine/ImEnvironment;Lcom/vk/instantjobs/InstantJob$b;)V
.locals 3
.locals 4
iget v0, p0, Lcom/vk/im/engine/internal/jobs/msg/MsgMarkAsReadJob;->b:I
invoke-static {v0}, Lru/vtosters/lite/dnr/DNRModule;->isDnrEnabledFor(I)Z
move-result v3
if-eqz v3, :cond_beb
return-void
:cond_beb
const-string v0, "env"
invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->b(Ljava/lang/Object;Ljava/lang/String;)V
@@ -120,6 +120,8 @@
invoke-virtual {p1, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
goto :goto_1
:cond_1
@@ -175,6 +177,8 @@
invoke-virtual {p1, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_2
:goto_1
return-void
@@ -663,6 +663,8 @@
.line 399
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 403
:cond_0
invoke-virtual {p0, v2, v2}, Lcom/vk/sharing/SharingActivity;->overridePendingTransition(II)V
@@ -42,6 +42,8 @@
invoke-virtual {p1, p2}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_0
return-void
.end method
@@ -628,11 +628,15 @@
if-eqz v0, :cond_0
const/16 v0, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result v0
.line 158
invoke-virtual {p1, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 161
:cond_0
new-instance v0, Lcom/vtosters/lite/ui/widget/MenuListView;
@@ -814,6 +818,8 @@
invoke-virtual {p1, v0}, Lcom/vtosters/lite/ui/EdgeSlidingPaneLayout;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 266
:cond_0
iget-object p1, p0, Lcom/vtosters/lite/ui/h/NavigationDelegateLeftMenu;->b:Lcom/vtosters/lite/ui/widget/MenuListView;
@@ -31,7 +31,9 @@
move-result p0
or-int/lit16 p0, p0, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result p0
invoke-virtual {p1, p0}, Landroid/view/View;->setSystemUiVisibility(I)V
@@ -62,7 +64,9 @@
move-result p0
or-int/lit16 p0, p0, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result p0
invoke-virtual {p1, p0}, Landroid/view/View;->setSystemUiVisibility(I)V
@@ -74,11 +78,15 @@
move-result p0
and-int/lit16 p0, p0, -0x2001
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result p0
invoke-virtual {p1, p0}, Landroid/view/View;->setSystemUiVisibility(I)V
:cond_2
:goto_0
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
return-void
.end method
@@ -79,10 +79,14 @@
move-result v0
or-int/lit16 v0, v0, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result v0
invoke-virtual {p0, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_1
return-void
.end method
@@ -618,6 +618,8 @@
invoke-virtual {p1, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_1
return-void
.end method
@@ -65,7 +65,9 @@
goto :goto_0
:cond_0
const/high16 p1, -0x1000000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getTextAttr()I
move-result p1
:goto_0
return p1
@@ -1067,7 +1067,7 @@
.method public a()Ljava/lang/String;
.locals 1
const-string v0, "5.97"
const-string v0, "5.111"
return-object v0
.end method
@@ -102,6 +102,8 @@
const/16 v1, 0xd04
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:try_end_0
.catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0
@@ -254,6 +254,10 @@
check-cast v0, Lcom/vk/im/engine/commands/messages/MsgHistoryGetArgs$a;
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->getMsgCount()I
move-result p1
iput p1, v0, Lcom/vk/im/engine/commands/messages/MsgHistoryGetArgs$a;->f:I
return-object v0
@@ -126,7 +126,9 @@
move-result v1
or-int/lit16 v1, v1, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbarFix()I
move-result v1
.line 68
invoke-virtual {v0, v1}, Lcom/vk/core/view/FitSystemWindowsFragmentWrapperFrameLayout;->setSystemUiVisibility(I)V
@@ -4601,10 +4601,14 @@
move-result p2
add-int/lit16 p2, p2, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result p2
invoke-virtual {p1, p2}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 375
:cond_2
invoke-virtual {p0}, Lcom/vk/poll/fragments/PollEditorFragment;->p()Landroid/support/v4/app/FragmentActivity;
@@ -165,6 +165,8 @@
invoke-virtual {v0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 96
invoke-virtual {p0}, Lcom/vtosters/lite/fragments/LeaderboardFragment;->p()Landroid/support/v4/app/FragmentActivity;
@@ -70,6 +70,16 @@
.method public static a(Landroid/content/Context;I)Landroid/content/res/ColorStateList;
.locals 2
invoke-virtual {p0, p1}, Landroid/content/Context;->getColorStateList(I)Landroid/content/res/ColorStateList;
move-result-object p0
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->themeCSL(Landroid/content/res/ColorStateList;)Landroid/content/res/ColorStateList;
move-result-object p0
return-object p0
.line 63
sget v0, Landroid/os/Build$VERSION;->SDK_INT:I
@@ -349,7 +349,7 @@
:goto_4
move-object v11, v10
const-string v10, "info"
const-string v10, "null"
.line 115
invoke-virtual {v2, v10}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
@@ -26,7 +26,7 @@
# direct methods
.method public constructor <init>(IIIIIZLjava/lang/String;ZLjava/lang/String;)V
.method public constructor <init>(IIIIIZLjava/lang/String;ILjava/lang/String;)V
.locals 1
const-string v0, "execute.getCommentsNew"
@@ -127,18 +127,7 @@
:cond_3
const-string p1, "sort"
if-eqz p8, :cond_4
const-string p2, "desc"
goto :goto_1
:cond_4
const-string p2, "asc"
.line 64
:goto_1
invoke-static {p2}, Lru/vtosters/lite/utils/Newsfeed;->getCommentsSort(Ljava/lang/String;)Ljava/lang/String;
invoke-static {p8}, Lru/vtosters/lite/utils/Newsfeed;->getCommentsSort(I)Ljava/lang/String;
move-result-object p2
@@ -1433,7 +1433,9 @@
:cond_26
:goto_15
const-string v2, "ads_easy_promote"
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->copyrightfix()Ljava/lang/String;
move-result-object v2
.line 373
invoke-virtual {v0, v2}, Lorg/json/JSONObject;->optJSONObject(Ljava/lang/String;)Lorg/json/JSONObject;
@@ -244,7 +244,6 @@
move-result-object v1
.line 49
const-string v2, "filter"
@@ -80,8 +80,18 @@
move-result v3
if-nez v3, :cond_beb
if-eqz v3, :cond_beb
const/4 p1, 0x0
.line 24
invoke-static {p1}, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean;
move-result-object p1
return-object p1
:cond_beb
invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;
move-result-object v2
@@ -127,8 +137,6 @@
invoke-virtual {p1, v0}, Lcom/vk/api/sdk/VKApiManager;->a(Lcom/vk/api/sdk/VKMethodCall;)V
:cond_beb
const/4 p1, 0x1
.line 24
@@ -190,6 +190,8 @@
.line 131
invoke-virtual {p0, v1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_1
return-void
.end method
@@ -535,6 +537,8 @@
.line 139
invoke-virtual {p0, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_0
return-void
.end method
@@ -763,10 +763,14 @@
move-result v0
add-int/lit16 v0, v0, 0x2000
invoke-static {}, Lru/vtosters/lite/utils/Themes;->getNeededColorStatusbar()I
move-result v0
invoke-virtual {p1, v0}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {p1}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
.line 181
invoke-virtual {p0}, Lcom/vk/wall/thread/CommentThreadFragment;->p()Landroid/support/v4/app/FragmentActivity;
@@ -115,6 +115,8 @@
invoke-virtual {v0, p1}, Landroid/view/View;->setSystemUiVisibility(I)V
invoke-static {v0}, Lru/vtosters/lite/utils/Themes;->setBarTheme(Landroid/view/View;)V
:cond_2
return-void
.end method
@@ -712,7 +712,7 @@
.method public a()Ljava/lang/String;
.locals 1
const-string v0, "5.97"
const-string v0, "5.111"
return-object v0
.end method