@@ -415,6 +415,26 @@ on checkSettingsCompatible pName, pValue
415415 answer error "32-bit only apps are not supported on iOS 11.0 and above"
416416 end if
417417 end if
418+
419+ if pName is "profile" then
420+ local tAppID
421+ put getSetting("ios,bundle id" ) into tAppID
422+
423+ local tProfile
424+ repeat for each element tProfile in sProfiles
425+ if tProfile ["id" ] is pValue then
426+ set the itemDelimiter to "."
427+ delete item 1 of tProfile ["appid" ]
428+
429+ local tID
430+ filter tAppID with tProfile ["appid" ] into tID
431+ if tID is empty then
432+ answer error revIDELocalise("The chosen provisioning profile requires an app ID matching:" && tProfile ["appid" ])
433+ end if
434+ exit repeat
435+ end if
436+ end repeat
437+ end if
418438end checkSettingsCompatible
419439
420440function fetchSetting pName
@@ -525,7 +545,7 @@ function getIosProvisioningProfiles
525545
526546 local tProfiles
527547 repeat for each line tProfile in tProfileFiles
528- local tContents , tAppId , tIsDist , tName , tId , tExpirationDate
548+ local tContents , tPrefix , tIsDist , tName , tId , tExpirationDate
529549 put url ("file:" & tProfile ) into tContents
530550
531551 set the itemDelimiter to "."
@@ -545,7 +565,7 @@ function getIosProvisioningProfiles
545565 end if
546566 get word 1 to - 1 of line it + 2 of tContents
547567 get char 9 to - 10 of it
548- put it into tAppId
568+ put it into tPrefix
549569
550570 get lineOffset ("<key>Name</key>" , tContents )
551571 if it is 0 then
@@ -567,9 +587,18 @@ function getIosProvisioningProfiles
567587 next repeat
568588 end if
569589
590+ local tAppID
591+ get lineOffset ("<key>application-identifier</key>" , tContents )
592+ if it is 0 then
593+ next repeat
594+ end if
595+ get word 1 to - 1 of line it + 1 of tContents
596+ put char 9 to - 10 of it into tAppID
597+
570598 put tId into tProfiles [tId ]["id" ]
571599 put tName into tProfiles [tId ]["name" ]
572- put tAppId into tProfiles [tId ]["appid" ]
600+ put tPrefix into tProfiles [tId ]["prefix" ]
601+ put tAppID into tProfiles [tId ]["appid" ]
573602 put tIsDist into tProfiles [tId ]["store" ]
574603 put tDaysLeft into tProfiles [tId ]["days remaining" ]
575604 end repeat
0 commit comments