├── .github ├── CODEOWNERS ├── dependabot.yml ├── funding.yml └── workflows │ ├── code-coverage.yml │ ├── code-integration.yml │ ├── code-quality.yml │ └── stale-issues.yaml ├── .gitignore ├── LICENSE ├── README.md ├── archived_packages ├── flutter_secure_storage_macos │ ├── .metadata │ ├── CHANGELOG.md │ ├── LICENSE │ ├── README.md │ ├── macos │ │ ├── .gitignore │ │ ├── Assets │ │ │ └── .gitkeep │ │ ├── Classes │ │ │ ├── FlutterSecureStorage.swift │ │ │ └── FlutterSecureStoragePlugin.swift │ │ ├── Resources │ │ │ └── PrivacyInfo.xcprivacy │ │ └── flutter_secure_storage_macos.podspec │ └── pubspec.yaml └── ios │ ├── .gitignore │ ├── Assets │ └── .gitkeep │ ├── Classes │ ├── FlutterSecureStorage.swift │ ├── FlutterSecureStoragePlugin.h │ ├── FlutterSecureStoragePlugin.m │ └── SwiftFlutterSecureStoragePlugin.swift │ ├── Resources │ └── PrivacyInfo.xcprivacy │ └── flutter_secure_storage.podspec ├── flutter_secure_storage ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ ├── settings.gradle │ └── src │ │ └── main │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── it_nomads │ │ └── fluttersecurestorage │ │ ├── FlutterSecureStorage.java │ │ ├── FlutterSecureStoragePlugin.java │ │ ├── ciphers │ │ ├── KeyCipher.java │ │ ├── RSACipher18Implementation.java │ │ ├── RSACipherOAEPImplementation.java │ │ ├── StorageCipher.java │ │ ├── StorageCipher18Implementation.java │ │ ├── StorageCipherFactory.java │ │ └── StorageCipherGCMImplementation.java │ │ └── crypto │ │ ├── EncryptedSharedPreferences.java │ │ ├── MasterKey.java │ │ └── MasterKeys.java ├── example │ ├── .gitignore │ ├── .metadata │ ├── README.md │ ├── analysis_options.yaml │ ├── android │ │ ├── .gitignore │ │ ├── app │ │ │ ├── build.gradle.kts │ │ │ └── src │ │ │ │ └── main │ │ │ │ ├── AndroidManifest.xml │ │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── it_nomads │ │ │ │ │ └── fluttersecurestorageexample │ │ │ │ │ └── MainActivity.kt │ │ │ │ └── res │ │ │ │ ├── drawable-v21 │ │ │ │ └── launch_background.xml │ │ │ │ ├── drawable │ │ │ │ └── launch_background.xml │ │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values-night │ │ │ │ └── styles.xml │ │ │ │ └── values │ │ │ │ └── styles.xml │ │ ├── build.gradle.kts │ │ ├── gradle.properties │ │ ├── gradle │ │ │ └── wrapper │ │ │ │ └── gradle-wrapper.properties │ │ └── settings.gradle.kts │ ├── integration_test │ │ └── app_test.dart │ ├── ios │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── AppFrameworkInfo.plist │ │ │ ├── Debug.xcconfig │ │ │ └── Release.xcconfig │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ ├── contents.xcworkspacedata │ │ │ │ └── xcshareddata │ │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ │ └── WorkspaceSettings.xcsettings │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── WorkspaceSettings.xcsettings │ │ └── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-1024x1024@1x.png │ │ │ │ ├── Icon-App-20x20@1x.png │ │ │ │ ├── Icon-App-20x20@2x.png │ │ │ │ ├── Icon-App-20x20@3x.png │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-40x40@3x.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x.png │ │ │ │ └── Icon-App-83.5x83.5@2x.png │ │ │ └── LaunchImage.imageset │ │ │ │ ├── Contents.json │ │ │ │ ├── LaunchImage.png │ │ │ │ ├── LaunchImage@2x.png │ │ │ │ ├── LaunchImage@3x.png │ │ │ │ └── README.md │ │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ │ ├── Info.plist │ │ │ └── Runner-Bridging-Header.h │ ├── lib │ │ └── main.dart │ ├── linux │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ │ ├── CMakeLists.txt │ │ │ ├── generated_plugin_registrant.cc │ │ │ ├── generated_plugin_registrant.h │ │ │ └── generated_plugins.cmake │ │ ├── main.cc │ │ ├── my_application.cc │ │ └── my_application.h │ ├── macos │ │ ├── .gitignore │ │ ├── Flutter │ │ │ ├── Flutter-Debug.xcconfig │ │ │ ├── Flutter-Release.xcconfig │ │ │ └── GeneratedPluginRegistrant.swift │ │ ├── Podfile │ │ ├── Podfile.lock │ │ ├── Runner.xcodeproj │ │ │ ├── project.pbxproj │ │ │ ├── project.xcworkspace │ │ │ │ └── xcshareddata │ │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcshareddata │ │ │ │ └── xcschemes │ │ │ │ └── Runner.xcscheme │ │ ├── Runner.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ ├── Runner │ │ │ ├── AppDelegate.swift │ │ │ ├── Assets.xcassets │ │ │ │ └── AppIcon.appiconset │ │ │ │ │ ├── Contents.json │ │ │ │ │ ├── app_icon_1024.png │ │ │ │ │ ├── app_icon_128.png │ │ │ │ │ ├── app_icon_16.png │ │ │ │ │ ├── app_icon_256.png │ │ │ │ │ ├── app_icon_32.png │ │ │ │ │ ├── app_icon_512.png │ │ │ │ │ └── app_icon_64.png │ │ │ ├── Base.lproj │ │ │ │ └── MainMenu.xib │ │ │ ├── Configs │ │ │ │ ├── AppInfo.xcconfig │ │ │ │ ├── Debug.xcconfig │ │ │ │ ├── Release.xcconfig │ │ │ │ └── Warnings.xcconfig │ │ │ ├── DebugProfile.entitlements │ │ │ ├── Info.plist │ │ │ ├── MainFlutterWindow.swift │ │ │ └── Release.entitlements │ │ └── RunnerTests │ │ │ └── RunnerTests.swift │ ├── pubspec.yaml │ ├── web │ │ ├── favicon.png │ │ ├── icons │ │ │ ├── Icon-192.png │ │ │ ├── Icon-512.png │ │ │ ├── Icon-maskable-192.png │ │ │ └── Icon-maskable-512.png │ │ ├── index.html │ │ └── manifest.json │ └── windows │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ │ └── runner │ │ ├── CMakeLists.txt │ │ ├── Runner.rc │ │ ├── flutter_window.cpp │ │ ├── flutter_window.h │ │ ├── main.cpp │ │ ├── resource.h │ │ ├── resources │ │ └── app_icon.ico │ │ ├── run_loop.cpp │ │ ├── run_loop.h │ │ ├── runner.exe.manifest │ │ ├── utils.cpp │ │ ├── utils.h │ │ ├── win32_window.cpp │ │ └── win32_window.h ├── lib │ ├── flutter_secure_storage.dart │ ├── options │ │ ├── android_options.dart │ │ ├── apple_options.dart │ │ ├── ios_options.dart │ │ ├── linux_options.dart │ │ ├── macos_options.dart │ │ ├── web_options.dart │ │ └── windows_options.dart │ └── test │ │ └── test_flutter_secure_storage_platform.dart ├── pubspec.yaml └── test │ └── flutter_secure_storage_test.dart ├── flutter_secure_storage_darwin ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── darwin │ ├── .gitignore │ ├── flutter_secure_storage_darwin.podspec │ └── flutter_secure_storage_darwin │ │ ├── Package.swift │ │ └── Sources │ │ └── flutter_secure_storage_darwin │ │ ├── Assets │ │ └── .gitkeep │ │ ├── FlutterSecureStorage.swift │ │ ├── FlutterSecureStorageDarwinPlugin.swift │ │ └── Resources │ │ └── PrivacyInfo.xcprivacy └── pubspec.yaml ├── flutter_secure_storage_linux ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── linux │ ├── CMakeLists.txt │ ├── flutter_secure_storage_linux_plugin.cc │ └── include │ │ ├── FHashTable.hpp │ │ ├── Secret.hpp │ │ ├── flutter_secure_storage_linux │ │ └── flutter_secure_storage_linux_plugin.h │ │ └── json.hpp └── pubspec.yaml ├── flutter_secure_storage_platform_interface ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── lib │ ├── flutter_secure_storage_platform_interface.dart │ └── src │ │ ├── method_channel_flutter_secure_storage.dart │ │ └── options.dart ├── pubspec.yaml └── test │ ├── flutter_secure_storage_platform_interface_mock.dart │ └── flutter_secure_storage_platform_interface_test.dart ├── flutter_secure_storage_web ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── lib │ └── flutter_secure_storage_web.dart └── pubspec.yaml ├── flutter_secure_storage_windows ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── LICENSE ├── README.md ├── analysis_options.yaml ├── example │ ├── .gitignore │ ├── README.md │ ├── analysis_options.yaml │ ├── integration_test │ │ └── app_test.dart │ ├── lib │ │ └── main.dart │ ├── pubspec.yaml │ └── windows │ │ ├── .gitignore │ │ ├── CMakeLists.txt │ │ ├── flutter │ │ ├── CMakeLists.txt │ │ ├── generated_plugin_registrant.cc │ │ ├── generated_plugin_registrant.h │ │ └── generated_plugins.cmake │ │ └── runner │ │ ├── CMakeLists.txt │ │ ├── Runner.rc │ │ ├── flutter_window.cpp │ │ ├── flutter_window.h │ │ ├── main.cpp │ │ ├── resource.h │ │ ├── resources │ │ └── app_icon.ico │ │ ├── runner.exe.manifest │ │ ├── utils.cpp │ │ ├── utils.h │ │ ├── win32_window.cpp │ │ └── win32_window.h ├── lib │ ├── flutter_secure_storage_windows.dart │ └── src │ │ ├── flutter_secure_storage_windows_ffi.dart │ │ └── flutter_secure_storage_windows_stub.dart ├── pubspec.yaml ├── test │ └── unit_test.dart └── windows │ ├── .gitignore │ ├── CMakeLists.txt │ ├── flutter_secure_storage_windows_plugin.cpp │ └── include │ └── flutter_secure_storage_windows │ └── flutter_secure_storage_windows_plugin.h ├── melos.yaml └── pubspec.yaml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # These owners will be the default owners for everything in 2 | # the repo. Unless a later match takes precedence, 3 | # review when someone opens a pull request. 4 | # For more on how to customize the CODEOWNERS file - https://help.github.com/en/articles/about-code-owners 5 | 6 | * @juliansteenbakker 7 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "github-actions" 4 | directory: "/" 5 | schedule: 6 | interval: "weekly" 7 | reviewers: 8 | - "juliansteenbakker" 9 | - package-ecosystem: gradle 10 | directory: "flutter_secure_storage/android" 11 | schedule: 12 | interval: "weekly" 13 | reviewers: 14 | - "juliansteenbakker" 15 | - package-ecosystem: gradle 16 | directory: "flutter_secure_storage/example/android" 17 | schedule: 18 | interval: "weekly" 19 | reviewers: 20 | - "juliansteenbakker" 21 | -------------------------------------------------------------------------------- /.github/funding.yml: -------------------------------------------------------------------------------- 1 | github: [juliansteenbakker] -------------------------------------------------------------------------------- /.github/workflows/code-coverage.yml: -------------------------------------------------------------------------------- 1 | name: 📊 Code Coverage 2 | 3 | on: [push, pull_request] 4 | 5 | env: 6 | PUB_ENVIRONMENT: bot.github 7 | 8 | jobs: 9 | test_with_coverage: 10 | name: 🧪 Unit Tests 11 | runs-on: ubuntu-latest 12 | timeout-minutes: 20 13 | defaults: 14 | run: 15 | working-directory: flutter_secure_storage 16 | 17 | steps: 18 | # Checkout the Repository 19 | - name: 📥 Checkout Repository 20 | uses: actions/checkout@v4 21 | 22 | # Setup Flutter SDK with Cache 23 | - name: ⚡ Set Up Flutter 24 | uses: subosito/flutter-action@v2 25 | with: 26 | channel: stable 27 | cache: true 28 | 29 | # Cache Pub Dependencies 30 | - name: 📦 Cache Pub Dependencies 31 | uses: actions/cache@v4 32 | with: 33 | path: | 34 | ~/.pub-cache 35 | flutter_secure_storage/.dart_tool 36 | key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} 37 | restore-keys: | 38 | ${{ runner.os }}-pub- 39 | 40 | # Install Project Dependencies 41 | - name: 🚀 Install Dependencies 42 | run: flutter pub get 43 | 44 | # Run Tests with Code Coverage 45 | - name: ✅ Run Unit Tests with Coverage 46 | run: flutter test --coverage 47 | 48 | # Upload Coverage Report as Artifact 49 | - name: 📊 Upload Coverage Report 50 | uses: actions/upload-artifact@v4 51 | with: 52 | name: coverage-report 53 | path: coverage/lcov.info 54 | 55 | # Upload Coverage to Codecov 56 | - name: ☁️ Upload Coverage to Codecov 57 | uses: codecov/codecov-action@v5 58 | with: 59 | token: ${{ secrets.CODECOV_TOKEN }} 60 | files: coverage/lcov.info 61 | flags: unittests 62 | name: codecov-flutter 63 | fail_ci_if_error: true 64 | -------------------------------------------------------------------------------- /.github/workflows/code-quality.yml: -------------------------------------------------------------------------------- 1 | name: 📝 Code Quality 2 | 3 | on: [push, pull_request] 4 | 5 | defaults: 6 | run: 7 | shell: bash 8 | 9 | env: 10 | PUB_ENVIRONMENT: bot.github 11 | 12 | jobs: 13 | analysis: 14 | name: 🔍 Analysis 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - name: 📥 Checkout Code 19 | uses: actions/checkout@v4 20 | 21 | - name: ⚡ Set Up Flutter 22 | uses: subosito/flutter-action@v2 23 | with: 24 | channel: stable 25 | cache: true 26 | 27 | - name: 🔍 Flutter Version Info 28 | run: flutter doctor -v 29 | 30 | - name: 📦 Cache Pub Dependencies 31 | uses: actions/cache@v4 32 | with: 33 | path: | 34 | ~/.pub-cache 35 | .dart_tool 36 | key: ${{ runner.os }}-pub-${{ hashFiles('**/pubspec.yaml') }} 37 | restore-keys: | 38 | ${{ runner.os }}-pub- 39 | 40 | - name: 🚀 Install Melos 41 | run: | 42 | flutter pub global activate melos 43 | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH 44 | 45 | - name: 🔧 Bootstrap Workspace with Melos 46 | run: melos bootstrap 47 | 48 | - name: ✅ Lint Code 49 | run: melos analyze 50 | 51 | formatting: 52 | name: 🎨 Formatting 53 | needs: analysis # This makes formatting start after analysis is complete 54 | runs-on: ubuntu-latest 55 | 56 | steps: 57 | - name: 📥 Checkout Code 58 | uses: actions/checkout@v4 59 | 60 | - name: ⚡ Set Up Flutter 61 | uses: subosito/flutter-action@v2 62 | with: 63 | channel: stable 64 | cache: true 65 | 66 | - name: 🚀 Install Melos 67 | run: | 68 | flutter pub global activate melos 69 | echo "$HOME/.pub-cache/bin" >> $GITHUB_PATH 70 | 71 | - name: 🔧 Bootstrap Workspace with Melos 72 | run: melos bootstrap 73 | 74 | - name: 🎯 Check Code Formatting 75 | run: melos format --output none --set-exit-if-changed 76 | -------------------------------------------------------------------------------- /.github/workflows/stale-issues.yaml: -------------------------------------------------------------------------------- 1 | name: 🗂️ Close Inactive Issues 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | days-before-issue-stale: 7 | description: "Days before marking an issue as stale" 8 | required: false 9 | default: "60" 10 | days-before-issue-close: 11 | description: "Days before closing a stale issue" 12 | required: false 13 | default: "60" 14 | schedule: 15 | - cron: "30 1 * * *" # Runs daily at 1:30 AM UTC 16 | 17 | permissions: 18 | issues: write 19 | pull-requests: read # Read-only to avoid unintended PR actions 20 | 21 | jobs: 22 | close-inactive-issues: 23 | name: 🚀 Close Inactive Issues 24 | runs-on: ubuntu-latest 25 | 26 | steps: 27 | - name: 🔍 Run Stale Action 28 | uses: actions/stale@v9 29 | with: 30 | repo-token: ${{ secrets.GITHUB_TOKEN }} 31 | 32 | # Issue Configuration 33 | days-before-issue-stale: ${{ github.event.inputs.days-before-issue-stale || 60 }} 34 | days-before-issue-close: ${{ github.event.inputs.days-before-issue-close || 60 }} 35 | stale-issue-label: "stale" 36 | exempt-issue-labels: "pinned,important,discussion" # Protect important issues 37 | stale-issue-message: | 38 | ⚠️ This issue has been marked as **stale** because it has been open for **${{ github.event.inputs.days-before-issue-stale || 60 }} days** with no activity. 39 | 40 | If this issue is still relevant, please comment to keep it active. Otherwise, it will be closed in **${{ github.event.inputs.days-before-issue-close || 60 }} days**. 41 | 42 | close-issue-message: | 43 | ❌ This issue has been **closed** because it remained inactive for **${{ github.event.inputs.days-before-issue-close || 60 }} days** after being marked as stale. 44 | 45 | # PR Configuration (Disabling PR handling explicitly) 46 | days-before-pr-stale: -1 47 | days-before-pr-close: -1 48 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | .vscode/ 12 | migrate_working_dir/ 13 | 14 | # IntelliJ related 15 | *.iml 16 | *.ipr 17 | *.iws 18 | .idea/ 19 | 20 | # The .vscode folder contains launch configuration and tasks you configure in 21 | # VS Code which you may wish to be included in version control, so this line 22 | # is commented out by default. 23 | #.vscode/ 24 | 25 | # Flutter/Dart/Pub related 26 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 27 | pubspec.lock 28 | pubspec_overrides.yaml 29 | **/doc/api/ 30 | .dart_tool/ 31 | .packages 32 | build/ 33 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 4.0.0 2 | - This plugin requires a minimum dart sdk of 3.3.0 or higher and a minimum flutter version of 3.19.0. 3 | - Updated documentation 4 | 5 | ## 3.1.3 6 | Added useDataProtectionKeyChain parameter. 7 | 8 | ## 3.1.2 9 | Fixed an issue which caused the readAll and deleteAll to not work properly. 10 | 11 | ## 3.1.1 12 | Fixed an issue which caused a platform exception when the key does not exists in the keychain. 13 | 14 | ## 3.1.0 15 | New Features: 16 | * Added isProtectedDataAvailable, A Boolean value that indicates whether content protection is active. 17 | 18 | Improvements: 19 | * Use accessibility option for all operations 20 | * Added privacy manifest 21 | 22 | ## 3.0.1 23 | Update Dart SDK Constraint to support <4.0.0 instead of <3.0.0. 24 | 25 | ## 3.0.0 26 | Changed minimum macOS version from 10.13 to 10.14 to mach latest Flutter version. 27 | 28 | ## 2.0.1 29 | Fixed build error. 30 | 31 | ## 2.0.1 32 | Fixed an issue with the plugin name. 33 | 34 | ## 2.0.0 35 | - Changed minimum macOS version from 10.11 to 10.13 to mach min Flutter version. 36 | - Upgraded codebase to swift 37 | - Fixed containsKey always returning true 38 | 39 | ## 1.1.2 40 | Updated flutter_secure_storage_platform_interface to latest version. 41 | 42 | ## 1.1.1 43 | Fixes a memory leak in the keychain 44 | 45 | ## 1.1.0 46 | Add containsKey function 47 | 48 | ## 1.0.0 49 | - Initial macOS implementation 50 | - Removed unused Flutter test and effective_dart dependency -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_macos 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for macOS. 4 | 5 | ## Features 6 | 7 | - Secure storage using the Keychain API. 8 | - Fully integrated with macOS security features. 9 | 10 | ## Installation 11 | 12 | Add the dependency in your `pubspec.yaml` and run `flutter pub get`. 13 | 14 | ## Configuration 15 | 16 | You also need to add Keychain Sharing as capability to your macOS runner. To achieve this, please add the following in *both* your `macos/Runner/DebugProfile.entitlements` *and* `macos/Runner/Release.entitlements`. 17 | 18 | ``` 19 | keychain-access-groups 20 | 21 | ``` 22 | 23 | If you have set your application up to use App Groups then you will need to add the name of the App Group to the `keychain-access-groups` argument above. Failure to do so will result in values appearing to be written successfully but never actually being written at all. For example if your app has an App Group named "aoeu" then your value for above would instead read: 24 | 25 | ``` 26 | keychain-access-groups 27 | 28 | $(AppIdentifierPrefix)aoeu 29 | 30 | ``` 31 | 32 | If you are configuring this value through XCode then the string you set in the Keychain Sharing section would simply read "aoeu" with XCode appending the `$(AppIdentifierPrefix)` when it saves the configuration. 33 | 34 | ## Usage 35 | 36 | Refer to the main [flutter_secure_storage README](../../README.md) for common usage instructions. 37 | 38 | ## License 39 | 40 | This project is licensed under the BSD 3 License. See the [LICENSE](../../LICENSE) file for details. 41 | -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/macos/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | 13 | *.pbxuser 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspectivev3 17 | 18 | !default.pbxuser 19 | !default.mode1v3 20 | !default.mode2v3 21 | !default.perspectivev3 22 | 23 | xcuserdata 24 | 25 | *.moved-aside 26 | 27 | *.pyc 28 | *sync/ 29 | Icon? 30 | .tags* 31 | -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/macos/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/archived_packages/flutter_secure_storage_macos/macos/Assets/.gitkeep -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/macos/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTrackingDomains 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyTracking 12 | 13 | 14 | -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/macos/flutter_secure_storage_macos.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint flutter_secure_storage_macos.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'flutter_secure_storage_macos' 7 | s.version = '6.1.3' 8 | s.summary = 'Flutter Secure Storage' 9 | s.description = <<-DESC 10 | Flutter Secure Storage Plugin for MacOs 11 | DESC 12 | s.homepage = 'https://github.com/mogol/flutter_secure_storage' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'German Saprykin' => 'saprykin.h@gmail.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'Classes/**/*' 17 | s.dependency 'FlutterMacOS' 18 | 19 | s.platform = :osx, '10.14' 20 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } 21 | s.swift_version = '5.0' 22 | s.resource_bundles = {'flutter_secure_storage_macos' => ['Resources/PrivacyInfo.xcprivacy']} 23 | end 24 | -------------------------------------------------------------------------------- /archived_packages/flutter_secure_storage_macos/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_macos 2 | description: macOS implementation of flutter_secure_storage 3 | repository: https://github.com/mogol/flutter_secure_storage 4 | version: 4.0.0 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_secure_storage_platform_interface: ^2.0.0 14 | 15 | flutter: 16 | plugin: 17 | implements: flutter_secure_storage 18 | platforms: 19 | macos: 20 | pluginClass: FlutterSecureStoragePlugin 21 | -------------------------------------------------------------------------------- /archived_packages/ios/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | 13 | *.pbxuser 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspectivev3 17 | 18 | !default.pbxuser 19 | !default.mode1v3 20 | !default.mode2v3 21 | !default.perspectivev3 22 | 23 | xcuserdata 24 | 25 | *.moved-aside 26 | 27 | *.pyc 28 | *sync/ 29 | Icon? 30 | .tags* 31 | 32 | -------------------------------------------------------------------------------- /archived_packages/ios/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/archived_packages/ios/Assets/.gitkeep -------------------------------------------------------------------------------- /archived_packages/ios/Classes/FlutterSecureStoragePlugin.h: -------------------------------------------------------------------------------- 1 | //#import 2 | // 3 | //@interface FlutterSecureStoragePlugin : NSObject 4 | //- (void)write:(NSString *)value forKey:(NSString *)key forGroup:(NSString *)groupId accessibilityAttr:(NSString *)accessibility forAccountName:(NSString *)accountName forSynchronizable:(NSString *)synchronizable; 5 | //-(NSString *)read:(NSString *)key forGroup:(NSString *)groupId forAccountName:(NSString *)accountName forSynchronizable:(NSString *)synchronizable; 6 | //-(void)delete:(NSString *)key forGroup:(NSString *)groupId forAccountName:(NSString *)accountName forSynchronizable:(NSString *)synchronizable; 7 | //-(NSDictionary *)readAll:(NSString *)groupId forAccountName:(NSString *)accountName forSynchronizable:(NSString *)synchronizable; 8 | //-(NSNumber *)containsKey:(NSString *)key forGroup:(NSString *)groupId forAccountName:(NSString *)accountName forSynchronizable:(NSString *)synchronizable; 9 | //@end 10 | 11 | #import 12 | 13 | @interface FlutterSecureStoragePlugin : NSObject 14 | @end 15 | -------------------------------------------------------------------------------- /archived_packages/ios/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTrackingDomains 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyTracking 12 | 13 | 14 | -------------------------------------------------------------------------------- /archived_packages/ios/flutter_secure_storage.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_secure_storage' 6 | s.version = '10.0.0' 7 | s.summary = 'A Flutter plugin to store data in secure storage.' 8 | s.description = <<-DESC 9 | A Flutter plugin to store data in secure storage. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'German Saprykin' => 'saprykin.h@gmail.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'Classes/**/*' 16 | s.public_header_files = 'Classes/**/*.h' 17 | s.dependency 'Flutter' 18 | s.platform = :ios, '12.0' 19 | s.ios.deployment_target = '12.0' 20 | 21 | # Flutter.framework does not contain a i386 slice. 22 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 23 | s.swift_version = '5.0' 24 | s.resource_bundles = {'flutter_secure_storage' => ['Resources/PrivacyInfo.xcprivacy']} 25 | end 26 | 27 | -------------------------------------------------------------------------------- /flutter_secure_storage/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | coverage/ 13 | 14 | # IntelliJ related 15 | *.iml 16 | *.ipr 17 | *.iws 18 | .idea/ 19 | 20 | # The .vscode folder contains launch configuration and tasks you configure in 21 | # VS Code which you may wish to be included in version control, so this line 22 | # is commented out by default. 23 | #.vscode/ 24 | 25 | # Flutter/Dart/Pub related 26 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 27 | /pubspec.lock 28 | **/doc/api/ 29 | .dart_tool/ 30 | .packages 31 | build/ 32 | -------------------------------------------------------------------------------- /flutter_secure_storage/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /flutter_secure_storage/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for Android and iOS. 4 | 5 | ## Features 6 | 7 | - Secure storage using Keychain (iOS) and Encrypted Shared Preferences with Tink (Android). 8 | - Platform-specific options for encryption and accessibility. 9 | 10 | ## Installation 11 | 12 | Add the dependency in your `pubspec.yaml` and run `flutter pub get`. 13 | 14 | ## Configuration 15 | 16 | ### Android 17 | 18 | 1. Disable Google Drive backups to avoid key-related exceptions: 19 | - Add the required settings in your `AndroidManifest.xml`. 20 | 21 | 2. Exclude shared preferences used by the plugin: 22 | - Follow the linked documentation for further details. 23 | 24 | ### iOS 25 | 26 | You also need to add Keychain Sharing as capability to your iOS runner. To achieve this, please add the following in *both* your `ios/Runner/DebugProfile.entitlements` *and* `ios/Runner/Release.entitlements`. 27 | 28 | ``` 29 | keychain-access-groups 30 | 31 | ``` 32 | 33 | If you have set your application up to use App Groups then you will need to add the name of the App Group to the `keychain-access-groups` argument above. Failure to do so will result in values appearing to be written successfully but never actually being written at all. For example if your app has an App Group named "aoeu" then your value for above would instead read: 34 | 35 | ``` 36 | keychain-access-groups 37 | 38 | $(AppIdentifierPrefix)aoeu 39 | 40 | ``` 41 | 42 | If you are configuring this value through XCode then the string you set in the Keychain Sharing section would simply read "aoeu" with XCode appending the `$(AppIdentifierPrefix)` when it saves the configuration. 43 | 44 | ## Usage 45 | 46 | Refer to the main [flutter_secure_storage README](../README.md) for common usage instructions. 47 | 48 | ## License 49 | 50 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 51 | -------------------------------------------------------------------------------- /flutter_secure_storage/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_secure_storage/android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/build.gradle: -------------------------------------------------------------------------------- 1 | group 'com.it_nomads.fluttersecurestorage' 2 | version '1.0-SNAPSHOT' 3 | 4 | buildscript { 5 | repositories { 6 | google() 7 | mavenCentral() 8 | } 9 | 10 | dependencies { 11 | classpath 'com.android.tools.build:gradle:8.8.0' 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | apply plugin: 'com.android.library' 23 | 24 | android { 25 | if (project.android.hasProperty("namespace")) { 26 | namespace("com.it_nomads.fluttersecurestorage") 27 | } 28 | 29 | buildFeatures { 30 | buildConfig = true 31 | } 32 | 33 | compileSdk 35 34 | 35 | compileOptions { 36 | sourceCompatibility = JavaVersion.VERSION_17 37 | targetCompatibility = JavaVersion.VERSION_17 38 | } 39 | 40 | defaultConfig { 41 | minSdkVersion 23 42 | } 43 | 44 | } 45 | 46 | dependencies { 47 | implementation("com.google.crypto.tink:tink-android:1.17.0") 48 | } 49 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx1536M 2 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue May 17 09:58:24 CEST 2022 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_secure_storage' 2 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/ciphers/KeyCipher.java: -------------------------------------------------------------------------------- 1 | package com.it_nomads.fluttersecurestorage.ciphers; 2 | 3 | import java.security.Key; 4 | 5 | public interface KeyCipher { 6 | byte[] wrap(Key key) throws Exception; 7 | 8 | Key unwrap(byte[] wrappedKey, String algorithm) throws Exception; 9 | } 10 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/ciphers/RSACipherOAEPImplementation.java: -------------------------------------------------------------------------------- 1 | package com.it_nomads.fluttersecurestorage.ciphers; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | import android.security.keystore.KeyGenParameterSpec; 6 | import android.security.keystore.KeyProperties; 7 | 8 | import androidx.annotation.RequiresApi; 9 | 10 | import java.math.BigInteger; 11 | import java.security.spec.AlgorithmParameterSpec; 12 | import java.security.spec.MGF1ParameterSpec; 13 | import java.util.Calendar; 14 | 15 | import javax.crypto.Cipher; 16 | import javax.crypto.spec.OAEPParameterSpec; 17 | import javax.crypto.spec.PSource; 18 | import javax.security.auth.x500.X500Principal; 19 | 20 | public class RSACipherOAEPImplementation extends RSACipher18Implementation { 21 | 22 | public RSACipherOAEPImplementation(Context context) throws Exception { 23 | super(context); 24 | } 25 | 26 | @Override 27 | protected String createKeyAlias() { 28 | return context.getPackageName() + ".FlutterSecureStoragePluginKeyOAEP"; 29 | } 30 | 31 | @RequiresApi(api = Build.VERSION_CODES.M) 32 | @Override 33 | protected AlgorithmParameterSpec makeAlgorithmParameterSpec(Context context, Calendar start, Calendar end) { 34 | final KeyGenParameterSpec.Builder builder = new KeyGenParameterSpec.Builder(keyAlias, KeyProperties.PURPOSE_DECRYPT | KeyProperties.PURPOSE_ENCRYPT) 35 | .setCertificateSubject(new X500Principal("CN=" + keyAlias)) 36 | .setDigests(KeyProperties.DIGEST_SHA256) 37 | .setBlockModes(KeyProperties.BLOCK_MODE_ECB) 38 | .setEncryptionPaddings(KeyProperties.ENCRYPTION_PADDING_RSA_OAEP) 39 | .setCertificateSerialNumber(BigInteger.valueOf(1)) 40 | .setCertificateNotBefore(start.getTime()) 41 | .setCertificateNotAfter(end.getTime()); 42 | return builder.build(); 43 | } 44 | 45 | @Override 46 | protected Cipher getRSACipher() throws Exception { 47 | return Cipher.getInstance("RSA/ECB/OAEPPadding", "AndroidKeyStoreBCWorkaround"); 48 | } 49 | 50 | protected AlgorithmParameterSpec getAlgorithmParameterSpec() { 51 | return new OAEPParameterSpec("SHA-256", "MGF1", MGF1ParameterSpec.SHA1, PSource.PSpecified.DEFAULT); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/ciphers/StorageCipher.java: -------------------------------------------------------------------------------- 1 | package com.it_nomads.fluttersecurestorage.ciphers; 2 | 3 | public interface StorageCipher { 4 | byte[] encrypt(byte[] input) throws Exception; 5 | 6 | byte[] decrypt(byte[] input) throws Exception; 7 | } 8 | -------------------------------------------------------------------------------- /flutter_secure_storage/android/src/main/java/com/it_nomads/fluttersecurestorage/ciphers/StorageCipherGCMImplementation.java: -------------------------------------------------------------------------------- 1 | package com.it_nomads.fluttersecurestorage.ciphers; 2 | 3 | import android.content.Context; 4 | import android.os.Build; 5 | 6 | import androidx.annotation.RequiresApi; 7 | 8 | import java.security.spec.AlgorithmParameterSpec; 9 | 10 | import javax.crypto.Cipher; 11 | import javax.crypto.spec.GCMParameterSpec; 12 | 13 | public class StorageCipherGCMImplementation extends StorageCipher18Implementation { 14 | 15 | private static final int AUTHENTICATION_TAG_SIZE = 128; 16 | 17 | public StorageCipherGCMImplementation(Context context, KeyCipher keyCipher) throws Exception { 18 | super(context, keyCipher); 19 | } 20 | 21 | @Override 22 | protected String getAESPreferencesKey() { 23 | return "VGhpcyBpcyB0aGUga2V5IGZvcihBIHNlY3XyZZBzdG9yYWdlIEFFUyBLZXkK"; 24 | } 25 | 26 | @Override 27 | protected Cipher getCipher() throws Exception { 28 | return Cipher.getInstance("AES/GCM/NoPadding"); 29 | } 30 | 31 | protected int getIvSize() { 32 | return 12; 33 | } 34 | 35 | @RequiresApi(api = Build.VERSION_CODES.KITKAT) 36 | @Override 37 | protected AlgorithmParameterSpec getParameterSpec(byte[] iv) { 38 | return new GCMParameterSpec(AUTHENTICATION_TAG_SIZE, iv); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | **/doc/api/ 28 | **/ios/Flutter/.last_build_id 29 | .dart_tool/ 30 | .flutter-plugins 31 | .flutter-plugins-dependencies 32 | .packages 33 | .pub-cache/ 34 | .pub/ 35 | /build/ 36 | 37 | # Symbolication related 38 | app.*.symbols 39 | 40 | # Obfuscation related 41 | app.*.map.json 42 | 43 | # Android Studio will place build artifacts here 44 | /android/app/debug 45 | /android/app/profile 46 | /android/app/release 47 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "a14f74ff3a1cbd521163c5f03d68113d50af93d3" 8 | channel: "stable" 9 | 10 | project_type: app 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 17 | base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 18 | - platform: macos 19 | create_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 20 | base_revision: a14f74ff3a1cbd521163c5f03d68113d50af93d3 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage Example App 2 | 3 | This is the example application for demonstrating the use of `flutter_secure_storage` on iOS and Android platforms. 4 | 5 | ## About 6 | 7 | The example app showcases how to securely store and retrieve sensitive data using the `flutter_secure_storage` plugin. It provides a simple interface to demonstrate: 8 | 9 | - Writing data to secure storage. 10 | - Reading data from secure storage. 11 | - Checking for key existence. 12 | - Deleting specific keys or clearing all stored data. 13 | 14 | ## Running the Example App 15 | 16 | To run the example app: 17 | 18 | 1. Navigate to the `example` directory. 19 | 2. Install the dependencies using `flutter pub get`. 20 | 3. Run the app using `flutter run`. 21 | 22 | Ensure that you have an emulator or a physical device configured for iOS or Android. 23 | 24 | ## Integration Tests 25 | 26 | To run the integration tests, execute the following command: 27 | 28 | `flutter drive --target=test_driver/app.dart` 29 | 30 | This will launch the integration tests specified in the `test_driver` directory. 31 | 32 | ## Features Demonstrated 33 | 34 | 1. **Write Data**: 35 | Enter a key-value pair to securely store data. 36 | 37 | 2. **Read Data**: 38 | Retrieve a value by entering the corresponding key. 39 | 40 | 3. **Check Key Existence**: 41 | Check if a specific key exists in secure storage. 42 | 43 | 4. **Delete Data**: 44 | Remove data for a specific key or clear all stored data. 45 | 46 | ## Prerequisites 47 | 48 | ### Android 49 | 50 | - Ensure that the Android emulator or device has proper configurations for running Flutter applications. 51 | - Keychain and secure storage are configured automatically during the app build. 52 | 53 | ### iOS 54 | 55 | - Use a physical device or simulator running iOS 11.0 or later. 56 | - Ensure Keychain sharing is properly configured in the iOS project settings. 57 | 58 | ## Modifications 59 | 60 | You can modify the example code to test different scenarios or configurations, such as custom accessibility options or key expiration on iOS and Android. 61 | 62 | ## Contributing 63 | 64 | Feedback and contributions are welcome to improve the example app. 65 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/.gitignore: -------------------------------------------------------------------------------- 1 | gradle-wrapper.jar 2 | /.gradle 3 | /captures/ 4 | /gradlew 5 | /gradlew.bat 6 | /local.properties 7 | GeneratedPluginRegistrant.java 8 | 9 | # Remember to never publicly share your keystore. 10 | # See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app 11 | key.properties 12 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/build.gradle.kts: -------------------------------------------------------------------------------- 1 | import java.util.Properties 2 | import java.nio.file.Files 3 | import java.nio.file.Path 4 | 5 | plugins { 6 | id("com.android.application") 7 | id("org.jetbrains.kotlin.android") 8 | id("dev.flutter.flutter-gradle-plugin") 9 | } 10 | 11 | val localProperties: Properties = Properties() 12 | val localPropertiesFile: Path = rootProject.file("local.properties").toPath() 13 | if (Files.exists(localPropertiesFile)) { 14 | Files.newBufferedReader(localPropertiesFile).use { reader -> 15 | localProperties.load(reader) 16 | } 17 | } 18 | 19 | val flutterRoot: String = localProperties.getProperty("flutter.sdk") 20 | ?: throw GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.") 21 | 22 | val flutterVersionCode: String = localProperties.getProperty("flutter.versionCode") ?: "1" 23 | val flutterVersionName: String = localProperties.getProperty("flutter.versionName") ?: "1.0" 24 | 25 | android { 26 | namespace = "com.it_nomads.fluttersecurestorageexample" 27 | 28 | compileSdk = 35 29 | 30 | compileOptions { 31 | sourceCompatibility = JavaVersion.VERSION_17 32 | targetCompatibility = JavaVersion.VERSION_17 33 | } 34 | 35 | kotlinOptions { 36 | jvmTarget = JavaVersion.VERSION_17.toString() 37 | } 38 | 39 | sourceSets { 40 | named("main") { 41 | java.srcDir("src/main/kotlin") 42 | } 43 | } 44 | 45 | defaultConfig { 46 | applicationId = "com.it_nomads.fluttersecurestorageexample" 47 | minSdk = 23 48 | targetSdk = 35 49 | versionCode = flutterVersionCode.toInt() 50 | versionName = flutterVersionName 51 | } 52 | 53 | buildTypes { 54 | getByName("release") { 55 | // TODO: Add your own signing config for the release build. 56 | // Signing with the debug keys for now, so `flutter run --release` works. 57 | signingConfig = signingConfigs.getByName("debug") 58 | } 59 | } 60 | } 61 | 62 | flutter { 63 | source = "../.." 64 | } 65 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 14 | 18 | 22 | 23 | 24 | 25 | 26 | 27 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/kotlin/com/it_nomads/fluttersecurestorageexample/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.it_nomads.fluttersecurestorageexample; 2 | 3 | import io.flutter.embedding.android.FlutterActivity 4 | 5 | class MainActivity: FlutterActivity() 6 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/build.gradle.kts: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.layout.buildDirectory = file("../build") 9 | 10 | subprojects { 11 | project.layout.buildDirectory = 12 | file("${rootProject.layout.buildDirectory.get().asFile}/${project.name}") 13 | } 14 | subprojects { 15 | project.evaluationDependsOn(":app") 16 | } 17 | 18 | tasks.register("clean") { 19 | delete(rootProject.layout.buildDirectory) 20 | } 21 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | android.nonTransitiveRClass=false 5 | android.nonFinalResIds=false 6 | android.enableR8.fullMode=false 7 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Aug 29 10:45:20 CEST 2023 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip 7 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/android/settings.gradle.kts: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | val flutterSdkPath = 3 | run { 4 | val properties = java.util.Properties() 5 | file("local.properties").inputStream().use { properties.load(it) } 6 | val flutterSdkPath = properties.getProperty("flutter.sdk") 7 | require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } 8 | flutterSdkPath 9 | } 10 | 11 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 12 | 13 | repositories { 14 | google() 15 | mavenCentral() 16 | gradlePluginPortal() 17 | } 18 | } 19 | 20 | plugins { 21 | id("dev.flutter.flutter-plugin-loader") version "1.0.0" 22 | id("com.android.application") version "8.8.0" apply false 23 | id("org.jetbrains.kotlin.android") version "1.9.25" apply false 24 | } 25 | 26 | include(":app") 27 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/.gitignore: -------------------------------------------------------------------------------- 1 | **/dgph 2 | *.mode1v3 3 | *.mode2v3 4 | *.moved-aside 5 | *.pbxuser 6 | *.perspectivev3 7 | **/*sync/ 8 | .sconsign.dblite 9 | .tags* 10 | **/.vagrant/ 11 | **/DerivedData/ 12 | Icon? 13 | **/Pods/ 14 | **/.symlinks/ 15 | profile 16 | xcuserdata 17 | **/.generated/ 18 | Flutter/App.framework 19 | Flutter/Flutter.framework 20 | Flutter/Flutter.podspec 21 | Flutter/Generated.xcconfig 22 | Flutter/ephemeral/ 23 | Flutter/app.flx 24 | Flutter/app.zip 25 | Flutter/flutter_assets/ 26 | Flutter/flutter_export_environment.sh 27 | ServiceDefinitions.json 28 | Runner/GeneratedPluginRegistrant.* 29 | 30 | # Exceptions to above rules. 31 | !default.mode1v3 32 | !default.mode2v3 33 | !default.pbxuser 34 | !default.perspectivev3 35 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Flutter/AppFrameworkInfo.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | App 9 | CFBundleIdentifier 10 | io.flutter.flutter.app 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | App 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1.0 23 | MinimumOSVersion 24 | 12.0 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment this line to define a global platform for your project 2 | platform :ios, '12.0' 3 | 4 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 5 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 6 | 7 | project 'Runner', { 8 | 'Debug' => :debug, 9 | 'Profile' => :release, 10 | 'Release' => :release, 11 | } 12 | 13 | def flutter_root 14 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'Generated.xcconfig'), __FILE__) 15 | unless File.exist?(generated_xcode_build_settings_path) 16 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure flutter pub get is executed first" 17 | end 18 | 19 | File.foreach(generated_xcode_build_settings_path) do |line| 20 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 21 | return matches[1].strip if matches 22 | end 23 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Generated.xcconfig, then run flutter pub get" 24 | end 25 | 26 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 27 | 28 | flutter_ios_podfile_setup 29 | 30 | target 'Runner' do 31 | use_frameworks! 32 | use_modular_headers! 33 | 34 | flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__)) 35 | end 36 | 37 | post_install do |installer| 38 | installer.pods_project.targets.each do |target| 39 | flutter_additional_ios_build_settings(target) 40 | end 41 | end 42 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | - flutter_secure_storage_darwin (10.0.0): 4 | - Flutter 5 | - FlutterMacOS 6 | - integration_test (0.0.1): 7 | - Flutter 8 | - path_provider_foundation (0.0.1): 9 | - Flutter 10 | - FlutterMacOS 11 | 12 | DEPENDENCIES: 13 | - Flutter (from `Flutter`) 14 | - flutter_secure_storage_darwin (from `.symlinks/plugins/flutter_secure_storage_darwin/darwin`) 15 | - integration_test (from `.symlinks/plugins/integration_test/ios`) 16 | - path_provider_foundation (from `.symlinks/plugins/path_provider_foundation/darwin`) 17 | 18 | EXTERNAL SOURCES: 19 | Flutter: 20 | :path: Flutter 21 | flutter_secure_storage_darwin: 22 | :path: ".symlinks/plugins/flutter_secure_storage_darwin/darwin" 23 | integration_test: 24 | :path: ".symlinks/plugins/integration_test/ios" 25 | path_provider_foundation: 26 | :path: ".symlinks/plugins/path_provider_foundation/darwin" 27 | 28 | SPEC CHECKSUMS: 29 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 30 | flutter_secure_storage_darwin: 12d2375c690785d97a4e586f15f11be5ae35d5b0 31 | integration_test: 252f60fa39af5e17c3aa9899d35d908a0721b573 32 | path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 33 | 34 | PODFILE CHECKSUM: 4e8f8b2be68aeea4c0d5beb6ff1e79fface1d048 35 | 36 | COCOAPODS: 1.16.2 37 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 37 | 38 | 39 | 40 | 41 | 42 | 52 | 54 | 60 | 61 | 62 | 63 | 69 | 71 | 77 | 78 | 79 | 80 | 82 | 83 | 86 | 87 | 88 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreviewsEnabled 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import UIKit 2 | import Flutter 3 | 4 | @main 5 | @objc class AppDelegate: FlutterAppDelegate { 6 | override func application( 7 | _ application: UIApplication, 8 | didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? 9 | ) -> Bool { 10 | GeneratedPluginRegistrant.register(with: self) 11 | return super.application(application, didFinishLaunchingWithOptions: launchOptions) 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "20x20", 5 | "idiom" : "iphone", 6 | "filename" : "Icon-App-20x20@2x.png", 7 | "scale" : "2x" 8 | }, 9 | { 10 | "size" : "20x20", 11 | "idiom" : "iphone", 12 | "filename" : "Icon-App-20x20@3x.png", 13 | "scale" : "3x" 14 | }, 15 | { 16 | "size" : "29x29", 17 | "idiom" : "iphone", 18 | "filename" : "Icon-App-29x29@1x.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "29x29", 23 | "idiom" : "iphone", 24 | "filename" : "Icon-App-29x29@2x.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "29x29", 29 | "idiom" : "iphone", 30 | "filename" : "Icon-App-29x29@3x.png", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "size" : "40x40", 35 | "idiom" : "iphone", 36 | "filename" : "Icon-App-40x40@2x.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "40x40", 41 | "idiom" : "iphone", 42 | "filename" : "Icon-App-40x40@3x.png", 43 | "scale" : "3x" 44 | }, 45 | { 46 | "size" : "60x60", 47 | "idiom" : "iphone", 48 | "filename" : "Icon-App-60x60@2x.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "60x60", 53 | "idiom" : "iphone", 54 | "filename" : "Icon-App-60x60@3x.png", 55 | "scale" : "3x" 56 | }, 57 | { 58 | "size" : "20x20", 59 | "idiom" : "ipad", 60 | "filename" : "Icon-App-20x20@1x.png", 61 | "scale" : "1x" 62 | }, 63 | { 64 | "size" : "20x20", 65 | "idiom" : "ipad", 66 | "filename" : "Icon-App-20x20@2x.png", 67 | "scale" : "2x" 68 | }, 69 | { 70 | "size" : "29x29", 71 | "idiom" : "ipad", 72 | "filename" : "Icon-App-29x29@1x.png", 73 | "scale" : "1x" 74 | }, 75 | { 76 | "size" : "29x29", 77 | "idiom" : "ipad", 78 | "filename" : "Icon-App-29x29@2x.png", 79 | "scale" : "2x" 80 | }, 81 | { 82 | "size" : "40x40", 83 | "idiom" : "ipad", 84 | "filename" : "Icon-App-40x40@1x.png", 85 | "scale" : "1x" 86 | }, 87 | { 88 | "size" : "40x40", 89 | "idiom" : "ipad", 90 | "filename" : "Icon-App-40x40@2x.png", 91 | "scale" : "2x" 92 | }, 93 | { 94 | "size" : "76x76", 95 | "idiom" : "ipad", 96 | "filename" : "Icon-App-76x76@1x.png", 97 | "scale" : "1x" 98 | }, 99 | { 100 | "size" : "76x76", 101 | "idiom" : "ipad", 102 | "filename" : "Icon-App-76x76@2x.png", 103 | "scale" : "2x" 104 | }, 105 | { 106 | "size" : "83.5x83.5", 107 | "idiom" : "ipad", 108 | "filename" : "Icon-App-83.5x83.5@2x.png", 109 | "scale" : "2x" 110 | }, 111 | { 112 | "size" : "1024x1024", 113 | "idiom" : "ios-marketing", 114 | "filename" : "Icon-App-1024x1024@1x.png", 115 | "scale" : "1x" 116 | } 117 | ], 118 | "info" : { 119 | "version" : 1, 120 | "author" : "xcode" 121 | } 122 | } 123 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "LaunchImage.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "LaunchImage@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "LaunchImage@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md: -------------------------------------------------------------------------------- 1 | # Launch Screen Assets 2 | 3 | You can customize the launch screen with your own desired assets by replacing the image files in this directory. 4 | 5 | You can also do it by opening your Flutter project's Xcode project with `open ios/Runner.xcworkspace`, selecting `Runner/Assets.xcassets` in the Project Navigator and dropping in the desired images. -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Example 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | example 19 | CFBundlePackageType 20 | APPL 21 | CFBundleShortVersionString 22 | $(FLUTTER_BUILD_NAME) 23 | CFBundleSignature 24 | ???? 25 | CFBundleVersion 26 | $(FLUTTER_BUILD_NUMBER) 27 | LSRequiresIPhoneOS 28 | 29 | UIApplicationSupportsIndirectInputEvents 30 | 31 | UILaunchStoryboardName 32 | LaunchScreen 33 | UIMainStoryboardFile 34 | Main 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UIViewControllerBasedStatusBarAppearance 49 | 50 | 51 | 52 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral 2 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/flutter/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | 3 | set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") 4 | 5 | # Configuration provided via flutter tool. 6 | include(${EPHEMERAL_DIR}/generated_config.cmake) 7 | 8 | # TODO: Move the rest of this into files in ephemeral. See 9 | # https://github.com/flutter/flutter/issues/57146. 10 | 11 | # Serves the same purpose as list(TRANSFORM ... PREPEND ...), 12 | # which isn't available in 3.10. 13 | function(list_prepend LIST_NAME PREFIX) 14 | set(NEW_LIST "") 15 | foreach(element ${${LIST_NAME}}) 16 | list(APPEND NEW_LIST "${PREFIX}${element}") 17 | endforeach(element) 18 | set(${LIST_NAME} "${NEW_LIST}" PARENT_SCOPE) 19 | endfunction() 20 | 21 | # === Flutter Library === 22 | # System-level dependencies. 23 | find_package(PkgConfig REQUIRED) 24 | pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0) 25 | pkg_check_modules(GLIB REQUIRED IMPORTED_TARGET glib-2.0) 26 | pkg_check_modules(GIO REQUIRED IMPORTED_TARGET gio-2.0) 27 | pkg_check_modules(BLKID REQUIRED IMPORTED_TARGET blkid) 28 | pkg_check_modules(LZMA REQUIRED IMPORTED_TARGET liblzma) 29 | 30 | set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/libflutter_linux_gtk.so") 31 | 32 | # Published to parent scope for install step. 33 | set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) 34 | set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) 35 | set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) 36 | set(AOT_LIBRARY "${PROJECT_DIR}/build/lib/libapp.so" PARENT_SCOPE) 37 | 38 | list(APPEND FLUTTER_LIBRARY_HEADERS 39 | "fl_basic_message_channel.h" 40 | "fl_binary_codec.h" 41 | "fl_binary_messenger.h" 42 | "fl_dart_project.h" 43 | "fl_engine.h" 44 | "fl_json_message_codec.h" 45 | "fl_json_method_codec.h" 46 | "fl_message_codec.h" 47 | "fl_method_call.h" 48 | "fl_method_channel.h" 49 | "fl_method_codec.h" 50 | "fl_method_response.h" 51 | "fl_plugin_registrar.h" 52 | "fl_plugin_registry.h" 53 | "fl_standard_message_codec.h" 54 | "fl_standard_method_codec.h" 55 | "fl_string_codec.h" 56 | "fl_value.h" 57 | "fl_view.h" 58 | "flutter_linux.h" 59 | ) 60 | list_prepend(FLUTTER_LIBRARY_HEADERS "${EPHEMERAL_DIR}/flutter_linux/") 61 | add_library(flutter INTERFACE) 62 | target_include_directories(flutter INTERFACE 63 | "${EPHEMERAL_DIR}" 64 | ) 65 | target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}") 66 | target_link_libraries(flutter INTERFACE 67 | PkgConfig::GTK 68 | PkgConfig::GLIB 69 | PkgConfig::GIO 70 | PkgConfig::BLKID 71 | PkgConfig::LZMA 72 | ) 73 | add_dependencies(flutter flutter_assemble) 74 | 75 | # === Flutter tool backend === 76 | # _phony_ is a non-existent file to force this command to run every time, 77 | # since currently there's no way to get a full input/output list from the 78 | # flutter tool. 79 | add_custom_command( 80 | OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} 81 | ${CMAKE_CURRENT_BINARY_DIR}/_phony_ 82 | COMMAND ${CMAKE_COMMAND} -E env 83 | ${FLUTTER_TOOL_ENVIRONMENT} 84 | "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.sh" 85 | ${FLUTTER_TARGET_PLATFORM} ${CMAKE_BUILD_TYPE} 86 | VERBATIM 87 | ) 88 | add_custom_target(flutter_assemble DEPENDS 89 | "${FLUTTER_LIBRARY}" 90 | ${FLUTTER_LIBRARY_HEADERS} 91 | ) 92 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void fl_register_plugins(FlPluginRegistry* registry) { 12 | g_autoptr(FlPluginRegistrar) flutter_secure_storage_linux_registrar = 13 | fl_plugin_registry_get_registrar_for_plugin(registry, "FlutterSecureStorageLinuxPlugin"); 14 | flutter_secure_storage_linux_plugin_register_with_registrar(flutter_secure_storage_linux_registrar); 15 | } 16 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void fl_register_plugins(FlPluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_secure_storage_linux 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/linux plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/main.cc: -------------------------------------------------------------------------------- 1 | #include "my_application.h" 2 | 3 | int main(int argc, char** argv) { 4 | g_autoptr(MyApplication) app = my_application_new(); 5 | return g_application_run(G_APPLICATION(app), argc, argv); 6 | } 7 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/linux/my_application.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_MY_APPLICATION_H_ 2 | #define FLUTTER_MY_APPLICATION_H_ 3 | 4 | #include 5 | 6 | G_DECLARE_FINAL_TYPE(MyApplication, my_application, MY, APPLICATION, 7 | GtkApplication) 8 | 9 | /** 10 | * my_application_new: 11 | * 12 | * Creates a new Flutter-based application. 13 | * 14 | * Returns: a new #MyApplication. 15 | */ 16 | MyApplication* my_application_new(); 17 | 18 | #endif // FLUTTER_MY_APPLICATION_H_ 19 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/.gitignore: -------------------------------------------------------------------------------- 1 | # Flutter-related 2 | **/Flutter/ephemeral/ 3 | **/Pods/ 4 | 5 | # Xcode-related 6 | **/dgph 7 | **/xcuserdata/ 8 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Flutter/Flutter-Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Flutter/Flutter-Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "ephemeral/Flutter-Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Flutter/GeneratedPluginRegistrant.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | import FlutterMacOS 6 | import Foundation 7 | 8 | import flutter_secure_storage_darwin 9 | import path_provider_foundation 10 | 11 | func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { 12 | FlutterSecureStorageDarwinPlugin.register(with: registry.registrar(forPlugin: "FlutterSecureStorageDarwinPlugin")) 13 | PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) 14 | } 15 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Podfile: -------------------------------------------------------------------------------- 1 | platform :osx, '10.14' 2 | 3 | # CocoaPods analytics sends network stats synchronously affecting flutter build latency. 4 | ENV['COCOAPODS_DISABLE_STATS'] = 'true' 5 | 6 | project 'Runner', { 7 | 'Debug' => :debug, 8 | 'Profile' => :release, 9 | 'Release' => :release, 10 | } 11 | 12 | def flutter_root 13 | generated_xcode_build_settings_path = File.expand_path(File.join('..', 'Flutter', 'ephemeral', 'Flutter-Generated.xcconfig'), __FILE__) 14 | unless File.exist?(generated_xcode_build_settings_path) 15 | raise "#{generated_xcode_build_settings_path} must exist. If you're running pod install manually, make sure \"flutter pub get\" is executed first" 16 | end 17 | 18 | File.foreach(generated_xcode_build_settings_path) do |line| 19 | matches = line.match(/FLUTTER_ROOT\=(.*)/) 20 | return matches[1].strip if matches 21 | end 22 | raise "FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \"flutter pub get\"" 23 | end 24 | 25 | require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root) 26 | 27 | flutter_macos_podfile_setup 28 | 29 | target 'Runner' do 30 | use_frameworks! 31 | use_modular_headers! 32 | 33 | flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__)) 34 | target 'RunnerTests' do 35 | inherit! :search_paths 36 | end 37 | end 38 | 39 | post_install do |installer| 40 | installer.pods_project.targets.each do |target| 41 | flutter_additional_macos_build_settings(target) 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - flutter_secure_storage_darwin (10.0.0): 3 | - Flutter 4 | - FlutterMacOS 5 | - FlutterMacOS (1.0.0) 6 | - path_provider_foundation (0.0.1): 7 | - Flutter 8 | - FlutterMacOS 9 | 10 | DEPENDENCIES: 11 | - flutter_secure_storage_darwin (from `Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_darwin/darwin`) 12 | - FlutterMacOS (from `Flutter/ephemeral`) 13 | - path_provider_foundation (from `Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin`) 14 | 15 | EXTERNAL SOURCES: 16 | flutter_secure_storage_darwin: 17 | :path: Flutter/ephemeral/.symlinks/plugins/flutter_secure_storage_darwin/darwin 18 | FlutterMacOS: 19 | :path: Flutter/ephemeral 20 | path_provider_foundation: 21 | :path: Flutter/ephemeral/.symlinks/plugins/path_provider_foundation/darwin 22 | 23 | SPEC CHECKSUMS: 24 | flutter_secure_storage_darwin: 12d2375c690785d97a4e586f15f11be5ae35d5b0 25 | FlutterMacOS: 8f6f14fa908a6fb3fba0cd85dbd81ec4b251fb24 26 | path_provider_foundation: 2b6b4c569c0fb62ec74538f866245ac84301af46 27 | 28 | PODFILE CHECKSUM: 236401fc2c932af29a9fcf0e97baeeb2d750d367 29 | 30 | COCOAPODS: 1.16.2 31 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | @main 5 | class AppDelegate: FlutterAppDelegate { 6 | override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { 7 | return true 8 | } 9 | 10 | override func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { 11 | return true 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "size" : "16x16", 5 | "idiom" : "mac", 6 | "filename" : "app_icon_16.png", 7 | "scale" : "1x" 8 | }, 9 | { 10 | "size" : "16x16", 11 | "idiom" : "mac", 12 | "filename" : "app_icon_32.png", 13 | "scale" : "2x" 14 | }, 15 | { 16 | "size" : "32x32", 17 | "idiom" : "mac", 18 | "filename" : "app_icon_32.png", 19 | "scale" : "1x" 20 | }, 21 | { 22 | "size" : "32x32", 23 | "idiom" : "mac", 24 | "filename" : "app_icon_64.png", 25 | "scale" : "2x" 26 | }, 27 | { 28 | "size" : "128x128", 29 | "idiom" : "mac", 30 | "filename" : "app_icon_128.png", 31 | "scale" : "1x" 32 | }, 33 | { 34 | "size" : "128x128", 35 | "idiom" : "mac", 36 | "filename" : "app_icon_256.png", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "size" : "256x256", 41 | "idiom" : "mac", 42 | "filename" : "app_icon_256.png", 43 | "scale" : "1x" 44 | }, 45 | { 46 | "size" : "256x256", 47 | "idiom" : "mac", 48 | "filename" : "app_icon_512.png", 49 | "scale" : "2x" 50 | }, 51 | { 52 | "size" : "512x512", 53 | "idiom" : "mac", 54 | "filename" : "app_icon_512.png", 55 | "scale" : "1x" 56 | }, 57 | { 58 | "size" : "512x512", 59 | "idiom" : "mac", 60 | "filename" : "app_icon_1024.png", 61 | "scale" : "2x" 62 | } 63 | ], 64 | "info" : { 65 | "version" : 1, 66 | "author" : "xcode" 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_1024.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_128.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_16.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_256.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_32.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_512.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/macos/Runner/Assets.xcassets/AppIcon.appiconset/app_icon_64.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Configs/AppInfo.xcconfig: -------------------------------------------------------------------------------- 1 | // Application-level settings for the Runner target. 2 | // 3 | // This may be replaced with something auto-generated from metadata (e.g., pubspec.yaml) in the 4 | // future. If not, the values below would default to using the project name when this becomes a 5 | // 'flutter create' template. 6 | 7 | // The application's name. By default this is also the title of the Flutter window. 8 | PRODUCT_NAME = example 9 | 10 | // The application's bundle identifier 11 | PRODUCT_BUNDLE_IDENTIFIER = com.itnomads.example 12 | 13 | // The copyright displayed in application information 14 | PRODUCT_COPYRIGHT = Copyright © 2024 com.it_nomads. All rights reserved. 15 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Configs/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Debug.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Configs/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include "../../Flutter/Flutter-Release.xcconfig" 2 | #include "Warnings.xcconfig" 3 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Configs/Warnings.xcconfig: -------------------------------------------------------------------------------- 1 | WARNING_CFLAGS = -Wall -Wconditional-uninitialized -Wnullable-to-nonnull-conversion -Wmissing-method-return-type -Woverlength-strings 2 | GCC_WARN_UNDECLARED_SELECTOR = YES 3 | CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES 4 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE 5 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES 6 | CLANG_WARN_PRAGMA_PACK = YES 7 | CLANG_WARN_STRICT_PROTOTYPES = YES 8 | CLANG_WARN_COMMA = YES 9 | GCC_WARN_STRICT_SELECTOR_MATCH = YES 10 | CLANG_WARN_OBJC_REPEATED_USE_OF_WEAK = YES 11 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES 12 | GCC_WARN_SHADOW = YES 13 | CLANG_WARN_UNREACHABLE_CODE = YES 14 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/DebugProfile.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.allow-jit 8 | 9 | com.apple.security.network.server 10 | 11 | keychain-access-groups 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | $(PRODUCT_NAME) 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | $(FLUTTER_BUILD_NAME) 21 | CFBundleVersion 22 | $(FLUTTER_BUILD_NUMBER) 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSHumanReadableCopyright 26 | $(PRODUCT_COPYRIGHT) 27 | NSMainNibFile 28 | MainMenu 29 | NSPrincipalClass 30 | NSApplication 31 | 32 | 33 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/MainFlutterWindow.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | 4 | class MainFlutterWindow: NSWindow { 5 | override func awakeFromNib() { 6 | let flutterViewController = FlutterViewController() 7 | let windowFrame = self.frame 8 | self.contentViewController = flutterViewController 9 | self.setFrame(windowFrame, display: true) 10 | 11 | RegisterGeneratedPlugins(registry: flutterViewController) 12 | 13 | super.awakeFromNib() 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/Runner/Release.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | keychain-access-groups 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/macos/RunnerTests/RunnerTests.swift: -------------------------------------------------------------------------------- 1 | import Cocoa 2 | import FlutterMacOS 3 | import XCTest 4 | 5 | class RunnerTests: XCTestCase { 6 | 7 | func testExample() { 8 | // If you add code to the Runner application, consider adding tests here. 9 | // See https://developer.apple.com/documentation/xctest for more information about using XCTest. 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_example 2 | description: Demonstrates how to use the flutter_secure_storage plugin. 3 | 4 | version: 1.0.0+1 5 | 6 | publish_to: 'none' 7 | 8 | environment: 9 | sdk: '>=3.3.0 <4.0.0' 10 | flutter: '>=3.19.0' 11 | 12 | dependencies: 13 | flutter: 14 | sdk: flutter 15 | flutter_secure_storage: 16 | # When depending on this package from a real application you should use: 17 | # flutter_secure_storage: ^x.y.z 18 | # See https://dart.dev/tools/pub/dependencies#version-constraints 19 | # The example app is bundled with the plugin so we use a path dependency on 20 | # the parent directory to use the current plugin's version. 21 | path: ../ 22 | 23 | dev_dependencies: 24 | flutter_test: 25 | sdk: flutter 26 | integration_test: 27 | sdk: flutter 28 | test: any 29 | very_good_analysis: ^7.0.0 30 | 31 | flutter: 32 | uses-material-design: true 33 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/web/favicon.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/icons/Icon-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/web/icons/Icon-192.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/icons/Icon-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/web/icons/Icon-512.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/icons/Icon-maskable-192.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/web/icons/Icon-maskable-192.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/icons/Icon-maskable-512.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/web/icons/Icon-maskable-512.png -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | example 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/web/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "example", 3 | "short_name": "example", 4 | "start_url": ".", 5 | "display": "standalone", 6 | "background_color": "#0175C2", 7 | "theme_color": "#0175C2", 8 | "description": "A new Flutter project.", 9 | "orientation": "portrait-primary", 10 | "prefer_related_applications": false, 11 | "icons": [ 12 | { 13 | "src": "icons/Icon-192.png", 14 | "sizes": "192x192", 15 | "type": "image/png" 16 | }, 17 | { 18 | "src": "icons/Icon-512.png", 19 | "sizes": "512x512", 20 | "type": "image/png" 21 | }, 22 | { 23 | "src": "icons/Icon-maskable-192.png", 24 | "sizes": "192x192", 25 | "type": "image/png", 26 | "purpose": "maskable" 27 | }, 28 | { 29 | "src": "icons/Icon-maskable-512.png", 30 | "sizes": "512x512", 31 | "type": "image/png", 32 | "purpose": "maskable" 33 | } 34 | ] 35 | } 36 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_secure_storage_windows 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(runner LANGUAGES CXX) 3 | 4 | add_executable(${BINARY_NAME} WIN32 5 | "flutter_window.cpp" 6 | "main.cpp" 7 | "run_loop.cpp" 8 | "utils.cpp" 9 | "win32_window.cpp" 10 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 11 | "Runner.rc" 12 | "runner.exe.manifest" 13 | ) 14 | apply_standard_settings(${BINARY_NAME}) 15 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 16 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 17 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 18 | add_dependencies(${BINARY_NAME} flutter_assemble) 19 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/Runner.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #pragma code_page(65001) 4 | #include "resource.h" 5 | 6 | #define APSTUDIO_READONLY_SYMBOLS 7 | ///////////////////////////////////////////////////////////////////////////// 8 | // 9 | // Generated from the TEXTINCLUDE 2 resource. 10 | // 11 | #include "winres.h" 12 | 13 | ///////////////////////////////////////////////////////////////////////////// 14 | #undef APSTUDIO_READONLY_SYMBOLS 15 | 16 | ///////////////////////////////////////////////////////////////////////////// 17 | // English (United States) resources 18 | 19 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | 22 | #ifdef APSTUDIO_INVOKED 23 | ///////////////////////////////////////////////////////////////////////////// 24 | // 25 | // TEXTINCLUDE 26 | // 27 | 28 | 1 TEXTINCLUDE 29 | BEGIN 30 | "resource.h\0" 31 | END 32 | 33 | 2 TEXTINCLUDE 34 | BEGIN 35 | "#include ""winres.h""\r\n" 36 | "\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | 48 | ///////////////////////////////////////////////////////////////////////////// 49 | // 50 | // Icon 51 | // 52 | 53 | // Icon with lowest ID value placed first to ensure application icon 54 | // remains consistent on all systems. 55 | IDI_APP_ICON ICON "resources\\app_icon.ico" 56 | 57 | 58 | ///////////////////////////////////////////////////////////////////////////// 59 | // 60 | // Version 61 | // 62 | 63 | #if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) 64 | #define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD 65 | #else 66 | #define VERSION_AS_NUMBER 1,0,0,0 67 | #endif 68 | 69 | #if defined(FLUTTER_VERSION) 70 | #define VERSION_AS_STRING FLUTTER_VERSION 71 | #else 72 | #define VERSION_AS_STRING "1.0.0" 73 | #endif 74 | 75 | VS_VERSION_INFO VERSIONINFO 76 | FILEVERSION VERSION_AS_NUMBER 77 | PRODUCTVERSION VERSION_AS_NUMBER 78 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 79 | #ifdef _DEBUG 80 | FILEFLAGS VS_FF_DEBUG 81 | #else 82 | FILEFLAGS 0x0L 83 | #endif 84 | FILEOS VOS__WINDOWS32 85 | FILETYPE VFT_APP 86 | FILESUBTYPE 0x0L 87 | BEGIN 88 | BLOCK "StringFileInfo" 89 | BEGIN 90 | BLOCK "040904e4" 91 | BEGIN 92 | VALUE "CompanyName", "com.it_nomads" "\0" 93 | VALUE "FileDescription", "A new Flutter project." "\0" 94 | VALUE "FileVersion", VERSION_AS_STRING "\0" 95 | VALUE "InternalName", "example" "\0" 96 | VALUE "LegalCopyright", "Copyright (C) 2021 com.it_nomads. All rights reserved." "\0" 97 | VALUE "OriginalFilename", "example.exe" "\0" 98 | VALUE "ProductName", "example" "\0" 99 | VALUE "ProductVersion", VERSION_AS_STRING "\0" 100 | END 101 | END 102 | BLOCK "VarFileInfo" 103 | BEGIN 104 | VALUE "Translation", 0x409, 1252 105 | END 106 | END 107 | 108 | #endif // English (United States) resources 109 | ///////////////////////////////////////////////////////////////////////////// 110 | 111 | 112 | 113 | #ifndef APSTUDIO_INVOKED 114 | ///////////////////////////////////////////////////////////////////////////// 115 | // 116 | // Generated from the TEXTINCLUDE 3 resource. 117 | // 118 | 119 | 120 | ///////////////////////////////////////////////////////////////////////////// 121 | #endif // not APSTUDIO_INVOKED 122 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(RunLoop* run_loop, 8 | const flutter::DartProject& project) 9 | : run_loop_(run_loop), project_(project) {} 10 | 11 | FlutterWindow::~FlutterWindow() {} 12 | 13 | bool FlutterWindow::OnCreate() { 14 | if (!Win32Window::OnCreate()) { 15 | return false; 16 | } 17 | 18 | RECT frame = GetClientArea(); 19 | 20 | // The size here must match the window dimensions to avoid unnecessary surface 21 | // creation / destruction in the startup path. 22 | flutter_controller_ = std::make_unique( 23 | frame.right - frame.left, frame.bottom - frame.top, project_); 24 | // Ensure that basic setup of the controller was successful. 25 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 26 | return false; 27 | } 28 | RegisterPlugins(flutter_controller_->engine()); 29 | run_loop_->RegisterFlutterInstance(flutter_controller_->engine()); 30 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 31 | return true; 32 | } 33 | 34 | void FlutterWindow::OnDestroy() { 35 | if (flutter_controller_) { 36 | run_loop_->UnregisterFlutterInstance(flutter_controller_->engine()); 37 | flutter_controller_ = nullptr; 38 | } 39 | 40 | Win32Window::OnDestroy(); 41 | } 42 | 43 | LRESULT 44 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 45 | WPARAM const wparam, 46 | LPARAM const lparam) noexcept { 47 | // Give Flutter, including plugins, an opportunity to handle window messages. 48 | if (flutter_controller_) { 49 | std::optional result = 50 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 51 | lparam); 52 | if (result) { 53 | return *result; 54 | } 55 | } 56 | 57 | switch (message) { 58 | case WM_FONTCHANGE: 59 | flutter_controller_->engine()->ReloadSystemFonts(); 60 | break; 61 | } 62 | 63 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 64 | } 65 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "run_loop.h" 10 | #include "win32_window.h" 11 | 12 | // A window that does nothing but host a Flutter view. 13 | class FlutterWindow : public Win32Window { 14 | public: 15 | // Creates a new FlutterWindow driven by the |run_loop|, hosting a 16 | // Flutter view running |project|. 17 | explicit FlutterWindow(RunLoop* run_loop, 18 | const flutter::DartProject& project); 19 | virtual ~FlutterWindow(); 20 | 21 | protected: 22 | // Win32Window: 23 | bool OnCreate() override; 24 | void OnDestroy() override; 25 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 26 | LPARAM const lparam) noexcept override; 27 | 28 | private: 29 | // The run loop driving events for this window. 30 | RunLoop* run_loop_; 31 | 32 | // The project to run. 33 | flutter::DartProject project_; 34 | 35 | // The Flutter instance hosted by this window. 36 | std::unique_ptr flutter_controller_; 37 | }; 38 | 39 | #endif // RUNNER_FLUTTER_WINDOW_H_ 40 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "run_loop.h" 7 | #include "utils.h" 8 | 9 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 10 | _In_ wchar_t *command_line, _In_ int show_command) { 11 | // Attach to console when present (e.g., 'flutter run') or create a 12 | // new console when running with a debugger. 13 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 14 | CreateAndAttachConsole(); 15 | } 16 | 17 | // Initialize COM, so that it is available for use in the library and/or 18 | // plugins. 19 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 20 | 21 | RunLoop run_loop; 22 | 23 | flutter::DartProject project(L"data"); 24 | 25 | std::vector command_line_arguments = 26 | GetCommandLineArguments(); 27 | 28 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 29 | 30 | FlutterWindow window(&run_loop, project); 31 | Win32Window::Point origin(10, 10); 32 | Win32Window::Size size(1280, 720); 33 | if (!window.CreateAndShow(L"example", origin, size)) { 34 | return EXIT_FAILURE; 35 | } 36 | window.SetQuitOnClose(true); 37 | 38 | run_loop.Run(); 39 | 40 | ::CoUninitialize(); 41 | return EXIT_SUCCESS; 42 | } 43 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/run_loop.cpp: -------------------------------------------------------------------------------- 1 | #include "run_loop.h" 2 | 3 | #include 4 | 5 | #include 6 | 7 | RunLoop::RunLoop() {} 8 | 9 | RunLoop::~RunLoop() {} 10 | 11 | void RunLoop::Run() { 12 | bool keep_running = true; 13 | TimePoint next_flutter_event_time = TimePoint::clock::now(); 14 | while (keep_running) { 15 | std::chrono::nanoseconds wait_duration = 16 | std::max(std::chrono::nanoseconds(0), 17 | next_flutter_event_time - TimePoint::clock::now()); 18 | ::MsgWaitForMultipleObjects( 19 | 0, nullptr, FALSE, static_cast(wait_duration.count() / 1000), 20 | QS_ALLINPUT); 21 | bool processed_events = false; 22 | MSG message; 23 | // All pending Windows messages must be processed; MsgWaitForMultipleObjects 24 | // won't return again for items left in the queue after PeekMessage. 25 | while (::PeekMessage(&message, nullptr, 0, 0, PM_REMOVE)) { 26 | processed_events = true; 27 | if (message.message == WM_QUIT) { 28 | keep_running = false; 29 | break; 30 | } 31 | ::TranslateMessage(&message); 32 | ::DispatchMessage(&message); 33 | // Allow Flutter to process messages each time a Windows message is 34 | // processed, to prevent starvation. 35 | next_flutter_event_time = 36 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 37 | } 38 | // If the PeekMessage loop didn't run, process Flutter messages. 39 | if (!processed_events) { 40 | next_flutter_event_time = 41 | std::min(next_flutter_event_time, ProcessFlutterMessages()); 42 | } 43 | } 44 | } 45 | 46 | void RunLoop::RegisterFlutterInstance( 47 | flutter::FlutterEngine* flutter_instance) { 48 | flutter_instances_.insert(flutter_instance); 49 | } 50 | 51 | void RunLoop::UnregisterFlutterInstance( 52 | flutter::FlutterEngine* flutter_instance) { 53 | flutter_instances_.erase(flutter_instance); 54 | } 55 | 56 | RunLoop::TimePoint RunLoop::ProcessFlutterMessages() { 57 | TimePoint next_event_time = TimePoint::max(); 58 | for (auto instance : flutter_instances_) { 59 | std::chrono::nanoseconds wait_duration = instance->ProcessMessages(); 60 | if (wait_duration != std::chrono::nanoseconds::max()) { 61 | next_event_time = 62 | std::min(next_event_time, TimePoint::clock::now() + wait_duration); 63 | } 64 | } 65 | return next_event_time; 66 | } 67 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/run_loop.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_RUN_LOOP_H_ 2 | #define RUNNER_RUN_LOOP_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | 9 | // A runloop that will service events for Flutter instances as well 10 | // as native messages. 11 | class RunLoop { 12 | public: 13 | RunLoop(); 14 | ~RunLoop(); 15 | 16 | // Prevent copying 17 | RunLoop(RunLoop const&) = delete; 18 | RunLoop& operator=(RunLoop const&) = delete; 19 | 20 | // Runs the run loop until the application quits. 21 | void Run(); 22 | 23 | // Registers the given Flutter instance for event servicing. 24 | void RegisterFlutterInstance( 25 | flutter::FlutterEngine* flutter_instance); 26 | 27 | // Unregisters the given Flutter instance from event servicing. 28 | void UnregisterFlutterInstance( 29 | flutter::FlutterEngine* flutter_instance); 30 | 31 | private: 32 | using TimePoint = std::chrono::steady_clock::time_point; 33 | 34 | // Processes all currently pending messages for registered Flutter instances. 35 | TimePoint ProcessFlutterMessages(); 36 | 37 | std::set flutter_instances_; 38 | }; 39 | 40 | #endif // RUNNER_RUN_LOOP_H_ 41 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | if (target_length == 0) { 52 | return std::string(); 53 | } 54 | std::string utf8_string; 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /flutter_secure_storage/example/windows/runner/win32_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_WIN32_WINDOW_H_ 2 | #define RUNNER_WIN32_WINDOW_H_ 3 | 4 | #include 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | // A class abstraction for a high DPI-aware Win32 Window. Intended to be 11 | // inherited from by classes that wish to specialize with custom 12 | // rendering and input handling 13 | class Win32Window { 14 | public: 15 | struct Point { 16 | unsigned int x; 17 | unsigned int y; 18 | Point(unsigned int x, unsigned int y) : x(x), y(y) {} 19 | }; 20 | 21 | struct Size { 22 | unsigned int width; 23 | unsigned int height; 24 | Size(unsigned int width, unsigned int height) 25 | : width(width), height(height) {} 26 | }; 27 | 28 | Win32Window(); 29 | virtual ~Win32Window(); 30 | 31 | // Creates and shows a win32 window with |title| and position and size using 32 | // |origin| and |size|. New windows are created on the default monitor. Window 33 | // sizes are specified to the OS in physical pixels, hence to ensure a 34 | // consistent size to will treat the width height passed in to this function 35 | // as logical pixels and scale to appropriate for the default monitor. Returns 36 | // true if the window was created successfully. 37 | bool CreateAndShow(const std::wstring& title, 38 | const Point& origin, 39 | const Size& size); 40 | 41 | // Release OS resources associated with window. 42 | void Destroy(); 43 | 44 | // Inserts |content| into the window tree. 45 | void SetChildContent(HWND content); 46 | 47 | // Returns the backing Window handle to enable clients to set icon and other 48 | // window properties. Returns nullptr if the window has been destroyed. 49 | HWND GetHandle(); 50 | 51 | // If true, closing this window will quit the application. 52 | void SetQuitOnClose(bool quit_on_close); 53 | 54 | // Return a RECT representing the bounds of the current client area. 55 | RECT GetClientArea(); 56 | 57 | protected: 58 | // Processes and route salient window messages for mouse handling, 59 | // size change and DPI. Delegates handling of these to member overloads that 60 | // inheriting classes can handle. 61 | virtual LRESULT MessageHandler(HWND window, 62 | UINT const message, 63 | WPARAM const wparam, 64 | LPARAM const lparam) noexcept; 65 | 66 | // Called when CreateAndShow is called, allowing subclass window-related 67 | // setup. Subclasses should return false if setup fails. 68 | virtual bool OnCreate(); 69 | 70 | // Called when Destroy is called. 71 | virtual void OnDestroy(); 72 | 73 | private: 74 | friend class WindowClassRegistrar; 75 | 76 | // OS callback called by message pump. Handles the WM_NCCREATE message which 77 | // is passed when the non-client area is being created and enables automatic 78 | // non-client DPI scaling so that the non-client area automatically 79 | // responsponds to changes in DPI. All other messages are handled by 80 | // MessageHandler. 81 | static LRESULT CALLBACK WndProc(HWND const window, 82 | UINT const message, 83 | WPARAM const wparam, 84 | LPARAM const lparam) noexcept; 85 | 86 | // Retrieves a class instance pointer for |window| 87 | static Win32Window* GetThisFromHandle(HWND const window) noexcept; 88 | 89 | bool quit_on_close_ = false; 90 | 91 | // window handle for top level window. 92 | HWND window_handle_ = nullptr; 93 | 94 | // window handle for hosted content. 95 | HWND child_content_ = nullptr; 96 | }; 97 | 98 | #endif // RUNNER_WIN32_WINDOW_H_ 99 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/options/ios_options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage.dart'; 2 | 3 | /// Specific options for iOS platform. 4 | /// Currently there are no specific ios options available, but only shared 5 | /// options from apple options. 6 | class IOSOptions extends AppleOptions { 7 | /// Creates an instance of `IosOptions` with configurable parameters 8 | /// for keychain access and storage behavior. 9 | const IOSOptions({ 10 | super.accountName, 11 | super.groupId, 12 | super.accessibility, 13 | super.synchronizable, 14 | super.label, 15 | super.description, 16 | super.comment, 17 | super.isInvisible, 18 | super.isNegative, 19 | super.creationDate, 20 | super.lastModifiedDate, 21 | super.resultLimit, 22 | super.shouldReturnPersistentReference, 23 | super.authenticationUIBehavior, 24 | super.accessControlFlags, 25 | }); 26 | 27 | /// A predefined `IosOptions` instance with default settings. 28 | /// 29 | /// This can be used as a fallback or when no specific options are required. 30 | static const IOSOptions defaultOptions = IOSOptions(); 31 | 32 | @override 33 | Map toMap() => { 34 | ...super.toMap(), 35 | }; 36 | } 37 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/options/linux_options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage.dart'; 2 | 3 | /// Specific options for Linux platform. 4 | /// Currently there are no specific linux options available. 5 | class LinuxOptions extends Options { 6 | /// Creates an instance of `LinuxOptions` with no additional configuration. 7 | const LinuxOptions(); 8 | 9 | /// A predefined `LinuxOptions` instance with default settings. 10 | /// 11 | /// This can be used as a fallback or when no specific options are required. 12 | static const LinuxOptions defaultOptions = LinuxOptions(); 13 | 14 | /// Converts the `LinuxOptions` instance into a map representation. 15 | /// 16 | /// Returns: 17 | /// - An empty map, as `LinuxOptions` does not require additional 18 | /// configuration. 19 | /// 20 | /// Overrides: 21 | /// - [Options.toMap] to provide a Linux-specific implementation. 22 | @override 23 | Map toMap() { 24 | return {}; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/options/macos_options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage.dart'; 2 | 3 | /// Specific options for macOS platform. 4 | /// Extends `AppleOptions` and adds the `usesDataProtectionKeychain` parameter. 5 | class MacOsOptions extends AppleOptions { 6 | /// Creates an instance of `MacosOptions` with configurable parameters 7 | /// for keychain access and storage behavior. 8 | const MacOsOptions({ 9 | super.accountName, 10 | super.groupId, 11 | super.accessibility, 12 | super.synchronizable, 13 | super.label, 14 | super.description, 15 | super.comment, 16 | super.isInvisible, 17 | super.isNegative, 18 | super.creationDate, 19 | super.lastModifiedDate, 20 | super.resultLimit, 21 | super.shouldReturnPersistentReference, 22 | super.authenticationUIBehavior, 23 | super.accessControlFlags, 24 | this.usesDataProtectionKeychain = true, 25 | }); 26 | 27 | /// `kSecUseDataProtectionKeychain` (macOS only): **Shared**. 28 | /// Indicates whether the macOS data protection keychain is used. 29 | /// Not applicable on iOS. 30 | final bool usesDataProtectionKeychain; 31 | 32 | /// A predefined `MacosOptions` instance with default settings. 33 | /// 34 | /// This can be used as a fallback or when no specific options are required. 35 | static const MacOsOptions defaultOptions = MacOsOptions(); 36 | 37 | @override 38 | Map toMap() => { 39 | ...super.toMap(), 40 | 'usesDataProtectionKeychain': '$usesDataProtectionKeychain', 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/options/web_options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage.dart'; 2 | 3 | /// Specific options for web platform. 4 | class WebOptions extends Options { 5 | /// Creates an instance of `WebOptions` with configurable parameters 6 | /// for secure storage behavior on web platforms. 7 | /// 8 | /// Parameters: 9 | /// - [dbName]: The name of the database used for secure storage. 10 | /// Defaults to `'FlutterEncryptedStorage'`. 11 | /// - [publicKey]: The public key used for encryption. Defaults to 12 | /// `'FlutterSecureStorage'`. 13 | /// - [wrapKey]: The key used to wrap the encryption key. 14 | /// - [wrapKeyIv]: The initialization vector (IV) used for the wrap key. 15 | /// - [useSessionStorage]: Whether to use session storage instead of local 16 | /// storage. 17 | /// Defaults to `false`. 18 | const WebOptions({ 19 | this.dbName = 'FlutterEncryptedStorage', 20 | this.publicKey = 'FlutterSecureStorage', 21 | this.wrapKey = '', 22 | this.wrapKeyIv = '', 23 | this.useSessionStorage = false, 24 | }); 25 | 26 | /// A predefined `WebOptions` instance with default settings. 27 | /// 28 | /// This can be used as a fallback or when no specific options are required. 29 | static const WebOptions defaultOptions = WebOptions(); 30 | 31 | /// The name of the database used for secure storage. 32 | /// Defaults to `'FlutterEncryptedStorage'`. 33 | final String dbName; 34 | 35 | /// The public key used for encryption. 36 | /// Defaults to `'FlutterSecureStorage'`. 37 | final String publicKey; 38 | 39 | /// The key used to wrap the encryption key. 40 | final String wrapKey; 41 | 42 | /// The initialization vector (IV) used for the wrap key. 43 | final String wrapKeyIv; 44 | 45 | /// Whether to use session storage instead of local storage. 46 | /// Defaults to `false`. 47 | final bool useSessionStorage; 48 | 49 | /// Converts the `WebOptions` instance into a map representation, 50 | /// including all web-specific properties. 51 | @override 52 | Map toMap() => { 53 | 'dbName': dbName, 54 | 'publicKey': publicKey, 55 | 'wrapKey': wrapKey, 56 | 'wrapKeyIv': wrapKeyIv, 57 | 'useSessionStorage': useSessionStorage.toString(), 58 | }; 59 | } 60 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/options/windows_options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage.dart'; 2 | 3 | /// Specific options for Windows platform. 4 | class WindowsOptions extends Options { 5 | /// * If `useBackwardCompatibility` is set to true, trying to read from values 6 | /// which were written by previous versions. In addition, when reading or 7 | /// writing from previous version's storage, read values will be migrated to 8 | /// new storage automatically. This may introduces some performance hit and 9 | /// might cause error for some kinds of keys. 10 | /// Default is `false`. 11 | /// You must set this value to `false` if you could use: 12 | /// * Keys containing `"`, `<`, `>`, `|`, `:`, `*`, `?`, `/`, `\`, 13 | /// or any of ASCII control charactors. 14 | /// * Keys containing `/../`, `\..\`, or their combinations. 15 | /// * Long key string (precise size is depends on your app's product name, 16 | /// company name, and account name who executes your app). 17 | /// 18 | /// You can migrate all old data with this options as following: 19 | /// ```dart 20 | /// await FlutterSecureStorage().readAll( 21 | /// const WindowsOptions(useBackwardCompatibility: true), 22 | /// ); 23 | /// ``` 24 | const WindowsOptions({ 25 | bool useBackwardCompatibility = false, 26 | }) : _useBackwardCompatibility = useBackwardCompatibility; 27 | 28 | /// A predefined `WindowsOptions` instance with default settings. 29 | /// 30 | /// This can be used as a fallback or when no specific options are required. 31 | static const WindowsOptions defaultOptions = WindowsOptions(); 32 | 33 | final bool _useBackwardCompatibility; 34 | 35 | @override 36 | Map toMap() => { 37 | 'useBackwardCompatibility': _useBackwardCompatibility.toString(), 38 | }; 39 | 40 | /// Creates a new instance of `WindowsOptions` by copying the current instance 41 | /// and replacing specified properties with new values. 42 | WindowsOptions copyWith({ 43 | bool? useBackwardCompatibility, 44 | }) => 45 | WindowsOptions( 46 | useBackwardCompatibility: 47 | useBackwardCompatibility ?? _useBackwardCompatibility, 48 | ); 49 | } 50 | -------------------------------------------------------------------------------- /flutter_secure_storage/lib/test/test_flutter_secure_storage_platform.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_secure_storage_platform_interface/flutter_secure_storage_platform_interface.dart'; 2 | 3 | /// The `TestFlutterSecureStoragePlatform` class is a test implementation of 4 | /// the `FlutterSecureStoragePlatform` interface, allowing for in-memory storage 5 | /// of key-value pairs for testing purposes. 6 | class TestFlutterSecureStoragePlatform extends FlutterSecureStoragePlatform { 7 | /// Creates an instance of `TestFlutterSecureStoragePlatform` with an 8 | /// in-memory data store. 9 | /// 10 | /// Parameters: 11 | /// - [data]: A map representing the in-memory storage for key-value pairs. 12 | TestFlutterSecureStoragePlatform(this.data); 13 | 14 | /// The in-memory data store used for storing key-value pairs. 15 | final Map data; 16 | 17 | @override 18 | Future containsKey({ 19 | required String key, 20 | required Map options, 21 | }) async => 22 | data.containsKey(key); 23 | 24 | @override 25 | Future delete({ 26 | required String key, 27 | required Map options, 28 | }) async => 29 | data.remove(key); 30 | 31 | @override 32 | Future deleteAll({required Map options}) async => 33 | data.clear(); 34 | 35 | @override 36 | Future read({ 37 | required String key, 38 | required Map options, 39 | }) async => 40 | data[key]; 41 | 42 | @override 43 | Future> readAll({ 44 | required Map options, 45 | }) async => 46 | data; 47 | 48 | @override 49 | Future write({ 50 | required String key, 51 | required String value, 52 | required Map options, 53 | }) async => 54 | data[key] = value; 55 | } 56 | -------------------------------------------------------------------------------- /flutter_secure_storage/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage 2 | description: A Flutter plugin for securely storing sensitive data using encrypted storage. 3 | version: 10.0.0-beta.4 4 | repository: https://github.com/mogol/flutter_secure_storage/tree/develop/flutter_secure_storage 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | flutter: 11 | plugin: 12 | platforms: 13 | android: 14 | package: com.it_nomads.fluttersecurestorage 15 | pluginClass: FlutterSecureStoragePlugin 16 | ios: 17 | default_package: flutter_secure_storage_darwin 18 | macos: 19 | default_package: flutter_secure_storage_darwin 20 | linux: 21 | default_package: flutter_secure_storage_linux 22 | web: 23 | default_package: flutter_secure_storage_web 24 | windows: 25 | default_package: flutter_secure_storage_windows 26 | 27 | dependencies: 28 | flutter: 29 | sdk: flutter 30 | # The design on https://flutter.dev/go/federated-plugins was to leave 31 | # implementation constraints as "any". We cannot do it right now as it fails pub publish 32 | # validation, so we set a ^ constraint. 33 | # https://github.com/flutter/flutter/issues/46264 34 | flutter_secure_storage_darwin: ^0.1.0 35 | flutter_secure_storage_linux: ^2.0.0 36 | flutter_secure_storage_platform_interface: ^2.0.1 37 | flutter_secure_storage_web: ^2.0.0 38 | flutter_secure_storage_windows: ^4.0.0 39 | meta: ^1.3.0 40 | 41 | dev_dependencies: 42 | flutter_test: 43 | sdk: flutter 44 | mocktail: ^1.0.0 45 | plugin_platform_interface: ^2.0.0 46 | very_good_analysis: ^7.0.0 47 | 48 | # We need to manually declare supported platforms, because pub.dev won't find them. 49 | platforms: 50 | android: 51 | ios: 52 | linux: 53 | macos: 54 | web: 55 | windows: 56 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .build/ 9 | .buildlog/ 10 | .history 11 | .svn/ 12 | .swiftpm/ 13 | migrate_working_dir/ 14 | 15 | # IntelliJ related 16 | *.iml 17 | *.ipr 18 | *.iws 19 | .idea/ 20 | 21 | # The .vscode folder contains launch configuration and tasks you configure in 22 | # VS Code which you may wish to be included in version control, so this line 23 | # is commented out by default. 24 | #.vscode/ 25 | 26 | # Flutter/Dart/Pub related 27 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 28 | /pubspec.lock 29 | **/doc/api/ 30 | .dart_tool/ 31 | .flutter-plugins 32 | .flutter-plugins-dependencies 33 | build/ 34 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: "17025dd88227cd9532c33fa78f5250d548d87e9a" 8 | channel: "stable" 9 | 10 | project_type: plugin 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 17 | base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 18 | - platform: ios 19 | create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 20 | base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 21 | - platform: macos 22 | create_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 23 | base_revision: 17025dd88227cd9532c33fa78f5250d548d87e9a 24 | 25 | # User provided section 26 | 27 | # List of Local paths (relative to this file) that should be 28 | # ignored by the migrate tool. 29 | # 30 | # Files that are not part of the templates will be ignored by default. 31 | unmanaged_files: 32 | - 'lib/main.dart' 33 | - 'ios/Runner.xcodeproj/project.pbxproj' 34 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 0.1.0 2 | This package combines flutter_secure_storage_macos together with the ios part of flutter_secure_storage. 3 | 4 | Other changes: 5 | - Code has been rebuild from the ground up 6 | - Lots of missing attributes have been added to the IOSOptions and MacOsOptions classes. 7 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2025 Julian Steenbakker 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_darwin 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for iOS macOS. 4 | 5 | ## Features 6 | 7 | - Secure storage using the Keychain API. 8 | - Fully integrated with iOS and macOS security features. 9 | 10 | ## Installation 11 | 12 | Add the dependency in your `pubspec.yaml` and run `flutter pub get`. 13 | 14 | ## Configuration 15 | 16 | You also need to add Keychain Sharing as capability to your iOS or macOS runner. To achieve this, please add the following in *both* your `(ios/macos)/Runner/DebugProfile.entitlements` *and* `(ios/macos)/Runner/Release.entitlements`. 17 | 18 | ``` 19 | keychain-access-groups 20 | 21 | ``` 22 | 23 | If you have set your application up to use App Groups then you will need to add the name of the App Group to the `keychain-access-groups` argument above. Failure to do so will result in values appearing to be written successfully but never actually being written at all. For example if your app has an App Group named "aoeu" then your value for above would instead read: 24 | 25 | ``` 26 | keychain-access-groups 27 | 28 | $(AppIdentifierPrefix)aoeu 29 | 30 | ``` 31 | 32 | If you are configuring this value through XCode then the string you set in the Keychain Sharing section would simply read "aoeu" with XCode appending the `$(AppIdentifierPrefix)` when it saves the configuration. 33 | 34 | ## Usage 35 | 36 | Refer to the main [flutter_secure_storage README](../README.md) for common usage instructions. 37 | 38 | ## License 39 | 40 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 41 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/darwin/.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .vagrant/ 3 | .sconsign.dblite 4 | .svn/ 5 | 6 | .DS_Store 7 | *.swp 8 | profile 9 | 10 | DerivedData/ 11 | build/ 12 | 13 | *.pbxuser 14 | *.mode1v3 15 | *.mode2v3 16 | *.perspectivev3 17 | 18 | !default.pbxuser 19 | !default.mode1v3 20 | !default.mode2v3 21 | !default.perspectivev3 22 | 23 | xcuserdata 24 | 25 | *.moved-aside 26 | 27 | *.pyc 28 | *sync/ 29 | Icon? 30 | .tags* 31 | 32 | .build/ 33 | .swiftpm/ 34 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/darwin/flutter_secure_storage_darwin.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html 3 | # 4 | Pod::Spec.new do |s| 5 | s.name = 'flutter_secure_storage_darwin' 6 | s.version = '10.0.0' 7 | s.summary = 'A Flutter plugin to store data in secure storage.' 8 | s.description = <<-DESC 9 | A Flutter plugin to store data in secure storage. 10 | DESC 11 | s.homepage = 'http://example.com' 12 | s.license = { :file => '../LICENSE' } 13 | s.author = { 'German Saprykin' => 'saprykin.h@gmail.com' } 14 | s.source = { :path => '.' } 15 | s.source_files = 'flutter_secure_storage_darwin/Sources/flutter_secure_storage_darwin/**/*' 16 | s.ios.dependency 'Flutter' 17 | s.osx.dependency 'FlutterMacOS' 18 | s.ios.deployment_target = '12.0' 19 | s.osx.deployment_target = '10.14' 20 | # Flutter.framework does not contain a i386 slice. 21 | s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES', 'EXCLUDED_ARCHS[sdk=iphonesimulator*]' => 'i386' } 22 | s.swift_version = '5.0' 23 | s.resource_bundles = {'flutter_secure_storage' => ['flutter_secure_storage_darwin/Sources/flutter_secure_storage_darwin/Resources/PrivacyInfo.xcprivacy']} 24 | end 25 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/darwin/flutter_secure_storage_darwin/Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version: 5.9 2 | // The swift-tools-version declares the minimum version of Swift required to build this package. 3 | 4 | import PackageDescription 5 | 6 | let package = Package( 7 | name: "flutter_secure_storage_darwin", 8 | platforms: [ 9 | .iOS("12.0"), 10 | .macOS("10.14") 11 | ], 12 | products: [ 13 | .library(name: "flutter-secure-storage-darwin", targets: ["flutter_secure_storage_darwin"]) 14 | ], 15 | dependencies: [], 16 | targets: [ 17 | .target( 18 | name: "flutter_secure_storage_darwin", 19 | dependencies: [], 20 | resources: [ 21 | .process("Resources"), 22 | ] 23 | ) 24 | ] 25 | ) 26 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/darwin/flutter_secure_storage_darwin/Sources/flutter_secure_storage_darwin/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage_darwin/darwin/flutter_secure_storage_darwin/Sources/flutter_secure_storage_darwin/Assets/.gitkeep -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/darwin/flutter_secure_storage_darwin/Sources/flutter_secure_storage_darwin/Resources/PrivacyInfo.xcprivacy: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | NSPrivacyTrackingDomains 6 | 7 | NSPrivacyAccessedAPITypes 8 | 9 | NSPrivacyCollectedDataTypes 10 | 11 | NSPrivacyTracking 12 | 13 | 14 | -------------------------------------------------------------------------------- /flutter_secure_storage_darwin/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_darwin 2 | description: "Apple (ios and macos) implementation of flutter_secure_storage" 3 | version: 0.1.0 4 | homepage: https://github.com/juliansteenbakker/flutter_secure_storage 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | plugin_platform_interface: ^2.0.2 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | # For information on the generic Dart part of this file, see the 20 | # following page: https://dart.dev/tools/pub/pubspec 21 | 22 | # The following section is specific to Flutter packages. 23 | flutter: 24 | # This section identifies this Flutter project as a plugin project. 25 | # The 'pluginClass' specifies the class (in Java, Kotlin, Swift, Objective-C, etc.) 26 | # which should be registered in the plugin registry. This is required for 27 | # using method channels. 28 | # The Android 'package' specifies package in which the registered class is. 29 | # This is required for using method channels on Android. 30 | # The 'ffiPlugin' specifies that native code should be built and bundled. 31 | # This is required for using `dart:ffi`. 32 | # All these are used by the tooling to maintain consistency when 33 | # adding or updating assets for this project. 34 | plugin: 35 | platforms: 36 | ios: 37 | pluginClass: FlutterSecureStorageDarwinPlugin 38 | sharedDarwinSource: true 39 | macos: 40 | pluginClass: FlutterSecureStorageDarwinPlugin 41 | sharedDarwinSource: true 42 | 43 | # To add assets to your plugin package, add an assets section, like this: 44 | # assets: 45 | # - images/a_dot_burr.jpeg 46 | # - images/a_dot_ham.jpeg 47 | # 48 | # For details regarding assets in packages, see 49 | # https://flutter.dev/to/asset-from-package 50 | # 51 | # An image asset can refer to one or more resolution-specific "variants", see 52 | # https://flutter.dev/to/resolution-aware-images 53 | 54 | # To add custom fonts to your plugin package, add a fonts section here, 55 | # in this "flutter" section. Each entry in this list should have a 56 | # "family" key with the font family name, and a "fonts" key with a 57 | # list giving the asset and other descriptors for the font. For 58 | # example: 59 | # fonts: 60 | # - family: Schyler 61 | # fonts: 62 | # - asset: fonts/Schyler-Regular.ttf 63 | # - asset: fonts/Schyler-Italic.ttf 64 | # style: italic 65 | # - family: Trajan Pro 66 | # fonts: 67 | # - asset: fonts/TrajanPro.ttf 68 | # - asset: fonts/TrajanPro_Bold.ttf 69 | # weight: 700 70 | # 71 | # For details regarding fonts in packages, see 72 | # https://flutter.dev/to/font-from-package 73 | -------------------------------------------------------------------------------- /flutter_secure_storage_linux/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: plugin 11 | -------------------------------------------------------------------------------- /flutter_secure_storage_linux/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.1 2 | Adds application ID to cmake file 3 | 4 | ## 2.0.0 5 | - This plugin requires a minimum dart sdk of 3.3.0 or higher and a minimum flutter version of 3.19.0. 6 | - Updated documentation 7 | 8 | ## 1.2.2 9 | - Fix json.dump with indentations 10 | 11 | ## 1.2.1 12 | - Fixed search with schemas fails in cold keyrings 13 | - Fixed erase called on null 14 | 15 | ## 1.2.0 16 | - Remove and replace libjsoncpp1 dependency 17 | - Update Dart SDK Constraint to support <4.0.0 instead of <3.0.0. 18 | 19 | ## 1.1.3 20 | Fixed a memory management issue 21 | 22 | ## 1.1.2 23 | Updated flutter_secure_storage_platform_interface to latest version. 24 | 25 | ## 1.1.1 26 | Fixed an issue where no error was being reported if there was something wrong accessing the secret service. 27 | 28 | ## 1.1.0 29 | Add containsKey function. 30 | 31 | ## 1.0.0 32 | - Initial Linux implementation 33 | - Removed unused Flutter test and effective_dart dependency -------------------------------------------------------------------------------- /flutter_secure_storage_linux/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage_linux/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_linux 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for Linux. 4 | 5 | ## Features 6 | 7 | - Secure storage using `libsecret` library. 8 | - Compatible with various Linux keyring services like Gnome Keyring and KDE KSecretsService. 9 | 10 | ## Installation 11 | 12 | Ensure you have the required dependencies installed: `libsecret-1-dev` and `libjsoncpp-dev`. 13 | 14 | ## Configuration 15 | 16 | 1. Install a keyring service such as Gnome Keyring or KSecretsService. 17 | 2. Ensure your application includes runtime dependencies like `libsecret-1-0` and `libjsoncpp1`. 18 | 19 | ## Usage 20 | 21 | Refer to the main [flutter_secure_storage README](../README.md) for common usage instructions. 22 | 23 | ## License 24 | 25 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 26 | -------------------------------------------------------------------------------- /flutter_secure_storage_linux/linux/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.10) 2 | set(PROJECT_NAME "flutter_secure_storage_linux") 3 | project(${PROJECT_NAME} LANGUAGES CXX) 4 | 5 | # This value is used when generating builds using this plugin, so it must 6 | # not be changed 7 | set(PLUGIN_NAME "flutter_secure_storage_linux_plugin") 8 | 9 | add_definitions(-DAPPLICATION_ID="${APPLICATION_ID}") 10 | 11 | add_library(${PLUGIN_NAME} SHARED 12 | "flutter_secure_storage_linux_plugin.cc" 13 | ) 14 | apply_standard_settings(${PLUGIN_NAME}) 15 | pkg_check_modules(LIBSECRET REQUIRED IMPORTED_TARGET libsecret-1>=0.18.4) 16 | 17 | set_target_properties(${PLUGIN_NAME} PROPERTIES 18 | CXX_VISIBILITY_PRESET hidden) 19 | 20 | 21 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) 22 | target_include_directories(${PLUGIN_NAME} INTERFACE 23 | "${CMAKE_CURRENT_SOURCE_DIR}/include") 24 | include_directories(${LIBSECRET_INCLUDE_DIRS}) 25 | 26 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter) 27 | target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::GTK) 28 | target_link_libraries(${PLUGIN_NAME} PRIVATE PkgConfig::LIBSECRET) 29 | 30 | # List of absolute paths to libraries that should be bundled with the plugin 31 | set(flutter_secure_storage_bundled_libraries 32 | "" 33 | PARENT_SCOPE 34 | ) 35 | -------------------------------------------------------------------------------- /flutter_secure_storage_linux/linux/include/FHashTable.hpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class FHashTable { 4 | GHashTable *m_hashTable; 5 | public: 6 | 7 | FHashTable() { m_hashTable = g_hash_table_new_full(g_str_hash, nullptr, g_free, g_free); } 8 | 9 | GHashTable* getGHashTable(){ 10 | return m_hashTable; 11 | } 12 | 13 | bool insert(const char *key, const char *value) { 14 | return g_hash_table_insert(m_hashTable, (void *)g_strdup(key), (void *)g_strdup(value)); 15 | } 16 | 17 | const char *get(const char *key) { 18 | return (const char *)g_hash_table_lookup(m_hashTable, (void *)key); 19 | } 20 | 21 | bool contains(const char *key) { 22 | return g_hash_table_contains(m_hashTable, (void *)key); 23 | } 24 | 25 | bool remove(const char *key) { 26 | return g_hash_table_remove(m_hashTable, (void *)key); 27 | } 28 | 29 | void removeAll() { g_hash_table_remove_all(m_hashTable); } 30 | 31 | ~FHashTable() { 32 | g_hash_table_destroy(m_hashTable); 33 | } 34 | }; -------------------------------------------------------------------------------- /flutter_secure_storage_linux/linux/include/flutter_secure_storage_linux/flutter_secure_storage_linux_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_LINUX_PLUGIN_H_ 2 | #define FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_LINUX_PLUGIN_H_ 3 | 4 | #include 5 | 6 | G_BEGIN_DECLS 7 | 8 | #ifdef FLUTTER_PLUGIN_IMPL 9 | #define FLUTTER_PLUGIN_EXPORT __attribute__((visibility("default"))) 10 | #else 11 | #define FLUTTER_PLUGIN_EXPORT 12 | #endif 13 | 14 | typedef struct _FlutterSecureStorageLinuxPlugin FlutterSecureStorageLinuxPlugin; 15 | typedef struct 16 | { 17 | GObjectClass parent_class; 18 | } FlutterSecureStorageLinuxPluginClass; 19 | 20 | FLUTTER_PLUGIN_EXPORT GType flutter_secure_storage_linux_plugin_get_type(); 21 | 22 | FLUTTER_PLUGIN_EXPORT void flutter_secure_storage_linux_plugin_register_with_registrar( 23 | FlPluginRegistrar *registrar); 24 | 25 | G_END_DECLS 26 | 27 | #endif // FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_PLUGIN_H_ 28 | -------------------------------------------------------------------------------- /flutter_secure_storage_linux/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_linux 2 | description: Linux implementation of flutter_secure_storage 3 | repository: https://github.com/mogol/flutter_secure_storage 4 | version: 2.0.1 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_secure_storage_platform_interface: ^2.0.0 14 | 15 | flutter: 16 | plugin: 17 | implements: flutter_secure_storage 18 | platforms: 19 | linux: 20 | pluginClass: FlutterSecureStorageLinuxPlugin 21 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.1 2 | Remove dart:io to support WASM build of web. 3 | 4 | ## 2.0.0 5 | - This plugin requires a minimum dart sdk of 3.3.0 or higher and a minimum flutter version of 3.19.0. 6 | - Migrated to new analyzer and clean-up code. 7 | 8 | ## 1.1.2 9 | Adds onCupertinoProtectedDataAvailabilityChanged and isCupertinoProtectedDataAvailable via MethodChannelFlutterSecureStorage to prevent breaking changes. 10 | 11 | ## 1.1.1 12 | Reverts onCupertinoProtectedDataAvailabilityChanged and isCupertinoProtectedDataAvailable. 13 | 14 | ## 1.1.0 15 | Adds onCupertinoProtectedDataAvailabilityChanged and isCupertinoProtectedDataAvailable. 16 | 17 | ## 1.0.2 18 | - Update Dart SDK Constraint to support <4.0.0 instead of <3.0.0. 19 | 20 | ## 1.0.1 21 | - Migrated from flutter_lints to lint and applied suggestions. 22 | - Remove pubspec.lock according to https://dart.dev/guides/libraries/private-files#pubspeclock 23 | 24 | ## 1.0.0 25 | - Initial release. Contains the interface and an implementation based on method channels. 26 | - Changed effective_dart to flutter_lints -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_platform_interface 2 | 3 | This is the common platform interface for `flutter_secure_storage`. 4 | 5 | ## Features 6 | 7 | - Provides a standardized API for all platform implementations. 8 | 9 | ## Installation 10 | 11 | Add the dependency in your `pubspec.yaml` and run `flutter pub get`. 12 | 13 | ## Usage 14 | 15 | This package is not used directly. It provides the foundation for all other platform implementations of `flutter_secure_storage`. 16 | 17 | ## License 18 | 19 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 20 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/lib/src/options.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_secure_storage_platform_interface.dart'; 2 | 3 | /// The `Options` class provides a base abstraction for defining configuration 4 | /// options in a structured way. 5 | /// 6 | /// This class is designed to be extended by platform-specific or 7 | /// use-case-specific implementations that convert their options into a map 8 | /// representation. 9 | abstract class Options { 10 | /// Creates an instance of the `Options` class. 11 | /// 12 | /// This constructor is intended to be used by subclasses to initialize 13 | /// their configuration options. 14 | const Options(); 15 | 16 | /// A getter that retrieves the options as a map representation. 17 | /// 18 | /// This property calls the `toMap` method to convert the options into 19 | /// a map of key-value pairs. 20 | /// 21 | /// Returns: 22 | /// - A map containing the configuration options. 23 | Map get params => toMap(); 24 | 25 | /// Converts the options into a map representation. 26 | /// 27 | /// This method is intended to be overridden by subclasses to provide 28 | /// a specific mapping of their configuration properties. 29 | /// 30 | /// Returns: 31 | /// - A map containing the configuration options. 32 | @protected 33 | Map toMap(); 34 | } 35 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_platform_interface 2 | description: A common platform interface for the flutter_secure_storage plugin. 3 | homepage: https://github.com/mogol/flutter_secure_storage 4 | version: 2.0.1 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | plugin_platform_interface: ^2.0.1 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | mockito: ^5.0.12 19 | very_good_analysis: ^7.0.0 20 | -------------------------------------------------------------------------------- /flutter_secure_storage_platform_interface/test/flutter_secure_storage_platform_interface_mock.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter/services.dart'; 2 | import 'package:flutter_secure_storage_platform_interface/flutter_secure_storage_platform_interface.dart'; 3 | import 'package:mockito/mockito.dart'; 4 | 5 | import 'package:plugin_platform_interface/plugin_platform_interface.dart'; 6 | 7 | class MockMethodChannel extends Mock implements MethodChannel {} 8 | 9 | class MockFlutterSecureStoragePlatform extends Mock 10 | with MockPlatformInterfaceMixin 11 | implements FlutterSecureStoragePlatform {} 12 | 13 | class ImplementsFlutterSecureStoragePlatform extends Mock 14 | implements FlutterSecureStoragePlatform {} 15 | 16 | class ExtendsFlutterSecureStoragePlatform extends FlutterSecureStoragePlatform { 17 | @override 18 | Future containsKey({ 19 | required String key, 20 | required Map options, 21 | }) => 22 | Future.value(true); 23 | 24 | @override 25 | Future delete({ 26 | required String key, 27 | required Map options, 28 | }) => 29 | Future.value(); 30 | 31 | @override 32 | Future deleteAll({required Map options}) => 33 | Future.value(); 34 | 35 | @override 36 | Future read({ 37 | required String key, 38 | required Map options, 39 | }) => 40 | Future.value(); 41 | 42 | @override 43 | Future> readAll({required Map options}) => 44 | Future.value({}); 45 | 46 | @override 47 | Future write({ 48 | required String key, 49 | required String value, 50 | required Map options, 51 | }) => 52 | Future.value(); 53 | 54 | // @override 55 | // Future isCupertinoProtectedDataAvailable() => Future.value(true); 56 | // 57 | // @override 58 | // Stream get onCupertinoProtectedDataAvailabilityChanged => 59 | // Stream.value(true); 60 | } 61 | -------------------------------------------------------------------------------- /flutter_secure_storage_web/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | # Libraries should not include pubspec.lock, per https://dart.dev/guides/libraries/private-files#pubspeclock. 26 | /pubspec.lock 27 | **/doc/api/ 28 | .dart_tool/ 29 | .packages 30 | build/ 31 | -------------------------------------------------------------------------------- /flutter_secure_storage_web/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled and should not be manually edited. 5 | 6 | version: 7 | revision: f4abaa0735eba4dfd8f33f73363911d63931fe03 8 | channel: stable 9 | 10 | project_type: package 11 | -------------------------------------------------------------------------------- /flutter_secure_storage_web/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.0.0 2 | Stable release containing all changes from beta releases, which are: 3 | - This plugin requires a minimum dart sdk of 3.3.0 or higher and a minimum flutter version of 3.19.0. 4 | - Migrate away from `html` to `web` 5 | - Remove `js` in favor of using js-interop 6 | - Update web dependency support to support <2.0.0 instead of <1.0.0. 7 | 8 | Other changes: 9 | - Migrated from lint to very_good_analysis and clean-up code. 10 | 11 | ## 2.0.0-beta.2 12 | Update web dependency support to support <2.0.0 instead of <1.0.0. 13 | 14 | ## 2.0.0-beta.1 15 | - Migrate away from `html` to `web` 16 | - Remove `js` in favor of using js-interop 17 | 18 | ## 1.2.1 19 | Reverts onCupertinoProtectedDataAvailabilityChanged and isCupertinoProtectedDataAvailable. 20 | 21 | ## 1.2.0 22 | Updated flutter_secure_storage_platform_interface to latest version. 23 | 24 | ## 1.2.0 25 | Updated flutter_secure_storage_platform_interface to latest version. 26 | 27 | ## 1.1.2 28 | - Update Dart SDK Constraint to support <4.0.0 instead of <3.0.0. 29 | 30 | ## 1.1.1 31 | Updated flutter_secure_storage_platform_interface to latest version. 32 | 33 | ## 1.1.0 34 | - Migrated from flutter_lints to lint and applied suggestions. 35 | - Remove pubspec.lock according to https://dart.dev/guides/libraries/private-files#pubspeclock 36 | 37 | ## 1.0.2 38 | - Fix issue with delete key 39 | 40 | ## 1.0.1 41 | - Fix issue with containsKey 42 | 43 | ## 1.0.0 44 | - Initial Release of Web Implementation 45 | - Migrated to flutter_lints 46 | -------------------------------------------------------------------------------- /flutter_secure_storage_web/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage_web/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_web 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for web. 4 | 5 | ## Features 6 | 7 | - Secure storage using WebCrypto. 8 | - Application-specific key wrapping for enhanced security. 9 | 10 | ## Important Notice 11 | 12 | This plugin only works on HTTPS or localhost environments. Ensure that proper HTTP Strict Transport Security (HSTS) headers are configured to secure your application. 13 | 14 | ## Configuration 15 | 16 | You can use application-specific key wrapping to make keys more secure. 17 | 18 | ## Usage 19 | 20 | Refer to the main [flutter_secure_storage README](../README.md) for common usage instructions. 21 | 22 | ## License 23 | 24 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 25 | -------------------------------------------------------------------------------- /flutter_secure_storage_web/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_secure_storage_web/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_web 2 | description: Web implementation of flutter_secure_storage. Use flutter_secure_storage for the full flutter package. 3 | repository: https://github.com/mogol/flutter_secure_storage 4 | version: 2.0.0 5 | 6 | environment: 7 | sdk: ">=3.3.0 <4.0.0" 8 | flutter: ">=3.19.0" 9 | 10 | dependencies: 11 | flutter: 12 | sdk: flutter 13 | flutter_secure_storage_platform_interface: ^2.0.0 14 | flutter_web_plugins: 15 | sdk: flutter 16 | web: ">=0.5.0 <2.0.0" 17 | 18 | dev_dependencies: 19 | very_good_analysis: ^7.0.0 20 | flutter: 21 | plugin: 22 | platforms: 23 | web: 24 | pluginClass: FlutterSecureStorageWeb 25 | fileName: flutter_secure_storage_web.dart 26 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | .dart_tool/ 3 | 4 | .packages 5 | .pub/ 6 | 7 | build/ 8 | 9 | # Because this package is plugin package 10 | pubspec.lock 11 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/.metadata: -------------------------------------------------------------------------------- 1 | # This file tracks properties of this Flutter project. 2 | # Used by Flutter tool to assess capabilities and perform upgrades etc. 3 | # 4 | # This file should be version controlled. 5 | 6 | version: 7 | revision: 2ad6cd72c040113b47ee9055e722606a490ef0da 8 | channel: stable 9 | 10 | project_type: plugin 11 | 12 | # Tracks metadata for the flutter migrate command 13 | migration: 14 | platforms: 15 | - platform: root 16 | create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da 17 | base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da 18 | - platform: windows 19 | create_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da 20 | base_revision: 2ad6cd72c040113b47ee9055e722606a490ef0da 21 | 22 | # User provided section 23 | 24 | # List of Local paths (relative to this file) that should be 25 | # ignored by the migrate tool. 26 | # 27 | # Files that are not part of the templates will be ignored by default. 28 | unmanaged_files: 29 | - 'lib/main.dart' 30 | - 'ios/Runner.xcodeproj/project.pbxproj' 31 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 4.0.0 2 | - This plugin requires a minimum dart sdk of 3.3.0 or higher and a minimum flutter version of 3.19.0. 3 | - Migrated to new analyzer and clean-up code. 4 | - Migrates to `win32` version 5.5.4 to support Dart 3.4 / Flutter 3.22.0. 5 | 6 | ## 3.1.2 7 | Reverts onCupertinoProtectedDataAvailabilityChanged and isCupertinoProtectedDataAvailable. 8 | 9 | ## 3.1.1 10 | Updated flutter_secure_storage_platform_interface to latest version. 11 | 12 | ## 3.1.0 13 | Fixed CompanyName and CompanyProduct on Windows are ignored when the lang-charset in the Runner.rc file is not 040904e4 14 | 15 | ## 3.0.0 16 | - Migrated to win32 package replacing C. 17 | - Changed PathNotFoundException to FileSystemException to be backwards compatible with Flutter SDK 2.12.0 18 | - Applied lint suggestions 19 | 20 | ## 2.1.1 21 | Revert changes made in version 2.1.0 due to breaking changes. 22 | These changes will be republished under a new major version number 3.0.0. 23 | 24 | ## 2.1.0 25 | - Changed PathNotFoundException to FileSystemException to be backwards compatible with Flutter SDK 2.12.0 26 | - Applied lint suggestions 27 | 28 | ## 2.0.0 29 | Write encrypted data to files instead of the windows credential system. 30 | 31 | ## 1.1.3 32 | Updated flutter_secure_storage_platform_interface to latest version. 33 | 34 | ## 1.1.2 35 | - Silently ignore errors when deleting keys that don't exist 36 | 37 | ## 1.1.1 38 | - Fix application crash when key doesn't exists. 39 | 40 | ## 1.1.0 41 | Features 42 | - Add readAll, deleteAll and containsKey functions. 43 | 44 | Bugfixes 45 | - Fix implementation of delete operation to allow null value. 46 | 47 | ## 1.0.0 48 | - Initial Windows implementation 49 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright 2017 German Saprykin 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /flutter_secure_storage_windows/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_windows 2 | 3 | This is the platform-specific implementation of `flutter_secure_storage` for Windows. 4 | 5 | ## Features 6 | 7 | In the Windows implementation of the flutter_secure_storage plugin, sensitive data is securely stored using a combination of local file storage and the Windows Credential Manager. The storage mechanism ensures both confidentiality and integrity through encryption and controlled access. 8 | 9 | When a key-value pair is stored, the value is encrypted using the AES-GCM (Galois/Counter Mode) encryption algorithm. The plugin generates a unique encryption key, securely managed and stored in the Windows Credential Manager. This key is used to encrypt the value, and the resulting encrypted data is saved to a file in the application's support directory. Each file is named after the key (with a .secure extension) and contains the encrypted value along with a nonce (used for AES-GCM encryption) and an authentication tag to verify the integrity of the data during decryption. 10 | 11 | The directory for storing these files is dynamically determined based on the application's context, ensuring isolation and protection against unauthorized access. Additionally, for backward compatibility, the plugin can store and retrieve data directly from the Windows Credential Manager if needed. This hybrid approach leverages the security of encrypted local storage and the reliability of the Credential Manager, ensuring robust data protection for Flutter applications running on Windows. 12 | 13 | ## Installation 14 | 15 | Ensure the required C++ ATL libraries are installed alongside Visual Studio Build Tools. 16 | 17 | ## Usage 18 | 19 | Refer to the main [flutter_secure_storage README](../README.md) for common usage instructions. 20 | 21 | ## License 22 | 23 | This project is licensed under the BSD 3 License. See the [LICENSE](../LICENSE) file for details. 24 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:very_good_analysis/analysis_options.yaml -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | migrate_working_dir/ 12 | 13 | # IntelliJ related 14 | *.iml 15 | *.ipr 16 | *.iws 17 | .idea/ 18 | 19 | # The .vscode folder contains launch configuration and tasks you configure in 20 | # VS Code which you may wish to be included in version control, so this line 21 | # is commented out by default. 22 | #.vscode/ 23 | 24 | # Flutter/Dart/Pub related 25 | **/doc/api/ 26 | **/ios/Flutter/.last_build_id 27 | .dart_tool/ 28 | .flutter-plugins 29 | .flutter-plugins-dependencies 30 | .packages 31 | .pub-cache/ 32 | .pub/ 33 | /build/ 34 | 35 | # Symbolication related 36 | app.*.symbols 37 | 38 | # Obfuscation related 39 | app.*.map.json 40 | 41 | # Android Studio will place build artifacts here 42 | /android/app/debug 43 | /android/app/profile 44 | /android/app/release 45 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_secure_storage_windows_example 2 | 3 | Demonstrates how to use the flutter_secure_storage_windows plugin. 4 | 5 | ## Getting Started 6 | 7 | This project is a starting point for a Flutter application. 8 | 9 | A few resources to get you started if this is your first Flutter project: 10 | 11 | - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) 12 | - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) 13 | 14 | For help getting started with Flutter development, view the 15 | [online documentation](https://docs.flutter.dev/), which offers tutorials, 16 | samples, guidance on mobile development, and a full API reference. 17 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/analysis_options.yaml: -------------------------------------------------------------------------------- 1 | # This file configures the analyzer, which statically analyzes Dart code to 2 | # check for errors, warnings, and lints. 3 | # 4 | # The issues identified by the analyzer are surfaced in the UI of Dart-enabled 5 | # IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be 6 | # invoked from the command line by running `flutter analyze`. 7 | 8 | # The following line activates a set of recommended lints for Flutter apps, 9 | # packages, and plugins designed to encourage good coding practices. 10 | include: package:flutter_lints/flutter.yaml 11 | 12 | linter: 13 | # The lint rules applied to this project can be customized in the 14 | # section below to disable rules from the `package:flutter_lints/flutter.yaml` 15 | # included above or to enable additional rules. A list of all available lints 16 | # and their documentation is published at 17 | # https://dart-lang.github.io/linter/lints/index.html. 18 | # 19 | # Instead of disabling a lint rule for the entire project in the 20 | # section below, it can also be suppressed for a single line of code 21 | # or a specific dart file by using the `// ignore: name_of_lint` and 22 | # `// ignore_for_file: name_of_lint` syntax on the line or in the file 23 | # producing the lint. 24 | rules: 25 | # avoid_print: false # Uncomment to disable the `avoid_print` rule 26 | # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule 27 | 28 | # Additional information about this file can be found at 29 | # https://dart.dev/guides/language/analysis-options 30 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_windows_example 2 | description: Demonstrates how to use the flutter_secure_storage_windows plugin. 3 | publish_to: 'none' 4 | 5 | environment: 6 | sdk: '>=3.4.0 <4.0.0' 7 | flutter: '>=3.22.0' 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | flutter_secure_storage_platform_interface: 13 | flutter_secure_storage_windows: 14 | path: ../ 15 | path: ^1.8.0 16 | path_provider: ^2.0.0 17 | 18 | dev_dependencies: 19 | flutter_lints: ^2.0.0 20 | flutter_test: 21 | sdk: flutter 22 | integration_test: 23 | sdk: flutter 24 | 25 | dependency_overrides: 26 | flutter_secure_storage_platform_interface: 27 | path: ../../flutter_secure_storage_platform_interface 28 | 29 | flutter: 30 | uses-material-design: true 31 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ephemeral/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/flutter/generated_plugin_registrant.cc: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #include "generated_plugin_registrant.h" 8 | 9 | #include 10 | 11 | void RegisterPlugins(flutter::PluginRegistry* registry) { 12 | FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 13 | registry->GetRegistrarForPlugin("FlutterSecureStorageWindowsPlugin")); 14 | } 15 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/flutter/generated_plugin_registrant.h: -------------------------------------------------------------------------------- 1 | // 2 | // Generated file. Do not edit. 3 | // 4 | 5 | // clang-format off 6 | 7 | #ifndef GENERATED_PLUGIN_REGISTRANT_ 8 | #define GENERATED_PLUGIN_REGISTRANT_ 9 | 10 | #include 11 | 12 | // Registers Flutter plugins. 13 | void RegisterPlugins(flutter::PluginRegistry* registry); 14 | 15 | #endif // GENERATED_PLUGIN_REGISTRANT_ 16 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/flutter/generated_plugins.cmake: -------------------------------------------------------------------------------- 1 | # 2 | # Generated file, do not edit. 3 | # 4 | 5 | list(APPEND FLUTTER_PLUGIN_LIST 6 | flutter_secure_storage_windows 7 | ) 8 | 9 | list(APPEND FLUTTER_FFI_PLUGIN_LIST 10 | ) 11 | 12 | set(PLUGIN_BUNDLED_LIBRARIES) 13 | 14 | foreach(plugin ${FLUTTER_PLUGIN_LIST}) 15 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${plugin}/windows plugins/${plugin}) 16 | target_link_libraries(${BINARY_NAME} PRIVATE ${plugin}_plugin) 17 | list(APPEND PLUGIN_BUNDLED_LIBRARIES $) 18 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) 19 | endforeach(plugin) 20 | 21 | foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) 22 | add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) 23 | list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) 24 | endforeach(ffi_plugin) 25 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.14) 2 | project(runner LANGUAGES CXX) 3 | 4 | # Define the application target. To change its name, change BINARY_NAME in the 5 | # top-level CMakeLists.txt, not the value here, or `flutter run` will no longer 6 | # work. 7 | # 8 | # Any new source files that you add to the application should be added here. 9 | add_executable(${BINARY_NAME} WIN32 10 | "flutter_window.cpp" 11 | "main.cpp" 12 | "utils.cpp" 13 | "win32_window.cpp" 14 | "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" 15 | "Runner.rc" 16 | "runner.exe.manifest" 17 | ) 18 | 19 | # Apply the standard set of build settings. This can be removed for applications 20 | # that need different build settings. 21 | apply_standard_settings(${BINARY_NAME}) 22 | 23 | # Add preprocessor definitions for the build version. 24 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") 25 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") 26 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") 27 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") 28 | target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") 29 | 30 | # Disable Windows macros that collide with C++ standard library functions. 31 | target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") 32 | 33 | # Add dependency libraries and include directories. Add any application-specific 34 | # dependencies here. 35 | target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) 36 | target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") 37 | target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") 38 | 39 | # Run the Flutter tool portions of the build. This must not be removed. 40 | add_dependencies(${BINARY_NAME} flutter_assemble) 41 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/flutter_window.cpp: -------------------------------------------------------------------------------- 1 | #include "flutter_window.h" 2 | 3 | #include 4 | 5 | #include "flutter/generated_plugin_registrant.h" 6 | 7 | FlutterWindow::FlutterWindow(const flutter::DartProject& project) 8 | : project_(project) {} 9 | 10 | FlutterWindow::~FlutterWindow() {} 11 | 12 | bool FlutterWindow::OnCreate() { 13 | if (!Win32Window::OnCreate()) { 14 | return false; 15 | } 16 | 17 | RECT frame = GetClientArea(); 18 | 19 | // The size here must match the window dimensions to avoid unnecessary surface 20 | // creation / destruction in the startup path. 21 | flutter_controller_ = std::make_unique( 22 | frame.right - frame.left, frame.bottom - frame.top, project_); 23 | // Ensure that basic setup of the controller was successful. 24 | if (!flutter_controller_->engine() || !flutter_controller_->view()) { 25 | return false; 26 | } 27 | RegisterPlugins(flutter_controller_->engine()); 28 | SetChildContent(flutter_controller_->view()->GetNativeWindow()); 29 | 30 | flutter_controller_->engine()->SetNextFrameCallback([&]() { 31 | this->Show(); 32 | }); 33 | 34 | // Flutter can complete the first frame before the "show window" callback is 35 | // registered. The following call ensures a frame is pending to ensure the 36 | // window is shown. It is a no-op if the first frame hasn't completed yet. 37 | flutter_controller_->ForceRedraw(); 38 | 39 | return true; 40 | } 41 | 42 | void FlutterWindow::OnDestroy() { 43 | if (flutter_controller_) { 44 | flutter_controller_ = nullptr; 45 | } 46 | 47 | Win32Window::OnDestroy(); 48 | } 49 | 50 | LRESULT 51 | FlutterWindow::MessageHandler(HWND hwnd, UINT const message, 52 | WPARAM const wparam, 53 | LPARAM const lparam) noexcept { 54 | // Give Flutter, including plugins, an opportunity to handle window messages. 55 | if (flutter_controller_) { 56 | std::optional result = 57 | flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, 58 | lparam); 59 | if (result) { 60 | return *result; 61 | } 62 | } 63 | 64 | switch (message) { 65 | case WM_FONTCHANGE: 66 | flutter_controller_->engine()->ReloadSystemFonts(); 67 | break; 68 | } 69 | 70 | return Win32Window::MessageHandler(hwnd, message, wparam, lparam); 71 | } 72 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/flutter_window.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_FLUTTER_WINDOW_H_ 2 | #define RUNNER_FLUTTER_WINDOW_H_ 3 | 4 | #include 5 | #include 6 | 7 | #include 8 | 9 | #include "win32_window.h" 10 | 11 | // A window that does nothing but host a Flutter view. 12 | class FlutterWindow : public Win32Window { 13 | public: 14 | // Creates a new FlutterWindow hosting a Flutter view running |project|. 15 | explicit FlutterWindow(const flutter::DartProject& project); 16 | virtual ~FlutterWindow(); 17 | 18 | protected: 19 | // Win32Window: 20 | bool OnCreate() override; 21 | void OnDestroy() override; 22 | LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, 23 | LPARAM const lparam) noexcept override; 24 | 25 | private: 26 | // The project to run. 27 | flutter::DartProject project_; 28 | 29 | // The Flutter instance hosted by this window. 30 | std::unique_ptr flutter_controller_; 31 | }; 32 | 33 | #endif // RUNNER_FLUTTER_WINDOW_H_ 34 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "flutter_window.h" 6 | #include "utils.h" 7 | 8 | int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, 9 | _In_ wchar_t *command_line, _In_ int show_command) { 10 | // Attach to console when present (e.g., 'flutter run') or create a 11 | // new console when running with a debugger. 12 | if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { 13 | CreateAndAttachConsole(); 14 | } 15 | 16 | // Initialize COM, so that it is available for use in the library and/or 17 | // plugins. 18 | ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); 19 | 20 | flutter::DartProject project(L"data"); 21 | 22 | std::vector command_line_arguments = 23 | GetCommandLineArguments(); 24 | 25 | project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); 26 | 27 | FlutterWindow window(project); 28 | Win32Window::Point origin(10, 10); 29 | Win32Window::Size size(1280, 720); 30 | if (!window.Create(L"flutter_secure_storage_windows_example", origin, size)) { 31 | return EXIT_FAILURE; 32 | } 33 | window.SetQuitOnClose(true); 34 | 35 | ::MSG msg; 36 | while (::GetMessage(&msg, nullptr, 0, 0)) { 37 | ::TranslateMessage(&msg); 38 | ::DispatchMessage(&msg); 39 | } 40 | 41 | ::CoUninitialize(); 42 | return EXIT_SUCCESS; 43 | } 44 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by Runner.rc 4 | // 5 | #define IDI_APP_ICON 101 6 | 7 | // Next default values for new objects 8 | // 9 | #ifdef APSTUDIO_INVOKED 10 | #ifndef APSTUDIO_READONLY_SYMBOLS 11 | #define _APS_NEXT_RESOURCE_VALUE 102 12 | #define _APS_NEXT_COMMAND_VALUE 40001 13 | #define _APS_NEXT_CONTROL_VALUE 1001 14 | #define _APS_NEXT_SYMED_VALUE 101 15 | #endif 16 | #endif 17 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/resources/app_icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/juliansteenbakker/flutter_secure_storage/71b75a36f35f2ce945998e20c6c6aa1820babfc6/flutter_secure_storage_windows/example/windows/runner/resources/app_icon.ico -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/runner.exe.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PerMonitorV2 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/utils.cpp: -------------------------------------------------------------------------------- 1 | #include "utils.h" 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | void CreateAndAttachConsole() { 11 | if (::AllocConsole()) { 12 | FILE *unused; 13 | if (freopen_s(&unused, "CONOUT$", "w", stdout)) { 14 | _dup2(_fileno(stdout), 1); 15 | } 16 | if (freopen_s(&unused, "CONOUT$", "w", stderr)) { 17 | _dup2(_fileno(stdout), 2); 18 | } 19 | std::ios::sync_with_stdio(); 20 | FlutterDesktopResyncOutputStreams(); 21 | } 22 | } 23 | 24 | std::vector GetCommandLineArguments() { 25 | // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. 26 | int argc; 27 | wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); 28 | if (argv == nullptr) { 29 | return std::vector(); 30 | } 31 | 32 | std::vector command_line_arguments; 33 | 34 | // Skip the first argument as it's the binary name. 35 | for (int i = 1; i < argc; i++) { 36 | command_line_arguments.push_back(Utf8FromUtf16(argv[i])); 37 | } 38 | 39 | ::LocalFree(argv); 40 | 41 | return command_line_arguments; 42 | } 43 | 44 | std::string Utf8FromUtf16(const wchar_t* utf16_string) { 45 | if (utf16_string == nullptr) { 46 | return std::string(); 47 | } 48 | int target_length = ::WideCharToMultiByte( 49 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 50 | -1, nullptr, 0, nullptr, nullptr); 51 | std::string utf8_string; 52 | if (target_length == 0 || target_length > utf8_string.max_size()) { 53 | return utf8_string; 54 | } 55 | utf8_string.resize(target_length); 56 | int converted_length = ::WideCharToMultiByte( 57 | CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, 58 | -1, utf8_string.data(), 59 | target_length, nullptr, nullptr); 60 | if (converted_length == 0) { 61 | return std::string(); 62 | } 63 | return utf8_string; 64 | } 65 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/example/windows/runner/utils.h: -------------------------------------------------------------------------------- 1 | #ifndef RUNNER_UTILS_H_ 2 | #define RUNNER_UTILS_H_ 3 | 4 | #include 5 | #include 6 | 7 | // Creates a console for the process, and redirects stdout and stderr to 8 | // it for both the runner and the Flutter library. 9 | void CreateAndAttachConsole(); 10 | 11 | // Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string 12 | // encoded in UTF-8. Returns an empty std::string on failure. 13 | std::string Utf8FromUtf16(const wchar_t* utf16_string); 14 | 15 | // Gets the command line arguments passed in as a std::vector, 16 | // encoded in UTF-8. Returns an empty std::vector on failure. 17 | std::vector GetCommandLineArguments(); 18 | 19 | #endif // RUNNER_UTILS_H_ 20 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/lib/flutter_secure_storage_windows.dart: -------------------------------------------------------------------------------- 1 | export 'src/flutter_secure_storage_windows_stub.dart' 2 | if (dart.library.ffi) 'src/flutter_secure_storage_windows_ffi.dart' 3 | show FlutterSecureStorageWindows; 4 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/lib/src/flutter_secure_storage_windows_stub.dart: -------------------------------------------------------------------------------- 1 | import 'package:flutter_secure_storage_platform_interface/flutter_secure_storage_platform_interface.dart'; 2 | 3 | /// A stub implementation to avoid extra transitive dependencies 4 | /// on non-Windows platforms including web. 5 | class FlutterSecureStorageWindows extends FlutterSecureStoragePlatform { 6 | /// Cannot be instantiated. 7 | FlutterSecureStorageWindows() 8 | : assert(false, 'Cannot instantiate this class.'); 9 | 10 | /// Registers this plugin. 11 | static void registerWith() { 12 | FlutterSecureStoragePlatform.instance = FlutterSecureStorageWindows(); 13 | } 14 | 15 | @override 16 | Future containsKey({ 17 | required String key, 18 | required Map options, 19 | }) => 20 | Future.value(false); 21 | 22 | @override 23 | Future delete({ 24 | required String key, 25 | required Map options, 26 | }) => 27 | Future.value(); 28 | 29 | @override 30 | Future deleteAll({required Map options}) => 31 | Future.value(); 32 | 33 | @override 34 | Future read({ 35 | required String key, 36 | required Map options, 37 | }) => 38 | Future.value(); 39 | 40 | @override 41 | Future> readAll({required Map options}) => 42 | Future.value({}); 43 | 44 | @override 45 | Future write({ 46 | required String key, 47 | required String value, 48 | required Map options, 49 | }) => 50 | Future.value(); 51 | 52 | // @override 53 | // Future isCupertinoProtectedDataAvailable() => Future.value(true); 54 | // 55 | // @override 56 | // Stream get onCupertinoProtectedDataAvailabilityChanged => 57 | // Stream.value(true); 58 | } 59 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_windows 2 | description: Windows implementation of flutter_secure_storage. Please use flutter_secure_storage instead of this package. 3 | repository: https://github.com/mogol/flutter_secure_storage 4 | version: 4.0.0 5 | 6 | environment: 7 | sdk: '>=3.3.0 <4.0.0' 8 | flutter: '>=3.19.0' 9 | 10 | dependencies: 11 | ffi: ^2.0.0 12 | flutter: 13 | sdk: flutter 14 | flutter_secure_storage_platform_interface: ^2.0.0 15 | path: ^1.8.0 16 | path_provider: ^2.0.0 17 | win32: ^5.5.4 18 | 19 | dev_dependencies: 20 | flutter_test: 21 | sdk: flutter 22 | very_good_analysis: ^7.0.0 23 | 24 | flutter: 25 | plugin: 26 | implements: flutter_secure_storage 27 | platforms: 28 | windows: 29 | pluginClass: FlutterSecureStorageWindowsPlugin 30 | dartPluginClass: FlutterSecureStorageWindows 31 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/windows/.gitignore: -------------------------------------------------------------------------------- 1 | flutter/ 2 | 3 | # Visual Studio user-specific files. 4 | *.suo 5 | *.user 6 | *.userosscache 7 | *.sln.docstates 8 | 9 | # Visual Studio build-related files. 10 | x64/ 11 | x86/ 12 | 13 | # Visual Studio cache files 14 | # files ending in .cache can be ignored 15 | *.[Cc]ache 16 | # but keep track of directories ending in .cache 17 | !*.[Cc]ache/ 18 | -------------------------------------------------------------------------------- /flutter_secure_storage_windows/windows/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | set(PROJECT_NAME "flutter_secure_storage_windows") 3 | project(${PROJECT_NAME} LANGUAGES CXX) 4 | 5 | # This value is used when generating builds using this plugin, so it must 6 | # not be changed 7 | set(PLUGIN_NAME "flutter_secure_storage_windows_plugin") 8 | 9 | add_library(${PLUGIN_NAME} SHARED 10 | "flutter_secure_storage_windows_plugin.cpp" 11 | ) 12 | apply_standard_settings(${PLUGIN_NAME}) 13 | set_target_properties(${PLUGIN_NAME} PROPERTIES 14 | CXX_VISIBILITY_PRESET hidden) 15 | target_compile_definitions(${PLUGIN_NAME} PRIVATE FLUTTER_PLUGIN_IMPL) 16 | target_include_directories(${PLUGIN_NAME} INTERFACE 17 | "${CMAKE_CURRENT_SOURCE_DIR}/include") 18 | target_link_libraries(${PLUGIN_NAME} PRIVATE flutter flutter_wrapper_plugin) 19 | 20 | # List of absolute paths to libraries that should be bundled with the plugin 21 | set(flutter_secure_storage_bundled_libraries 22 | "" 23 | PARENT_SCOPE 24 | ) 25 | if(NOT DEFINED STORAGE_PREFIX) 26 | add_compile_definitions(SECURE_STORAGE_KEY_PREFIX="${BINARY_NAME}_VGhpcyBpcyB0aGUgcHJlZml4IGZv_") 27 | else() 28 | add_compile_definitions(SECURE_STORAGE_KEY_PREFIX="${STORAGE_PREFIX}_VGhpcyBpcyB0aGUgcHJlZml4IGZv_") 29 | endif() -------------------------------------------------------------------------------- /flutter_secure_storage_windows/windows/include/flutter_secure_storage_windows/flutter_secure_storage_windows_plugin.h: -------------------------------------------------------------------------------- 1 | #ifndef FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_WINDOWS_PLUGIN_H_ 2 | #define FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_WINDOWS_PLUGIN_H_ 3 | 4 | #include 5 | 6 | #ifdef FLUTTER_PLUGIN_IMPL 7 | #define FLUTTER_PLUGIN_EXPORT __declspec(dllexport) 8 | #else 9 | #define FLUTTER_PLUGIN_EXPORT __declspec(dllimport) 10 | #endif 11 | 12 | #if defined(__cplusplus) 13 | extern "C" { 14 | #endif 15 | 16 | FLUTTER_PLUGIN_EXPORT void FlutterSecureStorageWindowsPluginRegisterWithRegistrar( 17 | FlutterDesktopPluginRegistrarRef registrar); 18 | 19 | #if defined(__cplusplus) 20 | } // extern "C" 21 | #endif 22 | 23 | #endif // FLUTTER_PLUGIN_FLUTTER_SECURE_STORAGE_WINDOWS_PLUGIN_H_ 24 | -------------------------------------------------------------------------------- /melos.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage 2 | repository: https://github.com/mogol/flutter_secure_storage 3 | 4 | packages: 5 | - flutter_secure_storage 6 | - flutter_secure_storage/example 7 | - flutter_secure_storage_linux 8 | - flutter_secure_storage_darwin 9 | - flutter_secure_storage_platform_interface 10 | - flutter_secure_storage_web 11 | - flutter_secure_storage_windows 12 | - flutter_secure_storage_windows/example 13 | 14 | command: 15 | version: 16 | linkToCommits: true 17 | workspaceChangelog: true 18 | 19 | bootstrap: 20 | usePubspecOverrides: true 21 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_secure_storage_root 2 | 3 | environment: 4 | sdk: '>=2.15.0 <4.0.0' 5 | 6 | dev_dependencies: 7 | flutter_lints: ^3.0.2 8 | melos: ^6.0.0 9 | --------------------------------------------------------------------------------