diff --git a/packages/flutter_tools/lib/src/build_system/targets/ios.dart b/packages/flutter_tools/lib/src/build_system/targets/ios.dart index 9ca6e543a206de25898d5c92929d207bd547a977..56d73f7cfa42cded67692bcbf6e817b363bd047b 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/ios.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/ios.dart @@ -314,6 +314,7 @@ abstract class UnpackIOS extends Target { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', basePath, environment.outputDir.path, ]); diff --git a/packages/flutter_tools/lib/src/build_system/targets/macos.dart b/packages/flutter_tools/lib/src/build_system/targets/macos.dart index 9996664a0a1e53e702c5710d6590906ed12d75bf..e9f48cc88e441e4424d131f5aa8010a8354ecc3f 100644 --- a/packages/flutter_tools/lib/src/build_system/targets/macos.dart +++ b/packages/flutter_tools/lib/src/build_system/targets/macos.dart @@ -60,6 +60,7 @@ abstract class UnpackMacOS extends Target { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', basePath, environment.outputDir.path, ]); diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart index 33bf54e29af6763a928fe2021746e8b73deff6d3..a21fb095af2e4bbd7d5f62e47bebb6de23be5f3f 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/ios_test.dart @@ -541,6 +541,7 @@ void main() { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', 'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.physical', outputDir.path, ]); @@ -597,6 +598,7 @@ void main() { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', 'Artifact.flutterFramework.TargetPlatform.ios.debug.EnvironmentType.simulator', outputDir.path, ], diff --git a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart index 680d826b4967fb42c58bfe5fd1f8c03b4da0e138..21898bd3dcf88b23c9104d877fcb19daa888f809 100644 --- a/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart +++ b/packages/flutter_tools/test/general.shard/build_system/targets/macos_test.dart @@ -73,6 +73,7 @@ void main() { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', 'Artifact.flutterMacOSFramework.debug', environment.outputDir.path, ], @@ -133,6 +134,7 @@ void main() { '--delete', '--filter', '- .DS_Store/', + '--chmod=Du=rwx,Dgo=rx,Fu=rw,Fgo=r', // source 'Artifact.flutterMacOSFramework.debug', // destination diff --git a/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart b/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart index 2e0587524e68f5be895428ac48d2e2b4af84b795..0f7befcac57fd424ebb756dfaeec6d38f40710ae 100644 --- a/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart +++ b/packages/flutter_tools/test/host_cross_arch.shard/ios_content_validation_test.dart @@ -422,10 +422,16 @@ void main() { .whereType<Directory>() .singleWhere((Directory directory) => fileSystem.path.extension(directory.path) == '.app'); + final Directory flutterFrameworkDir = fileSystem.directory( + fileSystem.path.join( + appBundle.path, + 'Frameworks', + 'Flutter.framework', + ), + ); + final String flutterFramework = fileSystem.path.join( - appBundle.path, - 'Frameworks', - 'Flutter.framework', + flutterFrameworkDir.path, 'Flutter', ); @@ -456,6 +462,11 @@ void main() { ], ); expect(appCodesign, const ProcessResultMatcher()); + + // Check read/write permissions are being correctly set + final String rawStatString = flutterFrameworkDir.statSync().modeString(); + final String statString = rawStatString.substring(rawStatString.length - 9); + expect(statString, 'rwxr-xr-x'); }); }, skip: !platform.isMacOS, // [intended] only makes sense for macos platform. timeout: const Timeout(Duration(minutes: 10)) diff --git a/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart b/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart index 5568ad2f9a0b801c04029f97b60f375c52c13df6..2ff219c76419c2fefd2cc732c44ec7cfc0b0517b 100644 --- a/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart +++ b/packages/flutter_tools/test/host_cross_arch.shard/macos_content_validation_test.dart @@ -164,6 +164,11 @@ void main() { ), ); + // Check read/write permissions are being correctly set + final String rawStatString = outputFlutterFramework.statSync().modeString(); + final String statString = rawStatString.substring(rawStatString.length - 9); + expect(statString, 'rwxr-xr-x'); + // Check complicated macOS framework symlink structure. final Link current = outputFlutterFramework.childDirectory('Versions').childLink('Current');