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