mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-15 17:53:31 +01:00
Adds "Enable JIT" context menu action for active apps
Allows users to manually enable JIT for apps that don't explicitly support AltKit.
This commit is contained in:
@@ -1349,6 +1349,22 @@ private extension MyAppsViewController
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@available(iOS 14, *)
|
||||
func enableJIT(for installedApp: InstalledApp)
|
||||
{
|
||||
AppManager.shared.enableJIT(for: installedApp) { result in
|
||||
DispatchQueue.main.async {
|
||||
switch result
|
||||
{
|
||||
case .success: break
|
||||
case .failure(let error):
|
||||
let toastView = ToastView(error: error)
|
||||
toastView.show(in: self)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private extension MyAppsViewController
|
||||
@@ -1555,6 +1571,11 @@ extension MyAppsViewController
|
||||
self.remove(installedApp)
|
||||
}
|
||||
|
||||
let jitAction = UIAction(title: NSLocalizedString("Enable JIT", comment: ""), image: UIImage(systemName: "bolt")) { (action) in
|
||||
guard #available(iOS 14, *) else { return }
|
||||
self.enableJIT(for: installedApp)
|
||||
}
|
||||
|
||||
let backupAction = UIAction(title: NSLocalizedString("Back Up", comment: ""), image: UIImage(systemName: "doc.on.doc")) { (action) in
|
||||
self.backup(installedApp)
|
||||
}
|
||||
@@ -1601,6 +1622,11 @@ extension MyAppsViewController
|
||||
actions.append(activateAction)
|
||||
}
|
||||
|
||||
if installedApp.isActive, #available(iOS 14, *)
|
||||
{
|
||||
actions.append(jitAction)
|
||||
}
|
||||
|
||||
#if BETA
|
||||
actions.append(changeIconMenu)
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user