flutter/packages/flutter_tools/lib/src
Chris Bracken 68f375fe38
[macOS] support secure restorable state by default (#151605)
By default, Flutter apps only do default AppKit app serialisation of
Window location etc. and by default, state serialisation in AppKit apps
is compatible with `NSSecureCoding`. AppKit apps generated since Xcode
13.2 include this method in the app delegate generated by the default
app template.

Background
==========

This method was added to opt into having [de]serialization require a
coder implementing the `NSSecureCoding` protocol. Apple wasn't able to
force this across the board, because `NSSecureCoding` limits certain
behaviours during deserialisation, which some third-party apps have have
previously relied on.

Specific background on the sorts of vulnerabilities that
`NSSecureCoding` was designed to prevent are described in the
`NSSecureCoding` documentation:

https://developer.apple.com/documentation/foundation/nssecurecoding?language=objc

A demonstration of a root privilege escalation and SIP bypass
vulnerability is described in the following blog post:
https://sector7.computest.nl/post/2022-08-process-injection-breaking-all-macos-security-layers-with-a-single-vulnerability/

Fixes: https://github.com/flutter/flutter/issues/150062

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] I followed the [breaking change policy] and added [Data Driven
Fixes] where supported.
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview
[Tree Hygiene]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md
[test-exempt]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes
[Discord]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md
[Data Driven Fixes]:
https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md
2024-07-12 11:08:26 -07:00
..
android Reland "Upgrade template Gradle, App AGP, Module AGP, and Kotlin versions, and tests"... but no longer upgrade module AGP version (#151433) 2024-07-10 21:37:26 +00:00
base [tool] Remove some usages of deprecated usage package (#151359) 2024-07-09 18:17:21 +00:00
build_system Have flutter.js load local canvaskit instead of the CDN when appropriate (#150806) 2024-06-27 18:44:04 +00:00
commands [tool] Remove some usages of deprecated usage package (#151359) 2024-07-09 18:17:21 +00:00
custom_devices Control flow collections: flutter_tools/ (#147450) 2024-05-02 22:19:18 +00:00
dart Use `Isolate.packageConfigSync! to locate the packageconfig of flutter tools (#150340) 2024-06-26 09:49:44 +02:00
debug_adapters chore: fix typos and link broken (#150402) 2024-07-03 17:10:19 +00:00
drive Have flutter.js load local canvaskit instead of the CDN when appropriate (#150806) 2024-06-27 18:44:04 +00:00
fuchsia Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
intellij Remove duplicate global declaration of UserMessages (#142281) 2024-01-26 21:41:16 +00:00
ios [tool] Remove some usages of deprecated usage package (#151359) 2024-07-09 18:17:21 +00:00
isolated [native_assets] Stop running link hooks in JIT mode (#151534) 2024-07-12 06:44:23 +00:00
linux Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
localizations update generated localized message files in the stocks test app (#148741) 2024-06-03 18:08:19 +00:00
macos [macOS] support secure restorable state by default (#151605) 2024-07-12 11:08:26 -07:00
migrations Fixed few typos (#147087) 2024-04-22 16:49:19 +00:00
proxied_devices Avoid forwarding the data after socket is disconnected. (#146665) 2024-04-12 21:45:32 +00:00
reporting Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
runner Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
test Write the package config location to the test bootstrap. (#150440) 2024-07-09 09:36:19 -07:00
tester Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
vscode Remove duplicate global declaration of UserMessages (#142281) 2024-01-26 21:41:16 +00:00
web Handle a SocketException thrown when sending the browser close command to Chrome (#151197) 2024-07-03 13:23:20 +00:00
windows Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
application_package.dart
artifacts.dart Update old wiki links (#149544) 2024-06-17 17:26:08 +00:00
asset.dart Add none language strings to code blocks. (#146154) 2024-04-02 16:42:25 -07:00
build_info.dart Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
bundle_builder.dart print traces when transforming an asset (#146374) 2024-04-22 16:37:24 +00:00
bundle.dart Remove the fast reassemble / single widget reload feature (#132255) 2023-08-10 21:48:06 +00:00
cache.dart Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
cmake_project.dart [Windows] Ensure window is shown (#127046) 2023-05-19 22:25:55 +00:00
cmake.dart Reduce usage of testUsingContext (#131078) 2023-07-24 17:22:25 +00:00
compile.dart [native_assets] Use kernel concatenation (#147158) 2024-04-25 11:22:17 +00:00
context_runner.dart [tool] Remove some usages of deprecated usage package (#151359) 2024-07-09 18:17:21 +00:00
convert.dart Make custom Utf8Decoder replacement not extend platform class. (#123211) 2023-03-22 07:53:56 -07:00
daemon.dart Turning if chains into shorter switch statements (#144977) 2024-03-13 17:16:17 +00:00
dart_pub_json_formatter.dart
desktop_device.dart Disable sandboxing for macOS apps and tests in CI (#149618) 2024-06-04 21:51:19 +00:00
devfs.dart add verbose logging to select hot reload/hot restart tests (#147673) 2024-05-02 04:03:32 +00:00
device_port_forwarder.dart
device_vm_service_discovery_for_attach.dart Support mdns when attaching to proxied devices. (#146021) 2024-04-09 20:00:21 +00:00
device.dart Have flutter.js load local canvaskit instead of the CDN when appropriate (#150806) 2024-06-27 18:44:04 +00:00
devtools_launcher.dart Add a --print-dtd flag to print the DTD address served by DevTools server (#144272) 2024-03-25 13:04:18 -07:00
doctor_validator.dart Implementing switch expressions in flutter_tools/ (#145632) 2024-03-29 22:31:19 +00:00
doctor.dart Control flow collections: flutter_tools/ (#147450) 2024-05-02 22:19:18 +00:00
emulator.dart [tools] Add column header for emulators information (#142853) 2024-02-14 12:49:24 +00:00
features.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
flutter_application_package.dart Enable native compilation for windows-arm64 (#141930) 2024-01-26 00:08:20 +00:00
flutter_cache.dart Place flutter_gpu in the package cache. (#149299) 2024-06-03 22:46:02 +00:00
flutter_device_manager.dart Flutter preview device (#135639) 2023-10-18 00:27:54 +00:00
flutter_features.dart Add Swift Package Manager as new opt-in feature for iOS and macOS (#146256) 2024-04-18 21:12:36 +00:00
flutter_manifest.dart add default-flavor field to flutter pubspec, which will be used as the flavor in flutter build/run if --flavor is not provided (#147968) 2024-05-22 05:11:24 +00:00
flutter_plugins.dart feat: Support overriding native endorsed plugins (#137040) 2024-07-11 18:54:01 +00:00
flutter_project_metadata.dart switch statement cleanup (#148382) 2024-05-16 17:16:06 -07:00
globals.dart Disable single character mode in the terminal when exiting flutter_tools (#146534) 2024-04-10 23:54:42 +00:00
http_host_validator.dart Switch to more reliable flutter.dev link destinations in the tool (#150587) 2024-06-26 23:30:39 +00:00
license_collector.dart [flutter_tools] refactor license collector (#128748) 2023-06-15 20:25:19 +00:00
mdns_discovery.dart Enable native compilation for windows-arm64 (#141930) 2024-01-26 00:08:20 +00:00
native_assets.dart Reland "Move native assets to isolated/ directory" (#143055) 2024-02-08 17:49:48 +00:00
persistent_tool_state.dart Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279) 2024-03-04 20:20:19 +00:00
platform_plugins.dart Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279) 2024-03-04 20:20:19 +00:00
plugins.dart feat: Support overriding native endorsed plugins (#137040) 2024-07-11 18:54:01 +00:00
pre_run_validator.dart Add missing parameter to TableBorder.symmetric, and improve class constructors (#144279) 2024-03-04 20:20:19 +00:00
preview_device.dart [flutter_tools] Ensure flutter daemon clients can detect preview device (#140112) 2023-12-21 19:01:16 +00:00
project_validator_result.dart
project_validator.dart Control flow collections: flutter_tools/ (#147450) 2024-05-02 22:19:18 +00:00
project.dart Add support for type-safe plugin apply (#150958) 2024-06-28 17:24:59 +00:00
protocol_discovery.dart Remove an unnecessary assert (#129796) 2023-06-30 18:07:54 +00:00
proxy_validator.dart Control flow collections: flutter_tools/ (#147450) 2024-05-02 22:19:18 +00:00
resident_devtools_handler.dart Add a --print-dtd flag to print the DTD address served by DevTools server (#144272) 2024-03-25 13:04:18 -07:00
resident_runner.dart Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00
run_cold.dart Update Android minSdkVersion to 21 (#142267) 2024-01-29 09:49:09 -08:00
run_hot.dart add print traces to reload isolate resume logic (#147997) 2024-05-08 19:57:57 +00:00
sksl_writer.dart Enable native compilation for windows-arm64 (#141930) 2024-01-26 00:08:20 +00:00
template.dart Fix description in index.html / manifest.json getting double quoted (#131842) 2023-08-18 02:58:20 +00:00
tracing.dart Reland "Remove references to Observatory (#118577)" (#121606) 2023-02-28 11:57:04 -05:00
update_packages_pins.dart Unpin camera_android and remove its only usage (#150017) 2024-06-10 22:13:00 +00:00
version.dart Implementing switch expressions in flutter_tools/ (#145632) 2024-03-29 22:31:19 +00:00
vmservice.dart [tool] remove some temporary printTrace calls (#151074) 2024-07-02 00:53:19 +00:00
web_template.dart Have flutter.js load local canvaskit instead of the CDN when appropriate (#150806) 2024-06-27 18:44:04 +00:00
xcode_project.dart Refactor BuildInfo to always require packageConfigPath (#150559) 2024-07-02 11:19:31 +02:00