macos_grants 0.1.1
macos_grants: ^0.1.1 copied to clipboard
macOS privacy grants from Flutter: read Full Disk Access, Accessibility and Screen Recording, and find out whether this copy of your app can hold a grant at all.
0.1.1 #
- Builds with Swift Package Manager.
Package.swiftdepended on a package calledFlutterMacOS, which Flutter never generates, so dependency resolution failed before any Swift was compiled — in every app using Swift Package Manager, Flutter's default. It now depends onFlutterFramework, like Flutter's own plugin template. - Compiles on macOS 10.14, as declared.
screenRecording()calledCGPreflightScreenCaptureAccess, a macOS 10.15 API, with no availability check, so an app targeting 10.14 could not compile the plugin. On 10.14 it now answersgranted: Screen Recording was not a grant before 10.15, and every app could capture the screen. - Off macOS includes the web.
isMacOSreadPlatform.isMacOS, which throws on the web instead of answering false, so every call threw there rather than answeringunknown. - The example's entitlements, which turn the sandbox off so the Full Disk
Access probes can run, now ship with it. They had been ignored along with
the generated
macos/folder, so a fresh copy of the example ran sandboxed and answeredunknown. - Tests no longer ship in the package, and the screenshot's description fits pub.dev's 160-character limit, which it overran and was marked down for.
0.1.0 #
First release.
MacGrants.signing()— whether this bundle still validates (nested code included), who signed it, and whether a grant given to it survives an update. An ad-hoc signature makes the code's hash its identity, so every build is a new app to macOS.MacGrants.fullDiskAccess()— read by opening the paths the grant protects, since macOS offers no API for it. Every probe is tried; a path that exists and refuses means denied, nothing found at all means unknown.MacGrants.accessibility()andMacGrants.screenRecording().MacGrants.openSettings(pane)for the six Privacy panes, because none of these grants can be requested from code.GrantStatus.explain(signing)— the sentence to show a user, including the one case where "relaunch" never works and "reinstall" is the answer.
Every failure answers unknown, and a signature check that cannot run answers
valid: a check that did not happen must not accuse a working app.
