Skyost / SimpleSecureStorage

A simple and secure storage system for Flutter.
https://pub.dev/packages/simple_secure_storage
Other
1 stars 1 forks source link

Can't read or edit values on macOS with hardened runtime enabled #3

Open jdk-21 opened 6 months ago

jdk-21 commented 6 months ago

Describe the bug I tried using the example and it works on Mac in debug mode. But when the app is signed and notarized the example isn't working anymore.

To Reproduce Steps to reproduce the behavior:

  1. Clone the example
  2. Enable Hardened Runtime
  3. Build, Sign and Notarize the app

Expected behavior I should be able to read/write values.

Desktop:

Additional context I added the Entitlements to both Debug and Release. They look like this:

<key>keychain-access-groups</key>
    <array/>
Skyost commented 6 months ago

Did you follow the steps here ?

jdk-21 commented 6 months ago

Yes, I did. I didn't enable any additional entitlements as they don't seem to be relevant for this package. But maybe that's not the case.

Skyost commented 6 months ago

Well, you can try and tell me if it works 🙂

jdk-21 commented 6 months ago

I tried it and added every entitlement possible. But it still doesn't work

Skyost commented 6 months ago

Seems that the hardening is only done during the signing process of your app. Can you please try to configure it like if you want to release it (with a dev team etc.), then to run flutter build macos and to run the produced build ?

Side question : does it work with the other packages (flutter_secure_storage and biometric_storage) ?

jdk-21 commented 6 months ago

Running the flutter app in release mode with a dev team works without issue. But actually releasing it with signing and notarizing doesn't work. flutter_secure_storage has the same problems. I didn't test biometric_storage yet. I also tried to find documentation on how Keychain is affected by the Hardened Runtime, but I couldn't find any documentation by Apple on this topic.