mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
Adds "Open" context menu action for active apps
Launches the sideloaded app by opening the app-specific URL scheme embedded by AltStore during resigning.
This commit is contained in:
@@ -1005,6 +1005,16 @@ private extension MyAppsViewController
|
||||
|
||||
private extension MyAppsViewController
|
||||
{
|
||||
func open(_ installedApp: InstalledApp)
|
||||
{
|
||||
UIApplication.shared.open(installedApp.openAppURL) { success in
|
||||
guard !success else { return }
|
||||
|
||||
let toastView = ToastView(error: OperationError.openAppFailed(name: installedApp.name))
|
||||
toastView.show(in: self)
|
||||
}
|
||||
}
|
||||
|
||||
func refresh(_ installedApp: InstalledApp)
|
||||
{
|
||||
let previousProgress = AppManager.shared.refreshProgress(for: installedApp)
|
||||
@@ -1523,6 +1533,12 @@ extension MyAppsViewController
|
||||
{
|
||||
var actions = [UIMenuElement]()
|
||||
|
||||
let openAction = UIAction(title: NSLocalizedString("Open", comment: ""), image: UIImage(systemName: "arrow.up.forward.app")) { (action) in
|
||||
self.open(installedApp)
|
||||
}
|
||||
|
||||
let openMenu = UIMenu(title: "", options: .displayInline, children: [openAction])
|
||||
|
||||
let refreshAction = UIAction(title: NSLocalizedString("Refresh", comment: ""), image: UIImage(systemName: "arrow.clockwise")) { (action) in
|
||||
self.refresh(installedApp)
|
||||
}
|
||||
@@ -1577,6 +1593,7 @@ extension MyAppsViewController
|
||||
|
||||
if installedApp.isActive
|
||||
{
|
||||
actions.append(openMenu)
|
||||
actions.append(refreshAction)
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user