Merge remote-tracking branch 'origin/vtl-remaster' into vtl-remaster
This commit is contained in:
@@ -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"));
|
||||
}
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user