@@ -696,6 +696,44 @@ command toolsBuilderMakeAppBundle pVersion, pEdition, pPlatform
696696 end if
697697 end repeat
698698 end repeat
699+
700+ -- Sign any extension code resources
701+ local tExtensions
702+ put folders (tAppBundle & "/Contents/Tools/Extensions" ) into tExtensions
703+ repeat for each line tExtension in tExtensions
704+ local tCodeFolders
705+ put folders (tAppBundle & "/Contents/Tools/Extensions/" & tExtension & "/code" ) into tCodeFolders
706+ filter tCodeFolders with "*iphonesimulator*"
707+ if tCodeFolders is empty then next repeat
708+
709+
710+ repeat for each line tCodeFolder in tCodeFolders
711+ local tDylibs
712+ filter files (tAppBundle & "/Contents/Tools/Extensions/" & tExtension & "/code/" & tCodeFolder ) \
713+ with "*.dylib" into tDylibs
714+ if tDylibs is empty then next repeat
715+
716+ repeat for each line tFile in tDylibs
717+ -- Ignore files that aren't dylibs
718+ local tFullPath
719+ put tAppBundle & "/Contents/Tools/Extensions/" & tExtension & "/code/" & tCodeFolder & "/" & tFile into tFullPath
720+ get shell ("file" && escapeArg(tFullPath ))
721+ if "Mach-O" is not among the words of it then next repeat
722+
723+ clearExtendedAttributes escapeArg(tFullPath )
724+
725+ -- Sign the extension
726+ -- The "--force" parameter strips the existing signature (which was
727+ -- made using a not-valid-for-distribution profile)
728+ builderLog "message" , "Signing iOS extension" && "'" & tFullPath & "'"
729+ get shell ("/usr/bin/codesign --sign" && word 2 of tSigningId && "--force --verbose=2" && escapeArg(tFullPath ))
730+ if the result is not zero then
731+ builderLog "error" , "Could not sign iOS extension:" && it
732+ throw "failure"
733+ end if
734+ end repeat
735+ end repeat
736+ end repeat
699737
700738 clearExtendedAttributes escapeArg(tAppBundle )
701739
0 commit comments