Adds support for installing AltStore beta from AltStore

This commit is contained in:
Riley Testut
2019-09-12 13:04:15 -07:00
parent e3bf6d6239
commit 502a5488b0
5 changed files with 24 additions and 15 deletions

View File

@@ -22,16 +22,6 @@
<string>0.2</string> <string>0.2</string>
<key>CFBundleURLTypes</key> <key>CFBundleURLTypes</key>
<array> <array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>AltStore</string>
<key>CFBundleURLSchemes</key>
<array>
<string>altstore-com.rileytestut.altstore</string>
</array>
</dict>
<dict> <dict>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
<string>Editor</string> <string>Editor</string>
@@ -48,9 +38,11 @@
<key>LSApplicationQueriesSchemes</key> <key>LSApplicationQueriesSchemes</key>
<array> <array>
<string>altstore-com.rileytestut.AltStore</string> <string>altstore-com.rileytestut.AltStore</string>
<string>altstore-com.rileytestut.Delta</string>
<string>altstore-com.rileytestut.Clip</string>
<string>altstore-com.rileytestut.AltStore.Beta</string> <string>altstore-com.rileytestut.AltStore.Beta</string>
<string>altstore-com.rileytestut.Delta</string>
<string>altstore-com.rileytestut.Delta.Beta</string>
<string>altstore-com.rileytestut.Clip</string>
<string>altstore-com.rileytestut.Clip.Beta</string>
</array> </array>
<key>LSRequiresIPhoneOS</key> <key>LSRequiresIPhoneOS</key>
<true/> <true/>

View File

@@ -52,7 +52,7 @@ extension AppManager
do do
{ {
let installedApps = try context.fetch(fetchRequest) let installedApps = try context.fetch(fetchRequest)
for app in installedApps where app.storeApp != nil for app in installedApps where app.storeApp != nil && app.bundleIdentifier != StoreApp.altstoreAppID
{ {
if UIApplication.shared.canOpenURL(app.openAppURL) if UIApplication.shared.canOpenURL(app.openAppURL)
{ {

View File

@@ -14,7 +14,13 @@ import AltSign
extension StoreApp extension StoreApp
{ {
#if BETA
static let altstoreAppID = "com.rileytestut.AltStore.Beta"
static let alternativeAltStoreAppID = "com.rileytestut.AltStore"
#else
static let altstoreAppID = "com.rileytestut.AltStore" static let altstoreAppID = "com.rileytestut.AltStore"
static let alternativeAltStoreAppID = "com.rileytestut.AltStore.Beta"
#endif
} }
@objc(StoreApp) @objc(StoreApp)
@@ -139,6 +145,10 @@ extension StoreApp
app.versionDate = Date() app.versionDate = Date()
app.downloadURL = URL(string: "http://rileytestut.com")! app.downloadURL = URL(string: "http://rileytestut.com")!
#if BETA
app.isBeta = true
#endif
return app return app
} }
} }

View File

@@ -84,6 +84,10 @@ class MyAppsViewController: UICollectionViewController
self.sideloadingProgressView.progressTintColor = .altRed self.sideloadingProgressView.progressTintColor = .altRed
self.sideloadingProgressView.progress = 0 self.sideloadingProgressView.progress = 0
#if !BETA
self.navigationItem.leftBarButtonItem = nil
#endif
if let navigationBar = self.navigationController?.navigationBar if let navigationBar = self.navigationController?.navigationBar
{ {
navigationBar.addSubview(self.sideloadingProgressView) navigationBar.addSubview(self.sideloadingProgressView)
@@ -313,7 +317,10 @@ private extension MyAppsViewController
} }
else else
{ {
self.dataSource.predicate = NSPredicate(format: "%K == nil OR %K == NO", #keyPath(InstalledApp.storeApp), #keyPath(InstalledApp.storeApp.isBeta)) self.dataSource.predicate = NSPredicate(format: "%K == nil OR %K == NO OR %K == %@",
#keyPath(InstalledApp.storeApp),
#keyPath(InstalledApp.storeApp.isBeta),
#keyPath(InstalledApp.bundleIdentifier), StoreApp.altstoreAppID)
} }
} }
} }

View File

@@ -395,7 +395,7 @@ private extension ResignAppOperation
var additionalValues: [String: Any] = [Bundle.Info.urlTypes: allURLSchemes] var additionalValues: [String: Any] = [Bundle.Info.urlTypes: allURLSchemes]
if self.context.bundleIdentifier == StoreApp.altstoreAppID if self.context.bundleIdentifier == StoreApp.altstoreAppID || self.context.bundleIdentifier == StoreApp.alternativeAltStoreAppID
{ {
guard let udid = Bundle.main.object(forInfoDictionaryKey: Bundle.Info.deviceID) as? String else { throw OperationError.unknownUDID } guard let udid = Bundle.main.object(forInfoDictionaryKey: Bundle.Info.deviceID) as? String else { throw OperationError.unknownUDID }
additionalValues[Bundle.Info.deviceID] = udid additionalValues[Bundle.Info.deviceID] = udid