@@ -87,7 +87,6 @@ List<String> binariesWithoutEntitlements(String flutterRoot) {
87
87
return < String > [
88
88
'artifacts/engine/darwin-x64-profile/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS' ,
89
89
'artifacts/engine/darwin-x64-release/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS' ,
90
- 'artifacts/engine/darwin-x64-release/FlutterMacOS.xcframework/macos-arm64_x86_64/dSYMs/FlutterMacOS.framework.dSYM/Contents/Resources/DWARF/FlutterMacOS' ,
91
90
'artifacts/engine/darwin-x64/FlutterMacOS.xcframework/macos-arm64_x86_64/FlutterMacOS.framework/Versions/A/FlutterMacOS' ,
92
91
'artifacts/engine/darwin-x64/font-subset' ,
93
92
'artifacts/engine/darwin-x64/impellerc' ,
@@ -98,10 +97,8 @@ List<String> binariesWithoutEntitlements(String flutterRoot) {
98
97
'artifacts/engine/ios-profile/extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter' ,
99
98
'artifacts/engine/ios-profile/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' ,
100
99
'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter' ,
101
- 'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
102
100
'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' ,
103
101
'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter' ,
104
- 'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
105
102
'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' ,
106
103
'artifacts/engine/ios/Flutter.xcframework/ios-arm64/Flutter.framework/Flutter' ,
107
104
'artifacts/engine/ios/Flutter.xcframework/ios-arm64_x86_64-simulator/Flutter.framework/Flutter' ,
@@ -112,6 +109,21 @@ List<String> binariesWithoutEntitlements(String flutterRoot) {
112
109
.map ((String relativePath) => path.join (flutterRoot, 'bin' , 'cache' , relativePath)).toList ();
113
110
}
114
111
112
+ /// Binaries that are not expected to be codesigned.
113
+ ///
114
+ /// This list should be kept in sync with the actual contents of Flutter's cache.
115
+ List <String > unsignedBinaries (String flutterRoot) {
116
+ return < String > [
117
+ 'artifacts/engine/darwin-x64-release/FlutterMacOS.xcframework/macos-arm64_x86_64/dSYMs/FlutterMacOS.framework.dSYM/Contents/Resources/DWARF/FlutterMacOS' ,
118
+ 'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
119
+ 'artifacts/engine/ios-release/Flutter.xcframework/ios-arm64_x86_64-simulator/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
120
+ 'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
121
+ 'artifacts/engine/ios-release/extension_safe/Flutter.xcframework/ios-arm64_x86_64-simulator/dSYMs/Flutter.framework.dSYM/Contents/Resources/DWARF/Flutter' ,
122
+ ]
123
+ .map ((String relativePath) => path.join (flutterRoot, 'bin' , 'cache' , relativePath)).toList ();
124
+ }
125
+
126
+
115
127
/// xcframeworks that are expected to be codesigned.
116
128
///
117
129
/// This list should be kept in sync with the actual contents of Flutter's
@@ -136,8 +148,8 @@ List<String> signedXcframeworks(String flutterRoot) {
136
148
/// This function ignores code signatures and entitlements, and is intended to
137
149
/// be run on every commit. It should throw if either new binaries are added
138
150
/// to the cache or expected binaries removed. In either case, this class'
139
- /// [binariesWithEntitlements] or [binariesWithoutEntitlements] lists should
140
- /// be updated accordingly.
151
+ /// [binariesWithEntitlements] , [binariesWithoutEntitlements] , and
152
+ /// [unsignedBinaries] lists should be updated accordingly.
141
153
Future <void > verifyExist (
142
154
String flutterRoot,
143
155
{@visibleForTesting ProcessManager processManager = const LocalProcessManager ()
@@ -146,16 +158,18 @@ Future<void> verifyExist(
146
158
path.join (flutterRoot, 'bin' , 'cache' ),
147
159
processManager: processManager,
148
160
);
149
- final List <String > allExpectedFiles = binariesWithEntitlements (flutterRoot) + binariesWithoutEntitlements (flutterRoot);
161
+ final List <String > expectedSigned = binariesWithEntitlements (flutterRoot) + binariesWithoutEntitlements (flutterRoot);
162
+ final List <String > expectedUnsigned = unsignedBinaries (flutterRoot);
150
163
final Set <String > foundFiles = < String > {
151
164
for (final String binaryPath in binaryPaths)
152
- if (allExpectedFiles.contains (binaryPath)) binaryPath
165
+ if (expectedSigned.contains (binaryPath)) binaryPath
166
+ else if (expectedUnsigned.contains (binaryPath)) binaryPath
153
167
else throw Exception ('Found unexpected binary in cache: $binaryPath ' ),
154
168
};
155
169
156
- if (foundFiles.length < allExpectedFiles .length) {
170
+ if (foundFiles.length < expectedSigned .length) {
157
171
final List <String > unfoundFiles = < String > [
158
- for (final String file in allExpectedFiles ) if (! foundFiles.contains (file)) file,
172
+ for (final String file in expectedSigned ) if (! foundFiles.contains (file)) file,
159
173
];
160
174
print (
161
175
'Expected binaries not found in cache:\n\n ${unfoundFiles .join ('\n ' )}\n\n '
@@ -195,6 +209,11 @@ Future<void> verifySignatures(
195
209
if (signedXcframeworks (flutterRoot).contains (pathToCheck)) {
196
210
verifySignature = true ;
197
211
}
212
+ if (unsignedBinaries (flutterRoot).contains (pathToCheck)) {
213
+ // Binary is expected to be unsigned. No need to check signature, entitlements.
214
+ continue ;
215
+ }
216
+
198
217
if (! verifySignature && ! verifyEntitlements) {
199
218
unexpectedFiles.add (pathToCheck);
200
219
print ('Unexpected binary or xcframework $pathToCheck found in cache!' );
0 commit comments