mirror of
https://github.com/yuliskov/SmartTube.git
synced 2026-01-04 04:50:23 -06:00
ATV/Amazon bridge fixes
This commit is contained in:
Submodule MediaServiceCore updated: ca90b58739...288cb90f0b
Submodule SharedModules updated: e0af2622a5...891ef2ecc8
@@ -14,6 +14,8 @@
|
||||
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
|
||||
<uses-permission android:name="android.permission.ACTION_MANAGE_OVERLAY_PERMISSION" />
|
||||
<!-- <uses-permission android:name="android.permission.READ_PRIVILEGED_PHONE_STATE" /> -->
|
||||
<!-- Android 9+: needed to run package uninstaller (ATV, Amazon bride) -->
|
||||
<uses-permission android:name="android.permission.REQUEST_DELETE_PACKAGES"/>
|
||||
|
||||
<!-- Android 11+: fix access package info -->
|
||||
<queries>
|
||||
|
||||
@@ -4,7 +4,12 @@ import android.content.Context;
|
||||
import com.liskovsoft.sharedutils.helpers.Helpers;
|
||||
|
||||
public class ATVBridgePresenter extends BridgePresenter {
|
||||
private static final Integer[] ATV_YOUTUBE_PKG_HASH = {1430778939, -672009692, -798407885, -593272746};
|
||||
private static final Integer[] ATV_YOUTUBE_PKG_HASH = {
|
||||
//1430778939, // Armanych
|
||||
-672009692,
|
||||
-798407885,
|
||||
-593272746
|
||||
};
|
||||
private static final String ATV_YOUTUBE_PKG_NAME = "com.google.android.youtube.tv";
|
||||
private static final String ATV_BRIDGE_PKG_URL = "https://github.com/yuliskov/SmartTubeNext/releases/download/latest/ATV_Bridge.apk";
|
||||
private static ATVBridgePresenter sInstance;
|
||||
|
||||
@@ -4,7 +4,12 @@ import android.content.Context;
|
||||
import com.liskovsoft.sharedutils.helpers.Helpers;
|
||||
|
||||
public class AmazonBridgePresenter extends BridgePresenter {
|
||||
private static final Integer[] AMAZON_YOUTUBE_PKG_HASH = {1430778939, -672009692, -798407885, -593272746};
|
||||
private static final Integer[] AMAZON_YOUTUBE_PKG_HASH = {
|
||||
//1430778939, // Armanych
|
||||
-672009692,
|
||||
-798407885,
|
||||
-593272746
|
||||
};
|
||||
private static final String AMAZON_YOUTUBE_PKG_NAME = "com.amazon.firetv.youtube";
|
||||
private static final String AMAZON_BRIDGE_PKG_URL = "https://github.com/yuliskov/SmartTubeNext/releases/download/latest/Amazon_Bridge.apk";
|
||||
private static AmazonBridgePresenter sInstance;
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.net.Uri;
|
||||
import com.liskovsoft.appupdatechecker2.other.downloadmanager.DownloadManagerTask;
|
||||
import com.liskovsoft.appupdatechecker2.other.downloadmanager.DownloadManagerTask.DownloadListener;
|
||||
import com.liskovsoft.sharedutils.helpers.Helpers;
|
||||
import com.liskovsoft.sharedutils.helpers.MessageHelpers;
|
||||
import com.liskovsoft.sharedutils.mylogger.Log;
|
||||
import com.liskovsoft.smartyoutubetv2.common.R;
|
||||
import com.liskovsoft.smartyoutubetv2.common.app.models.playback.ui.OptionItem;
|
||||
@@ -95,7 +96,7 @@ abstract class BridgePresenter extends BasePresenter<Void> implements MotherActi
|
||||
private boolean isOldApkInstalled() {
|
||||
PackageInfo info = getPackageSignature(getPackageName());
|
||||
|
||||
return Helpers.isUserApp(info) && !Helpers.equalsAny(info.signatures[0].hashCode(), getPackageSignatureHash());
|
||||
return info != null && !Helpers.equalsAny(info.signatures[0].hashCode(), getPackageSignatureHash());
|
||||
}
|
||||
|
||||
private PackageInfo getPackageSignature(String pkgName) {
|
||||
@@ -126,6 +127,8 @@ abstract class BridgePresenter extends BasePresenter<Void> implements MotherActi
|
||||
public void onResult(int requestCode, int resultCode, Intent data) {
|
||||
if (requestCode == Helpers.REMOVE_PACKAGE_CODE && !isOldApkInstalled()) {
|
||||
installBridgeFromPath(getContext());
|
||||
} else {
|
||||
MessageHelpers.showMessage(getContext(), "The package " + getPackageName() + " cannot be uninstalled!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user