From ab66804d87ad8c4cfff587edd191398ad97868c6 Mon Sep 17 00:00:00 2001 From: aliveoutside <53598473+aliveoutside@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:13:58 +0300 Subject: [PATCH 1/4] fix ExternalLinkHandler --- .../lite/utils/ExternalLinkHandler.java | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/utils/ExternalLinkHandler.java b/app/src/main/java/ru/vtosters/lite/utils/ExternalLinkHandler.java index ca2d3129c..507375ddd 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/ExternalLinkHandler.java +++ b/app/src/main/java/ru/vtosters/lite/utils/ExternalLinkHandler.java @@ -33,7 +33,7 @@ public class ExternalLinkHandler { if (checkYoutubeLink(file)) { try { Intent intent = new Intent(Intent.ACTION_VIEW); - intent.setData(Uri.parse(file.n)); + intent.setData(Uri.parse(file.G)); context.startActivity(intent); return true; } catch (Exception e) { @@ -59,9 +59,9 @@ public class ExternalLinkHandler { } private static boolean checkYoutubeLink(VideoFile file) { - if (!isEmpty(file.n)) { + if (!isEmpty(file.G)) { for (String filter : filters) { - if (file.n.contains(filter)) + if (file.G.contains(filter)) return true; } } @@ -69,13 +69,13 @@ public class ExternalLinkHandler { } /** - * this.e = var3.optString("mp4_240", var3.optString("src")); - * this.f = var3.optString("mp4_360"); - * this.g = var3.optString("mp4_480"); - * this.h = var3.optString("mp4_720"); - * this.i = var3.optString("mp4_1080"); - * this.j = var3.optString("mp4_1440"); - * this.k = var3.optString("mp4_2160"); + * this.e = var66.optString("mp4_240", var66.optString("src")); + * this.f = var66.optString("mp4_360"); + * this.g = var66.optString("mp4_480"); + * this.h = var66.optString("mp4_720"); + * this.B = var66.optString("mp4_1080"); + * this.C = var66.optString("mp4_1440"); + * this.D = var66.optString("mp4_2160"); */ public static boolean checkVkVideo(VideoFile videoFile) { if (!isEmpty(videoFile.e)) { @@ -90,14 +90,14 @@ public class ExternalLinkHandler { if (!isEmpty(videoFile.h)) { qualities.put("720", videoFile.h); } - if (!isEmpty(videoFile.i)) { - qualities.put("1080", videoFile.i); + if (!isEmpty(videoFile.B)) { + qualities.put("1080", videoFile.B); } - if (!isEmpty(videoFile.j)) { - qualities.put("1440", videoFile.j); + if (!isEmpty(videoFile.C)) { + qualities.put("1440", videoFile.C); } - if (!isEmpty(videoFile.k)) { - qualities.put("2160", videoFile.k); + if (!isEmpty(videoFile.D)) { + qualities.put("2160", videoFile.D); } return qualities.size() > 0; From ec40c99c95a0b7a6368196315b7038645a540110 Mon Sep 17 00:00:00 2001 From: aliveoutside <53598473+aliveoutside@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:18:00 +0300 Subject: [PATCH 2/4] fix net/request --- app/src/main/java/ru/vtosters/lite/net/Request.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/ru/vtosters/lite/net/Request.java b/app/src/main/java/ru/vtosters/lite/net/Request.java index 10d0bdcb3..8032f9c9a 100644 --- a/app/src/main/java/ru/vtosters/lite/net/Request.java +++ b/app/src/main/java/ru/vtosters/lite/net/Request.java @@ -46,7 +46,7 @@ public class Request { httpURLConnection.setRequestProperty("Token", getUserToken()); } if (!mIsVTostersRequest) { - httpURLConnection.setRequestProperty("User-Agent", Network.a.a().a()); + httpURLConnection.setRequestProperty("User-Agent", Network.l.c().a()); } httpURLConnection.setRequestProperty("Content-Type", mIsVTostersRequest ? "Content-Type" : "application/x-www-form-urlencoded"); From ade116fa031f3f9f50cf1ec8116e65d45485a08f Mon Sep 17 00:00:00 2001 From: aliveoutside <53598473+aliveoutside@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:24:48 +0300 Subject: [PATCH 3/4] fix otadownloader --- .../java/ru/vtosters/lite/downloaders/OTADownloader.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/downloaders/OTADownloader.java b/app/src/main/java/ru/vtosters/lite/downloaders/OTADownloader.java index 4f1b12a85..2eaeeac4f 100644 --- a/app/src/main/java/ru/vtosters/lite/downloaders/OTADownloader.java +++ b/app/src/main/java/ru/vtosters/lite/downloaders/OTADownloader.java @@ -2,6 +2,7 @@ package ru.vtosters.lite.downloaders; import static ru.vtosters.lite.utils.Globals.getString; +import android.annotation.SuppressLint; import android.app.DownloadManager; import android.content.BroadcastReceiver; import android.content.Context; @@ -31,7 +32,7 @@ public class OTADownloader { var manager = (DownloadManager) Globals.getContext().getSystemService(Context.DOWNLOAD_SERVICE); var cursor = manager.query(query); if (cursor.moveToFirst()) { - var status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS)); + @SuppressLint("Range") var status = cursor.getInt(cursor.getColumnIndex(DownloadManager.COLUMN_STATUS)); if (status == DownloadManager.STATUS_SUCCESSFUL) { var downloadDir = new File(Environment.getExternalStorageDirectory(), "Download"); if (!downloadDir.exists()) return; @@ -45,7 +46,7 @@ public class OTADownloader { maxIndex = Math.max(maxIndex, Integer.parseInt(name.replaceFirst(".+-(\\d+).+", "$1"))); } File apk = maxIndex == -1 ? new File(downloadDir, "VTLite.apk") : new File(downloadDir, "VTLite-" + maxIndex + ".apk"); - APKInstallActivity.installOta(context, FileUtils.h(apk)); + APKInstallActivity.installOta(context, FileUtils.n(apk)); } else if (status == DownloadManager.STATUS_FAILED) { Globals.sendToast(getString("downloaderr")); } From 1d97000bef8194bb8bd955c0569160d4f8345396 Mon Sep 17 00:00:00 2001 From: aliveoutside <53598473+aliveoutside@users.noreply.github.com> Date: Wed, 22 Jun 2022 01:31:01 +0300 Subject: [PATCH 4/4] fix DockBarFragment --- .../lite/ui/fragments/dockbar/DockBarFragment.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/ui/fragments/dockbar/DockBarFragment.java b/app/src/main/java/ru/vtosters/lite/ui/fragments/dockbar/DockBarFragment.java index 522cd64fd..818417198 100644 --- a/app/src/main/java/ru/vtosters/lite/ui/fragments/dockbar/DockBarFragment.java +++ b/app/src/main/java/ru/vtosters/lite/ui/fragments/dockbar/DockBarFragment.java @@ -84,11 +84,12 @@ public class DockBarFragment extends MaterialPreferenceToolbarFragment { } @Override - public void a(View arg0, Bundle arg1) { - o_(true); + public void onViewCreated(View arg0, Bundle arg1) { + setHasOptionsMenu(true); - super.a(arg0, arg1); + super.onViewCreated(arg0, arg1); - a(getString("dockbar_editor")); + // TODO: хз что это + //a(getString("dockbar_editor")); } }