mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-08 22:33:26 +01:00
Fixes updating DolphiniOS due to mismatched bundle IDs
Manually sets Dolphin’s CFBundleIdentifier to match the source bundle ID to prevent breaking updates for existing users.
This commit is contained in:
@@ -24,6 +24,8 @@ extension StoreApp
|
||||
static let altstoreAppID = "com.rileytestut.AltStore"
|
||||
static let alternativeAltStoreAppIDs: Set<String> = ["com.rileytestut.AltStore.Beta", "com.rileytestut.AltStore.Alpha"]
|
||||
#endif
|
||||
|
||||
static let dolphinAppID = "me.oatmealdome.dolphinios-njb"
|
||||
}
|
||||
|
||||
@objc(StoreApp)
|
||||
|
||||
@@ -83,6 +83,19 @@ class DownloadAppOperation: ResultOperation<ALTApplication>
|
||||
|
||||
try FileManager.default.copyItem(at: appBundleURL, to: self.destinationURL, shouldReplace: true)
|
||||
|
||||
if self.context.bundleIdentifier == StoreApp.dolphinAppID, self.context.bundleIdentifier != application.bundleIdentifier
|
||||
{
|
||||
let infoPlistURL = self.destinationURL.appendingPathComponent("Info.plist")
|
||||
|
||||
if var infoPlist = NSDictionary(contentsOf: infoPlistURL) as? [String: Any]
|
||||
{
|
||||
// Manually update the app's bundle identifier to match the one specified in the source.
|
||||
// This allows people who previously installed the app to still update and refresh normally.
|
||||
infoPlist[kCFBundleIdentifierKey as String] = StoreApp.dolphinAppID
|
||||
(infoPlist as NSDictionary).write(to: infoPlistURL, atomically: true)
|
||||
}
|
||||
}
|
||||
|
||||
guard let copiedApplication = ALTApplication(fileURL: self.destinationURL) else { throw OperationError.invalidApp }
|
||||
self.finish(.success(copiedApplication))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user