From d797ddd668033b592d834e03e0dc362062ee32f9 Mon Sep 17 00:00:00 2001 From: Joseph Mattello Date: Fri, 30 Dec 2022 16:51:36 -0500 Subject: [PATCH] =?UTF-8?q?closes=20#93=20redo=20of=20bundle=20id=E2=80=99?= =?UTF-8?q?s=20from=20.app?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Joseph Mattello --- AltDaemon/XPCConnectionHandler.swift | 2 +- AltStore/AppDelegate.swift | 12 ++++++------ AltStoreCore/Components/Keychain.swift | 2 +- AltStoreCore/Model/Source.swift | 4 ++-- AltStoreCore/Model/StoreApp.swift | 6 +++--- AltWidget/ComplicationView.swift | 4 ++-- AltWidget/WidgetView.swift | 2 +- Shared/Extensions/ALTApplication+AltStoreApp.swift | 2 +- Shared/Extensions/Bundle+AltStore.swift | 2 ++ 9 files changed, 19 insertions(+), 17 deletions(-) diff --git a/AltDaemon/XPCConnectionHandler.swift b/AltDaemon/XPCConnectionHandler.swift index d6ee4202..c1571a3f 100644 --- a/AltDaemon/XPCConnectionHandler.swift +++ b/AltDaemon/XPCConnectionHandler.swift @@ -77,7 +77,7 @@ extension XPCConnectionHandler: NSXPCListenerDelegate guard let codeSigningInfo = signingInfo as? [String: Any], let bundleIdentifier = codeSigningInfo["identifier"] as? String, - bundleIdentifier.contains("com.rileytestut.AltStore") + bundleIdentifier.contains(Bundle.Info.appbundleIdentifier) else { return false } let connection = XPCConnection(newConnection) diff --git a/AltStore/AppDelegate.swift b/AltStore/AppDelegate.swift index b4fc4eb1..37c640e8 100644 --- a/AltStore/AppDelegate.swift +++ b/AltStore/AppDelegate.swift @@ -18,12 +18,12 @@ import EmotionalDamage extension AppDelegate { - static let openPatreonSettingsDeepLinkNotification = Notification.Name("com.rileytestut.AltStore.OpenPatreonSettingsDeepLinkNotification") - static let importAppDeepLinkNotification = Notification.Name("com.rileytestut.AltStore.ImportAppDeepLinkNotification") - static let addSourceDeepLinkNotification = Notification.Name("com.rileytestut.AltStore.AddSourceDeepLinkNotification") - - static let appBackupDidFinish = Notification.Name("com.rileytestut.AltStore.AppBackupDidFinish") - + static let openPatreonSettingsDeepLinkNotification = Notification.Name(Bundle.Info.appbundleIdentifier + ".OpenPatreonSettingsDeepLinkNotification") + static let importAppDeepLinkNotification = Notification.Name(Bundle.Info.appbundleIdentifier + ".ImportAppDeepLinkNotification") + static let addSourceDeepLinkNotification = Notification.Name(Bundle.Info.appbundleIdentifier + ".AddSourceDeepLinkNotification") + + static let appBackupDidFinish = Notification.Name(Bundle.Info.appbundleIdentifier + ".AppBackupDidFinish") + static let importAppDeepLinkURLKey = "fileURL" static let appBackupResultKey = "result" static let addSourceDeepLinkURLKey = "sourceURL" diff --git a/AltStoreCore/Components/Keychain.swift b/AltStoreCore/Components/Keychain.swift index ef45ad8e..bb21f913 100644 --- a/AltStoreCore/Components/Keychain.swift +++ b/AltStoreCore/Components/Keychain.swift @@ -45,7 +45,7 @@ public class Keychain { public static let shared = Keychain() - fileprivate let keychain = KeychainAccess.Keychain(service: "com.rileytestut.AltStore").accessibility(.afterFirstUnlock).synchronizable(true) + fileprivate let keychain = KeychainAccess.Keychain(service: Bundle.Info.appbundleIdentifier).accessibility(.afterFirstUnlock).synchronizable(true) @KeychainItem(key: "appleIDEmailAddress") public var appleIDEmailAddress: String? diff --git a/AltStoreCore/Model/Source.swift b/AltStoreCore/Model/Source.swift index 271a4af9..c8d97c6d 100644 --- a/AltStoreCore/Model/Source.swift +++ b/AltStoreCore/Model/Source.swift @@ -11,9 +11,9 @@ import CoreData public extension Source { #if ALPHA - static let altStoreIdentifier = "com.SideStore.SideStore" + static let altStoreIdentifier = Bundle.Info.appbundleIdentifier #else - static let altStoreIdentifier = "com.SideStore.SideStore" + static let altStoreIdentifier = Bundle.Info.appbundleIdentifier #endif #if STAGING diff --git a/AltStoreCore/Model/StoreApp.swift b/AltStoreCore/Model/StoreApp.swift index 94187049..c76c54f8 100644 --- a/AltStoreCore/Model/StoreApp.swift +++ b/AltStoreCore/Model/StoreApp.swift @@ -15,11 +15,11 @@ import AltSign public extension StoreApp { #if ALPHA - static let altstoreAppID = "com.SideStore.SideStore" + static let altstoreAppID = Bundle.Info.appbundleIdentifier #elseif BETA - static let altstoreAppID = "com.SideStore.SideStore" + static let altstoreAppID = Bundle.Info.appbundleIdentifier #else - static let altstoreAppID = "com.SideStore.SideStore" + static let altstoreAppID = Bundle.Info.appbundleIdentifier #endif static let dolphinAppID = "me.oatmealdome.dolphinios-njb" diff --git a/AltWidget/ComplicationView.swift b/AltWidget/ComplicationView.swift index 19222926..5c0a4c1c 100644 --- a/AltWidget/ComplicationView.swift +++ b/AltWidget/ComplicationView.swift @@ -59,14 +59,14 @@ struct ComplicationView_Previews: PreviewProvider { let expiredDate = shortExpirationDate.addingTimeInterval(1 * 60 * 60 * 24) let weekAltstore = AppSnapshot(name: "AltStore", - bundleIdentifier: "com.rileytestut.AltStore", + bundleIdentifier: Bundle.Info.appbundleIdentifier, expirationDate: shortExpirationDate, refreshedDate: shortRefreshedDate, tintColor: .altPrimary, icon: UIImage(named: "AltStore")) let yearAltstore = AppSnapshot(name: "AltStore", - bundleIdentifier: "com.rileytestut.AltStore", + bundleIdentifier: Bundle.Info.appbundleIdentifier, expirationDate: longExpirationDate, refreshedDate: longRefreshedDate, tintColor: .altPrimary, diff --git a/AltWidget/WidgetView.swift b/AltWidget/WidgetView.swift index 55fcc679..6dcfadec 100644 --- a/AltWidget/WidgetView.swift +++ b/AltWidget/WidgetView.swift @@ -155,7 +155,7 @@ struct WidgetView_Previews: PreviewProvider { let longExpirationDate = Calendar.current.date(byAdding: .day, value: 365, to: longRefreshedDate) ?? Date() let altstore = AppSnapshot(name: "AltStore", - bundleIdentifier: "com.rileytestut.AltStore", + bundleIdentifier: Bundle.Info.appbundleIdentifier, expirationDate: shortExpirationDate, refreshedDate: shortRefreshedDate, tintColor: .altPrimary, diff --git a/Shared/Extensions/ALTApplication+AltStoreApp.swift b/Shared/Extensions/ALTApplication+AltStoreApp.swift index 5e5afb7c..dc983b66 100644 --- a/Shared/Extensions/ALTApplication+AltStoreApp.swift +++ b/Shared/Extensions/ALTApplication+AltStoreApp.swift @@ -10,7 +10,7 @@ import AltSign extension ALTApplication { - static let altstoreBundleID = "com.SideStore.SideStore" + static let altstoreBundleID = Bundle.Info.appbundleIdentifier var isAltStoreApp: Bool { let isAltStoreApp = self.bundleIdentifier.contains(ALTApplication.altstoreBundleID) diff --git a/Shared/Extensions/Bundle+AltStore.swift b/Shared/Extensions/Bundle+AltStore.swift index 88e73b66..cd3eff27 100644 --- a/Shared/Extensions/Bundle+AltStore.swift +++ b/Shared/Extensions/Bundle+AltStore.swift @@ -17,6 +17,8 @@ public extension Bundle public static let certificateID = "ALTCertificateID" public static let appGroups = "ALTAppGroups" public static let altBundleID = "ALTBundleIdentifier" + public static let orgbundleIdentifier = "com.SideStore" + public static let appbundleIdentifier = orgbundleIdentifier + ".SideStore" public static let devicePairingString = "ALTPairingFile" public static let urlTypes = "CFBundleURLTypes" public static let exportedUTIs = "UTExportedTypeDeclarations"