mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-19 11:43:24 +01:00
Removes sideloading beta alert
This commit is contained in:
@@ -675,36 +675,20 @@ private extension MyAppsViewController
|
|||||||
|
|
||||||
@IBAction func sideloadApp(_ sender: UIBarButtonItem)
|
@IBAction func sideloadApp(_ sender: UIBarButtonItem)
|
||||||
{
|
{
|
||||||
self.presentSideloadingAlert { (shouldContinue) in
|
let supportedTypes: [String]
|
||||||
guard shouldContinue else { return }
|
|
||||||
|
if let types = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, "ipa" as CFString, nil)?.takeRetainedValue()
|
||||||
let supportedTypes: [String]
|
{
|
||||||
|
supportedTypes = (types as NSArray).map { $0 as! String }
|
||||||
if let types = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, "ipa" as CFString, nil)?.takeRetainedValue()
|
|
||||||
{
|
|
||||||
supportedTypes = (types as NSArray).map { $0 as! String }
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
supportedTypes = ["com.apple.itunes.ipa"] // Declared by the system.
|
|
||||||
}
|
|
||||||
|
|
||||||
let documentPickerViewController = UIDocumentPickerViewController(documentTypes: supportedTypes, in: .import)
|
|
||||||
documentPickerViewController.delegate = self
|
|
||||||
self.present(documentPickerViewController, animated: true, completion: nil)
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
{
|
||||||
func presentSideloadingAlert(completion: @escaping (Bool) -> Void)
|
supportedTypes = ["com.apple.itunes.ipa"] // Declared by the system.
|
||||||
{
|
}
|
||||||
let alertController = UIAlertController(title: NSLocalizedString("Sideload Apps (Beta)", comment: ""), message: NSLocalizedString("If you encounter an app that is not able to be sideloaded, please report the app to support@altstore.io.", comment: ""), preferredStyle: .alert)
|
|
||||||
alertController.addAction(UIAlertAction(title: RSTSystemLocalizedString("OK"), style: .default, handler: { (action) in
|
let documentPickerViewController = UIDocumentPickerViewController(documentTypes: supportedTypes, in: .import)
|
||||||
completion(true)
|
documentPickerViewController.delegate = self
|
||||||
}))
|
self.present(documentPickerViewController, animated: true, completion: nil)
|
||||||
alertController.addAction(UIAlertAction(title: UIAlertAction.cancel.title, style: UIAlertAction.cancel.style, handler: { (action) in
|
|
||||||
completion(false)
|
|
||||||
}))
|
|
||||||
self.present(alertController, animated: true, completion: nil)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sideloadApp(at fileURL: URL, completion: @escaping (Result<Void, Error>) -> Void)
|
func sideloadApp(at fileURL: URL, completion: @escaping (Result<Void, Error>) -> Void)
|
||||||
@@ -1044,10 +1028,8 @@ private extension MyAppsViewController
|
|||||||
self.loadViewIfNeeded()
|
self.loadViewIfNeeded()
|
||||||
|
|
||||||
guard let fileURL = notification.userInfo?[AppDelegate.importAppDeepLinkURLKey] as? URL else { return }
|
guard let fileURL = notification.userInfo?[AppDelegate.importAppDeepLinkURLKey] as? URL else { return }
|
||||||
guard self.presentedViewController == nil else { return }
|
|
||||||
|
|
||||||
func finish()
|
self.sideloadApp(at: fileURL) { (result) in
|
||||||
{
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
try FileManager.default.removeItem(at: fileURL)
|
try FileManager.default.removeItem(at: fileURL)
|
||||||
@@ -1057,29 +1039,6 @@ private extension MyAppsViewController
|
|||||||
print("Unable to remove imported .ipa.", error)
|
print("Unable to remove imported .ipa.", error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#if BETA
|
|
||||||
|
|
||||||
self.presentSideloadingAlert { (shouldContinue) in
|
|
||||||
if shouldContinue
|
|
||||||
{
|
|
||||||
self.sideloadApp(at: fileURL) { (result) in
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
self.sideloadApp(at: fileURL) { (result) in
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user