Skip to content

Commit 4410ce0

Browse files
authored
Merge pull request livecode#6630 from montegoulding/bugfix-21469
[[ Bug 21469 ]] Recursively sign frameworks in iOS apps
2 parents d150ca5 + 43ebc69 commit 4410ce0

2 files changed

Lines changed: 20 additions & 1 deletion

File tree

docs/notes/bugfix-21469.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Ensure iOS apps with embedded frameworks are correctly signed

ide-support/revsaveasiosstandalone.livecodescript

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,8 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget, pSett
801801
--try
802802
-- Perform the codesigning of the main bundle
803803
local tResult
804-
put shell("/usr/bin/codesign --verbose -f -s" && quote & tCertificate & quote && \
804+
__CodesignFrameworks pAppBundle, tCertificate, tEntitlementsFile
805+
put shell("/usr/bin/codesign --deep --verbose -f -s" && quote & tCertificate & quote && \
805806
"--entitlements" && quote & tEntitlementsFile & quote && \
806807
quote & pAppBundle & quote) into tResult
807808
-- MM-2012-10-25: [[ Bug ]] try catch finally oddness meant that any errors here were being ignored.
@@ -817,6 +818,23 @@ private command revSaveAsMobileStandaloneMain pStack, pAppBundle, pTarget, pSett
817818
end if
818819
end revSaveAsMobileStandaloneMain
819820

821+
private command __CodesignFrameworks pPath, pCertificate, pEntitlements
822+
local tFrameworks
823+
put folders(pPath) into tFrameworks
824+
filter tFrameworks with "*.framework"
825+
repeat for each line tFramework in tFrameworks
826+
__CodesignFrameworks pPath & "/" & tFramework & "/Frameworks", pCertificate, pEntitlements
827+
828+
local tResult
829+
put shell("/usr/bin/codesign --deep --verbose -f -s" && quote & pCertificate & quote && \
830+
"--entitlements" && quote & pEntitlements & quote && \
831+
quote & pPath & "/" & tFramework & quote) into tResult
832+
if not (tResult contains "signed bundle" or tResult contains "signed app bundle") then
833+
throw "codesigning failed with" && tResult
834+
end if
835+
end repeat
836+
end __CodesignFrameworks
837+
820838
command revSaveAsMobileDeployer pDeployAppBundle, pAppBundle, pAppName, pAppId, pAppExecutables
821839
create folder pDeployAppBundle
822840
create folder pDeployAppBundle & slash & "Contents"

0 commit comments

Comments
 (0)