Compare commits
17
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
27dd93efa3 | ||
|
|
f4c7cdce8b | ||
|
|
adc5bb2b8c | ||
|
|
34f49a9b42 | ||
|
|
84ad75e948 | ||
|
|
e049b5f989 | ||
|
|
5de52ed6b5 | ||
|
|
46c4f1c6dc | ||
|
|
126f5259d1 | ||
|
|
2d1867197f | ||
|
|
c1d4216416 | ||
|
|
0f45a8d175 | ||
|
|
15ed01b4d3 | ||
|
|
41763a4b54 | ||
|
|
d98d81f105 | ||
|
|
899554a571 | ||
|
|
87b1a89bd8 |
@@ -0,0 +1,336 @@
|
|||||||
|
package com.vk.libvideo;
|
||||||
|
|
||||||
|
import android.os.Bundle;
|
||||||
|
import android.text.TextUtils;
|
||||||
|
import androidx.annotation.NonNull;
|
||||||
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.core.app.NotificationCompat;
|
||||||
|
import com.vk.bridges.StatisticsBridge1;
|
||||||
|
import com.vk.dto.common.VideoFile;
|
||||||
|
import com.vk.media.player.PlayerTypes;
|
||||||
|
import com.vk.navigation.NavigatorKeys;
|
||||||
|
import com.vk.statistic.Statistic;
|
||||||
|
import org.json.JSONException;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
import ru.vtosters.hooks.other.Preferences;
|
||||||
|
import ru.vtosters.lite.utils.Metrics;
|
||||||
|
|
||||||
|
import java.util.Locale;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public class VideoTracker {
|
||||||
|
private final VideoFile a;
|
||||||
|
|
||||||
|
/* renamed from: b reason: collision with root package name */
|
||||||
|
private Statistic f15638b;
|
||||||
|
|
||||||
|
/* renamed from: c reason: collision with root package name */
|
||||||
|
private String f15639c;
|
||||||
|
|
||||||
|
/* renamed from: d reason: collision with root package name */
|
||||||
|
private String f15640d;
|
||||||
|
|
||||||
|
/* renamed from: e reason: collision with root package name */
|
||||||
|
private final boolean f15641e;
|
||||||
|
|
||||||
|
/* renamed from: f reason: collision with root package name */
|
||||||
|
private int f15642f = -1;
|
||||||
|
private final int g;
|
||||||
|
private final int h;
|
||||||
|
private final int i;
|
||||||
|
private final int j;
|
||||||
|
private final int k;
|
||||||
|
private int l;
|
||||||
|
private PlayerType m;
|
||||||
|
private Screen n;
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public enum FullscreenTransition {
|
||||||
|
TAP,
|
||||||
|
SCREEN_ROTATION
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public enum PlayerType {
|
||||||
|
INLINE,
|
||||||
|
CAROUSEL,
|
||||||
|
FULLSCREEN
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public enum ResizeAction {
|
||||||
|
BUTTON,
|
||||||
|
GESTURE
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public enum RewindType {
|
||||||
|
SLIDER,
|
||||||
|
DOUBLE_TAP
|
||||||
|
}
|
||||||
|
|
||||||
|
/* loaded from: classes3.dex */
|
||||||
|
public enum Screen {
|
||||||
|
INLINE,
|
||||||
|
CAROUSEL,
|
||||||
|
PORTRAIT,
|
||||||
|
LANDSCAPE
|
||||||
|
}
|
||||||
|
|
||||||
|
public VideoTracker(VideoFile videoFile, @Nullable Statistic statistic, String str, boolean z, @Nullable String str2) {
|
||||||
|
this.a = videoFile;
|
||||||
|
this.f15638b = statistic;
|
||||||
|
int i = videoFile.d;
|
||||||
|
this.g = (int) (i * 0.25f);
|
||||||
|
this.h = (int) (i * 0.5f);
|
||||||
|
this.i = (int) (i * 0.75f);
|
||||||
|
this.j = (int) (i * 0.95f);
|
||||||
|
this.k = i - 1;
|
||||||
|
this.f15639c = str;
|
||||||
|
this.f15641e = z;
|
||||||
|
this.f15640d = str2;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean a(int i, int i2, int i3) {
|
||||||
|
return i3 > i && i3 <= i2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(String str) {
|
||||||
|
this.f15640d = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean b() {
|
||||||
|
return this.f15638b != null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void c() {
|
||||||
|
this.f15642f = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void d() {
|
||||||
|
c("video_fullscreen_off");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void e() {
|
||||||
|
c("video_fullscreen_on");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void f() {
|
||||||
|
c("video_pause");
|
||||||
|
c("pause", "pause");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void g() {
|
||||||
|
c("video_resume");
|
||||||
|
c("pause", "resume");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void h() {
|
||||||
|
c("video_volume_off");
|
||||||
|
c("volume", "off");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void i() {
|
||||||
|
c("video_volume_on");
|
||||||
|
c("volume", "on");
|
||||||
|
}
|
||||||
|
|
||||||
|
private void c(String str, String str2) {
|
||||||
|
a(b(str, str2));
|
||||||
|
}
|
||||||
|
|
||||||
|
public String a() {
|
||||||
|
return this.f15640d;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void b(String str) {
|
||||||
|
if (Objects.equals(this.f15639c, str)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this.f15639c = str;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void c(String str) {
|
||||||
|
if (this.f15638b != null) {
|
||||||
|
StatisticsBridge1.a().a(this.f15638b, str);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(@Nullable Statistic statistic) {
|
||||||
|
this.f15638b = statistic;
|
||||||
|
}
|
||||||
|
|
||||||
|
private Bundle b(String str, String str2) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString(NotificationCompat.CATEGORY_EVENT, str);
|
||||||
|
bundle.putString("value", str2);
|
||||||
|
bundle.putInt("position", this.f15642f);
|
||||||
|
return bundle;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(PlayerType playerType) {
|
||||||
|
if (this.m != playerType) {
|
||||||
|
this.m = playerType;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(int i, int i2) {
|
||||||
|
int i3 = this.f15642f;
|
||||||
|
if (i == i3) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (a(i3, i, 0)) {
|
||||||
|
a("start", i2);
|
||||||
|
c("video_start");
|
||||||
|
}
|
||||||
|
// if (this.a.d > 0) {
|
||||||
|
// if (a(this.f15642f, i, 3)) {
|
||||||
|
// a("3s", i2);
|
||||||
|
// c("video_play_3s");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, 10)) {
|
||||||
|
// a("10s", i2);
|
||||||
|
// c("video_play_10s");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, this.g)) {
|
||||||
|
// a("25", i2);
|
||||||
|
// c("video_play_25");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, this.h)) {
|
||||||
|
// a("50", i2);
|
||||||
|
// c("video_play_50");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, this.i)) {
|
||||||
|
// a("75", i2);
|
||||||
|
// c("video_play_75");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, this.j)) {
|
||||||
|
// a("95", i2);
|
||||||
|
// c("video_play_95");
|
||||||
|
// }
|
||||||
|
// if (a(this.f15642f, i, this.k)) {
|
||||||
|
// a("100", i2);
|
||||||
|
// c("video_play_100");
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
this.f15642f = i;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(int i) {
|
||||||
|
a("continue", i);
|
||||||
|
c("video_start");
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(@NonNull Screen screen) {
|
||||||
|
if (this.n != screen) {
|
||||||
|
this.n = screen;
|
||||||
|
c("screen", screen.toString().toLowerCase());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(@NonNull FullscreenTransition fullscreenTransition) {
|
||||||
|
c("full_screen_transition", fullscreenTransition.toString().toLowerCase());
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(int i, boolean z) {
|
||||||
|
if (this.l != i) {
|
||||||
|
this.l = i;
|
||||||
|
c(z ? "auto_quality" : "quality", PlayerTypes.c(i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(@Nullable String str, boolean z) {
|
||||||
|
String str2 = z ? "auto_subtitles" : "subtitles";
|
||||||
|
if (str == null) {
|
||||||
|
str = "off";
|
||||||
|
}
|
||||||
|
c(str2, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(int i, int i2, @NonNull RewindType rewindType) {
|
||||||
|
Bundle b2 = b("rewind", i <= i2 ? "forward" : "backward");
|
||||||
|
b2.putString("rewind_type", rewindType.toString().toLowerCase());
|
||||||
|
b2.putInt("rewind_start", i);
|
||||||
|
b2.putInt("rewind_end", i2);
|
||||||
|
a(b2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(float f2) {
|
||||||
|
String format;
|
||||||
|
if (f2 == 1.0f) {
|
||||||
|
format = "normal";
|
||||||
|
} else {
|
||||||
|
int i = (int) f2;
|
||||||
|
format = f2 == ((float) i) ? String.format(Locale.US, "%s", i) : String.format(Locale.US, "%.2f", f2);
|
||||||
|
}
|
||||||
|
c("speed", format);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(boolean z, @NonNull ResizeAction resizeAction) {
|
||||||
|
Bundle b2 = b("resize", z ? "widen" : "narrow");
|
||||||
|
b2.putString("resize_action", resizeAction.toString().toLowerCase());
|
||||||
|
a(b2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void a(String str, String str2) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("link_type", str);
|
||||||
|
bundle.putString("value", str2);
|
||||||
|
bundle.putString(NotificationCompat.CATEGORY_EVENT, "show_link");
|
||||||
|
a(bundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void a(String str, int i) {
|
||||||
|
Bundle bundle = new Bundle();
|
||||||
|
bundle.putString("autoplay", this.f15641e ? "1" : "0");
|
||||||
|
bundle.putString("position", str);
|
||||||
|
if (i >= 0) {
|
||||||
|
bundle.putInt("quality", i - 2);
|
||||||
|
}
|
||||||
|
PlayerType playerType = this.m;
|
||||||
|
if (playerType != null) {
|
||||||
|
bundle.putString("player_type", playerType.toString().toLowerCase());
|
||||||
|
}
|
||||||
|
a("video_play", bundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void a(Bundle bundle) {
|
||||||
|
a("video_event", bundle);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void a(String str, Bundle bundle) {
|
||||||
|
bundle.putString("video_id", this.a.a + "_" + this.a.b);
|
||||||
|
bundle.putString(NavigatorKeys.V, this.f15639c);
|
||||||
|
bundle.putString(NavigatorKeys.Z, this.f15639c);
|
||||||
|
if (!TextUtils.isEmpty(this.f15640d)) {
|
||||||
|
bundle.putString("context", this.f15640d);
|
||||||
|
}
|
||||||
|
if (!TextUtils.isEmpty(this.a.l0)) {
|
||||||
|
bundle.putString(NavigatorKeys.l0, this.a.l0);
|
||||||
|
}
|
||||||
|
bundle.putLong("ts", System.currentTimeMillis());
|
||||||
|
StatisticsBridge1.a().a(str, bundle);
|
||||||
|
|
||||||
|
if (Preferences.getBoolValue("sendVideoMetrics", true) && str.equals("video_play")) {
|
||||||
|
try {
|
||||||
|
sendMetrics(str);
|
||||||
|
} catch (JSONException e) {
|
||||||
|
throw new RuntimeException(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void sendMetrics(String event) throws JSONException {
|
||||||
|
JSONObject jsonObject = new JSONObject();
|
||||||
|
jsonObject.put("e", event);
|
||||||
|
jsonObject.put("source", this.f15639c);
|
||||||
|
jsonObject.put("ref", this.f15639c);
|
||||||
|
jsonObject.put("video_id", this.a.a + "_" + this.a.b);
|
||||||
|
jsonObject.put("position", "start");
|
||||||
|
jsonObject.put("position_sec", 0);
|
||||||
|
jsonObject.put("cur_quality", "auto");
|
||||||
|
|
||||||
|
Metrics.trackEvents(jsonObject, false);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -11,11 +11,10 @@ import com.vk.music.stats.i.MusicPlaybackParams;
|
|||||||
import com.vk.navigation.NavigatorKeys;
|
import com.vk.navigation.NavigatorKeys;
|
||||||
import com.vtosters.lite.data.Analytics;
|
import com.vtosters.lite.data.Analytics;
|
||||||
import kotlin.jvm.b.Functions2;
|
import kotlin.jvm.b.Functions2;
|
||||||
import org.json.JSONArray;
|
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import ru.vtosters.hooks.other.Preferences;
|
import ru.vtosters.hooks.other.Preferences;
|
||||||
import ru.vtosters.lite.music.Metrics;
|
import ru.vtosters.lite.utils.Metrics;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@@ -161,7 +160,6 @@ public final class VKMusicStatsTracker implements MusicStatsTracker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void makeMetricsRequest(MusicPlaybackParams musicPlaybackParams, String str) throws JSONException {
|
private void makeMetricsRequest(MusicPlaybackParams musicPlaybackParams, String str) throws JSONException {
|
||||||
JSONArray events = new JSONArray();
|
|
||||||
JSONObject event = new JSONObject();
|
JSONObject event = new JSONObject();
|
||||||
|
|
||||||
if (str.equals("music_stop_playback")) {
|
if (str.equals("music_stop_playback")) {
|
||||||
@@ -173,7 +171,6 @@ public final class VKMusicStatsTracker implements MusicStatsTracker {
|
|||||||
event.put("reason", "new");
|
event.put("reason", "new");
|
||||||
event.put("state", "app");
|
event.put("state", "app");
|
||||||
event.put("duration", musicPlaybackParams.a());
|
event.put("duration", musicPlaybackParams.a());
|
||||||
events.put(event);
|
|
||||||
} else {
|
} else {
|
||||||
event.put("e", str);
|
event.put("e", str);
|
||||||
event.put("audio_id", musicPlaybackParams.c());
|
event.put("audio_id", musicPlaybackParams.c());
|
||||||
@@ -185,11 +182,9 @@ public final class VKMusicStatsTracker implements MusicStatsTracker {
|
|||||||
if (StringExt.a((CharSequence) musicPlaybackParams.e())) {
|
if (StringExt.a((CharSequence) musicPlaybackParams.e())) {
|
||||||
event.put("prev_audio_id", musicPlaybackParams.e());
|
event.put("prev_audio_id", musicPlaybackParams.e());
|
||||||
}
|
}
|
||||||
|
|
||||||
events.put(event);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Metrics.trackEvents(events.toString());
|
Metrics.trackEvents(event, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Analytics.l a(MusicPlaybackParams musicPlaybackParams, String str) {
|
private Analytics.l a(MusicPlaybackParams musicPlaybackParams, String str) {
|
||||||
|
|||||||
@@ -11,37 +11,37 @@ import com.vtosters.lite.R;
|
|||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
|
|
||||||
public class GmsHook {
|
public class GmsHook {
|
||||||
private static final boolean needToSpoof = !isGmsInstalled() && (isFakeGmsInstalled() || isFakeGms2Installed());
|
private static final String[] spoofPackages = {"com.mgoogle", "app.revanced"};
|
||||||
|
private static final String currentGms;
|
||||||
|
|
||||||
|
static {
|
||||||
|
currentGms = getSpoofPackagePrefix();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean isPackageInstalled(String packageName) {
|
||||||
|
try {
|
||||||
|
AndroidUtils.getGlobalContext().getPackageManager().getPackageInfo(packageName, 0);
|
||||||
|
return true;
|
||||||
|
} catch (Exception unused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isGmsInstalled() {
|
public static boolean isGmsInstalled() {
|
||||||
try {
|
return isPackageInstalled("com.google.android.gms");
|
||||||
AndroidUtils.getGlobalContext().getPackageManager().getPackageInfo("com.google.android.gms", 0);
|
}
|
||||||
return true;
|
|
||||||
} catch (Exception unused) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} // Google Market Services check
|
|
||||||
|
|
||||||
public static boolean isFakeGmsInstalled() {
|
public static boolean isSpoofPackageInstalled(String packageName) {
|
||||||
try {
|
return isPackageInstalled(packageName + ".android.gms");
|
||||||
AndroidUtils.getGlobalContext().getPackageManager().getPackageInfo("com.mgoogle.android.gms", 0);
|
}
|
||||||
return true;
|
|
||||||
} catch (Exception unused) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} // Microg Google Market Services check
|
|
||||||
|
|
||||||
public static boolean isFakeGms2Installed() {
|
|
||||||
try {
|
|
||||||
AndroidUtils.getGlobalContext().getPackageManager().getPackageInfo("app.revanced.android.gms", 0);
|
|
||||||
return true;
|
|
||||||
} catch (Exception unused) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
} // Microg Google Market Services check
|
|
||||||
|
|
||||||
public static boolean isAnyServicesInstalled() {
|
public static boolean isAnyServicesInstalled() {
|
||||||
return isGmsInstalled() || isFakeGmsInstalled() || isFakeGms2Installed();
|
for (String packageName : spoofPackages) {
|
||||||
|
if (isSpoofPackageInstalled(packageName)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fixGapps() {
|
public static void fixGapps() {
|
||||||
@@ -52,10 +52,10 @@ public class GmsHook {
|
|||||||
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", AndroidUtils.getResources().getString(R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
|
notificationManager.createNotificationChannel(new NotificationChannel("audio_playback_channel", AndroidUtils.getResources().getString(R.string.audio_message_play_error), NotificationManager.IMPORTANCE_LOW));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} // Music channels fix
|
}
|
||||||
|
|
||||||
public static String replaceGMSPackage(String str) {
|
public static String replaceGMSPackage(String str) {
|
||||||
return needToSpoof ? str.replaceAll("com.google", (isFakeGms2Installed() ? "app.revanced" : "com.mgoogle")) : str;
|
return shouldSpoof() ? str.replaceAll("com.google", currentGms) : str;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getFirebaseInstanceIdReceiver() {
|
public static String getFirebaseInstanceIdReceiver() {
|
||||||
@@ -63,6 +63,37 @@ public class GmsHook {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static Class getFirebaseInstanceIdReceiverClass() {
|
public static Class getFirebaseInstanceIdReceiverClass() {
|
||||||
return needToSpoof ? (isFakeGms2Installed() ? FirebaseInstanceIdReceiver3.class : FirebaseInstanceIdReceiver2.class) : FirebaseInstanceIdReceiver.class;
|
return getSpoofFirebaseInstanceIdReceiverClass();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
public static String getCurrentGms() {
|
||||||
|
return currentGms;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean shouldSpoof() {
|
||||||
|
return !isGmsInstalled() && (isSpoofPackageInstalled("com.mgoogle") || isSpoofPackageInstalled("app.revanced"));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getSpoofPackagePrefix() {
|
||||||
|
for (String packageName : spoofPackages) {
|
||||||
|
if (isSpoofPackageInstalled(packageName)) {
|
||||||
|
return packageName;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "com.google";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Class getSpoofFirebaseInstanceIdReceiverClass() {
|
||||||
|
switch (currentGms) {
|
||||||
|
case "com.mgoogle" -> {
|
||||||
|
return FirebaseInstanceIdReceiver2.class;
|
||||||
|
}
|
||||||
|
case "app.revanced" -> {
|
||||||
|
return FirebaseInstanceIdReceiver3.class;
|
||||||
|
}
|
||||||
|
default -> {
|
||||||
|
return FirebaseInstanceIdReceiver.class;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,29 +1,40 @@
|
|||||||
package ru.vtosters.hooks;
|
package ru.vtosters.hooks;
|
||||||
|
|
||||||
|
import androidx.core.util.Pair;
|
||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
import ru.vtosters.hooks.other.Preferences;
|
||||||
|
import ru.vtosters.lite.utils.RenameTool;
|
||||||
|
|
||||||
public class RenameHook {
|
public class RenameHook {
|
||||||
public static void injectIntoJson(JSONObject obj) throws JSONException {
|
public static void injectIntoJson(JSONObject obj) throws JSONException {
|
||||||
// int i = obj.getInt("id");
|
if (isEnabled()) {
|
||||||
// if (RenameTool.updateRequested) {
|
int i = obj.getInt("id");
|
||||||
// RenameTool.reloadDB();
|
if (RenameTool.updateRequested) {
|
||||||
// }
|
RenameTool.reloadDB();
|
||||||
//
|
}
|
||||||
// Pair<String, String> user = RenameTool.renamedUsers.get(i);
|
|
||||||
// if (user == null) return;
|
Pair<String, String> user = RenameTool.renamedUsers.get(i);
|
||||||
// obj.put(RenameTool.COLUMN_FIRSTNAME, user.first).put(RenameTool.COLUMN_LASTNAME, user.second);
|
if (user == null) return;
|
||||||
|
obj.put(RenameTool.COLUMN_FIRSTNAME, user.first).put(RenameTool.COLUMN_LASTNAME, user.second);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isEnabled() {
|
||||||
|
return Preferences.getBoolValue("unstableNameChanger", true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void injectIntoJsonGroup(JSONObject obj) throws JSONException {
|
public static void injectIntoJsonGroup(JSONObject obj) throws JSONException {
|
||||||
// int i = obj.getInt("id");
|
if (isEnabled()) {
|
||||||
//
|
int i = obj.getInt("id");
|
||||||
// if (RenameTool.updateRequested) {
|
|
||||||
// RenameTool.reloadDB();
|
if (RenameTool.updateRequested) {
|
||||||
// }
|
RenameTool.reloadDB();
|
||||||
//
|
}
|
||||||
// String user = RenameTool.renamedGroups.get(i);
|
|
||||||
// if (user == null) return;
|
String user = RenameTool.renamedGroups.get(i);
|
||||||
// obj.put("name", user);
|
if (user == null) return;
|
||||||
|
obj.put("name", user);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,11 +42,13 @@ public class CatalogJsonInjector {
|
|||||||
|
|
||||||
removeUnsupportedLayouts(blocks);
|
removeUnsupportedLayouts(blocks);
|
||||||
|
|
||||||
fetchCatalogId("https://vk.com/audio?section=my_playlists", oldItems);
|
if (Preferences.getBoolValue("playlistsCatalogs", true)) {
|
||||||
|
fetchCatalogId("https://vk.com/audio?section=my_playlists", oldItems);
|
||||||
|
|
||||||
fetchCatalogId("https://vk.com/audio?section=albums", oldItems);
|
fetchCatalogId("https://vk.com/audio?section=albums", oldItems);
|
||||||
|
}
|
||||||
|
|
||||||
if (Preferences.sendMusicMetrics()) {
|
if (Preferences.sendMusicMetrics() && Preferences.getBoolValue("playStatCatalog", false)) {
|
||||||
fetchCatalogId("https://vk.com/audio?section=recent", oldItems);
|
fetchCatalogId("https://vk.com/audio?section=recent", oldItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import ru.vtosters.lite.downloaders.AudioDownloader;
|
|||||||
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
||||||
import ru.vtosters.lite.music.cache.helpers.PlaylistHelper;
|
import ru.vtosters.lite.music.cache.helpers.PlaylistHelper;
|
||||||
import ru.vtosters.lite.music.cache.helpers.TracklistHelper;
|
import ru.vtosters.lite.music.cache.helpers.TracklistHelper;
|
||||||
|
import ru.vtosters.lite.utils.AccountManagerUtils;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -36,8 +37,10 @@ public class PlaylistInjector {
|
|||||||
|
|
||||||
public static Observable<AudioGetPlaylist.c> injectGetPlaylist(AudioGetPlaylist audioGetPlaylist) {
|
public static Observable<AudioGetPlaylist.c> injectGetPlaylist(AudioGetPlaylist audioGetPlaylist) {
|
||||||
try {
|
try {
|
||||||
if (MusicCacheImpl.isEmpty())
|
if (MusicCacheImpl.isEmpty()) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
var requestArgs = audioGetPlaylist.b();
|
var requestArgs = audioGetPlaylist.b();
|
||||||
|
|
||||||
var id = requestArgs.get("id");
|
var id = requestArgs.get("id");
|
||||||
@@ -45,9 +48,11 @@ public class PlaylistInjector {
|
|||||||
var accessKey = requestArgs.get("access_key");
|
var accessKey = requestArgs.get("access_key");
|
||||||
boolean isVirtualPlaylist = accessKey != null && (accessKey.equals("cache"));
|
boolean isVirtualPlaylist = accessKey != null && (accessKey.equals("cache"));
|
||||||
boolean isAlbumVirtualPlaylist = accessKey != null && (accessKey.equals("cacheAlbum"));
|
boolean isAlbumVirtualPlaylist = accessKey != null && (accessKey.equals("cacheAlbum"));
|
||||||
|
boolean isOwnCachePlaylist = Objects.equals(ownerId, String.valueOf(AccountManagerUtils.getUserId())) && Objects.equals(id, "-1");
|
||||||
|
|
||||||
if (TextUtils.isEmpty(id) || (!isVirtualPlaylist && !isAlbumVirtualPlaylist))
|
if (TextUtils.isEmpty(id) || (!isVirtualPlaylist && !isAlbumVirtualPlaylist)) {
|
||||||
return null;
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return Observable.a((ObservableOnSubscribe<AudioGetPlaylist.c>) observableEmitter -> {
|
return Observable.a((ObservableOnSubscribe<AudioGetPlaylist.c>) observableEmitter -> {
|
||||||
AudioGetPlaylist.c response = new AudioGetPlaylist.c();
|
AudioGetPlaylist.c response = new AudioGetPlaylist.c();
|
||||||
@@ -81,13 +86,11 @@ public class PlaylistInjector {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
response.c = (ArrayList<MusicTrack>) MusicCacheImpl.getPlaylistSongs(ownerId, id);
|
if (isOwnCachePlaylist) {
|
||||||
|
response.c = (ArrayList<MusicTrack>) TracklistHelper.getMyCachedMusicTracks();
|
||||||
Log.d("Playlist", "Open playlist " + ownerId + "_" + id);
|
|
||||||
|
|
||||||
if (Objects.equals(id, "-1")) {
|
|
||||||
response.b = PlaylistHelper.createCachedPlaylistMetadata();
|
response.b = PlaylistHelper.createCachedPlaylistMetadata();
|
||||||
} else {
|
} else {
|
||||||
|
response.c = (ArrayList<MusicTrack>) MusicCacheImpl.getPlaylistSongs(ownerId, id);
|
||||||
response.b = MusicCacheImpl.getPlaylist(id, ownerId);
|
response.b = MusicCacheImpl.getPlaylist(id, ownerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class TracklistInjector {
|
|||||||
Log.d("TracklistInjector", "Using vkx cache catalog");
|
Log.d("TracklistInjector", "Using vkx cache catalog");
|
||||||
observableEmitter.b(parser.c(new JSONObject(service.getCacheCatalog())));
|
observableEmitter.b(parser.c(new JSONObject(service.getCacheCatalog())));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.fillInStackTrace();
|
||||||
List<MusicTrack> tracks = new ArrayList<>();
|
List<MusicTrack> tracks = new ArrayList<>();
|
||||||
List<String> cache = service.getCache();
|
List<String> cache = service.getCache();
|
||||||
|
|
||||||
@@ -55,16 +55,14 @@ public class TracklistInjector {
|
|||||||
observableEmitter.b(parser.c(createVirtualCatalog(tracks)));
|
observableEmitter.b(parser.c(createVirtualCatalog(tracks)));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.fillInStackTrace();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
if (MusicCacheImpl.isEmpty()) {
|
if (MusicCacheImpl.isEmpty()) {
|
||||||
observableEmitter.b(parser.c(getEmptyCatalog()));
|
observableEmitter.b(parser.c(getEmptyCatalog()));
|
||||||
} else {
|
} else {
|
||||||
observableEmitter.b(parser.c(createVirtualCatalog(
|
observableEmitter.b(parser.c(createVirtualCatalog(TracklistHelper.getMyCachedMusicTracks())));
|
||||||
PlaylistCacheDbDelegate.getTracksInPlaylist(AndroidUtils.getGlobalContext(),
|
|
||||||
AccountManagerUtils.getUserId() + "_-1"))));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@@ -248,7 +246,7 @@ public class TracklistInjector {
|
|||||||
.put(getCatalogPlaylist());
|
.put(getCatalogPlaylist());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!MusicCacheImpl.getAllOwnTracks().isEmpty()) {
|
if (!PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
|
||||||
if (MusicCacheImpl.hasPlaylist()) blocks.put(getCatalogSeparator());
|
if (MusicCacheImpl.hasPlaylist()) blocks.put(getCatalogSeparator());
|
||||||
blocks.put(getCatalogHeader(AndroidUtils.getString(R.string.cached_tracks_title)))
|
blocks.put(getCatalogHeader(AndroidUtils.getString(R.string.cached_tracks_title)))
|
||||||
.put(getShuffleButton())
|
.put(getShuffleButton())
|
||||||
|
|||||||
@@ -100,8 +100,8 @@ public class Preferences {
|
|||||||
return getBoolValue("vkme", false);
|
return getBoolValue("vkme", false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean autocache() {
|
public static int autocache() {
|
||||||
return getBoolValue("autocache", false);
|
return Preferences.getPreferences().getInt("autocaching", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean adsstories() {
|
public static boolean adsstories() {
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ public class Device {
|
|||||||
+ "- Manufacturer: " + this.manufacturerName + "\n"
|
+ "- Manufacturer: " + this.manufacturerName + "\n"
|
||||||
+ "- Brand: " + this.brandName + "\n"
|
+ "- Brand: " + this.brandName + "\n"
|
||||||
+ "- Model: " + this.modelName + "\n"
|
+ "- Model: " + this.modelName + "\n"
|
||||||
+ (isMIUI() ? "- Miui Version Code: " + this.MiuiUiVersionCode + "\n" + "- Miui Version Name: " + this.MiuiUiVersionName + "\n" : "")
|
+ (isMIUI() || isHyperOs() ? "- Miui/HyperOS Version Code: " + this.MiuiUiVersionCode + "\n" + "- Miui/HyperOS Version Name: " + this.MiuiUiVersionName + "\n" : "")
|
||||||
+ (isSamsung() ? "- OneUi Major Version: " + this.OneUiMajorVersion + "\n" + "- OneUi Minor Version: " + this.OneUiMinorVersion + "\n" : "")
|
+ (isSamsung() ? "- OneUi Major Version: " + this.OneUiMajorVersion + "\n" + "- OneUi Minor Version: " + this.OneUiMinorVersion + "\n" : "")
|
||||||
+ (hasMiuiIncrCode() ? "- Miui Version Incremental Code: " + this.MiuiIncrementalCode + "\n" : "")
|
+ (hasMiuiIncrCode() ? "- Miui Version Incremental Code: " + this.MiuiIncrementalCode + "\n" : "")
|
||||||
+ (isEMUI() ? "- Emui Version: " + this.EmuiVersion : "");
|
+ (isEMUI() ? "- Emui Version: " + this.EmuiVersion : "");
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class OEMDetector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isOEM() {
|
public static boolean isOEM() {
|
||||||
return isMIUI() || isEMUI() || isFlyme() || isZenUI() || isSamsung() || isVivo() || isOneUi();
|
return isMIUI() || isEMUI() || isFlyme() || isZenUI() || isSamsung() || isVivo() || isOneUi() || isHyperOs();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isMIUI() {
|
public static boolean isMIUI() {
|
||||||
@@ -68,6 +68,15 @@ public class OEMDetector {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isHyperOs() {
|
||||||
|
try {
|
||||||
|
int miuiVer = Integer.parseInt(getMiuiUiVersionCode()); // cuz hyperos gives 816 and etc
|
||||||
|
return miuiVer > 14 && isMIUI();
|
||||||
|
} catch (Exception unused) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isIntentResolved(Context ctx, Intent intent) {
|
public static boolean isIntentResolved(Context ctx, Intent intent) {
|
||||||
return (intent != null && ctx.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null);
|
return (intent != null && ctx.getPackageManager().resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY) != null);
|
||||||
}
|
}
|
||||||
@@ -124,7 +133,6 @@ public class OEMDetector {
|
|||||||
try {
|
try {
|
||||||
return (String) getPropMtd.invoke(null, prop);
|
return (String) getPropMtd.invoke(null, prop);
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
e.printStackTrace();
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ import ru.vtosters.hooks.other.Preferences;
|
|||||||
import ru.vtosters.lite.di.singleton.VtOkHttpClient;
|
import ru.vtosters.lite.di.singleton.VtOkHttpClient;
|
||||||
import ru.vtosters.lite.downloaders.AudioDownloader;
|
import ru.vtosters.lite.downloaders.AudioDownloader;
|
||||||
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
||||||
|
import ru.vtosters.lite.utils.AccountManagerUtils;
|
||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
import ru.vtosters.lite.utils.music.MusicTrackUtils;
|
import ru.vtosters.lite.utils.music.MusicTrackUtils;
|
||||||
|
|
||||||
@@ -50,13 +51,14 @@ public class LastFMScrobbler {
|
|||||||
var access_key = !TextUtils.isEmpty(musictrack.J) ? musictrack.J : "";
|
var access_key = !TextUtils.isEmpty(musictrack.J) ? musictrack.J : "";
|
||||||
var album_id = musictrack.I;
|
var album_id = musictrack.I;
|
||||||
var album = album_id != null ? album_id.getTitle() : null;
|
var album = album_id != null ? album_id.getTitle() : null;
|
||||||
|
var isOwnTrack = musictrack.e == AccountManagerUtils.getUserId();
|
||||||
|
|
||||||
if (TextUtils.isEmpty(uid) || TextUtils.isEmpty(artist) || TextUtils.isEmpty(title) || duration == 0) {
|
if (TextUtils.isEmpty(uid) || TextUtils.isEmpty(artist) || TextUtils.isEmpty(title) || duration == 0) {
|
||||||
Log.d("Scrobbler", "grabTrackInfo: " + "Empty track, info: " + artist + " - " + title + " - " + duration + " - " + uid);
|
Log.d("Scrobbler", "grabTrackInfo: " + "Empty track, info: " + artist + " - " + title + " - " + duration + " - " + uid);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Preferences.autocache() && !MusicCacheImpl.isCachedTrack(uid)) {
|
if (needToCache(isOwnTrack) && !MusicCacheImpl.isCachedTrack(uid)) {
|
||||||
if (LibVKXClient.isIntegrationEnabled()) {
|
if (LibVKXClient.isIntegrationEnabled()) {
|
||||||
LibVKXClient.getInstance().runOnService(service -> {
|
LibVKXClient.getInstance().runOnService(service -> {
|
||||||
try {
|
try {
|
||||||
@@ -73,6 +75,12 @@ public class LastFMScrobbler {
|
|||||||
scrobbleTrack(duration, artist, title, uid, album);
|
scrobbleTrack(duration, artist, title, uid, album);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static boolean needToCache(boolean isOwnTrack) {
|
||||||
|
int autocache = Preferences.autocache();
|
||||||
|
|
||||||
|
return autocache == 2 || (autocache == 1 && isOwnTrack);
|
||||||
|
}
|
||||||
|
|
||||||
public static void scrobbleTrack(
|
public static void scrobbleTrack(
|
||||||
long duration,
|
long duration,
|
||||||
String artist,
|
String artist,
|
||||||
|
|||||||
@@ -1,38 +0,0 @@
|
|||||||
package ru.vtosters.lite.music;
|
|
||||||
|
|
||||||
import android.util.Log;
|
|
||||||
import com.vk.core.network.Network;
|
|
||||||
import okhttp3.Call;
|
|
||||||
import okhttp3.Callback;
|
|
||||||
import okhttp3.Request;
|
|
||||||
import okhttp3.Response;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
|
|
||||||
import static com.vk.core.network.Network.ClientType.CLIENT_API;
|
|
||||||
import static ru.vtosters.lite.proxy.ProxyUtils.getApi;
|
|
||||||
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
|
|
||||||
|
|
||||||
public class Metrics {
|
|
||||||
public static void trackEvents(String object) {
|
|
||||||
trackEventsRequest(object);
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void trackEventsRequest(String object) {
|
|
||||||
Request req = new Request.a()
|
|
||||||
.b("https://" + getApi() + "/method/stats.trackEvents?events=" + object + "&v=5.119&access_token=" + getUserToken())
|
|
||||||
.a();
|
|
||||||
|
|
||||||
Network.b(CLIENT_API).a(req).a(new Callback() {
|
|
||||||
@Override
|
|
||||||
public void a(Call call, IOException e) {
|
|
||||||
e.fillInStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void a(Call call, Response response) throws IOException {
|
|
||||||
Log.d("MusicMetrics", response.a().g());
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -59,12 +59,12 @@ public class MusicCacheImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean hasPlaylist() {
|
public static boolean hasPlaylist() {
|
||||||
return PlaylistCacheDbDelegate.getPlaylistsCount(AndroidUtils.getGlobalContext()) != 0; // has playlists or not
|
return !PlaylistCacheDbDelegate.isPlaylistsDbEmpty(AndroidUtils.getGlobalContext()); // has playlists or not
|
||||||
}
|
}
|
||||||
|
|
||||||
public static long getTracksCount() {
|
public static long getTracksCount() {
|
||||||
return !LibVKXClient.isIntegrationEnabled()
|
return !LibVKXClient.isIntegrationEnabled()
|
||||||
? MusicCacheDbDelegate.getTracksCount(AndroidUtils.getGlobalContext())
|
? PlaylistCacheDbDelegate.getTracksCountInPlaylist(AndroidUtils.getGlobalContext(),AccountManagerUtils.getUserId() + "_-1")
|
||||||
: LibVKXClient.getInstance().runOnServiceSync(
|
: LibVKXClient.getInstance().runOnServiceSync(
|
||||||
new LibVKXClientImpl.LibVKXActionGeneric<Long>() {
|
new LibVKXClientImpl.LibVKXActionGeneric<Long>() {
|
||||||
@Override
|
@Override
|
||||||
@@ -89,7 +89,7 @@ public class MusicCacheImpl {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isEmpty() {
|
public static boolean isEmpty() {
|
||||||
return !LibVKXClient.isIntegrationEnabled() && getTracksCount() == 0L;
|
return !LibVKXClient.isIntegrationEnabled() && MusicCacheDbDelegate.isEmpty(AndroidUtils.getGlobalContext());
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void clear() {
|
public static void clear() {
|
||||||
|
|||||||
@@ -174,6 +174,15 @@ public class MusicCacheDb extends SQLiteOpenHelper implements AutoCloseable { //
|
|||||||
return DatabaseUtils.queryNumEntries(getReadableDatabase(), Constants.TABLE_NAME);
|
return DatabaseUtils.queryNumEntries(getReadableDatabase(), Constants.TABLE_NAME);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isDatabaseEmpty() {
|
||||||
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_NAME + " LIMIT 1)", null);
|
||||||
|
cursor.moveToFirst();
|
||||||
|
boolean isEmpty = cursor.getInt(0) == 0;
|
||||||
|
cursor.close();
|
||||||
|
return isEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
public MusicTrack getTrackById(String trackId) {
|
public MusicTrack getTrackById(String trackId) {
|
||||||
SQLiteDatabase db = getReadableDatabase();
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
Cursor cursor = db.query(Constants.TABLE_NAME, null, Constants.COLUMN_TRACK_ID + " = ?", new String[]{trackId}, null, null, null);
|
Cursor cursor = db.query(Constants.TABLE_NAME, null, Constants.COLUMN_TRACK_ID + " = ?", new String[]{trackId}, null, null, null);
|
||||||
|
|||||||
@@ -53,8 +53,7 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
|
|||||||
Boolean.parseBoolean(cur.getString(cur.getColumnIndex(Constants.COLUMN_IS_EXPLICIT))),
|
Boolean.parseBoolean(cur.getString(cur.getColumnIndex(Constants.COLUMN_IS_EXPLICIT))),
|
||||||
cur.getString(cur.getColumnIndex(Constants.COLUMN_TITLE)),
|
cur.getString(cur.getColumnIndex(Constants.COLUMN_TITLE)),
|
||||||
cur.getString(cur.getColumnIndex(Constants.COLUMN_DESCRIPTION)),
|
cur.getString(cur.getColumnIndex(Constants.COLUMN_DESCRIPTION)),
|
||||||
photo,
|
photo);
|
||||||
0);
|
|
||||||
|
|
||||||
Log.d("Playlist", "generated " + Playlist.U.a(playlist).v1());
|
Log.d("Playlist", "generated " + Playlist.U.a(playlist).v1());
|
||||||
|
|
||||||
@@ -170,6 +169,50 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
|
|||||||
return playlists;
|
return playlists;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public long getTracksCountInPlaylist(String playlistId) {
|
||||||
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
|
Cursor cursor = db.query(
|
||||||
|
Constants.TABLE_PLAYLIST_TRACKS,
|
||||||
|
new String[]{Constants.COLUMN_TRACK_ID},
|
||||||
|
Constants.COLUMN_PLAYLIST_ID + " = ?",
|
||||||
|
new String[]{playlistId},
|
||||||
|
null, null, null
|
||||||
|
);
|
||||||
|
|
||||||
|
long count = cursor.getCount();
|
||||||
|
cursor.close();
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllPlaylistIds() {
|
||||||
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
|
List<String> playlistIds = new ArrayList<>();
|
||||||
|
Cursor cursor = db.query(
|
||||||
|
Constants.TABLE_NAME,
|
||||||
|
new String[]{Constants.COLUMN_ID, Constants.COLUMN_OWNER_ID},
|
||||||
|
null, null, null, null, null
|
||||||
|
);
|
||||||
|
|
||||||
|
if (cursor.moveToFirst()) {
|
||||||
|
do {
|
||||||
|
String playlistId = cursor.getString(cursor.getColumnIndexOrThrow(Constants.COLUMN_OWNER_ID)) + "_" + cursor.getString(cursor.getColumnIndexOrThrow(Constants.COLUMN_ID));
|
||||||
|
playlistIds.add(playlistId);
|
||||||
|
} while (cursor.moveToNext());
|
||||||
|
}
|
||||||
|
|
||||||
|
cursor.close();
|
||||||
|
return playlistIds;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean isPlaylistsDbEmpty() {
|
||||||
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_NAME + " LIMIT 1)", null);
|
||||||
|
cursor.moveToFirst();
|
||||||
|
boolean isEmpty = cursor.getInt(0) == 0;
|
||||||
|
cursor.close();
|
||||||
|
return isEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
public void addTrackToPlaylist(String playlistId, String trackId) {
|
public void addTrackToPlaylist(String playlistId, String trackId) {
|
||||||
ContentValues values = new ContentValues();
|
ContentValues values = new ContentValues();
|
||||||
values.put(Constants.COLUMN_PLAYLIST_ID, playlistId);
|
values.put(Constants.COLUMN_PLAYLIST_ID, playlistId);
|
||||||
@@ -181,6 +224,15 @@ public class PlaylistCacheDb extends SQLiteOpenHelper implements AutoCloseable {
|
|||||||
getWritableDatabase().delete(Constants.TABLE_PLAYLIST_TRACKS, Constants.COLUMN_PLAYLIST_ID + " = ? AND " + Constants.COLUMN_TRACK_ID + " = ?", new String[]{playlistId, trackId});
|
getWritableDatabase().delete(Constants.TABLE_PLAYLIST_TRACKS, Constants.COLUMN_PLAYLIST_ID + " = ? AND " + Constants.COLUMN_TRACK_ID + " = ?", new String[]{playlistId, trackId});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isPlaylistEmpty(String playlistId) {
|
||||||
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
|
Cursor cursor = db.rawQuery("SELECT EXISTS(SELECT 1 FROM " + Constants.TABLE_PLAYLIST_TRACKS + " WHERE " + Constants.COLUMN_PLAYLIST_ID + " = ? LIMIT 1)", new String[]{playlistId});
|
||||||
|
cursor.moveToFirst();
|
||||||
|
boolean isEmpty = cursor.getInt(0) == 0;
|
||||||
|
cursor.close();
|
||||||
|
return isEmpty;
|
||||||
|
}
|
||||||
|
|
||||||
public List<MusicTrack> getTracksInPlaylist(String playlistId) {
|
public List<MusicTrack> getTracksInPlaylist(String playlistId) {
|
||||||
SQLiteDatabase db = getReadableDatabase();
|
SQLiteDatabase db = getReadableDatabase();
|
||||||
Cursor cursor = db.query(
|
Cursor cursor = db.query(
|
||||||
|
|||||||
+6
@@ -55,6 +55,12 @@ public class MusicCacheDbDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isEmpty(Context context) {
|
||||||
|
try (var db = connectToDb(context)) {
|
||||||
|
return db.isDatabaseEmpty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isCachedTrack(Context context, String trackId) {
|
public static boolean isCachedTrack(Context context, String trackId) {
|
||||||
try (var db = connectToDb(context)) {
|
try (var db = connectToDb(context)) {
|
||||||
return db.isCachedTrack(trackId);
|
return db.isCachedTrack(trackId);
|
||||||
|
|||||||
+31
@@ -62,6 +62,31 @@ public class PlaylistCacheDbDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static long getTracksCountInPlaylist(Context context, String playlistId) {
|
||||||
|
try (var db = connectToDb(context)) {
|
||||||
|
return db.getTracksCountInPlaylist(playlistId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean isPlaylistsDbEmpty(Context context) {
|
||||||
|
try (var db = connectToDb(context)) {
|
||||||
|
return db.isPlaylistsDbEmpty();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void removeAllPlaylists(Context context) {
|
||||||
|
List<String> playlistIds = getAllPlaylistIds(context);
|
||||||
|
for (String playlistId : playlistIds) {
|
||||||
|
deletePlaylist(context, playlistId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<String> getAllPlaylistIds(Context context) {
|
||||||
|
try (var db = connectToDb(context)) {
|
||||||
|
return db.getAllPlaylistIds();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isCachedPlaylist(Context context, String id) {
|
public static boolean isCachedPlaylist(Context context, String id) {
|
||||||
try (var db = connectToDb(context)) {
|
try (var db = connectToDb(context)) {
|
||||||
String[] parts = id.split("_");
|
String[] parts = id.split("_");
|
||||||
@@ -112,6 +137,12 @@ public class PlaylistCacheDbDelegate {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isPlaylistEmpty(Context context, String playlistId) {
|
||||||
|
try (var db = connectToDb(context)) {
|
||||||
|
return db.isPlaylistEmpty(playlistId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void drop(Context context) {
|
public static void drop(Context context) {
|
||||||
context.deleteDatabase(PlaylistCacheDb.Constants.DB_NAME);
|
context.deleteDatabase(PlaylistCacheDb.Constants.DB_NAME);
|
||||||
}
|
}
|
||||||
|
|||||||
+16
-15
@@ -7,6 +7,7 @@ import org.json.JSONArray;
|
|||||||
import org.json.JSONException;
|
import org.json.JSONException;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
||||||
|
import ru.vtosters.lite.music.cache.delegate.PlaylistCacheDbDelegate;
|
||||||
import ru.vtosters.lite.utils.AccountManagerUtils;
|
import ru.vtosters.lite.utils.AccountManagerUtils;
|
||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
import ru.vtosters.lite.utils.NetworkUtils;
|
import ru.vtosters.lite.utils.NetworkUtils;
|
||||||
@@ -25,19 +26,19 @@ public class PlaylistHelper {
|
|||||||
public static JSONArray addCachedPlaylists(JSONArray jsonArray, Boolean noPlaylists) {
|
public static JSONArray addCachedPlaylists(JSONArray jsonArray, Boolean noPlaylists) {
|
||||||
try {
|
try {
|
||||||
if (noPlaylists) {
|
if (noPlaylists) {
|
||||||
jsonArray.put(new JSONArray().put(getCachedSongsPlaylist()));
|
jsonArray.put(new JSONArray());
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
if (!PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
|
||||||
jsonArray.put(getCachedSongsPlaylist());
|
jsonArray.put(getCachedSongsPlaylist());
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Playlist playlist : MusicCacheImpl.getPlaylists()) {
|
if (MusicCacheImpl.hasPlaylist()) {
|
||||||
if (noPlaylists) {
|
for (Playlist playlist : MusicCacheImpl.getPlaylists()) {
|
||||||
jsonArray.put(new JSONArray().put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist), playlist.O)));
|
jsonArray.put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist)));
|
||||||
} else {
|
|
||||||
jsonArray.put(generatePlaylist(playlist.a, playlist.b, playlist.C, playlist.g, playlist.B, PlaylistUtils.getThumb(playlist), playlist.O));
|
|
||||||
}
|
|
||||||
|
|
||||||
Log.d("PlaylistHelper", "Playlist cache added: " + playlist.a + " " + playlist.b + " " + playlist.C + " " + playlist.g + " " + playlist.B);
|
Log.d("PlaylistHelper", "Playlist cache added: " + playlist.a + " " + playlist.b + " " + playlist.C + " " + playlist.g + " " + playlist.B);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (JSONException e) {
|
} catch (JSONException e) {
|
||||||
e.fillInStackTrace();
|
e.fillInStackTrace();
|
||||||
@@ -45,7 +46,7 @@ public class PlaylistHelper {
|
|||||||
return jsonArray;
|
return jsonArray;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONObject generatePlaylist(int id, int owner_id, boolean is_explicit, String title, String description, JSONObject photo, int count) throws JSONException {
|
public static JSONObject generatePlaylist(int id, int owner_id, boolean is_explicit, String title, String description, JSONObject photo) throws JSONException {
|
||||||
JSONObject playlist = new JSONObject()
|
JSONObject playlist = new JSONObject()
|
||||||
.put("id", id)
|
.put("id", id)
|
||||||
.put("owner_id", owner_id)
|
.put("owner_id", owner_id)
|
||||||
@@ -64,7 +65,7 @@ public class PlaylistHelper {
|
|||||||
.put("subtitle", "")
|
.put("subtitle", "")
|
||||||
.put("meta", new JSONObject()
|
.put("meta", new JSONObject()
|
||||||
.put("view", "compact"))
|
.put("view", "compact"))
|
||||||
.put("count", count);
|
.put("count", 0);
|
||||||
|
|
||||||
if (photo != null) {
|
if (photo != null) {
|
||||||
playlist.put("photo", photo);
|
playlist.put("photo", photo);
|
||||||
@@ -101,18 +102,18 @@ public class PlaylistHelper {
|
|||||||
.put("height", 600))
|
.put("height", 600))
|
||||||
.put("meta", new JSONObject()
|
.put("meta", new JSONObject()
|
||||||
.put("view", "compact"))
|
.put("view", "compact"))
|
||||||
.put("count", MusicCacheImpl.getAllOwnTracks().size());
|
.put("count", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static JSONArray getCachedPlaylistsIds() {
|
public static JSONArray getCachedPlaylistsIds() {
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
|
|
||||||
if (NetworkUtils.isNetworkConnected() && !MusicCacheImpl.getAllOwnTracks().isEmpty()) {
|
if (NetworkUtils.isNetworkConnected() && !PlaylistCacheDbDelegate.isPlaylistEmpty(AndroidUtils.getGlobalContext(), AccountManagerUtils.getUserId() + "_-1")) {
|
||||||
arr.put(AccountManagerUtils.getUserId() + "_-1");
|
arr.put(AccountManagerUtils.getUserId() + "_-1");
|
||||||
}
|
}
|
||||||
|
|
||||||
for (var playlist : MusicCacheImpl.getPlaylists()) {
|
for (String playlist : PlaylistCacheDbDelegate.getAllPlaylistIds(AndroidUtils.getGlobalContext())) {
|
||||||
arr.put(playlist.v1());
|
arr.put(playlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr;
|
return arr;
|
||||||
|
|||||||
+1
-1
@@ -28,7 +28,7 @@ public class TracklistHelper {
|
|||||||
|
|
||||||
boolean doNotinvertOrder = Preferences.getBoolValue("invertCachedTracks", false);
|
boolean doNotinvertOrder = Preferences.getBoolValue("invertCachedTracks", false);
|
||||||
|
|
||||||
if (!doNotinvertOrder) {
|
if (doNotinvertOrder) {
|
||||||
Collections.reverse(tracks);
|
Collections.reverse(tracks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import com.google.android.exoplayer2.source.hls.playlist.e;
|
|||||||
import com.google.android.exoplayer2.source.hls.playlist.f;
|
import com.google.android.exoplayer2.source.hls.playlist.f;
|
||||||
import com.google.android.exoplayer2.source.hls.playlist.f.a;
|
import com.google.android.exoplayer2.source.hls.playlist.f.a;
|
||||||
import com.vk.dto.music.MusicTrack;
|
import com.vk.dto.music.MusicTrack;
|
||||||
|
import com.vk.dto.music.Playlist;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.net.URL;
|
||||||
import java.security.GeneralSecurityException;
|
import java.security.GeneralSecurityException;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -20,7 +22,6 @@ import javax.crypto.Cipher;
|
|||||||
import javax.crypto.spec.IvParameterSpec;
|
import javax.crypto.spec.IvParameterSpec;
|
||||||
import javax.crypto.spec.SecretKeySpec;
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
|
||||||
import com.vk.dto.music.Playlist;
|
|
||||||
import ru.vtosters.hooks.other.Preferences;
|
import ru.vtosters.hooks.other.Preferences;
|
||||||
import ru.vtosters.lite.music.converter.ts.MpegDemuxer;
|
import ru.vtosters.lite.music.converter.ts.MpegDemuxer;
|
||||||
import ru.vtosters.lite.music.interfaces.Callback;
|
import ru.vtosters.lite.music.interfaces.Callback;
|
||||||
@@ -37,17 +38,29 @@ public final class Mp3Downloader implements ITrackDownloader {
|
|||||||
@Override
|
@Override
|
||||||
public void download(MusicTrack track, Callback callback, Playlist playlist) {
|
public void download(MusicTrack track, Callback callback, Playlist playlist) {
|
||||||
String uri = track.D;
|
String uri = track.D;
|
||||||
|
|
||||||
if (Objects.requireNonNull(uri).isEmpty()) {
|
if (Objects.requireNonNull(uri).isEmpty()) {
|
||||||
String msg = "link error: " + track.y1() + ", title: " + Mp3Downloader.getTitle(track);
|
String msg = "link error: " + track.y1() + ", title: " + Mp3Downloader.getTitle(track);
|
||||||
Log.d("Mp3Downloader", msg);
|
Log.d("Mp3Downloader", msg);
|
||||||
throw new RuntimeException(msg);
|
throw new RuntimeException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
var tsParser = new com.google.android.exoplayer2.source.hls.playlist.h(e.a(track.D));
|
if (Objects.requireNonNull(uri).contains("master.m3u8?siren=1")) {
|
||||||
var baseUri = track.D.substring(0, track.D.lastIndexOf("/") + 1);
|
try {
|
||||||
|
String content = IOUtils.readAllLines(new URL(uri).openStream());
|
||||||
|
String replacement = content.split("\n")[2].trim();
|
||||||
|
uri = uri.replace("master.m3u8?siren=1", replacement);
|
||||||
|
} catch (IOException e) {
|
||||||
|
callback.onFailure(e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var tsParser = new com.google.android.exoplayer2.source.hls.playlist.h(e.a(uri));
|
||||||
|
var baseUri = uri.substring(0, uri.lastIndexOf("/") + 1);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var segments = ((f) tsParser.a(Uri.parse(baseUri), IOUtils.openStream(track.D))).o;
|
var segments = ((f) tsParser.a(Uri.parse(baseUri), IOUtils.openStream(uri))).o;
|
||||||
|
|
||||||
byte[] buff = getMergedTs(baseUri, segments, callback);
|
byte[] buff = getMergedTs(baseUri, segments, callback);
|
||||||
MpegDemuxer.convert(buff, outputFile.getAbsolutePath());
|
MpegDemuxer.convert(buff, outputFile.getAbsolutePath());
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import ru.vtosters.lite.utils.NavigatorUtils;
|
|||||||
|
|
||||||
public class InstallGMS {
|
public class InstallGMS {
|
||||||
public static void alert(final Activity activity) {
|
public static void alert(final Activity activity) {
|
||||||
if (!GmsHook.isAnyServicesInstalled() && Preferences.getBoolValue("showAlertGms", true)) {
|
if (!GmsHook.isAnyServicesInstalled() && !GmsHook.isGmsInstalled() && Preferences.getBoolValue("showAlertGms", true)) {
|
||||||
new VkAlertDialog.Builder(activity)
|
new VkAlertDialog.Builder(activity)
|
||||||
.setTitle(activity.getString(R.string.warning))
|
.setTitle(activity.getString(R.string.warning))
|
||||||
.setMessage(activity.getString(R.string.gmsissuesumm))
|
.setMessage(activity.getString(R.string.gmsissuesumm))
|
||||||
|
|||||||
@@ -3,9 +3,12 @@ package ru.vtosters.lite.ui.fragments;
|
|||||||
import android.annotation.SuppressLint;
|
import android.annotation.SuppressLint;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
|
import android.widget.ArrayAdapter;
|
||||||
import android.widget.EditText;
|
import android.widget.EditText;
|
||||||
import android.widget.LinearLayout;
|
import android.widget.LinearLayout;
|
||||||
|
import android.widget.TextView;
|
||||||
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
|
import bruhcollective.itaysonlab.libvkx.client.LibVKXClient;
|
||||||
import com.vk.core.dialogs.alert.VkAlertDialog;
|
import com.vk.core.dialogs.alert.VkAlertDialog;
|
||||||
import com.vk.dto.music.Playlist;
|
import com.vk.dto.music.Playlist;
|
||||||
@@ -17,13 +20,18 @@ import ru.vtosters.lite.music.LastFMScrobbler;
|
|||||||
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
import ru.vtosters.lite.music.cache.MusicCacheImpl;
|
||||||
import ru.vtosters.lite.music.cache.delegate.PlaylistCacheDbDelegate;
|
import ru.vtosters.lite.music.cache.delegate.PlaylistCacheDbDelegate;
|
||||||
import ru.vtosters.lite.ui.PreferenceFragmentUtils;
|
import ru.vtosters.lite.ui.PreferenceFragmentUtils;
|
||||||
|
import ru.vtosters.lite.utils.AccountManagerUtils;
|
||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
import ru.vtosters.lite.utils.LifecycleUtils;
|
import ru.vtosters.lite.utils.LifecycleUtils;
|
||||||
|
|
||||||
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.ExecutorService;
|
import java.util.concurrent.ExecutorService;
|
||||||
import java.util.concurrent.Executors;
|
import java.util.concurrent.Executors;
|
||||||
|
|
||||||
|
import static ru.vtosters.hooks.other.Preferences.getBoolValue;
|
||||||
|
import static ru.vtosters.hooks.other.ThemesUtils.getTextAttr;
|
||||||
|
|
||||||
public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
||||||
private static final ExecutorService executor = Executors.newCachedThreadPool();
|
private static final ExecutorService executor = Executors.newCachedThreadPool();
|
||||||
|
|
||||||
@@ -48,7 +56,7 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
if (MusicCacheImpl.isEmpty()) {
|
if (MusicCacheImpl.isEmpty()) {
|
||||||
AndroidUtils.sendToast(requireContext().getString(com.vtosters.lite.R.string.no_cache_error));
|
AndroidUtils.sendToast(requireContext().getString(com.vtosters.lite.R.string.no_cache_error));
|
||||||
} else {
|
} else {
|
||||||
delcache(requireContext());
|
delcache(requireContext(), false);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -66,6 +74,18 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PreferenceFragmentUtils.addPreference(
|
||||||
|
getPreferenceScreen(),
|
||||||
|
"cached_playlists",
|
||||||
|
"Удалить все скачанные плейлисты",
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
preference -> {
|
||||||
|
delcache(requireContext(), true);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(
|
PreferenceFragmentUtils.addPreference(
|
||||||
@@ -93,15 +113,38 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
}
|
}
|
||||||
).setEnabled(!MusicCacheImpl.isEmpty());
|
).setEnabled(!MusicCacheImpl.isEmpty());
|
||||||
|
|
||||||
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
PreferenceFragmentUtils.addPreference(
|
||||||
getPreferenceScreen(),
|
getPreferenceScreen(),
|
||||||
"autocache",
|
"autocache_params",
|
||||||
getString(com.vtosters.lite.R.string.autocache_title),
|
getString(com.vtosters.lite.R.string.autocache_title),
|
||||||
getString(com.vtosters.lite.R.string.autocache_summ),
|
getAutocacheSumm(),
|
||||||
null,
|
null,
|
||||||
false,
|
preference -> {
|
||||||
(preference, o) -> {
|
List<String> items = Arrays.asList("Не кешировать", "Только свои", "Все");
|
||||||
Preferences.getPreferences().edit().putBoolean("autocache", (boolean) o).apply();
|
|
||||||
|
ArrayAdapter<String> adapter = new ArrayAdapter<>(requireContext(), android.R.layout.simple_list_item_1, items) {
|
||||||
|
@Override
|
||||||
|
public View getView(int position, View convertView, ViewGroup parent) {
|
||||||
|
TextView textView = (TextView) super.getView(position, convertView, parent);
|
||||||
|
textView.setTextColor(getTextAttr());
|
||||||
|
return textView;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
int selectedItem = Preferences.getPreferences().getInt("autocaching", 0);
|
||||||
|
if (selectedItem >= 0 && selectedItem < items.size()) {
|
||||||
|
adapter.getItem(selectedItem);
|
||||||
|
}
|
||||||
|
|
||||||
|
new VkAlertDialog.Builder(getActivity())
|
||||||
|
.setAdapter(adapter, (dialog, which) -> {
|
||||||
|
adapter.getItem(which);
|
||||||
|
Preferences.getPreferences().edit().putInt("autocaching", which).apply();
|
||||||
|
findPreference("autocache_params").setSummary(getAutocacheSumm());
|
||||||
|
dialog.cancel();
|
||||||
|
})
|
||||||
|
.show();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -117,6 +160,7 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
false,
|
false,
|
||||||
(preference, o) -> {
|
(preference, o) -> {
|
||||||
Preferences.getPreferences().edit().putBoolean("dldir", (boolean) o).apply();
|
Preferences.getPreferences().edit().putBoolean("dldir", (boolean) o).apply();
|
||||||
|
LifecycleUtils.restartApplicationWithTimer();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -165,6 +209,7 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Preferences.setMetadataSeparator(separator.getText().toString());
|
Preferences.setMetadataSeparator(separator.getText().toString());
|
||||||
|
findPreference("metadataSeparator").setSummary(separator.getText().toString());
|
||||||
})
|
})
|
||||||
.setNegativeButton("Отмена", (dialog, which) -> dialog.cancel())
|
.setNegativeButton("Отмена", (dialog, which) -> dialog.cancel())
|
||||||
.show();
|
.show();
|
||||||
@@ -178,7 +223,7 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
getPreferenceScreen(),
|
getPreferenceScreen(),
|
||||||
"sendMusicMetrics",
|
"sendMusicMetrics",
|
||||||
"Отправлять статистику",
|
"Отправлять статистику",
|
||||||
"Статистика прослушиваний необходима для работы рекомендаций и истории прослушивания музыки\n\nЕсли вас не интересуют рекомендации - смело отключайте данную функцию",
|
"Статистика прослушиваний необходима для работы рекомендаций и истории прослушивания музыки",
|
||||||
null,
|
null,
|
||||||
true,
|
true,
|
||||||
(preference, o) -> {
|
(preference, o) -> {
|
||||||
@@ -187,6 +232,19 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
||||||
|
getPreferenceScreen(),
|
||||||
|
"playStatCatalog",
|
||||||
|
"Список истории прослушиваний",
|
||||||
|
"Показывать вкладку истории прослушиваний в музыкальном разделе\n\nОтключение ускорит открытие музыкального раздела при медленном интернете",
|
||||||
|
null,
|
||||||
|
false,
|
||||||
|
(preference, o) -> {
|
||||||
|
Preferences.getPreferences().edit().putBoolean("playStatCatalog", (boolean) o).apply();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
).setVisible(Preferences.sendMusicMetrics() && !getBoolValue("useOldAppVer", false));
|
||||||
|
|
||||||
if (!Preferences.serverFeaturesDisable()) {
|
if (!Preferences.serverFeaturesDisable()) {
|
||||||
PreferenceFragmentUtils.addPreferenceCategory(getPreferenceScreen(), "Интеграция Genius");
|
PreferenceFragmentUtils.addPreferenceCategory(getPreferenceScreen(), "Интеграция Genius");
|
||||||
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
||||||
@@ -294,6 +352,19 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
list.setVisible(!Preferences.getBoolValue("useOldAppVer", false));
|
list.setVisible(!Preferences.getBoolValue("useOldAppVer", false));
|
||||||
|
|
||||||
getPreferenceScreen().addPreference(list);
|
getPreferenceScreen().addPreference(list);
|
||||||
|
|
||||||
|
PreferenceFragmentUtils.addMaterialSwitchPreference(
|
||||||
|
getPreferenceScreen(),
|
||||||
|
"playlistsCatalogs",
|
||||||
|
"Списки плейлистов",
|
||||||
|
"Показывать вкладку плейлистов и альбомов прослушиваний в музыкальном разделе\n\nОтключение ускорит открытие музыкального раздела при медленном интернете",
|
||||||
|
null,
|
||||||
|
true,
|
||||||
|
(preference, o) -> {
|
||||||
|
Preferences.getPreferences().edit().putBoolean("playlistsCatalogs", (boolean) o).apply();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
).setVisible(!getBoolValue("useOldAppVer", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lastfmAuth(Context ctx) {
|
private void lastfmAuth(Context ctx) {
|
||||||
@@ -333,6 +404,15 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String getAutocacheSumm() {
|
||||||
|
int autocache = Preferences.autocache();
|
||||||
|
return switch (autocache) {
|
||||||
|
case 1 -> "Только для своих";
|
||||||
|
case 2 -> "Кешировать всё";
|
||||||
|
default -> "Отключено";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
public void updateLastFmPref() {
|
public void updateLastFmPref() {
|
||||||
if (LastFMScrobbler.isLoggedIn()) {
|
if (LastFMScrobbler.isLoggedIn()) {
|
||||||
findPreference("lastfm_auth").setSummary(getString(com.vtosters.lite.R.string.lastfm_authorized_as) + " " + LastFMScrobbler.getUserName());
|
findPreference("lastfm_auth").setSummary(getString(com.vtosters.lite.R.string.lastfm_authorized_as) + " " + LastFMScrobbler.getUserName());
|
||||||
@@ -354,7 +434,8 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void cachedPlaylistsDialog(Context ctx) {
|
@SuppressLint("DefaultLocale")
|
||||||
|
private void cachedPlaylistsDialog(Context ctx) {
|
||||||
List<Playlist> playlists = PlaylistCacheDbDelegate.getAllPlaylists(ctx);
|
List<Playlist> playlists = PlaylistCacheDbDelegate.getAllPlaylists(ctx);
|
||||||
String[] playlistNames = new String[playlists.size()];
|
String[] playlistNames = new String[playlists.size()];
|
||||||
|
|
||||||
@@ -369,19 +450,27 @@ public class MusicFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
String playlistId = selectedPlaylist.v1();
|
String playlistId = selectedPlaylist.v1();
|
||||||
PlaylistCacheDbDelegate.deletePlaylist(ctx, playlistId);
|
PlaylistCacheDbDelegate.deletePlaylist(ctx, playlistId);
|
||||||
AndroidUtils.sendToast("Плейлист удален");
|
AndroidUtils.sendToast("Плейлист удален");
|
||||||
|
findPreference("cached_playlists").setSummary(String.format("Скачано плейлистов: %d", MusicCacheImpl.getPlaylists().size()));
|
||||||
});
|
});
|
||||||
|
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void delcache(Context ctx) {
|
private void delcache(Context ctx, boolean isPlaylists) {
|
||||||
new VkAlertDialog.Builder(ctx)
|
new VkAlertDialog.Builder(ctx)
|
||||||
.setTitle(com.vtosters.lite.R.string.warning)
|
.setTitle(com.vtosters.lite.R.string.warning)
|
||||||
.setMessage(com.vtosters.lite.R.string.cached_tracks_remove_confirm)
|
.setMessage(com.vtosters.lite.R.string.cached_tracks_remove_confirm)
|
||||||
.setPositiveButton(com.vtosters.lite.R.string.yes,
|
.setPositiveButton(com.vtosters.lite.R.string.yes, (dialog, which) -> {
|
||||||
(dialog, which) -> executor.submit(MusicCacheImpl::clear))
|
executor.submit(() -> {
|
||||||
.setNeutralButton(com.vtosters.lite.R.string.no,
|
if (isPlaylists) {
|
||||||
(dialog, which) -> dialog.cancel())
|
PlaylistCacheDbDelegate.removeAllPlaylists(ctx);
|
||||||
|
} else {
|
||||||
|
PlaylistCacheDbDelegate.deletePlaylist(ctx, AccountManagerUtils.getUserId() + "_-1");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
findPreference("cached_tracks").setSummary(String.format(requireContext().getString(com.vtosters.lite.R.string.cached_tracks_counter), MusicCacheImpl.getTracksCount()));
|
||||||
|
})
|
||||||
|
.setNeutralButton(com.vtosters.lite.R.string.no, (dialog, which) -> dialog.cancel())
|
||||||
.show();
|
.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,12 +60,12 @@ public class OtherFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
findPreference("microgsettings").setVisible(GmsHook.isFakeGmsInstalled() && !GmsHook.isGmsInstalled());
|
findPreference("microgsettings").setVisible(GmsHook.isAnyServicesInstalled() && !GmsHook.isGmsInstalled());
|
||||||
|
|
||||||
findPreference("microgsettings").setOnPreferenceClickListener(preference -> {
|
findPreference("microgsettings").setOnPreferenceClickListener(preference -> {
|
||||||
try {
|
try {
|
||||||
Intent intent = new Intent(Intent.ACTION_MAIN);
|
Intent intent = new Intent(Intent.ACTION_MAIN);
|
||||||
intent.setComponent(new ComponentName((GmsHook.isFakeGms2Installed() ? "app.revanced.android.gms" : "com.mgoogle.android.gms"), "org.microg.gms.ui.SettingsActivity"));
|
intent.setComponent(new ComponentName(GmsHook.getCurrentGms() + ".android.gms", "org.microg.gms.ui.SettingsActivity"));
|
||||||
startActivity(intent);
|
startActivity(intent);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -81,6 +81,17 @@ public class OtherFragment extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
findPreference("unstableNameChangerDrop").setOnPreferenceClickListener(preference -> {
|
||||||
|
RenameTool.clearDatabase();
|
||||||
|
LifecycleUtils.restartApplicationWithTimer();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
findPreference("unstableNameChanger").setOnPreferenceChangeListener((preference, o) -> {
|
||||||
|
LifecycleUtils.restartApplicationWithTimer();
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
findPreference("copydebuginfo").setOnPreferenceClickListener(preference -> {
|
findPreference("copydebuginfo").setOnPreferenceClickListener(preference -> {
|
||||||
copyText(new DeviceInfoCollector().collect().forLogging());
|
copyText(new DeviceInfoCollector().collect().forLogging());
|
||||||
Toast.makeText(requireContext(), AndroidUtils.getString("device_info_copied"), Toast.LENGTH_SHORT).show();
|
Toast.makeText(requireContext(), AndroidUtils.getString("device_info_copied"), Toast.LENGTH_SHORT).show();
|
||||||
|
|||||||
@@ -227,6 +227,23 @@ public class SponsorPostFragment extends TrackedMaterialPreferenceToolbarFragmen
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (NetworkUtils.isNetworkConnected()) {
|
||||||
|
PreferenceFragmentUtils.addPreference(
|
||||||
|
getPreferenceScreen(),
|
||||||
|
"",
|
||||||
|
"Обновить списки фильтров",
|
||||||
|
null,
|
||||||
|
null,
|
||||||
|
preference -> {
|
||||||
|
this.requireActivity().runOnUiThread(() -> {
|
||||||
|
FiltersPreferences.forceUpdateFilters();
|
||||||
|
AndroidUtils.sendToast("Обновлено");
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(
|
PreferenceFragmentUtils.addPreference(
|
||||||
getPreferenceScreen(),
|
getPreferenceScreen(),
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -13,6 +13,8 @@ import ru.vtosters.lite.ui.PreferenceFragmentUtils;
|
|||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
import ru.vtosters.lite.utils.VersionReader;
|
import ru.vtosters.lite.utils.VersionReader;
|
||||||
|
|
||||||
|
import static ru.vtosters.hooks.GmsHook.isSpoofPackageInstalled;
|
||||||
|
|
||||||
public class SystemInfo extends TrackedMaterialPreferenceToolbarFragment {
|
public class SystemInfo extends TrackedMaterialPreferenceToolbarFragment {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -46,11 +48,11 @@ public class SystemInfo extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
boolean isZenUI = OEMDetector.isZenUI();
|
boolean isZenUI = OEMDetector.isZenUI();
|
||||||
boolean isEMUI = OEMDetector.isEMUI();
|
boolean isEMUI = OEMDetector.isEMUI();
|
||||||
boolean hasMiuiIncrCode = OEMDetector.hasMiuiIncrCode();
|
boolean hasMiuiIncrCode = OEMDetector.hasMiuiIncrCode();
|
||||||
|
boolean isHyperOS = OEMDetector.isHyperOs();
|
||||||
|
|
||||||
boolean hasGMS = GmsHook.isGmsInstalled();
|
boolean hasGMS = GmsHook.isGmsInstalled();
|
||||||
boolean hasVancedMicroG = GmsHook.isFakeGmsInstalled();
|
boolean hasVancedMicroG = GmsHook.isAnyServicesInstalled();
|
||||||
boolean hasReVancedMicroG = GmsHook.isFakeGms2Installed();
|
String GMSPackageName = hasGMS ? "com.google.android.gms" : hasVancedMicroG ? GmsHook.getCurrentGms() + ".android.gms" : "no gms or microg";
|
||||||
String GMSPackageName = hasGMS ? "com.google.android.gms" : hasVancedMicroG ? "com.mgoogle.android.gms" : hasReVancedMicroG ? "app.revanced.android.gms" : "no gms or microg";
|
|
||||||
|
|
||||||
boolean isValidSignature = Preferences.isValidSignature();
|
boolean isValidSignature = Preferences.isValidSignature();
|
||||||
boolean isTablet = AndroidUtils.isTablet();
|
boolean isTablet = AndroidUtils.isTablet();
|
||||||
@@ -104,9 +106,7 @@ public class SystemInfo extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isInstalledGoogleGMS", "Value: " + hasGMS, 0, null);
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isInstalledGoogleGMS", "Value: " + hasGMS, 0, null);
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isInstalledVancedMicroG", "Value: " + hasVancedMicroG, 0, null);
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isInstalledMicroG", "Value: " + hasVancedMicroG, 0, null);
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isInstalledReVancedMicroG", "Value: " + hasReVancedMicroG, 0, null);
|
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "Product Name", productName, 0, preference -> {
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "Product Name", productName, 0, preference -> {
|
||||||
((ClipboardManager) requireActivity().getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("MBH-ST", productName));
|
((ClipboardManager) requireActivity().getSystemService(Context.CLIPBOARD_SERVICE)).setPrimaryClip(ClipData.newPlainText("MBH-ST", productName));
|
||||||
@@ -194,6 +194,8 @@ public class SystemInfo extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isMiui", "Value: " + isMiui, 0, null);
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isMiui", "Value: " + isMiui, 0, null);
|
||||||
|
|
||||||
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isHyperOS", "Value: " + isHyperOS, 0, null);
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isEMUI", "Value: " + isEMUI, 0, null);
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isEMUI", "Value: " + isEMUI, 0, null);
|
||||||
|
|
||||||
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isFlyme", "Value: " + isFlyme, 0, null);
|
PreferenceFragmentUtils.addPreference(getPreferenceScreen(), "", "isFlyme", "Value: " + isFlyme, 0, null);
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ public class VTSettings extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
boolean isLinksUnverified = AndroidUtils.isLinksUnverified(requireActivity());
|
boolean isLinksUnverified = AndroidUtils.isLinksUnverified(requireActivity());
|
||||||
boolean isDozingAvailable = Build.VERSION.SDK_INT >= 23 && !manager.isIgnoringBatteryOptimizations(AndroidUtils.getPackageName());
|
boolean isDozingAvailable = Build.VERSION.SDK_INT >= 23 && !manager.isIgnoringBatteryOptimizations(AndroidUtils.getPackageName());
|
||||||
boolean areNotificationsDisabled = !AndroidUtils.areNotificationsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
boolean areNotificationsDisabled = !AndroidUtils.areNotificationsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.O;
|
||||||
boolean isGMSNotInstalled = !GmsHook.isAnyServicesInstalled();
|
boolean isGMSNotInstalled = !GmsHook.isAnyServicesInstalled() && !GmsHook.isGmsInstalled();
|
||||||
|
|
||||||
if (AccountManagerUtils.isLogin()) {
|
if (AccountManagerUtils.isLogin()) {
|
||||||
Preference accountSwitcher = PreferenceFragmentUtils.addPreference(
|
Preference accountSwitcher = PreferenceFragmentUtils.addPreference(
|
||||||
@@ -584,7 +584,7 @@ public class VTSettings extends TrackedMaterialPreferenceToolbarFragment {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
if (Build.VERSION.SDK_INT >= 33 && !OEMDetector.isMIUI()) {
|
if (Build.VERSION.SDK_INT >= 33 && (!OEMDetector.isMIUI() || OEMDetector.isHyperOs())) {
|
||||||
PreferenceFragmentUtils.addPreference(
|
PreferenceFragmentUtils.addPreference(
|
||||||
getPreferenceScreen(),
|
getPreferenceScreen(),
|
||||||
"",
|
"",
|
||||||
|
|||||||
@@ -14,10 +14,12 @@ import com.vtosters.lite.api.ExtendedCommunityProfile;
|
|||||||
import com.vtosters.lite.api.ExtendedUserProfile;
|
import com.vtosters.lite.api.ExtendedUserProfile;
|
||||||
import kotlin.Unit;
|
import kotlin.Unit;
|
||||||
import kotlin.jvm.b.Functions;
|
import kotlin.jvm.b.Functions;
|
||||||
|
import ru.vtosters.hooks.RenameHook;
|
||||||
import ru.vtosters.hooks.other.Preferences;
|
import ru.vtosters.hooks.other.Preferences;
|
||||||
import ru.vtosters.lite.foaf.FoafBase;
|
import ru.vtosters.lite.foaf.FoafBase;
|
||||||
import ru.vtosters.lite.utils.AccountManagerUtils;
|
import ru.vtosters.lite.utils.AccountManagerUtils;
|
||||||
import ru.vtosters.lite.utils.AndroidUtils;
|
import ru.vtosters.lite.utils.AndroidUtils;
|
||||||
|
import ru.vtosters.lite.utils.RenameTool;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
@@ -66,10 +68,12 @@ public class MenuBuilder {
|
|||||||
return Unit.a;
|
return Unit.a;
|
||||||
});
|
});
|
||||||
|
|
||||||
// addItem(builder, AndroidUtils.getString(R.string.menu_change_name), () -> {
|
if (RenameHook.isEnabled()) {
|
||||||
// RenameTool.createDialog(eup, ctx);
|
addItem(builder, AndroidUtils.getString(R.string.menu_change_name), () -> {
|
||||||
// return Unit.a;
|
RenameTool.createDialog(eup, ctx);
|
||||||
// });
|
return Unit.a;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
addItem(builder, AndroidUtils.getString(isPageWhitelistedFilter ? R.string.remove_from_filter_whitelist : R.string.add_to_filter_whitelist), () -> {
|
addItem(builder, AndroidUtils.getString(isPageWhitelistedFilter ? R.string.remove_from_filter_whitelist : R.string.add_to_filter_whitelist), () -> {
|
||||||
setWhitelistedFilter(eup, !isPageWhitelistedFilter);
|
setWhitelistedFilter(eup, !isPageWhitelistedFilter);
|
||||||
@@ -83,7 +87,7 @@ public class MenuBuilder {
|
|||||||
return Unit.a;
|
return Unit.a;
|
||||||
});
|
});
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
e.printStackTrace();
|
e.fillInStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -100,10 +104,12 @@ public class MenuBuilder {
|
|||||||
return Unit.a;
|
return Unit.a;
|
||||||
});
|
});
|
||||||
|
|
||||||
// addItem(builder, AndroidUtils.getString(R.string.menu_change_name), () -> {
|
if (RenameHook.isEnabled()) {
|
||||||
// RenameTool.createDialogGroup(ecp, ctx);
|
addItem(builder, AndroidUtils.getString(R.string.menu_change_name), () -> {
|
||||||
// return Unit.a;
|
RenameTool.createDialogGroup(ecp, ctx);
|
||||||
// });
|
return Unit.a;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
addItem(builder, AndroidUtils.getString(isPageWhitelistedFilter ? R.string.remove_from_filter_whitelist : R.string.add_to_filter_whitelist), () -> {
|
addItem(builder, AndroidUtils.getString(isPageWhitelistedFilter ? R.string.remove_from_filter_whitelist : R.string.add_to_filter_whitelist), () -> {
|
||||||
setWhitelistedFilter(ecp, !isPageWhitelistedFilter);
|
setWhitelistedFilter(ecp, !isPageWhitelistedFilter);
|
||||||
@@ -123,7 +129,7 @@ public class MenuBuilder {
|
|||||||
return Unit.a;
|
return Unit.a;
|
||||||
});
|
});
|
||||||
} catch (IllegalAccessException | InvocationTargetException e) {
|
} catch (IllegalAccessException | InvocationTargetException e) {
|
||||||
e.printStackTrace();
|
e.fillInStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,107 @@
|
|||||||
|
package ru.vtosters.lite.utils;
|
||||||
|
|
||||||
|
import android.content.Context;
|
||||||
|
import android.net.ConnectivityManager;
|
||||||
|
import android.net.NetworkCapabilities;
|
||||||
|
import android.net.NetworkInfo;
|
||||||
|
import android.os.Build;
|
||||||
|
import android.util.Log;
|
||||||
|
import com.vk.core.network.Network;
|
||||||
|
import okhttp3.Call;
|
||||||
|
import okhttp3.Callback;
|
||||||
|
import okhttp3.Request;
|
||||||
|
import okhttp3.Response;
|
||||||
|
import org.json.JSONArray;
|
||||||
|
import org.json.JSONObject;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import static com.vk.core.network.Network.ClientType.CLIENT_API;
|
||||||
|
import static ru.vtosters.hooks.other.Preferences.getBoolValue;
|
||||||
|
import static ru.vtosters.lite.proxy.ProxyUtils.getApi;
|
||||||
|
import static ru.vtosters.lite.utils.AccountManagerUtils.getUserToken;
|
||||||
|
|
||||||
|
public class Metrics {
|
||||||
|
private static JSONArray events = new JSONArray();
|
||||||
|
|
||||||
|
public static void trackEvents(JSONObject object, boolean isMusic) {
|
||||||
|
if (NetworkUtils.isNetworkConnected()) {
|
||||||
|
handleNetworkConnected(object, isMusic);
|
||||||
|
} else {
|
||||||
|
handleNetworkDisconnected(object, isMusic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void handleNetworkConnected(JSONObject object, boolean isMusic) {
|
||||||
|
if (isMusic || shouldSaveUserTraffic() || events.length() > 0) {
|
||||||
|
trackEventsImmediately(object);
|
||||||
|
} else {
|
||||||
|
trackEventList(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void handleNetworkDisconnected(JSONObject object, boolean isMusic) {
|
||||||
|
if (!isMusic) {
|
||||||
|
events.put(object);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static boolean shouldSaveUserTraffic() {
|
||||||
|
return getBoolValue("isRoamingState", false) || isMobileNetwork();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void trackEventList(JSONObject object) {
|
||||||
|
events.put(object);
|
||||||
|
|
||||||
|
if (events.length() > 2) {
|
||||||
|
trackEventsRequest(events);
|
||||||
|
resetEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void trackEventsImmediately(JSONObject object) {
|
||||||
|
JSONArray eventsToTrack = new JSONArray();
|
||||||
|
eventsToTrack.put(object);
|
||||||
|
trackEventsRequest(eventsToTrack);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void resetEvents() {
|
||||||
|
events = new JSONArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
|
private static boolean isMobileNetwork() {
|
||||||
|
ConnectivityManager connectivityManager = (ConnectivityManager) AndroidUtils.getGlobalContext().getSystemService(Context.CONNECTIVITY_SERVICE);
|
||||||
|
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
|
android.net.Network network = connectivityManager.getActiveNetwork();
|
||||||
|
if (network != null) {
|
||||||
|
NetworkCapabilities networkCapabilities = connectivityManager.getNetworkCapabilities(network);
|
||||||
|
return networkCapabilities != null && networkCapabilities.hasTransport(NetworkCapabilities.TRANSPORT_CELLULAR);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
NetworkInfo networkInfo = connectivityManager.getNetworkInfo(ConnectivityManager.TYPE_MOBILE);
|
||||||
|
return networkInfo != null && networkInfo.isConnected();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void trackEventsRequest(JSONArray object) {
|
||||||
|
Request req = new Request.a()
|
||||||
|
.b("https://" + getApi() + "/method/stats.trackEvents?events=" + object.toString() + "&v=5.119&access_token=" + getUserToken())
|
||||||
|
.a();
|
||||||
|
|
||||||
|
Network.b(CLIENT_API).a(req).a(new Callback() {
|
||||||
|
@Override
|
||||||
|
public void a(Call call, IOException e) {
|
||||||
|
e.fillInStackTrace();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void a(Call call, Response response) throws IOException {
|
||||||
|
Log.d("Metrics", response.a().g());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package ru.vtosters.lite.utils;
|
package ru.vtosters.lite.utils;
|
||||||
|
|
||||||
|
import android.content.ContentValues;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.database.Cursor;
|
import android.database.Cursor;
|
||||||
@@ -12,15 +13,15 @@ import android.widget.LinearLayout;
|
|||||||
import androidx.core.util.Pair;
|
import androidx.core.util.Pair;
|
||||||
import com.vk.core.dialogs.alert.VkAlertDialog;
|
import com.vk.core.dialogs.alert.VkAlertDialog;
|
||||||
import com.vk.dto.user.UserProfile;
|
import com.vk.dto.user.UserProfile;
|
||||||
import com.vk.im.engine.models.users.User;
|
|
||||||
import com.vtosters.lite.R;
|
import com.vtosters.lite.R;
|
||||||
import com.vtosters.lite.api.ExtendedCommunityProfile;
|
import com.vtosters.lite.api.ExtendedCommunityProfile;
|
||||||
import com.vtosters.lite.api.ExtendedUserProfile;
|
import com.vtosters.lite.api.ExtendedUserProfile;
|
||||||
import ru.vtosters.hooks.other.ThemesUtils;
|
import ru.vtosters.hooks.other.ThemesUtils;
|
||||||
|
|
||||||
import java.lang.reflect.Field;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
|
import java.util.function.BiConsumer;
|
||||||
|
|
||||||
import static ru.vtosters.hooks.other.ThemesUtils.getSTextAttr;
|
import static ru.vtosters.hooks.other.ThemesUtils.getSTextAttr;
|
||||||
import static ru.vtosters.hooks.other.ThemesUtils.getTextAttr;
|
import static ru.vtosters.hooks.other.ThemesUtils.getTextAttr;
|
||||||
@@ -47,69 +48,40 @@ public class RenameTool {
|
|||||||
return helperInstance;
|
return helperInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getCurrentModifiedUser() {
|
|
||||||
Cursor rawQuery = getHelper().getReadableDatabase().rawQuery(String.format("SELECT * FROM %s WHERE %s=%s", TABLE_NAME, COLUMN_VKID, AccountManagerUtils.getUserId()), new String[0]);
|
|
||||||
if (rawQuery.moveToFirst()) {
|
|
||||||
try {
|
|
||||||
String decode = URLDecoder.decode(rawQuery.getString(rawQuery.getColumnIndexOrThrow(COLUMN_FIRSTNAME)), "UTF-8");
|
|
||||||
return decode + " " + URLDecoder.decode(rawQuery.getString(rawQuery.getColumnIndexOrThrow(COLUMN_LASTNAME)), "UTF-8");
|
|
||||||
} catch (java.io.UnsupportedEncodingException | java.lang.IllegalArgumentException e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
} finally {
|
|
||||||
rawQuery.close();
|
|
||||||
}
|
|
||||||
} else rawQuery.close();
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Reload all values from DB
|
|
||||||
public static void reloadDB() {
|
public static void reloadDB() {
|
||||||
renamedGroups.clear();
|
renamedGroups.clear();
|
||||||
renamedUsers.clear();
|
renamedUsers.clear();
|
||||||
updateRequested = false;
|
updateRequested = false;
|
||||||
|
|
||||||
try (Cursor cursor = getHelper().getReadableDatabase().rawQuery(String.format("SELECT * FROM %s", TABLE_NAME), new String[0])) {
|
loadData(TABLE_NAME, (cursor, vkID) -> {
|
||||||
while (cursor.moveToNext()) {
|
String firstName = decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_FIRSTNAME)));
|
||||||
String firstName = URLDecoder.decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_FIRSTNAME)), "UTF-8");
|
String lastName = decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_LASTNAME)));
|
||||||
String lastName = URLDecoder.decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_LASTNAME)), "UTF-8");
|
renamedUsers.put(vkID, new Pair<>(firstName, lastName));
|
||||||
int vkID = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_VKID));
|
});
|
||||||
renamedUsers.put(vkID, new Pair<>(firstName, lastName));
|
|
||||||
}
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
|
|
||||||
try (Cursor cursor = getHelper().getReadableDatabase().rawQuery(String.format("SELECT * FROM %s", TABLE_NAME_GROUP), new String[0])) {
|
loadData(TABLE_NAME_GROUP, (cursor, vkID) -> {
|
||||||
|
String name = decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_NAME)));
|
||||||
|
renamedGroups.put(vkID, name);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// Generic method to load data from the database
|
||||||
|
private static void loadData(String tableName, BiConsumer<Cursor, Integer> consumer) {
|
||||||
|
try (Cursor cursor = getHelper().getReadableDatabase().rawQuery("SELECT * FROM " + tableName, null)) {
|
||||||
while (cursor.moveToNext()) {
|
while (cursor.moveToNext()) {
|
||||||
String name = URLDecoder.decode(cursor.getString(cursor.getColumnIndexOrThrow(COLUMN_NAME)), "UTF-8");
|
|
||||||
int vkID = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_VKID));
|
int vkID = cursor.getInt(cursor.getColumnIndexOrThrow(COLUMN_VKID));
|
||||||
renamedGroups.put(vkID, name);
|
consumer.accept(cursor, vkID);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
throw new RuntimeException("Failed to load data from " + tableName, e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void injectIntoChat(User u) {
|
private static String decode(String value) {
|
||||||
int id = u.getId();
|
|
||||||
if (updateRequested) {
|
|
||||||
reloadDB();
|
|
||||||
}
|
|
||||||
|
|
||||||
Pair<String, String> user = renamedUsers.get(id);
|
|
||||||
if (user == null) return;
|
|
||||||
|
|
||||||
setObject(u, "I", user.first);
|
|
||||||
setObject(u, "J", user.second);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void setObject(User instance, String name, Object obj) {
|
|
||||||
try {
|
try {
|
||||||
Field f = User.class.getDeclaredField(name);
|
return URLDecoder.decode(value, "UTF-8");
|
||||||
f.setAccessible(true);
|
} catch (UnsupportedEncodingException e) {
|
||||||
f.set(instance, obj);
|
throw new RuntimeException("UTF-8 encoding not supported", e);
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -117,7 +89,7 @@ public class RenameTool {
|
|||||||
LinearLayout linearLayout = new LinearLayout(ctx);
|
LinearLayout linearLayout = new LinearLayout(ctx);
|
||||||
linearLayout.setOrientation(LinearLayout.VERTICAL);
|
linearLayout.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
|
||||||
final EditText fn = new EditText(ctx);
|
EditText fn = new EditText(ctx);
|
||||||
fn.setHint(R.string.vk_auth_sign_up_first_name);
|
fn.setHint(R.string.vk_auth_sign_up_first_name);
|
||||||
fn.setTextColor(getTextAttr());
|
fn.setTextColor(getTextAttr());
|
||||||
fn.setHintTextColor(getSTextAttr());
|
fn.setHintTextColor(getSTextAttr());
|
||||||
@@ -128,7 +100,7 @@ public class RenameTool {
|
|||||||
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
|
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
|
||||||
fn.setLayoutParams(margin);
|
fn.setLayoutParams(margin);
|
||||||
|
|
||||||
final EditText ln = new EditText(ctx);
|
EditText ln = new EditText(ctx);
|
||||||
ln.setHint(R.string.vk_auth_sign_up_last_name);
|
ln.setHint(R.string.vk_auth_sign_up_last_name);
|
||||||
ln.setTextColor(getTextAttr());
|
ln.setTextColor(getTextAttr());
|
||||||
ln.setHintTextColor(getSTextAttr());
|
ln.setHintTextColor(getSTextAttr());
|
||||||
@@ -137,69 +109,93 @@ public class RenameTool {
|
|||||||
ln.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
|
ln.getLayoutParams().width = ViewGroup.LayoutParams.MATCH_PARENT;
|
||||||
ln.setLayoutParams(margin);
|
ln.setLayoutParams(margin);
|
||||||
|
|
||||||
final UserProfile profile = AccountManagerUtils.fromEup(eup);
|
UserProfile profile = AccountManagerUtils.fromEup(eup);
|
||||||
fn.setText(AccountManagerUtils.getUserFirstName(profile));
|
fn.setText(AccountManagerUtils.getUserFirstName(profile));
|
||||||
ln.setText(AccountManagerUtils.getUserLastName(profile));
|
ln.setText(AccountManagerUtils.getUserLastName(profile));
|
||||||
|
|
||||||
int id = AccountManagerUtils.getUserID(profile);
|
int id = AccountManagerUtils.getUserID(profile);
|
||||||
|
|
||||||
var builder = new VkAlertDialog.Builder(ctx)
|
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(ctx)
|
||||||
.setTitle(R.string.rename_title)
|
.setTitle(R.string.rename_title)
|
||||||
.setMessage(R.string.rename_message)
|
.setMessage(R.string.rename_message)
|
||||||
.setView(linearLayout)
|
.setView(linearLayout)
|
||||||
.setPositiveButton("OK", (dialog, which) -> {
|
.setPositiveButton("OK", (dialog, which) -> updateName(ctx, fn.getText().toString(), ln.getText().toString(), id));
|
||||||
String firstName = fn.getText().toString();
|
|
||||||
String lastName = ln.getText().toString();
|
if (isChangedName(id)) {
|
||||||
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
builder.setNeutralButton(R.string.rename_reset, (dialog, which) -> deleteUser(ctx, id));
|
||||||
try {
|
}
|
||||||
if (isChangedName(id)) {
|
|
||||||
writableDatabase.execSQL(
|
|
||||||
String.format("UPDATE %s SET %s='%s', %s='%s' WHERE %s='%s'",
|
|
||||||
TABLE_NAME,
|
|
||||||
COLUMN_FIRSTNAME, URLEncoder.encode(firstName, "UTF-8"),
|
|
||||||
COLUMN_LASTNAME, URLEncoder.encode(lastName, "UTF-8"),
|
|
||||||
COLUMN_VKID, id));
|
|
||||||
} else {
|
|
||||||
writableDatabase.execSQL(
|
|
||||||
String.format("INSERT INTO %s (%s, %s, %s) VALUES (%s, '%s', '%s')",
|
|
||||||
TABLE_NAME,
|
|
||||||
COLUMN_VKID, COLUMN_FIRSTNAME, COLUMN_LASTNAME,
|
|
||||||
id, URLEncoder.encode(firstName, "UTF-8"), URLEncoder.encode(lastName, "UTF-8")));
|
|
||||||
}
|
|
||||||
updateRequested = true;
|
|
||||||
if (id == AccountManagerUtils.getUserId()) {
|
|
||||||
ctx.sendBroadcast(new Intent("com.vkontakte.android.USER_NAME_CHANGED"));
|
|
||||||
}
|
|
||||||
ctx.sendBroadcast(new Intent("com.vkontakte.android.ACTION_PROFILE_UPDATED").putExtra("uid", id));
|
|
||||||
|
|
||||||
sendToast(ctx.getString(R.string.rename_success));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
sendToast(ctx.getString(R.string.rename_error));
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (isChangedName(id))
|
|
||||||
builder.setNeutralButton(R.string.rename_reset, (dialog, which) -> {
|
|
||||||
getHelper().getWritableDatabase().execSQL(
|
|
||||||
String.format(
|
|
||||||
"DELETE FROM %s WHERE %s='%s'",
|
|
||||||
TABLE_NAME,
|
|
||||||
COLUMN_VKID, id));
|
|
||||||
if (id == AccountManagerUtils.getUserId()) {
|
|
||||||
ctx.sendBroadcast(new Intent("com.vkontakte.android.USER_NAME_CHANGED"));
|
|
||||||
}
|
|
||||||
updateRequested = true;
|
|
||||||
ctx.sendBroadcast(new Intent("com.vkontakte.android.ACTION_PROFILE_UPDATED").putExtra("uid", id));
|
|
||||||
sendToast(ctx.getString(R.string.rename_remove_from_bd_success));
|
|
||||||
});
|
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void deleteUser(Context ctx, int id) {
|
||||||
|
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
||||||
|
|
||||||
|
writableDatabase.delete(TABLE_NAME, COLUMN_VKID + "=?", new String[]{String.valueOf(id)});
|
||||||
|
|
||||||
|
updateRequested = true;
|
||||||
|
notifyUser(ctx, id);
|
||||||
|
|
||||||
|
sendToast(ctx.getString(R.string.rename_remove_from_bd_success));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void clearDatabase() {
|
||||||
|
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
||||||
|
|
||||||
|
writableDatabase.delete(TABLE_NAME, null, null);
|
||||||
|
writableDatabase.delete(TABLE_NAME_GROUP, null, null);
|
||||||
|
|
||||||
|
renamedGroups.clear();
|
||||||
|
renamedUsers.clear();
|
||||||
|
updateRequested = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateName(Context ctx, String firstName, String lastName, int id) {
|
||||||
|
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
||||||
|
|
||||||
|
try {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(COLUMN_FIRSTNAME, encode(firstName));
|
||||||
|
values.put(COLUMN_LASTNAME, encode(lastName));
|
||||||
|
|
||||||
|
if (isChangedName(id)) {
|
||||||
|
// Update existing record
|
||||||
|
writableDatabase.update(TABLE_NAME, values, COLUMN_VKID + "=?", new String[]{String.valueOf(id)});
|
||||||
|
} else {
|
||||||
|
// Insert new record
|
||||||
|
values.put(COLUMN_VKID, id);
|
||||||
|
writableDatabase.insert(TABLE_NAME, null, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateRequested = true;
|
||||||
|
notifyUser(ctx, id);
|
||||||
|
|
||||||
|
sendToast(ctx.getString(R.string.rename_success));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Database operation failed", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String encode(String value) {
|
||||||
|
try {
|
||||||
|
return URLEncoder.encode(value, "UTF-8");
|
||||||
|
} catch (UnsupportedEncodingException e) {
|
||||||
|
throw new RuntimeException("UTF-8 encoding not supported", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void notifyUser(Context ctx, int id) {
|
||||||
|
if (id == AccountManagerUtils.getUserId()) {
|
||||||
|
ctx.sendBroadcast(new Intent("com.vkontakte.android.USER_NAME_CHANGED"));
|
||||||
|
}
|
||||||
|
ctx.sendBroadcast(new Intent("com.vkontakte.android.ACTION_PROFILE_UPDATED").putExtra("uid", id));
|
||||||
|
}
|
||||||
|
|
||||||
public static void createDialogGroup(ExtendedCommunityProfile eup, final Context ctx) {
|
public static void createDialogGroup(ExtendedCommunityProfile eup, final Context ctx) {
|
||||||
LinearLayout linearLayout = new LinearLayout(ctx);
|
LinearLayout linearLayout = new LinearLayout(ctx);
|
||||||
linearLayout.setOrientation(LinearLayout.VERTICAL);
|
linearLayout.setOrientation(LinearLayout.VERTICAL);
|
||||||
|
|
||||||
final EditText fn = new EditText(ctx);
|
EditText fn = new EditText(ctx);
|
||||||
fn.setHint(R.string.vk_auth_sign_up_first_name);
|
fn.setHint(R.string.vk_auth_sign_up_first_name);
|
||||||
fn.setHintTextColor(getSTextAttr());
|
fn.setHintTextColor(getSTextAttr());
|
||||||
fn.setTextColor(getTextAttr());
|
fn.setTextColor(getTextAttr());
|
||||||
@@ -210,52 +206,61 @@ public class RenameTool {
|
|||||||
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
|
margin.setMargins(dp2px(20f), 0, dp2px(20f), 0);
|
||||||
fn.setLayoutParams(margin);
|
fn.setLayoutParams(margin);
|
||||||
|
|
||||||
final UserProfile profile = AccountManagerUtils.fromEup(eup);
|
UserProfile profile = AccountManagerUtils.fromEup(eup);
|
||||||
fn.setText(AccountManagerUtils.getGroupName(profile));
|
fn.setText(AccountManagerUtils.getGroupName(profile));
|
||||||
|
|
||||||
int fid = AccountManagerUtils.getUserID(profile);
|
int fid = AccountManagerUtils.getUserID(profile);
|
||||||
|
|
||||||
if (fid < 0) fid = -fid;
|
if (fid < 0) fid = -fid;
|
||||||
|
|
||||||
final int id = fid;
|
int id = fid;
|
||||||
|
|
||||||
var builder = new VkAlertDialog.Builder(ctx)
|
VkAlertDialog.Builder builder = new VkAlertDialog.Builder(ctx)
|
||||||
.setTitle(R.string.rename_title)
|
.setTitle(R.string.rename_title)
|
||||||
.setMessage(R.string.rename_message)
|
.setMessage(R.string.rename_message)
|
||||||
.setView(linearLayout)
|
.setView(linearLayout)
|
||||||
.setPositiveButton("OK", (dialog, which) -> {
|
.setPositiveButton("OK", (dialog, which) -> updateGroupName(ctx, fn.getText().toString(), id));
|
||||||
String firstName = fn.getText().toString();
|
|
||||||
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
if (isChangedNameGroup(id)) {
|
||||||
try {
|
builder.setNeutralButton(R.string.rename_reset, (dialog, which) -> deleteGroupName(ctx, id));
|
||||||
if (isChangedNameGroup(id)) {
|
}
|
||||||
writableDatabase.execSQL(
|
|
||||||
String.format(
|
|
||||||
"UPDATE %s SET %s='%s' WHERE %s='%s'",
|
|
||||||
TABLE_NAME_GROUP,
|
|
||||||
COLUMN_NAME, URLEncoder.encode(firstName, "UTF-8"),
|
|
||||||
COLUMN_VKID, id));
|
|
||||||
} else {
|
|
||||||
writableDatabase.execSQL(
|
|
||||||
String.format(
|
|
||||||
"INSERT INTO %s (%s, %s) VALUES (%s, '%s')",
|
|
||||||
TABLE_NAME_GROUP,
|
|
||||||
COLUMN_VKID, COLUMN_NAME,
|
|
||||||
id, URLEncoder.encode(firstName, "UTF-8")));
|
|
||||||
}
|
|
||||||
updateRequested = true;
|
|
||||||
sendToast(AndroidUtils.getString(R.string.rename_group_success));
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if (isChangedNameGroup(id))
|
|
||||||
builder.setNeutralButton(R.string.rename_reset, (dialog, which) -> {
|
|
||||||
getHelper().getWritableDatabase().execSQL(String.format("DELETE FROM %s WHERE %s='%s'", TABLE_NAME_GROUP, COLUMN_VKID, id));
|
|
||||||
updateRequested = true;
|
|
||||||
sendToast(ctx.getString(R.string.rename_remove_group_from_bd_success));
|
|
||||||
});
|
|
||||||
builder.show();
|
builder.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void deleteGroupName(Context ctx, int id) {
|
||||||
|
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
||||||
|
|
||||||
|
writableDatabase.delete(TABLE_NAME_GROUP, COLUMN_VKID + "=?", new String[]{String.valueOf(id)});
|
||||||
|
|
||||||
|
updateRequested = true;
|
||||||
|
|
||||||
|
sendToast(ctx.getString(R.string.rename_remove_group_from_bd_success));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void updateGroupName(Context ctx, String groupName, int id) {
|
||||||
|
SQLiteDatabase writableDatabase = getHelper().getWritableDatabase();
|
||||||
|
|
||||||
|
try {
|
||||||
|
ContentValues values = new ContentValues();
|
||||||
|
values.put(COLUMN_NAME, encode(groupName));
|
||||||
|
|
||||||
|
if (isChangedNameGroup(id)) {
|
||||||
|
// Update existing record
|
||||||
|
writableDatabase.update(TABLE_NAME_GROUP, values, COLUMN_VKID + "=?", new String[]{String.valueOf(id)});
|
||||||
|
} else {
|
||||||
|
// Insert new record
|
||||||
|
values.put(COLUMN_VKID, id);
|
||||||
|
writableDatabase.insert(TABLE_NAME_GROUP, null, values);
|
||||||
|
}
|
||||||
|
|
||||||
|
updateRequested = true;
|
||||||
|
sendToast(AndroidUtils.getString(R.string.rename_group_success));
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new RuntimeException("Database operation failed", e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean isChangedName(int uid) {
|
public static boolean isChangedName(int uid) {
|
||||||
return renamedUsers.get(uid) != null;
|
return renamedUsers.get(uid) != null;
|
||||||
}
|
}
|
||||||
@@ -264,10 +269,6 @@ public class RenameTool {
|
|||||||
return renamedGroups.get(uid) != null;
|
return renamedGroups.get(uid) != null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean isIdInList(UserProfile profile) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static class DbHelper extends SQLiteOpenHelper {
|
private static class DbHelper extends SQLiteOpenHelper {
|
||||||
public DbHelper(Context context) {
|
public DbHelper(Context context) {
|
||||||
super(context, DB_NAME, null, DB_VERSION);
|
super(context, DB_NAME, null, DB_VERSION);
|
||||||
|
|||||||
@@ -61,6 +61,18 @@ public class FiltersPreferences {
|
|||||||
editor.apply();
|
editor.apply();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void forceUpdateFilters() {
|
||||||
|
SharedPreferences.Editor editor = preferences.edit();
|
||||||
|
|
||||||
|
preferences.getAll().keySet().stream()
|
||||||
|
.filter(key -> key.endsWith(":" + PREF_KEY_VERSION))
|
||||||
|
.forEach(key -> editor.putString(key, "0"));
|
||||||
|
|
||||||
|
editor.apply();
|
||||||
|
|
||||||
|
Updates.updateFilters();
|
||||||
|
}
|
||||||
|
|
||||||
public static boolean getSavedKeyValue(int id) {
|
public static boolean getSavedKeyValue(int id) {
|
||||||
return getFilter(id) != null;
|
return getFilter(id) != null;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package ru.vtosters.sponsorpost.utils;
|
package ru.vtosters.sponsorpost.utils;
|
||||||
|
|
||||||
|
import android.util.Log;
|
||||||
import ru.vtosters.lite.utils.NetworkUtils;
|
import ru.vtosters.lite.utils.NetworkUtils;
|
||||||
import ru.vtosters.lite.utils.newsfeed.NewsFeedFiltersUtils;
|
import ru.vtosters.lite.utils.newsfeed.NewsFeedFiltersUtils;
|
||||||
import ru.vtosters.sponsorpost.data.Filter;
|
import ru.vtosters.sponsorpost.data.Filter;
|
||||||
@@ -31,14 +32,17 @@ public class Updates {
|
|||||||
for (Filter filter : filters) {
|
for (Filter filter : filters) {
|
||||||
Filter localFilter = findLocalFilterById(localFilters, filter.getId());
|
Filter localFilter = findLocalFilterById(localFilters, filter.getId());
|
||||||
if (localFilter == null) {
|
if (localFilter == null) {
|
||||||
|
Log.d("Updates", "local filter is not exist, adding new: " + filter.getId());
|
||||||
FiltersPreferences.saveFilter(filter);
|
FiltersPreferences.saveFilter(filter);
|
||||||
} else {
|
} else {
|
||||||
String remoteVersion = filter.getVersion();
|
String remoteVersion = filter.getVersion();
|
||||||
String localVersion = localFilter.getVersion();
|
String localVersion = localFilter.getVersion();
|
||||||
if (Objects.equals(remoteVersion, localVersion)) {
|
if (Objects.equals(remoteVersion, localVersion)) {
|
||||||
FiltersPreferences.saveFilter(filter);
|
Log.d("Updates", "saved local filter: " + localFilter.getId());
|
||||||
} else {
|
|
||||||
FiltersPreferences.saveFilter(localFilter);
|
FiltersPreferences.saveFilter(localFilter);
|
||||||
|
} else {
|
||||||
|
Log.d("Updates", "saved remote filter: " + filter.getId());
|
||||||
|
FiltersPreferences.saveFilter(filter);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6437,7 +6437,7 @@
|
|||||||
<string name="update_latest">У вас установлена последняя версия приложения</string>
|
<string name="update_latest">У вас установлена последняя версия приложения</string>
|
||||||
<string name="update_err">Ошибка проверки обновления</string>
|
<string name="update_err">Ошибка проверки обновления</string>
|
||||||
<string name="serverFeaturesDisable">Отключить все внешние подключения</string>
|
<string name="serverFeaturesDisable">Отключить все внешние подключения</string>
|
||||||
<string name="serverFeaturesDisable_summ">Отключает галочки и все дополнительные функции связанные с получением данных с сервера ВТостерс.\n\nАктульно для тех у кого безлимитный интернет на ВКонтакте</string>
|
<string name="serverFeaturesDisable_summ">Отключает галочки и все дополнительные функции связанные с получением данных с сервера ВТостерс.\n\nАктуально для тех у кого безлимитный интернет на ВКонтакте</string>
|
||||||
|
|
||||||
<string name="tgs_token_missing">Токен отсутствует</string>
|
<string name="tgs_token_missing">Токен отсутствует</string>
|
||||||
<string name="tgs_token_reset_dialog">Сбросить токен бота?</string>
|
<string name="tgs_token_reset_dialog">Сбросить токен бота?</string>
|
||||||
|
|||||||
@@ -31,6 +31,11 @@
|
|||||||
android:key="__dbg_disable_video_feed"
|
android:key="__dbg_disable_video_feed"
|
||||||
android:summary="@string/interfacevideorecsum"
|
android:summary="@string/interfacevideorecsum"
|
||||||
android:title="@string/interfacevideorec"/>
|
android:title="@string/interfacevideorec"/>
|
||||||
|
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="sendVideoMetrics"
|
||||||
|
android:summary="Статистика необходима для работы рекомендаций и истории видео"
|
||||||
|
android:title="Отправлять статистику"/>
|
||||||
<Preference
|
<Preference
|
||||||
android:key="clearvideohistory"
|
android:key="clearvideohistory"
|
||||||
android:summary="@string/clearvideohistory_summ"
|
android:summary="@string/clearvideohistory_summ"
|
||||||
|
|||||||
@@ -8,11 +8,21 @@
|
|||||||
<Preference
|
<Preference
|
||||||
android:key="microgsettings"
|
android:key="microgsettings"
|
||||||
android:title="@string/microgsett"/>
|
android:title="@string/microgsett"/>
|
||||||
|
</PreferenceCategory>
|
||||||
|
<PreferenceCategory android:title="Экспериментальные функции">
|
||||||
<com.vtosters.lite.ui.MaterialSwitchPreference
|
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||||
android:defaultValue="false"
|
android:defaultValue="false"
|
||||||
android:key="batchmessages"
|
android:key="batchmessages"
|
||||||
android:summary="Поможет исправить скорость загрузки сообщений, но работает нестабильно"
|
android:summary="Поможет исправить скорость загрузки сообщений, но работает нестабильно"
|
||||||
android:title="Альтернативная загрузка сообщений"/>
|
android:title="Альтернативная загрузка сообщений"/>
|
||||||
|
<com.vtosters.lite.ui.MaterialSwitchPreference
|
||||||
|
android:defaultValue="true"
|
||||||
|
android:key="unstableNameChanger"
|
||||||
|
android:title="Редактор имен"
|
||||||
|
android:summary="Редактор имен групп и профилей людей\n\nПри проблемах с работой сообщений лучше отключить данную функцию"/>
|
||||||
|
<Preference
|
||||||
|
android:key="unstableNameChangerDrop"
|
||||||
|
android:title="Сбросить информацию о переименованиях"/>
|
||||||
</PreferenceCategory>
|
</PreferenceCategory>
|
||||||
<PreferenceCategory android:title="@string/vtverify">
|
<PreferenceCategory android:title="@string/vtverify">
|
||||||
<Preference
|
<Preference
|
||||||
|
|||||||
@@ -390,6 +390,8 @@
|
|||||||
.method public static final b(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
.method public static final b(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
||||||
.locals 1
|
.locals 1
|
||||||
|
|
||||||
|
invoke-static {p0}, Lru/vtosters/hooks/RenameHook;->injectIntoJsonGroup(Lorg/json/JSONObject;)V
|
||||||
|
|
||||||
sget-object v0, Lcom/vk/dto/newsfeed/Owner;->h:Lcom/vk/dto/newsfeed/Owner$b;
|
sget-object v0, Lcom/vk/dto/newsfeed/Owner;->h:Lcom/vk/dto/newsfeed/Owner$b;
|
||||||
|
|
||||||
invoke-virtual {v0, p0}, Lcom/vk/dto/newsfeed/Owner$b;->b(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
invoke-virtual {v0, p0}, Lcom/vk/dto/newsfeed/Owner$b;->b(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
||||||
@@ -402,6 +404,8 @@
|
|||||||
.method public static final c(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
.method public static final c(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
||||||
.locals 1
|
.locals 1
|
||||||
|
|
||||||
|
invoke-static {p0}, Lru/vtosters/hooks/RenameHook;->injectIntoJson(Lorg/json/JSONObject;)V
|
||||||
|
|
||||||
sget-object v0, Lcom/vk/dto/newsfeed/Owner;->h:Lcom/vk/dto/newsfeed/Owner$b;
|
sget-object v0, Lcom/vk/dto/newsfeed/Owner;->h:Lcom/vk/dto/newsfeed/Owner$b;
|
||||||
|
|
||||||
invoke-virtual {v0, p0}, Lcom/vk/dto/newsfeed/Owner$b;->c(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
invoke-virtual {v0, p0}, Lcom/vk/dto/newsfeed/Owner$b;->c(Lorg/json/JSONObject;)Lcom/vk/dto/newsfeed/Owner;
|
||||||
|
|||||||
@@ -1,118 +0,0 @@
|
|||||||
.class public final enum Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
.super Ljava/lang/Enum;
|
|
||||||
.source "VideoTracker.java"
|
|
||||||
|
|
||||||
|
|
||||||
# annotations
|
|
||||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
||||||
value = Lcom/vk/libvideo/VideoTracker;
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/InnerClass;
|
|
||||||
accessFlags = 0x4019
|
|
||||||
name = "FullscreenTransition"
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"Ljava/lang/Enum<",
|
|
||||||
"Lcom/vk/libvideo/VideoTracker$FullscreenTransition;",
|
|
||||||
">;"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
|
|
||||||
# static fields
|
|
||||||
.field private static final synthetic $VALUES:[Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
.field public static final enum SCREEN_ROTATION:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
.field public static final enum TAP:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
|
|
||||||
# direct methods
|
|
||||||
.method static constructor <clinit>()V
|
|
||||||
.locals 4
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
const/4 v1, 0x0
|
|
||||||
|
|
||||||
const-string v2, "TAP"
|
|
||||||
|
|
||||||
invoke-direct {v0, v2, v1}, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->TAP:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
const/4 v2, 0x1
|
|
||||||
|
|
||||||
const-string v3, "SCREEN_ROTATION"
|
|
||||||
|
|
||||||
invoke-direct {v0, v3, v2}, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->SCREEN_ROTATION:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
const/4 v0, 0x2
|
|
||||||
|
|
||||||
new-array v0, v0, [Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
.line 2
|
|
||||||
sget-object v3, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->TAP:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
aput-object v3, v0, v1
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->SCREEN_ROTATION:Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
aput-object v1, v0, v2
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->$VALUES:[Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method private constructor <init>(Ljava/lang/String;I)V
|
|
||||||
.locals 0
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"()V"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
const-class v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
||||||
|
|
||||||
move-result-object p0
|
|
||||||
|
|
||||||
check-cast p0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
return-object p0
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static values()[Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
sget-object v0, Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->$VALUES:[Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
invoke-virtual {v0}, [Lcom/vk/libvideo/VideoTracker$FullscreenTransition;->clone()Ljava/lang/Object;
|
|
||||||
|
|
||||||
move-result-object v0
|
|
||||||
|
|
||||||
check-cast v0, [Lcom/vk/libvideo/VideoTracker$FullscreenTransition;
|
|
||||||
|
|
||||||
return-object v0
|
|
||||||
.end method
|
|
||||||
@@ -1,134 +0,0 @@
|
|||||||
.class public final enum Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
.super Ljava/lang/Enum;
|
|
||||||
.source "VideoTracker.java"
|
|
||||||
|
|
||||||
|
|
||||||
# annotations
|
|
||||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
||||||
value = Lcom/vk/libvideo/VideoTracker;
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/InnerClass;
|
|
||||||
accessFlags = 0x4019
|
|
||||||
name = "PlayerType"
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"Ljava/lang/Enum<",
|
|
||||||
"Lcom/vk/libvideo/VideoTracker$PlayerType;",
|
|
||||||
">;"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
|
|
||||||
# static fields
|
|
||||||
.field private static final synthetic $VALUES:[Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
.field public static final enum CAROUSEL:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
.field public static final enum FULLSCREEN:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
.field public static final enum INLINE:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
|
|
||||||
# direct methods
|
|
||||||
.method static constructor <clinit>()V
|
|
||||||
.locals 5
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
const/4 v1, 0x0
|
|
||||||
|
|
||||||
const-string v2, "INLINE"
|
|
||||||
|
|
||||||
invoke-direct {v0, v2, v1}, Lcom/vk/libvideo/VideoTracker$PlayerType;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$PlayerType;->INLINE:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
const/4 v2, 0x1
|
|
||||||
|
|
||||||
const-string v3, "CAROUSEL"
|
|
||||||
|
|
||||||
invoke-direct {v0, v3, v2}, Lcom/vk/libvideo/VideoTracker$PlayerType;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$PlayerType;->CAROUSEL:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
const/4 v3, 0x2
|
|
||||||
|
|
||||||
const-string v4, "FULLSCREEN"
|
|
||||||
|
|
||||||
invoke-direct {v0, v4, v3}, Lcom/vk/libvideo/VideoTracker$PlayerType;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$PlayerType;->FULLSCREEN:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
const/4 v0, 0x3
|
|
||||||
|
|
||||||
new-array v0, v0, [Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
.line 2
|
|
||||||
sget-object v4, Lcom/vk/libvideo/VideoTracker$PlayerType;->INLINE:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
aput-object v4, v0, v1
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$PlayerType;->CAROUSEL:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
aput-object v1, v0, v2
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$PlayerType;->FULLSCREEN:Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
aput-object v1, v0, v3
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$PlayerType;->$VALUES:[Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method private constructor <init>(Ljava/lang/String;I)V
|
|
||||||
.locals 0
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"()V"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
const-class v0, Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
||||||
|
|
||||||
move-result-object p0
|
|
||||||
|
|
||||||
check-cast p0, Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
return-object p0
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static values()[Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
sget-object v0, Lcom/vk/libvideo/VideoTracker$PlayerType;->$VALUES:[Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
invoke-virtual {v0}, [Lcom/vk/libvideo/VideoTracker$PlayerType;->clone()Ljava/lang/Object;
|
|
||||||
|
|
||||||
move-result-object v0
|
|
||||||
|
|
||||||
check-cast v0, [Lcom/vk/libvideo/VideoTracker$PlayerType;
|
|
||||||
|
|
||||||
return-object v0
|
|
||||||
.end method
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
.class public final enum Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
.super Ljava/lang/Enum;
|
|
||||||
.source "VideoTracker.java"
|
|
||||||
|
|
||||||
|
|
||||||
# annotations
|
|
||||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
||||||
value = Lcom/vk/libvideo/VideoTracker;
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/InnerClass;
|
|
||||||
accessFlags = 0x4019
|
|
||||||
name = "ResizeAction"
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"Ljava/lang/Enum<",
|
|
||||||
"Lcom/vk/libvideo/VideoTracker$ResizeAction;",
|
|
||||||
">;"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
|
|
||||||
# static fields
|
|
||||||
.field private static final synthetic $VALUES:[Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
.field public static final enum BUTTON:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
.field public static final enum GESTURE:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
|
|
||||||
# direct methods
|
|
||||||
.method static constructor <clinit>()V
|
|
||||||
.locals 4
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
const/4 v1, 0x0
|
|
||||||
|
|
||||||
const-string v2, "BUTTON"
|
|
||||||
|
|
||||||
invoke-direct {v0, v2, v1}, Lcom/vk/libvideo/VideoTracker$ResizeAction;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;->BUTTON:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
const/4 v2, 0x1
|
|
||||||
|
|
||||||
const-string v3, "GESTURE"
|
|
||||||
|
|
||||||
invoke-direct {v0, v3, v2}, Lcom/vk/libvideo/VideoTracker$ResizeAction;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;->GESTURE:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
const/4 v0, 0x2
|
|
||||||
|
|
||||||
new-array v0, v0, [Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
.line 2
|
|
||||||
sget-object v3, Lcom/vk/libvideo/VideoTracker$ResizeAction;->BUTTON:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
aput-object v3, v0, v1
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$ResizeAction;->GESTURE:Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
aput-object v1, v0, v2
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;->$VALUES:[Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method private constructor <init>(Ljava/lang/String;I)V
|
|
||||||
.locals 0
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"()V"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
const-class v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
||||||
|
|
||||||
move-result-object p0
|
|
||||||
|
|
||||||
check-cast p0, Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
return-object p0
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static values()[Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
sget-object v0, Lcom/vk/libvideo/VideoTracker$ResizeAction;->$VALUES:[Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
invoke-virtual {v0}, [Lcom/vk/libvideo/VideoTracker$ResizeAction;->clone()Ljava/lang/Object;
|
|
||||||
|
|
||||||
move-result-object v0
|
|
||||||
|
|
||||||
check-cast v0, [Lcom/vk/libvideo/VideoTracker$ResizeAction;
|
|
||||||
|
|
||||||
return-object v0
|
|
||||||
.end method
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
.class public final enum Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
.super Ljava/lang/Enum;
|
|
||||||
.source "VideoTracker.java"
|
|
||||||
|
|
||||||
|
|
||||||
# annotations
|
|
||||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
||||||
value = Lcom/vk/libvideo/VideoTracker;
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/InnerClass;
|
|
||||||
accessFlags = 0x4019
|
|
||||||
name = "RewindType"
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"Ljava/lang/Enum<",
|
|
||||||
"Lcom/vk/libvideo/VideoTracker$RewindType;",
|
|
||||||
">;"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
|
|
||||||
# static fields
|
|
||||||
.field private static final synthetic $VALUES:[Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
.field public static final enum DOUBLE_TAP:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
.field public static final enum SLIDER:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
|
|
||||||
# direct methods
|
|
||||||
.method static constructor <clinit>()V
|
|
||||||
.locals 4
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
const/4 v1, 0x0
|
|
||||||
|
|
||||||
const-string v2, "SLIDER"
|
|
||||||
|
|
||||||
invoke-direct {v0, v2, v1}, Lcom/vk/libvideo/VideoTracker$RewindType;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$RewindType;->SLIDER:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
const/4 v2, 0x1
|
|
||||||
|
|
||||||
const-string v3, "DOUBLE_TAP"
|
|
||||||
|
|
||||||
invoke-direct {v0, v3, v2}, Lcom/vk/libvideo/VideoTracker$RewindType;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$RewindType;->DOUBLE_TAP:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
const/4 v0, 0x2
|
|
||||||
|
|
||||||
new-array v0, v0, [Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
.line 2
|
|
||||||
sget-object v3, Lcom/vk/libvideo/VideoTracker$RewindType;->SLIDER:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
aput-object v3, v0, v1
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$RewindType;->DOUBLE_TAP:Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
aput-object v1, v0, v2
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$RewindType;->$VALUES:[Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method private constructor <init>(Ljava/lang/String;I)V
|
|
||||||
.locals 0
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"()V"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
const-class v0, Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
||||||
|
|
||||||
move-result-object p0
|
|
||||||
|
|
||||||
check-cast p0, Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
return-object p0
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static values()[Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
sget-object v0, Lcom/vk/libvideo/VideoTracker$RewindType;->$VALUES:[Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
invoke-virtual {v0}, [Lcom/vk/libvideo/VideoTracker$RewindType;->clone()Ljava/lang/Object;
|
|
||||||
|
|
||||||
move-result-object v0
|
|
||||||
|
|
||||||
check-cast v0, [Lcom/vk/libvideo/VideoTracker$RewindType;
|
|
||||||
|
|
||||||
return-object v0
|
|
||||||
.end method
|
|
||||||
@@ -1,150 +0,0 @@
|
|||||||
.class public final enum Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
.super Ljava/lang/Enum;
|
|
||||||
.source "VideoTracker.java"
|
|
||||||
|
|
||||||
|
|
||||||
# annotations
|
|
||||||
.annotation system Ldalvik/annotation/EnclosingClass;
|
|
||||||
value = Lcom/vk/libvideo/VideoTracker;
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/InnerClass;
|
|
||||||
accessFlags = 0x4019
|
|
||||||
name = "Screen"
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"Ljava/lang/Enum<",
|
|
||||||
"Lcom/vk/libvideo/VideoTracker$Screen;",
|
|
||||||
">;"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
|
|
||||||
# static fields
|
|
||||||
.field private static final synthetic $VALUES:[Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
.field public static final enum CAROUSEL:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
.field public static final enum INLINE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
.field public static final enum LANDSCAPE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
.field public static final enum PORTRAIT:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
|
|
||||||
# direct methods
|
|
||||||
.method static constructor <clinit>()V
|
|
||||||
.locals 6
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
const/4 v1, 0x0
|
|
||||||
|
|
||||||
const-string v2, "INLINE"
|
|
||||||
|
|
||||||
invoke-direct {v0, v2, v1}, Lcom/vk/libvideo/VideoTracker$Screen;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->INLINE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
const/4 v2, 0x1
|
|
||||||
|
|
||||||
const-string v3, "CAROUSEL"
|
|
||||||
|
|
||||||
invoke-direct {v0, v3, v2}, Lcom/vk/libvideo/VideoTracker$Screen;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->CAROUSEL:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
const/4 v3, 0x2
|
|
||||||
|
|
||||||
const-string v4, "PORTRAIT"
|
|
||||||
|
|
||||||
invoke-direct {v0, v4, v3}, Lcom/vk/libvideo/VideoTracker$Screen;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->PORTRAIT:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
new-instance v0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
const/4 v4, 0x3
|
|
||||||
|
|
||||||
const-string v5, "LANDSCAPE"
|
|
||||||
|
|
||||||
invoke-direct {v0, v5, v4}, Lcom/vk/libvideo/VideoTracker$Screen;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->LANDSCAPE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
const/4 v0, 0x4
|
|
||||||
|
|
||||||
new-array v0, v0, [Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
.line 2
|
|
||||||
sget-object v5, Lcom/vk/libvideo/VideoTracker$Screen;->INLINE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
aput-object v5, v0, v1
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$Screen;->CAROUSEL:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
aput-object v1, v0, v2
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$Screen;->PORTRAIT:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
aput-object v1, v0, v3
|
|
||||||
|
|
||||||
sget-object v1, Lcom/vk/libvideo/VideoTracker$Screen;->LANDSCAPE:Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
aput-object v1, v0, v4
|
|
||||||
|
|
||||||
sput-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->$VALUES:[Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method private constructor <init>(Ljava/lang/String;I)V
|
|
||||||
.locals 0
|
|
||||||
.annotation system Ldalvik/annotation/Signature;
|
|
||||||
value = {
|
|
||||||
"()V"
|
|
||||||
}
|
|
||||||
.end annotation
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
invoke-direct {p0, p1, p2}, Ljava/lang/Enum;-><init>(Ljava/lang/String;I)V
|
|
||||||
|
|
||||||
return-void
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static valueOf(Ljava/lang/String;)Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
const-class v0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
invoke-static {v0, p0}, Ljava/lang/Enum;->valueOf(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/Enum;
|
|
||||||
|
|
||||||
move-result-object p0
|
|
||||||
|
|
||||||
check-cast p0, Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
return-object p0
|
|
||||||
.end method
|
|
||||||
|
|
||||||
.method public static values()[Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
.locals 1
|
|
||||||
|
|
||||||
.line 1
|
|
||||||
sget-object v0, Lcom/vk/libvideo/VideoTracker$Screen;->$VALUES:[Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
invoke-virtual {v0}, [Lcom/vk/libvideo/VideoTracker$Screen;->clone()Ljava/lang/Object;
|
|
||||||
|
|
||||||
move-result-object v0
|
|
||||||
|
|
||||||
check-cast v0, [Lcom/vk/libvideo/VideoTracker$Screen;
|
|
||||||
|
|
||||||
return-object v0
|
|
||||||
.end method
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user