feature: added a prompt before installing to customize appId

This commit is contained in:
mahee96
2026-02-02 08:44:49 +05:30
parent d70c916222
commit 30c03aad42
4 changed files with 212 additions and 38 deletions

View File

@@ -54,7 +54,8 @@ class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioni
Logger.sideload.notice("Fetching provisioning profiles for app \(self.context.bundleIdentifier, privacy: .public)...")
self.progress.totalUnitCount = Int64(1 + app.appExtensions.count)
let effectiveBundleId = self.context.bundleIdentifier
self.prepareProvisioningProfile(for: app, parentApp: nil, team: team, session: session) { (result) in
do
{
@@ -62,7 +63,7 @@ class FetchProvisioningProfilesOperation: ResultOperation<[String: ALTProvisioni
let profile = try result.get()
var profiles = [app.bundleIdentifier: profile]
var profiles = [effectiveBundleId: profile]
var error: Error?
let dispatchGroup = DispatchGroup()
@@ -220,19 +221,30 @@ extension FetchProvisioningProfilesOperation
// Or, if the app _is_ installed but with a different team, we need to create a new
// bundle identifier anyway to prevent collisions with the previous team.
let parentBundleID = parentApp?.bundleIdentifier ?? app.bundleIdentifier
let effectiveParentBundleID = self.context.bundleIdentifier
let updatedParentBundleID: String
if app.isAltStoreApp
{
// Use legacy bundle ID format for AltStore (and its extensions).
updatedParentBundleID = parentBundleID + "." + team.identifier // Append just team identifier to make it harder to track.
updatedParentBundleID = effectiveParentBundleID + "." + team.identifier // Append just team identifier to make it harder to track.
}
else
{
updatedParentBundleID = parentBundleID + "." + team.identifier // Append just team identifier to make it harder to track.
updatedParentBundleID = effectiveParentBundleID + "." + team.identifier // Append just team identifier to make it harder to track.
}
if let parentApp = parentApp,
app.bundleIdentifier.hasPrefix(parentBundleID + ".")
{
let suffix = String(app.bundleIdentifier.dropFirst(parentBundleID.count))
bundleID = updatedParentBundleID + suffix
}
else
{
bundleID = updatedParentBundleID
}
bundleID = app.bundleIdentifier.replacingOccurrences(of: parentBundleID, with: updatedParentBundleID)
}
let preferredName: String