Compare commits
14
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9360ea4d85 | ||
|
|
c87d6581c8 | ||
|
|
7133fc6c03 | ||
|
|
46af5af250 | ||
|
|
5b9cc6778c | ||
|
|
5260ad8243 | ||
|
|
2996772020 | ||
|
|
d37534cb6b | ||
|
|
92eb48c21e | ||
|
|
d9e867cb6e | ||
|
|
f200c6e59a | ||
|
|
c668f3bf9a | ||
|
|
bd7afee09b | ||
|
|
ff09a4aec0 |
@@ -25,3 +25,4 @@ smali/assets/version.properties
|
||||
app/src/main/assets/version.properties
|
||||
smali/build/resources.zip
|
||||
*.idsig
|
||||
/smali/VTLite.apk.cache/
|
||||
|
||||
@@ -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,8 +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.net.Request;
|
||||
|
||||
public class FoafBase {
|
||||
private static final Pattern FOAF_REGEX = Pattern.compile("<ya:created dc:date=\"(.+?)\"\\/>");
|
||||
@@ -35,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;
|
||||
}
|
||||
@@ -67,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
-1
@@ -1,4 +1,4 @@
|
||||
package ru.f0x1d.net;
|
||||
package ru.vtosters.lite.net;
|
||||
|
||||
import android.util.Base64;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.f0x1d.net;
|
||||
package ru.vtosters.lite.net;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.f0x1d.net;
|
||||
package ru.vtosters.lite.net;
|
||||
|
||||
import java.net.PasswordAuthentication;
|
||||
import java.net.Proxy;
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package ru.f0x1d.net;
|
||||
package ru.vtosters.lite.net;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
+1
-1
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -2,7 +2,7 @@ package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
import static ru.vtosters.lite.utils.Globals.getPrefsValue;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanFalse;
|
||||
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 = getPrefsValue("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,21 +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;
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
// Current UserId
|
||||
public static int getUserId() {
|
||||
return VKAccountManager.b().a();
|
||||
}
|
||||
} // Current UserId
|
||||
|
||||
public static String getUserSecret() {
|
||||
return VKAccountManager.b().c();
|
||||
@@ -60,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;
|
||||
@@ -80,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 {
|
||||
@@ -111,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);
|
||||
@@ -121,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();
|
||||
@@ -159,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 hasMusicChannel = false;
|
||||
|
||||
try {
|
||||
if (notificationManager.getNotificationChannel("audio_playback_channel") != null) {
|
||||
hasMusicChannel = true;
|
||||
}
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
} 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() {
|
||||
@@ -227,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);
|
||||
}
|
||||
}
|
||||
@@ -4,19 +4,19 @@ 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.getPrefsValue;
|
||||
import static ru.vtosters.lite.utils.Preferences.BooleanTrue;
|
||||
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;
|
||||
@@ -74,7 +74,7 @@ public class Newsfeed {
|
||||
}
|
||||
|
||||
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,7 +90,7 @@ public class Newsfeed {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
} // Get needed filter list from assets
|
||||
|
||||
public static boolean injectFilters(JSONObject jSONObject) {
|
||||
String optString = jSONObject.optString(NavigatorKeys.j, "");
|
||||
@@ -105,7 +105,7 @@ public class Newsfeed {
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
} // json newsfeed/posts injector to detect and delete posts
|
||||
|
||||
public static boolean authors_rec(String str) {
|
||||
return str.equals("authors_rec") && !authorsrecomm();
|
||||
@@ -170,15 +170,8 @@ public class Newsfeed {
|
||||
return adsstories() ? "null" : "ads";
|
||||
}
|
||||
|
||||
public static String getCommentsSort(String def) {
|
||||
switch (getPrefsValue("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) {
|
||||
@@ -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":
|
||||
|
||||
@@ -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,59 +180,59 @@ 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() {
|
||||
@@ -242,59 +244,59 @@ public class Preferences {
|
||||
}
|
||||
|
||||
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() {
|
||||
@@ -308,22 +310,22 @@ public class Preferences {
|
||||
|
||||
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() {
|
||||
@@ -335,7 +337,7 @@ public class Preferences {
|
||||
}
|
||||
|
||||
public static long VKVersionBuildLong() {
|
||||
return (long) VKVersionBuild();
|
||||
return VKVersionBuild();
|
||||
}
|
||||
|
||||
public static String getLocale() {
|
||||
|
||||
@@ -3,7 +3,7 @@ package ru.vtosters.lite.utils;
|
||||
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.BooleanFalse;
|
||||
import static ru.vtosters.lite.utils.Preferences.getBoolValue;
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
@@ -122,7 +122,7 @@ public class Proxy {
|
||||
clearProperty("http.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
} // Reset all proxies
|
||||
|
||||
public static void resetProxySocks() {
|
||||
clearProperty("https.proxyHost");
|
||||
@@ -133,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");
|
||||
@@ -142,7 +142,7 @@ public class Proxy {
|
||||
clearProperty("https.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
} // Reset all except http
|
||||
|
||||
public static void resetProxyHttps() {
|
||||
clearProperty("http.proxyHost");
|
||||
@@ -151,7 +151,7 @@ public class Proxy {
|
||||
clearProperty("http.proxyPassword");
|
||||
clearProperty("socksProxyHost");
|
||||
clearProperty("socksPortHost");
|
||||
}
|
||||
} // Reset all except https
|
||||
|
||||
public static String proxyHostHTTP() {
|
||||
String string = getPrefsValue("proxyHostHTTP");
|
||||
@@ -207,8 +207,8 @@ public class Proxy {
|
||||
return getPrefsValue("proxy").equals("apiproxy");
|
||||
}
|
||||
|
||||
// Official vk proxy enforcer
|
||||
|
||||
public static boolean proxyvk() {
|
||||
return BooleanFalse("proxyvk");
|
||||
}
|
||||
return getBoolValue("proxyvk", false);
|
||||
} // Official vk proxy enforcer
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ 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;
|
||||
@@ -19,6 +20,8 @@ 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;
|
||||
@@ -26,52 +29,68 @@ 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);
|
||||
}
|
||||
|
||||
public static int getAmoledTheme() {
|
||||
return getContext().getResources().getIdentifier("BaseAmoledStyle", "style", getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static int picFix() {
|
||||
return getContext().getResources().getIdentifier("ActionBarThemeFix", "style", getContext().getPackageName());
|
||||
}
|
||||
|
||||
public static int getAmoledImTheme() {
|
||||
return getContext().getResources().getIdentifier("VkIm.Theme.VkApp.Amoled", "style", getContext().getPackageName());
|
||||
}
|
||||
} // 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;
|
||||
@@ -92,7 +111,7 @@ public class Themes {
|
||||
default:
|
||||
return VKTheme.DARK;
|
||||
}
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
public static ImTheme getImDarkTheme() {
|
||||
switch (getPrefsValue("darktheme")) {
|
||||
@@ -101,25 +120,25 @@ public class Themes {
|
||||
default:
|
||||
return ImTheme.VKAPP_DARK;
|
||||
}
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
public static VKTheme getLightTheme() {
|
||||
switch (getPrefsValue("lighttheme")) {
|
||||
default:
|
||||
return VKTheme.DEFAULT_LIGHT;
|
||||
}
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
public static ImTheme getImLightTheme() {
|
||||
switch (getPrefsValue("lighttheme")) {
|
||||
default:
|
||||
return ImTheme.VKAPP_LIGHT;
|
||||
}
|
||||
}
|
||||
} // Return needed theme for theme changer
|
||||
|
||||
public static int getColorFromAttr(int attr) {
|
||||
return VKThemeHelper.a(attr);
|
||||
}
|
||||
} // Get needed attr color
|
||||
|
||||
public static boolean isAndroidMonet() {
|
||||
return color_grishka() && Build.VERSION.SDK_INT >= 31;
|
||||
@@ -127,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) {
|
||||
@@ -141,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) {
|
||||
@@ -165,14 +233,14 @@ 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) {
|
||||
@@ -183,7 +251,8 @@ public class Themes {
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -225,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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package ru.vtosters.lite.utils;
|
||||
|
||||
import static ru.vtosters.lite.utils.Globals.getContext;
|
||||
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;
|
||||
|
||||
@@ -67,7 +68,7 @@ public class VKUIInjector {
|
||||
|
||||
public static void inject(WebView webView) {
|
||||
String string = getPrefsValue("darktheme");
|
||||
if (Preferences.BooleanTrue("VKUI_INJ")) {
|
||||
if (getBoolValue("VKUI_INJ", true)) {
|
||||
if (!isLoaded) {
|
||||
load();
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<resources>
|
||||
<string name="app_name">Vtoasters Shit</string>
|
||||
<string name="app_name">VTosters Lite</string>
|
||||
</resources>
|
||||
+1
-1
@@ -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>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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" />
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -83,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="Выберите значение"
|
||||
@@ -97,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"
|
||||
|
||||
@@ -92,10 +92,6 @@
|
||||
|
||||
iput-object p2, p0, Lcom/vk/im/engine/commands/dialogs/DialogsHistoryGetArgs;->c:Lcom/vk/im/engine/models/dialogs/DialogsFilter;
|
||||
|
||||
invoke-static {}, Lru/vtosters/lite/utils/Preferences;->getMsgCount()I
|
||||
|
||||
move-result p3
|
||||
|
||||
iput p3, p0, Lcom/vk/im/engine/commands/dialogs/DialogsHistoryGetArgs;->d:I
|
||||
|
||||
iput-object p4, p0, Lcom/vk/im/engine/commands/dialogs/DialogsHistoryGetArgs;->e:Lcom/vk/im/engine/models/Source;
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
+2
-6
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user