Keep Flutter.framework binaries writable so they can be code signed#40174
Keep Flutter.framework binaries writable so they can be code signed#40174jmagman merged 1 commit intoflutter:masterfrom
Conversation
christopherfujino
left a comment
There was a problem hiding this comment.
This SEEMS foolproof...LGTM
| RunCommand cp -r -- "${flutter_framework}" "${derived_dir}/engine" | ||
| RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec chmod a-w "{}" \; | ||
| # Make headers, plists, and modulemap files read-only to discourage editing. | ||
| RunCommand find "${derived_dir}/engine/Flutter.framework" -type f \( -name '*.h' -o -name '*.modulemap' -o -name '*.plist' \) -exec chmod a-w "{}" \; |
There was a problem hiding this comment.
To inline this, the last attempt at #39539 was:
RunCommand find "${derived_dir}/engine/Flutter.framework" -type f -exec grep -Il '.' {} \; | xargs chmod a-w
https://github.com/flutter/flutter/pull/39539/files#diff-0d00f38df3883291f23cee8074ac075dR146
I really don't know how this caused devicelab issues removing the repo, but this change is closer to what was there before (no grep -I), just adds checks the extensions.
Means that the stable version under the existing app mixture is unable to use? My god! |
You can see the caveats here: https://github.com/flutter/flutter/wiki/Add-Flutter-to-existing-apps#intro
|
but run $ flutter build ios
Building com.mtd.iosFlutterModule for device (ios-release)...
Automatically signing iOS for device deployment using specified development team in Xcode project: BB535CKPXQ
Running Xcode build...
Xcode build done. 11.2s
Failed to build iOS app
Error output from Xcode build:
↳
** BUILD FAILED **
Xcode's output:
↳
/Users/oheroj/Desktop/TN/flutter_module/build/ios/Release-iphoneos/Runner.app/Frameworks/Flutter.framework: replacing existing
signature
/Users/oheroj/Desktop/TN/flutter_module/build/ios/Release-iphoneos/Runner.app/Frameworks/Flutter.framework: Permission denied
Command CodeSign failed with a nonzero exit code
note: Using new build systemnote: Planning buildnote: Constructing build description |
|
@jmagman yep, our team were working with this 'experimental feature' in the stable branch and bring it to our online app on previous stable version (v1.7.8). 😂And we will apply this PR to our inner fork version. thx. |
hello,If 1.9 stable continue to have a hotfix, the inner fork verion merge this hotfix branch? |
Description
Flutter.framework files were made read-only to "Provide a strong hint to developers that editing Flutter framework headers isn't supported" (cb2b89c) However this is making the Flutter binary readonly, which is being copied into the final embedded Frameworks directories, then can't be codesigned.
Only make headers, modulemaps, and plists readonly.
Related Issues
Fixes #39507.
Another attempt at #39539.
Tests
add2app gets past codesigning for me, but it's still flaky so I didn't turn it back on. See #40173.
Checklist
///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change