Repository: flutter/flutter
File: packages/flutter_tools/lib/src/ios/mac.dart (Dart)

Code before:
    logger: logger,
  );
  final bool headersChanged = !fingerprinter.doesFingerprintMatch();
  if (headersChanged) {
    fingerprinter.writeFingerprint();
  }
  return headersChanged;
}

/// Extended attributes can cause code signing errors. Remove them.
///
/// Attributes like `com.apple.FinderInfo` and `com.apple.provenance` are added
/// by Finder, cloud storage services (OneDrive, iCloud, Dropbox), or when files
/// are downloaded. These must be removed before code signing.
///
/// See: https://developer.apple.com/library/archive/qa/qa1940/_index.html
/// See: https://github.com/flutter/flutter/issues/180351
Future<void> removeExtendedAttributes(
  FileSystemEntity projectDirectory,
  ProcessUtils processUtils,
  Logger logger,
) async {
  // Remove specific extended attributes that cause code signing failures.
  // We remove com.apple.FinderInfo and com.apple.provenance, but preserve
  // com.apple.xcode.CreatedByBuildSystem which Xcode uses to manage build directories.
  final attributesToRemove = <String>['com.apple.FinderInfo', 'com.apple.provenance'];

  for (final attribute in attributesToRemove) {
    final bool success = await processUtils.exitsHappy(<String>[
      'xattr',
      '-r',
      '-d',
      attribute,
      projectDirectory.path,
    ]);
    // Ignore all errors, for example if directory is missing or attribute doesn't exist.
    if (!success) {
      logger.printTrace('Failed to remove $attribute from ${projectDirectory.path}');
    }
  }
}

Future<RunResult?> _runBuildWithRetries(
  List<String> buildCommands,
  BuildableIOSApp app,
  Directory resultBundleDirectory,
) async {
  var buildRetryDelaySeconds = 1;
  var remainingTries = 8;

  RunResult? buildResult;

Review comment (suggestion):
Drive-by comment: this can probably be a Set

```suggestion
 const attributesToRemove = <String>{'com.apple.FinderInfo', 'com.apple.provenance'};
```

Code after:
    'framework_public_headers.fingerprint',
  );
  final fingerprinter = Fingerprinter(
    fingerprintPath: fingerprintPath,
    paths: files,
    fileSystem: fileSystem,
    logger: logger,
  );
  final bool headersChanged = !fingerprinter.doesFingerprintMatch();
  if (headersChanged) {
    fingerprinter.writeFingerprint();
  }
  return headersChanged;
}

/// Extended attributes can cause code signing errors. Remove them.
///
/// Attributes like `com.apple.FinderInfo` and `com.apple.provenance` are added
/// by Finder, cloud storage services (OneDrive, iCloud, Dropbox), or when files
/// are downloaded. These must be removed before code signing.
///
/// See: https://developer.apple.com/library/archive/qa/qa1940/_index.html
/// See: https://github.com/flutter/flutter/issues/180351
Future<void> removeExtendedAttributes(
  FileSystemEntity projectDirectory,
  ProcessUtils processUtils,
  Logger logger,
) async {
  // Remove specific extended attributes that cause code signing failures.
  // We remove com.apple.FinderInfo and com.apple.provenance, but preserve
  // com.apple.xcode.CreatedByBuildSystem which Xcode uses to manage build directories.
  const attributesToRemove = <String>{'com.apple.FinderInfo', 'com.apple.provenance'};

  for (final attribute in attributesToRemove) {
    final bool success = await processUtils.exitsHappy(<String>[
      'xattr',
      '-r',
      '-d',
      attribute,
      projectDirectory.path,
    ]);
    // Ignore all errors, for example if directory is missing or attribute doesn't exist.
    if (!success) {
      logger.printTrace('Failed to remove $attribute from ${projectDirectory.path}');
    }
  }
}

Future<RunResult?> _runBuildWithRetries(
  List<String> buildCommands,
  BuildableIOSApp app,