Skip to content

Commit

Permalink
add support for partial wildcard in profiles (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
kambala-decapitator authored Nov 4, 2024
1 parent 8d3f6be commit 27eead3
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions AppSigner/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -880,17 +880,21 @@ class MainView: NSView, URLSessionDataDelegate, URLSessionDelegate, URLSessionDo
if shouldSkipGetTaskAllow {
profile.removeGetTaskAllow()
}
let isWildcard = profile.appID == "*" // TODO: support com.example.* wildcard
if !isWildcard && (newApplicationID != "" && newApplicationID != profile.appID) {
setStatus("Unable to change App ID to \(newApplicationID), provisioning profile won't allow it")
cleanup(tempFolder); return
} else if isWildcard {
if newApplicationID != "" {

let hasNewAppID = !newApplicationID.isEmpty
if let wildcardIndex = profile.appID.firstIndex(of: "*") {
let allowedPrefix = profile.appID.prefix(upTo: wildcardIndex)
if hasNewAppID, newApplicationID.starts(with: allowedPrefix) {
profile.update(trueAppID: newApplicationID)
} else if let existingBundleID = bundleID {
profile.update(trueAppID: existingBundleID)
}
} else if hasNewAppID, newApplicationID != profile.appID {
setStatus("Unable to change App ID to \(newApplicationID), provisioning profile won't allow it")
cleanup(tempFolder)
return
}

if let entitlements = profile.getEntitlementsPlist() {
Log.write("–––––––––––––––––––––––\n\(entitlements)")
Log.write("–––––––––––––––––––––––")
Expand Down

0 comments on commit 27eead3

Please sign in to comment.