├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── bug_report.yml │ └── feature_request.yml └── pull_request_template.md ├── .gitignore ├── .metadata ├── CHANGELOG.md ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── Locker-github.jpg ├── MAINTAINERS.md ├── README.md ├── SECURITY.md ├── analysis_options.yaml ├── android ├── .gitignore ├── build.gradle ├── settings.gradle └── src │ └── main │ ├── AndroidManifest.xml │ └── kotlin │ └── com │ └── infinum │ └── flutter_locker │ ├── FlutterLocker.kt │ └── FlutterLockerPlugin.kt ├── example ├── .gitignore ├── .metadata ├── README.md ├── analysis_options.yaml ├── android │ ├── .gitignore │ ├── app │ │ ├── build.gradle │ │ └── src │ │ │ ├── debug │ │ │ └── AndroidManifest.xml │ │ │ ├── main │ │ │ ├── AndroidManifest.xml │ │ │ ├── kotlin │ │ │ │ └── com │ │ │ │ │ └── example │ │ │ │ │ └── flutter_locker_example │ │ │ │ │ └── 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 │ │ │ └── profile │ │ │ └── AndroidManifest.xml │ ├── build.gradle │ ├── gradle.properties │ ├── gradle │ │ └── wrapper │ │ │ └── gradle-wrapper.properties │ └── settings.gradle ├── ios │ ├── .gitignore │ ├── Flutter │ │ ├── AppFrameworkInfo.plist │ │ ├── Debug.xcconfig │ │ └── Release.xcconfig │ ├── Podfile │ ├── Podfile.lock │ ├── Runner.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ │ └── swiftpm │ │ │ │ └── Package.resolved │ │ └── xcshareddata │ │ │ └── xcschemes │ │ │ └── Runner.xcscheme │ ├── Runner.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ ├── IDEWorkspaceChecks.plist │ │ │ └── swiftpm │ │ │ └── Package.resolved │ └── 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 ├── pubspec.lock ├── pubspec.yaml └── test │ └── widget_test.dart ├── ios ├── .gitignore ├── flutter_locker.podspec └── flutter_locker │ ├── Package.swift │ └── Sources │ └── flutter_locker │ ├── FlutterLocker.swift │ └── FlutterLockerPlugin.swift ├── lib ├── flutter_locker.dart ├── gen │ └── locker_api.gen.dart └── src │ ├── flutter_locker.dart │ └── locker_exception.dart ├── pigeons └── locker_api.dart └── pubspec.yaml /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | # Each line is a file pattern followed by one or more owners. 3 | # Code owners are automatically requested for review when someone opens a pull request that modifies code that they own. 4 | # These owners will be the default owners for everything in the repo. 5 | * @Truba @zenled @lukaknezic -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.yml: -------------------------------------------------------------------------------- 1 | name: Bug report 2 | description: File a bug report. 3 | labels: bug 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description 9 | description: A clear and concise description of what the bug is. 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: environment 14 | attributes: 15 | label: Environment 16 | description: | 17 | An environment information where issue occurred. Try to provide as much information as possible, including: 18 | - device name, model and manufacturer 19 | - operating system version 20 | - software name, version and build number 21 | - additional information (e.g. dependencies, IDE, etc.) 22 | value: | 23 | - Device: 24 | - Operating system: 25 | - Software information: 26 | - Additional information: 27 | validations: 28 | required: true 29 | - type: textarea 30 | id: reproduction-steps 31 | attributes: 32 | label: Reproduction steps 33 | description: Steps to reproduce the behavior. 34 | value: | 35 | 1. 36 | 2. 37 | 3. 38 | ... 39 | validations: 40 | required: true 41 | - type: textarea 42 | id: expected-behavior 43 | attributes: 44 | label: Expected behavior 45 | description: A clear and concise description of what you expected to happen. 46 | validations: 47 | required: true 48 | - type: textarea 49 | id: additional-information 50 | attributes: 51 | label: Additional information 52 | description: Any additional information that might be helpful in solving the issue. 53 | validations: 54 | required: false 55 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.yml: -------------------------------------------------------------------------------- 1 | name: Feature request 2 | description: Propose a new feature or an idea for this project. 3 | labels: enhancement 4 | body: 5 | - type: textarea 6 | id: feature-description 7 | attributes: 8 | label: Feature description 9 | description: A clear and concise description of the feature request, including what problem it solves. 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: additional-information 14 | attributes: 15 | label: Additional information 16 | description: An additional information or screenshots about the feature request. 17 | validations: 18 | required: false 19 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Summary 2 | 3 | 6 | 7 | **Related issue**: 8 | 9 | ## Changes 10 | 11 | ### Type 12 | 13 | - [ ] **Feature**: This pull request introduces a new feature. 14 | - [ ] **Bug fix**: This pull request fixes a bug. 15 | - [ ] **Refactor**: This pull request refactors existing code. 16 | - [ ] **Documentation**: This pull request updates documentation. 17 | - [ ] **Other**: This pull request makes other changes. 18 | 19 | #### Additional information 20 | 21 | - [ ] This pull request introduces a **breaking change**. 22 | 23 | ### Description 24 | 25 | 30 | 31 | ## Checklist 32 | 33 | - [ ] I have performed a self-review of my own code. 34 | - [ ] I have tested my changes, including edge cases. 35 | - [ ] I have added necessary tests for the changes introduced (if applicable). 36 | - [ ] I have updated the documentation to reflect my changes (if applicable). 37 | 38 | ## Additional notes 39 | 40 | -------------------------------------------------------------------------------- /.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 | -------------------------------------------------------------------------------- /.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: "8495dee1fd4aacbe9de707e7581203232f591b2f" 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: 8495dee1fd4aacbe9de707e7581203232f591b2f 17 | base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 18 | - platform: android 19 | create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 20 | base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 21 | - platform: ios 22 | create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 23 | base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 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 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## 2.1.6 2 | 3 | - Swift Package Manager support 4 | 5 | ## 2.1.5 6 | 7 | - Update dependencies 8 | - Android improvements 9 | 10 | ## 2.1.4 11 | 12 | - Update dependencies 13 | 14 | ## 2.1.3 15 | 16 | - Fixed LockerException not showing exception details 17 | 18 | ## 2.1.2 19 | 20 | - Fixed incorrect LockerException being return 21 | 22 | ## 2.1.1 23 | 24 | - Migrate android dependencies to mavenCentral from jcenter 25 | - Update dependencies 26 | 27 | ## 2.1.0+1 28 | 29 | - Remove pigeon as dependency 30 | - Decrease flutter version 31 | 32 | ## 2.1.0 33 | 34 | - BREAKING: Models now accept named parameters instead of unnamed ones. Migration guide is in README 35 | 36 | ## 2.0.4 37 | 38 | - Support building for Android on Apple M1 Macs 39 | - Updated iOS Locker Pod 40 | 41 | ## 2.0.3 42 | 43 | - Exposing `LockerException` 44 | - Updated documentation and example 45 | 46 | ## 2.0.2 47 | 48 | - Fix missing file 49 | 50 | ## 2.0.1 51 | 52 | - Updated with iOS Locker 3.0 53 | 54 | ## 2.0.0 55 | 56 | - Added null safety 57 | 58 | ## 1.0.2 59 | 60 | - Updated documentation. 61 | 62 | ## 1.0.1 63 | 64 | - Resolved maintenance issues 65 | 66 | ## 1.0.0 67 | 68 | - Initial release -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of conduct 2 | 3 | ## Our pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at opensource@infinum.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 1.4, 71 | available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html). 72 | 73 | For answers to common questions about this code of conduct, visit 74 | the [FAQ](https://www.contributor-covenant.org/faq) page. -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing guidelines 2 | 3 | Welcome to our project! We appreciate your interest in helping us improve it. 4 | 5 | ## How can I contribute? 6 | 7 | There are multiple ways in which you can help us make this project even better. 8 | 9 | - Reporting bugs or suggesting new features 10 | - Contributing code improvements or new features 11 | - Writing, updating, or fixing tests 12 | - Improving documentation, including inline comments, user manuals, and developer guides 13 | 14 | ## Issue reporting 15 | 16 | If you found a bug or have an idea for a new feature, please open an issue. Be sure to include a clear and descriptive title, as well as a detailed description of the bug or feature. 17 | 18 | To avoid duplicate issues, please check if a similar issue has already been created. 19 | 20 | ## Making changes 21 | 22 | To make changes to the project, please follow these steps: 23 | 24 | 1. Fork the project repository. 25 | 2. Create a new branch for your changes, based on the project's main branch. 26 | 3. Make your changes. Ensure you've followed the coding style and standards. 27 | 4. Test your changes thoroughly, ensuring all existing tests pass and new tests cover your changes where appropriate. 28 | 5. Commit your changes with a clear and descriptive commit message. 29 | 6. Push your changes to your fork. 30 | 7. Create a pull request to the project's main branch. 31 | 32 | Once we check everything, we will merge the changes into the main branch and include it in the next release. 33 | 34 | ## Guidelines for pull requests 35 | 36 | When submitting a pull request, please ensure that: 37 | 38 | - Your pull request is concise and well-scoped 39 | - Your code is properly tested 40 | - Your code adheres to the project's coding standards and style guidelines 41 | - Your commit message is clear and descriptive 42 | - Your pull request includes a description of the changes you have made and why you have made them 43 | 44 | Try to avoid creating large pull requests that include multiple unrelated changes. Instead, break them down into smaller, more focused pull requests. This will make it easier for us to review and merge your changes. 45 | 46 | ## Code of conduct 47 | 48 | We want to ensure a welcoming environment for everyone. With that in mind, all contributors are expected to follow our [code of conduct](/CODE_OF_CONDUCT.md). 49 | 50 | ## License 51 | 52 | By submitting a pull request you agree to release that code under the project's [license](/LICENSE). -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. -------------------------------------------------------------------------------- /Locker-github.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/Locker-github.jpg -------------------------------------------------------------------------------- /MAINTAINERS.md: -------------------------------------------------------------------------------- 1 | ### Pigeon 2 | 3 | This plugin uses Pigeon. To generate pigeon files run: 4 | 5 | ``` 6 | dart run pigeon --input pigeons/locker_api.dart 7 | ``` -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Flutter Locker🔒 2 | 3 |

4 | Locker 5 |

6 | 7 | Flutter plugin that secures your secrets in keychain using biometric authentication (Fingerprint, Touch ID, Face ID...). 8 | 9 | 10 | It uses: 11 | - [Locker on iOS](https://github.com/infinum/Locker) 12 | - [Goldfinger on Android](https://github.com/infinum/Android-Goldfinger) 13 | 14 | ## Table of contents 15 | 16 | * [Usage](#usage) 17 | * [Exceptions](#exceptions) 18 | * [Notes](#notes) 19 | * [Setup](#setup) 20 | * [Contributing](#contributing) 21 | * [License](#license) 22 | * [Credits](#credits) 23 | 24 | ## Migrate to 2.1.0 25 | 26 | The models now accept named parameters instead of unnamed, e.g.: 27 | 28 | ```dart 29 | RetrieveSecretRequest( 30 | key: 'key', 31 | androidPrompt: AndroidPrompt(title: 'title', cancelLabel: 'cancel'), 32 | iOsPrompt: IOsPrompt(touchIdText: 'description'), 33 | ) 34 | ``` 35 | 36 | ## Usage 37 | 38 | ```dart 39 | FlutterLocker.canAuthenticate(); 40 | ``` 41 | Checks if the devices has biometric features. 42 | 43 | ```dart 44 | await FlutterLocker.save(SaveSecretRequest( 45 | key: 'key', 46 | secret: 'secret', 47 | androidPrompt: AndroidPrompt(title: 'Authenticate', cancelLabel: 'Cancel'), 48 | )); 49 | ``` 50 | Saves the secret. On Android prompt is shown, while on iOS there is no need for the prompt when saving. 51 | 52 | ```dart 53 | await FlutterLocker.retrieve(RetrieveSecretRequest( 54 | key: key, 55 | androidPrompt: AndroidPrompt(title: 'Authenticate', cancelLabel: 'Cancel'), 56 | iOsPrompt: IOsPrompt(touchIdText: 'Authenticate'), 57 | )); 58 | ``` 59 | Retrieves the secret. You need to provide a prompt for Android and iOS. Prompt for iOS is used only with TouchID. FaceID uses strings from `Info.plist`. 60 | 61 | ```dart 62 | await FlutterLocker.delete('key'); 63 | ``` 64 | Deletes the secret. 65 | 66 | ## Exceptions 67 | 68 | For common exceptions, a `LockerException` is thrown. 69 | 70 | Use `LockerException.reason` to find out what went wrong: 71 | 72 | - `secretNotFound` - Happens when you try to retrieve a secret that was never saved for that key 73 | - `authenticationCanceled` - User canceled the authentication prompt 74 | - `authenticationFailed` - User failed authentication, e.g. by too many wrong attempts 75 | 76 | For other exception, a `PlatformException` is thrown. You can use `PlatformException.message` to get more info. 77 | 78 | ## Notes 79 | 80 | - iOS only: app will not show authentication dialog when saving (authentication will always succeed) 81 | - please follow [Locker](https://github.com/infinum/Locker) and [Goldfinger](https://github.com/infinum/Android-Goldfinger) setup to prevent any issues 82 | 83 | ## Setup 84 | 85 | ### iOS 86 | 87 | To use **Locker** you need to add the `NSFaceIDUsageDescription` to you `Info.plist`. 88 | 89 | If `NSFaceIDUsageDescription` is not provided, the app will crash with the following error: 90 | ``` 91 | This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSFaceIDUsageDescription key with a string value explaining to the user how the app uses this data. 92 | ``` 93 | 94 | ### Android 95 | 96 | Ensure `MainActivity` extends `FlutterFragmentActivity`. 97 | 98 | ```kotlin 99 | class MainActivity: FlutterFragmentActivity() { 100 | // ... 101 | } 102 | ``` 103 | 104 | When showing authentication prompt, the app might crash on some Samsung devices if you don't use an appropriate theme: https://github.com/infinum/flutter-plugins-locker/commit/fcb1f6401d89f860d24ea9a75027d62a03e87926. 105 | 106 |

107 | 108 | 109 | 110 | 111 | 112 | 113 |

114 | 115 | ## Contributing 116 | 117 | We believe that the community can help us improve and build better a product. 118 | Please refer to our [contributing guide](CONTRIBUTING.md) to learn about the types of contributions we accept and the process for submitting them. 119 | 120 | To ensure that our community remains respectful and professional, we defined a [code of conduct](CODE_OF_CONDUCT.md) that we expect all contributors to follow. 121 | 122 | We appreciate your interest and look forward to your contributions. 123 | 124 | ## License 125 | 126 | ```text 127 | Copyright 2024 Infinum 128 | 129 | Licensed under the Apache License, Version 2.0 (the "License"); 130 | you may not use this file except in compliance with the License. 131 | You may obtain a copy of the License at 132 | 133 | http://www.apache.org/licenses/LICENSE-2.0 134 | 135 | Unless required by applicable law or agreed to in writing, software 136 | distributed under the License is distributed on an "AS IS" BASIS, 137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138 | See the License for the specific language governing permissions and 139 | limitations under the License. 140 | ``` 141 | 142 | ## Credits 143 | 144 | Maintained and sponsored by [Infinum](https://infinum.com). 145 | 146 |
147 | 148 | 149 | 150 | 151 | 152 | 153 |
154 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security 2 | 3 | ## Reporting security issues 4 | 5 | At Infinum we are committed to ensuring the security of our software. If you have discovered a security vulnerability or have concerns regarding the security of our project, we encourage you to report it to us in a responsible manner. 6 | 7 | If you discover a security vulnerability, please report it to us by emailing us at opensource@infinum.com. We will review your report, and if the issue is confirmed, we will work to resolve the issue as soon as possible and coordinate the release of a security patch. 8 | 9 | ## Responsible disclosure 10 | 11 | We request that you practice responsible disclosure by allowing us time to investigate and address any reported vulnerabilities before making them public. We believe this approach helps protect our users and provides a better outcome for everyone involved. 12 | 13 | ## Preferred languages 14 | 15 | We prefer all communication to be in English. 16 | 17 | ## Contributions 18 | 19 | We greatly appreciate your help in keeping Infinum projects secure. Your efforts contribute to the ongoing improvement of our project's security. -------------------------------------------------------------------------------- /analysis_options.yaml: -------------------------------------------------------------------------------- 1 | include: package:flutter_lints/flutter.yaml 2 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | .cxx 10 | -------------------------------------------------------------------------------- /android/build.gradle: -------------------------------------------------------------------------------- 1 | group = "com.infinum.flutter_locker" 2 | version = "1.0-SNAPSHOT" 3 | 4 | buildscript { 5 | ext.kotlin_version = "1.8.22" 6 | repositories { 7 | google() 8 | mavenCentral() 9 | } 10 | 11 | dependencies { 12 | classpath "com.android.tools.build:gradle:8.1.4" 13 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 14 | } 15 | } 16 | 17 | allprojects { 18 | repositories { 19 | google() 20 | mavenCentral() 21 | } 22 | } 23 | 24 | apply plugin: "com.android.library" 25 | apply plugin: "kotlin-android" 26 | 27 | android { 28 | namespace = "com.infinum.flutter_locker" 29 | 30 | compileSdk = 35 31 | 32 | compileOptions { 33 | sourceCompatibility = JavaVersion.VERSION_11 34 | targetCompatibility = JavaVersion.VERSION_11 35 | } 36 | 37 | kotlinOptions { 38 | jvmTarget = JavaVersion.VERSION_11 39 | } 40 | 41 | sourceSets { 42 | main.java.srcDirs += "src/main/kotlin" 43 | test.java.srcDirs += "src/test/kotlin" 44 | } 45 | 46 | defaultConfig { 47 | minSdk = 21 48 | } 49 | 50 | dependencies { 51 | implementation "androidx.biometric:biometric-ktx:1.1.0" 52 | implementation "com.infinum:goldfinger:2.2.0" 53 | 54 | testImplementation "org.jetbrains.kotlin:kotlin-test" 55 | testImplementation "org.mockito:mockito-core:5.0.0" 56 | } 57 | 58 | testOptions { 59 | unitTests.all { 60 | useJUnitPlatform() 61 | 62 | testLogging { 63 | events "passed", "skipped", "failed", "standardOut", "standardError" 64 | outputs.upToDateWhen {false} 65 | showStandardStreams = true 66 | } 67 | } 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /android/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'flutter_locker' 2 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/infinum/flutter_locker/FlutterLocker.kt: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v22.7.2), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | @file:Suppress("UNCHECKED_CAST", "ArrayInDataClass") 4 | 5 | package com.infinum.flutter_locker 6 | 7 | import android.util.Log 8 | import io.flutter.plugin.common.BasicMessageChannel 9 | import io.flutter.plugin.common.BinaryMessenger 10 | import io.flutter.plugin.common.EventChannel 11 | import io.flutter.plugin.common.MessageCodec 12 | import io.flutter.plugin.common.StandardMethodCodec 13 | import io.flutter.plugin.common.StandardMessageCodec 14 | import java.io.ByteArrayOutputStream 15 | import java.nio.ByteBuffer 16 | 17 | private fun wrapResult(result: Any?): List { 18 | return listOf(result) 19 | } 20 | 21 | private fun wrapError(exception: Throwable): List { 22 | return if (exception is FlutterError) { 23 | listOf( 24 | exception.code, 25 | exception.message, 26 | exception.details 27 | ) 28 | } else { 29 | listOf( 30 | exception.javaClass.simpleName, 31 | exception.toString(), 32 | "Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception) 33 | ) 34 | } 35 | } 36 | 37 | /** 38 | * Error class for passing custom error details to Flutter via a thrown PlatformException. 39 | * @property code The error code. 40 | * @property message The error message. 41 | * @property details The error details. Must be a datatype supported by the api codec. 42 | */ 43 | class FlutterError ( 44 | val code: String, 45 | override val message: String? = null, 46 | val details: Any? = null 47 | ) : Throwable() 48 | 49 | /** 50 | * Data structure for retrieving the saved secret 51 | * 52 | * Generated class from Pigeon that represents data sent in messages. 53 | */ 54 | data class RetrieveSecretRequest ( 55 | val key: String, 56 | val androidPrompt: AndroidPrompt, 57 | val iOsPrompt: IOsPrompt 58 | ) 59 | { 60 | companion object { 61 | fun fromList(pigeonVar_list: List): RetrieveSecretRequest { 62 | val key = pigeonVar_list[0] as String 63 | val androidPrompt = pigeonVar_list[1] as AndroidPrompt 64 | val iOsPrompt = pigeonVar_list[2] as IOsPrompt 65 | return RetrieveSecretRequest(key, androidPrompt, iOsPrompt) 66 | } 67 | } 68 | fun toList(): List { 69 | return listOf( 70 | key, 71 | androidPrompt, 72 | iOsPrompt, 73 | ) 74 | } 75 | } 76 | 77 | /** 78 | * Data structure for saving the saved secret 79 | * 80 | * Generated class from Pigeon that represents data sent in messages. 81 | */ 82 | data class SaveSecretRequest ( 83 | val key: String, 84 | val secret: String, 85 | val androidPrompt: AndroidPrompt 86 | ) 87 | { 88 | companion object { 89 | fun fromList(pigeonVar_list: List): SaveSecretRequest { 90 | val key = pigeonVar_list[0] as String 91 | val secret = pigeonVar_list[1] as String 92 | val androidPrompt = pigeonVar_list[2] as AndroidPrompt 93 | return SaveSecretRequest(key, secret, androidPrompt) 94 | } 95 | } 96 | fun toList(): List { 97 | return listOf( 98 | key, 99 | secret, 100 | androidPrompt, 101 | ) 102 | } 103 | } 104 | 105 | /** 106 | * Defines text that's displayed in native OS prompt for authentication 107 | * 108 | * title and cancel are required. 109 | * 110 | * Generated class from Pigeon that represents data sent in messages. 111 | */ 112 | data class AndroidPrompt ( 113 | val title: String, 114 | val cancelLabel: String, 115 | val descriptionLabel: String? = null 116 | ) 117 | { 118 | companion object { 119 | fun fromList(pigeonVar_list: List): AndroidPrompt { 120 | val title = pigeonVar_list[0] as String 121 | val cancelLabel = pigeonVar_list[1] as String 122 | val descriptionLabel = pigeonVar_list[2] as String? 123 | return AndroidPrompt(title, cancelLabel, descriptionLabel) 124 | } 125 | } 126 | fun toList(): List { 127 | return listOf( 128 | title, 129 | cancelLabel, 130 | descriptionLabel, 131 | ) 132 | } 133 | } 134 | 135 | /** 136 | * The iOS native dialog is only shown when retrieving secret. 137 | * 138 | * - For phones with Touch ID, the [touchIdText] is displayed in prompt. 139 | * - For phones with Face ID, the text is defined in plist file. 140 | * 141 | * Generated class from Pigeon that represents data sent in messages. 142 | */ 143 | data class IOsPrompt ( 144 | val touchIdText: String 145 | ) 146 | { 147 | companion object { 148 | fun fromList(pigeonVar_list: List): IOsPrompt { 149 | val touchIdText = pigeonVar_list[0] as String 150 | return IOsPrompt(touchIdText) 151 | } 152 | } 153 | fun toList(): List { 154 | return listOf( 155 | touchIdText, 156 | ) 157 | } 158 | } 159 | private open class FlutterLockerPigeonCodec : StandardMessageCodec() { 160 | override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { 161 | return when (type) { 162 | 129.toByte() -> { 163 | return (readValue(buffer) as? List)?.let { 164 | RetrieveSecretRequest.fromList(it) 165 | } 166 | } 167 | 130.toByte() -> { 168 | return (readValue(buffer) as? List)?.let { 169 | SaveSecretRequest.fromList(it) 170 | } 171 | } 172 | 131.toByte() -> { 173 | return (readValue(buffer) as? List)?.let { 174 | AndroidPrompt.fromList(it) 175 | } 176 | } 177 | 132.toByte() -> { 178 | return (readValue(buffer) as? List)?.let { 179 | IOsPrompt.fromList(it) 180 | } 181 | } 182 | else -> super.readValueOfType(type, buffer) 183 | } 184 | } 185 | override fun writeValue(stream: ByteArrayOutputStream, value: Any?) { 186 | when (value) { 187 | is RetrieveSecretRequest -> { 188 | stream.write(129) 189 | writeValue(stream, value.toList()) 190 | } 191 | is SaveSecretRequest -> { 192 | stream.write(130) 193 | writeValue(stream, value.toList()) 194 | } 195 | is AndroidPrompt -> { 196 | stream.write(131) 197 | writeValue(stream, value.toList()) 198 | } 199 | is IOsPrompt -> { 200 | stream.write(132) 201 | writeValue(stream, value.toList()) 202 | } 203 | else -> super.writeValue(stream, value) 204 | } 205 | } 206 | } 207 | 208 | 209 | /** Generated interface from Pigeon that represents a handler of messages from Flutter. */ 210 | interface FlutterLockerHostApi { 211 | fun canAuthenticate(callback: (Result) -> Unit) 212 | fun save(request: SaveSecretRequest, callback: (Result) -> Unit) 213 | fun retrieve(request: RetrieveSecretRequest, callback: (Result) -> Unit) 214 | fun delete(key: String, callback: (Result) -> Unit) 215 | 216 | companion object { 217 | /** The codec used by FlutterLockerHostApi. */ 218 | val codec: MessageCodec by lazy { 219 | FlutterLockerPigeonCodec() 220 | } 221 | /** Sets up an instance of `FlutterLockerHostApi` to handle messages through the `binaryMessenger`. */ 222 | @JvmOverloads 223 | fun setUp(binaryMessenger: BinaryMessenger, api: FlutterLockerHostApi?, messageChannelSuffix: String = "") { 224 | val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" 225 | run { 226 | val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.canAuthenticate$separatedMessageChannelSuffix", codec) 227 | if (api != null) { 228 | channel.setMessageHandler { _, reply -> 229 | api.canAuthenticate{ result: Result -> 230 | val error = result.exceptionOrNull() 231 | if (error != null) { 232 | reply.reply(wrapError(error)) 233 | } else { 234 | val data = result.getOrNull() 235 | reply.reply(wrapResult(data)) 236 | } 237 | } 238 | } 239 | } else { 240 | channel.setMessageHandler(null) 241 | } 242 | } 243 | run { 244 | val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.save$separatedMessageChannelSuffix", codec) 245 | if (api != null) { 246 | channel.setMessageHandler { message, reply -> 247 | val args = message as List 248 | val requestArg = args[0] as SaveSecretRequest 249 | api.save(requestArg) { result: Result -> 250 | val error = result.exceptionOrNull() 251 | if (error != null) { 252 | reply.reply(wrapError(error)) 253 | } else { 254 | reply.reply(wrapResult(null)) 255 | } 256 | } 257 | } 258 | } else { 259 | channel.setMessageHandler(null) 260 | } 261 | } 262 | run { 263 | val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.retrieve$separatedMessageChannelSuffix", codec) 264 | if (api != null) { 265 | channel.setMessageHandler { message, reply -> 266 | val args = message as List 267 | val requestArg = args[0] as RetrieveSecretRequest 268 | api.retrieve(requestArg) { result: Result -> 269 | val error = result.exceptionOrNull() 270 | if (error != null) { 271 | reply.reply(wrapError(error)) 272 | } else { 273 | val data = result.getOrNull() 274 | reply.reply(wrapResult(data)) 275 | } 276 | } 277 | } 278 | } else { 279 | channel.setMessageHandler(null) 280 | } 281 | } 282 | run { 283 | val channel = BasicMessageChannel(binaryMessenger, "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.delete$separatedMessageChannelSuffix", codec) 284 | if (api != null) { 285 | channel.setMessageHandler { message, reply -> 286 | val args = message as List 287 | val keyArg = args[0] as String 288 | api.delete(keyArg) { result: Result -> 289 | val error = result.exceptionOrNull() 290 | if (error != null) { 291 | reply.reply(wrapError(error)) 292 | } else { 293 | reply.reply(wrapResult(null)) 294 | } 295 | } 296 | } 297 | } else { 298 | channel.setMessageHandler(null) 299 | } 300 | } 301 | } 302 | } 303 | } 304 | -------------------------------------------------------------------------------- /android/src/main/kotlin/com/infinum/flutter_locker/FlutterLockerPlugin.kt: -------------------------------------------------------------------------------- 1 | package com.infinum.flutter_locker 2 | 3 | import android.app.Activity 4 | import android.content.Context 5 | import androidx.biometric.BiometricManager 6 | import androidx.fragment.app.FragmentActivity 7 | import co.infinum.goldfinger.Goldfinger 8 | import io.flutter.embedding.engine.plugins.FlutterPlugin 9 | import io.flutter.embedding.engine.plugins.activity.ActivityAware 10 | import io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding 11 | 12 | /** FlutterLockerPlugin */ 13 | class FlutterLockerPlugin : FlutterPlugin, ActivityAware, FlutterLockerHostApi { 14 | private lateinit var activity: Activity 15 | private lateinit var goldfinger: Goldfinger 16 | 17 | private val authenticators = BiometricManager.Authenticators.BIOMETRIC_STRONG 18 | 19 | object ErrorCodes { 20 | const val OTHER = "other" 21 | const val SECRET_NOT_FOUND = "secretNotFound" 22 | const val AUTHENTICATION_CANCELED = "authenticationCanceled" 23 | const val AUTHENTICATION_FAILED = "authenticationFailed" 24 | } 25 | 26 | override fun canAuthenticate(callback: (Result) -> Unit) { 27 | callback(Result.success(goldfinger.canAuthenticate(authenticators))) 28 | } 29 | 30 | override fun save(request: SaveSecretRequest, callback: (Result) -> Unit) { 31 | val prompt = Goldfinger.PromptParams.Builder(activity as FragmentActivity) 32 | .allowedAuthenticators(authenticators) 33 | .title(request.androidPrompt.title) 34 | .description(request.androidPrompt.descriptionLabel) 35 | .negativeButtonText(request.androidPrompt.cancelLabel) 36 | .build() 37 | 38 | goldfinger.encrypt(prompt, request.key, request.secret, object : Goldfinger.Callback { 39 | override fun onResult(goldfingerResult: Goldfinger.Result) { 40 | if (goldfingerResult.type() == Goldfinger.Type.SUCCESS) { 41 | activity.getPreferences(Context.MODE_PRIVATE).edit() 42 | .putString(request.key.toPrefsKey(), goldfingerResult.value()).apply() 43 | callback(Result.success(Unit)) 44 | } else if (goldfingerResult.type() == Goldfinger.Type.ERROR) { 45 | val error = FlutterError(reasonToErrorCode(goldfingerResult.reason()), goldfingerResult.message()) 46 | callback(Result.failure(error)) 47 | } 48 | } 49 | 50 | override fun onError(e: Exception) { 51 | callback(Result.failure(FlutterError(ErrorCodes.OTHER, e.message))) 52 | } 53 | }) 54 | } 55 | 56 | override fun retrieve(request: RetrieveSecretRequest, callback: (Result) -> Unit) { 57 | val prompt = Goldfinger.PromptParams.Builder(activity as FragmentActivity) 58 | .allowedAuthenticators(authenticators) 59 | .title(request.androidPrompt.title) 60 | .description(request.androidPrompt.descriptionLabel) 61 | .negativeButtonText(request.androidPrompt.cancelLabel) 62 | .build() 63 | 64 | val encryptedSecret = 65 | activity.getPreferences(Context.MODE_PRIVATE).getString(request.key.toPrefsKey(), null) 66 | 67 | encryptedSecret?.let { 68 | goldfinger.decrypt(prompt, request.key, it, object : Goldfinger.Callback { 69 | override fun onResult(goldfingerResult: Goldfinger.Result) { 70 | if (goldfingerResult.type() == Goldfinger.Type.SUCCESS) { 71 | callback(Result.success(goldfingerResult.value() as String)) 72 | } else if (goldfingerResult.type() == Goldfinger.Type.ERROR) { 73 | val error = FlutterError(reasonToErrorCode(goldfingerResult.reason()), goldfingerResult.message()) 74 | callback(Result.failure(error)) 75 | } 76 | } 77 | 78 | override fun onError(e: Exception) { 79 | val error = FlutterError(ErrorCodes.SECRET_NOT_FOUND) 80 | callback(Result.failure(error)) 81 | } 82 | }) 83 | } ?: kotlin.run { 84 | val error = FlutterError(ErrorCodes.SECRET_NOT_FOUND) 85 | callback(Result.failure(error)) 86 | } 87 | } 88 | 89 | override fun delete(key: String, callback: (Result) -> Unit) { 90 | activity.getPreferences(Context.MODE_PRIVATE).edit().remove(key.toPrefsKey()).apply() 91 | callback(Result.success(Unit)) 92 | } 93 | 94 | private fun reasonToErrorCode(reason: Goldfinger.Reason): String { 95 | return when (reason) { 96 | Goldfinger.Reason.NEGATIVE_BUTTON, Goldfinger.Reason.CANCELED, Goldfinger.Reason.USER_CANCELED -> { 97 | ErrorCodes.AUTHENTICATION_CANCELED 98 | } 99 | Goldfinger.Reason.LOCKOUT_PERMANENT, Goldfinger.Reason.LOCKOUT -> { 100 | ErrorCodes.AUTHENTICATION_FAILED 101 | } 102 | else -> { 103 | ErrorCodes.OTHER 104 | } 105 | } 106 | } 107 | 108 | // When saving to prefs we add this prefix to avoid any possible clash with other keys 109 | fun String.toPrefsKey(): String = "\$_flutter_locker_$this" 110 | override fun onAttachedToEngine(binding: FlutterPlugin.FlutterPluginBinding) { 111 | goldfinger = Goldfinger.Builder(binding.applicationContext).build() 112 | FlutterLockerHostApi.setUp(binding.binaryMessenger, this) 113 | } 114 | 115 | override fun onAttachedToActivity(binding: ActivityPluginBinding) { 116 | activity = binding.activity 117 | } 118 | 119 | override fun onDetachedFromActivityForConfigChanges() { 120 | // no-op 121 | } 122 | 123 | override fun onReattachedToActivityForConfigChanges(binding: ActivityPluginBinding) { 124 | activity = binding.activity 125 | } 126 | 127 | override fun onDetachedFromActivity() { 128 | // no-op 129 | } 130 | 131 | override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) { 132 | // no-op 133 | } 134 | } -------------------------------------------------------------------------------- /example/.gitignore: -------------------------------------------------------------------------------- 1 | # Miscellaneous 2 | *.class 3 | *.log 4 | *.pyc 5 | *.swp 6 | .DS_Store 7 | .atom/ 8 | .buildlog/ 9 | .history 10 | .svn/ 11 | 12 | # IntelliJ related 13 | *.iml 14 | *.ipr 15 | *.iws 16 | .idea/ 17 | 18 | # The .vscode folder contains launch configuration and tasks you configure in 19 | # VS Code which you may wish to be included in version control, so this line 20 | # is commented out by default. 21 | #.vscode/ 22 | 23 | # Flutter/Dart/Pub related 24 | **/doc/api/ 25 | .dart_tool/ 26 | .flutter-plugins 27 | .flutter-plugins-dependencies 28 | .packages 29 | .pub-cache/ 30 | .pub/ 31 | /build/ 32 | 33 | # Web related 34 | lib/generated_plugin_registrant.dart 35 | 36 | # Symbolication related 37 | app.*.symbols 38 | 39 | # Obfuscation related 40 | app.*.map.json 41 | 42 | # Exceptions to above rules. 43 | !/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages 44 | -------------------------------------------------------------------------------- /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: "8495dee1fd4aacbe9de707e7581203232f591b2f" 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: 8495dee1fd4aacbe9de707e7581203232f591b2f 17 | base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 18 | - platform: android 19 | create_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 20 | base_revision: 8495dee1fd4aacbe9de707e7581203232f591b2f 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 | -------------------------------------------------------------------------------- /example/README.md: -------------------------------------------------------------------------------- 1 | # flutter_locker_example 2 | 3 | Demonstrates how to use the flutter_locker plugin. 4 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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/to/reference-keystore 11 | key.properties 12 | **/*.keystore 13 | **/*.jks 14 | -------------------------------------------------------------------------------- /example/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id "com.android.application" 3 | id "kotlin-android" 4 | // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. 5 | id "dev.flutter.flutter-gradle-plugin" 6 | } 7 | 8 | android { 9 | namespace = "com.example.flutter_locker_example" 10 | compileSdk = flutter.compileSdkVersion 11 | ndkVersion = flutter.ndkVersion 12 | 13 | compileOptions { 14 | sourceCompatibility = JavaVersion.VERSION_1_8 15 | targetCompatibility = JavaVersion.VERSION_1_8 16 | } 17 | 18 | kotlinOptions { 19 | jvmTarget = JavaVersion.VERSION_1_8 20 | } 21 | 22 | defaultConfig { 23 | applicationId = "com.example.flutter_locker_example" 24 | // You can update the following values to match your application needs. 25 | // For more information, see: https://flutter.dev/to/review-gradle-config. 26 | minSdk = flutter.minSdkVersion 27 | targetSdk = flutter.targetSdkVersion 28 | versionCode = flutter.versionCode 29 | versionName = flutter.versionName 30 | } 31 | 32 | buildTypes { 33 | release { 34 | signingConfig = signingConfigs.debug 35 | } 36 | } 37 | } 38 | 39 | flutter { 40 | source = "../.." 41 | } 42 | -------------------------------------------------------------------------------- /example/android/app/src/debug/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 15 | 19 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /example/android/app/src/main/kotlin/com/example/flutter_locker_example/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package com.example.flutter_locker_example 2 | 3 | import io.flutter.embedding.android.FlutterFragmentActivity 4 | 5 | class MainActivity: FlutterFragmentActivity() 6 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable-v21/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/drawable/launch_background.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 12 | 13 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/android/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/android/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /example/android/app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 15 | 18 | 19 | -------------------------------------------------------------------------------- /example/android/app/src/profile/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/android/build.gradle: -------------------------------------------------------------------------------- 1 | allprojects { 2 | repositories { 3 | google() 4 | mavenCentral() 5 | } 6 | } 7 | 8 | rootProject.buildDir = "../build" 9 | subprojects { 10 | project.buildDir = "${rootProject.buildDir}/${project.name}" 11 | } 12 | subprojects { 13 | project.evaluationDependsOn(":app") 14 | } 15 | 16 | tasks.register("clean", Delete) { 17 | delete rootProject.buildDir 18 | } 19 | -------------------------------------------------------------------------------- /example/android/gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError 2 | android.useAndroidX=true 3 | android.enableJetifier=true 4 | -------------------------------------------------------------------------------- /example/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | zipStoreBase=GRADLE_USER_HOME 4 | zipStorePath=wrapper/dists 5 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip 6 | -------------------------------------------------------------------------------- /example/android/settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | def flutterSdkPath = { 3 | def properties = new Properties() 4 | file("local.properties").withInputStream { properties.load(it) } 5 | def flutterSdkPath = properties.getProperty("flutter.sdk") 6 | assert flutterSdkPath != null, "flutter.sdk not set in local.properties" 7 | return flutterSdkPath 8 | }() 9 | 10 | includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") 11 | 12 | repositories { 13 | google() 14 | mavenCentral() 15 | gradlePluginPortal() 16 | } 17 | } 18 | 19 | plugins { 20 | id "dev.flutter.flutter-plugin-loader" version "1.0.0" 21 | id "com.android.application" version '8.3.0' apply false 22 | id "org.jetbrains.kotlin.android" version "1.8.22" apply false 23 | } 24 | 25 | include ":app" 26 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Flutter/Debug.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /example/ios/Flutter/Release.xcconfig: -------------------------------------------------------------------------------- 1 | #include? "Pods/Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig" 2 | #include "Generated.xcconfig" 3 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Flutter (1.0.0) 3 | 4 | DEPENDENCIES: 5 | - Flutter (from `Flutter`) 6 | 7 | EXTERNAL SOURCES: 8 | Flutter: 9 | :path: Flutter 10 | 11 | SPEC CHECKSUMS: 12 | Flutter: e0871f40cf51350855a761d2e70bf5af5b9b5de7 13 | 14 | PODFILE CHECKSUM: ce13d36744da294d67f8e460dbb7aed7c09bd7f4 15 | 16 | COCOAPODS: 1.16.2 17 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 54; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */ = {isa = PBXBuildFile; fileRef = 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */; }; 11 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */ = {isa = PBXBuildFile; fileRef = 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */; }; 12 | 6E9186B52D3E6B8000E0A62E /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 6E9186B42D3E6B8000E0A62E /* FlutterGeneratedPluginSwiftPackage */; }; 13 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 74858FAE1ED2DC5600515810 /* AppDelegate.swift */; }; 14 | 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */ = {isa = PBXBuildFile; productRef = 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */; }; 15 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FA1CF9000F007C117D /* Main.storyboard */; }; 16 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FD1CF9000F007C117D /* Assets.xcassets */; }; 17 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */; }; 18 | B562B52329852F83CB88C1D9 /* Pods_Runner.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B6DB386EA6AA969F0755994E /* Pods_Runner.framework */; }; 19 | /* End PBXBuildFile section */ 20 | 21 | /* Begin PBXCopyFilesBuildPhase section */ 22 | 9705A1C41CF9048500538489 /* Embed Frameworks */ = { 23 | isa = PBXCopyFilesBuildPhase; 24 | buildActionMask = 2147483647; 25 | dstPath = ""; 26 | dstSubfolderSpec = 10; 27 | files = ( 28 | ); 29 | name = "Embed Frameworks"; 30 | runOnlyForDeploymentPostprocessing = 0; 31 | }; 32 | /* End PBXCopyFilesBuildPhase section */ 33 | 34 | /* Begin PBXFileReference section */ 35 | 10D8DCB648226A1CB834625D /* Pods-Runner.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.debug.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.debug.xcconfig"; sourceTree = ""; }; 36 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GeneratedPluginRegistrant.h; sourceTree = ""; }; 37 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GeneratedPluginRegistrant.m; sourceTree = ""; }; 38 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = AppFrameworkInfo.plist; path = Flutter/AppFrameworkInfo.plist; sourceTree = ""; }; 39 | 735292E35DF63A3641726111 /* Pods-Runner.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.release.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.release.xcconfig"; sourceTree = ""; }; 40 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Runner-Bridging-Header.h"; sourceTree = ""; }; 41 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 42 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = Release.xcconfig; path = Flutter/Release.xcconfig; sourceTree = ""; }; 43 | 81B4C0778E2EE1B58C651DE6 /* Pods-Runner.profile.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-Runner.profile.xcconfig"; path = "Target Support Files/Pods-Runner/Pods-Runner.profile.xcconfig"; sourceTree = ""; }; 44 | 9740EEB21CF90195004384FC /* Debug.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Debug.xcconfig; path = Flutter/Debug.xcconfig; sourceTree = ""; }; 45 | 9740EEB31CF90195004384FC /* Generated.xcconfig */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.xcconfig; name = Generated.xcconfig; path = Flutter/Generated.xcconfig; sourceTree = ""; }; 46 | 97C146EE1CF9000F007C117D /* Runner.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Runner.app; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 97C146FB1CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 48 | 97C146FD1CF9000F007C117D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 49 | 97C147001CF9000F007C117D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 50 | 97C147021CF9000F007C117D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 51 | B6DB386EA6AA969F0755994E /* Pods_Runner.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_Runner.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 52 | /* End PBXFileReference section */ 53 | 54 | /* Begin PBXFrameworksBuildPhase section */ 55 | 97C146EB1CF9000F007C117D /* Frameworks */ = { 56 | isa = PBXFrameworksBuildPhase; 57 | buildActionMask = 2147483647; 58 | files = ( 59 | 78A318202AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 60 | 6E9186B52D3E6B8000E0A62E /* FlutterGeneratedPluginSwiftPackage in Frameworks */, 61 | B562B52329852F83CB88C1D9 /* Pods_Runner.framework in Frameworks */, 62 | ); 63 | runOnlyForDeploymentPostprocessing = 0; 64 | }; 65 | /* End PBXFrameworksBuildPhase section */ 66 | 67 | /* Begin PBXGroup section */ 68 | 001E716E86D9E31C022F9CCE /* Frameworks */ = { 69 | isa = PBXGroup; 70 | children = ( 71 | B6DB386EA6AA969F0755994E /* Pods_Runner.framework */, 72 | ); 73 | name = Frameworks; 74 | sourceTree = ""; 75 | }; 76 | 08CACFA5D49423421D5FC55A /* Pods */ = { 77 | isa = PBXGroup; 78 | children = ( 79 | 10D8DCB648226A1CB834625D /* Pods-Runner.debug.xcconfig */, 80 | 735292E35DF63A3641726111 /* Pods-Runner.release.xcconfig */, 81 | 81B4C0778E2EE1B58C651DE6 /* Pods-Runner.profile.xcconfig */, 82 | ); 83 | name = Pods; 84 | path = Pods; 85 | sourceTree = ""; 86 | }; 87 | 9740EEB11CF90186004384FC /* Flutter */ = { 88 | isa = PBXGroup; 89 | children = ( 90 | 3B3967151E833CAA004F5970 /* AppFrameworkInfo.plist */, 91 | 9740EEB21CF90195004384FC /* Debug.xcconfig */, 92 | 7AFA3C8E1D35360C0083082E /* Release.xcconfig */, 93 | 9740EEB31CF90195004384FC /* Generated.xcconfig */, 94 | ); 95 | name = Flutter; 96 | sourceTree = ""; 97 | }; 98 | 97C146E51CF9000F007C117D = { 99 | isa = PBXGroup; 100 | children = ( 101 | 9740EEB11CF90186004384FC /* Flutter */, 102 | 97C146F01CF9000F007C117D /* Runner */, 103 | 97C146EF1CF9000F007C117D /* Products */, 104 | 08CACFA5D49423421D5FC55A /* Pods */, 105 | 001E716E86D9E31C022F9CCE /* Frameworks */, 106 | ); 107 | sourceTree = ""; 108 | }; 109 | 97C146EF1CF9000F007C117D /* Products */ = { 110 | isa = PBXGroup; 111 | children = ( 112 | 97C146EE1CF9000F007C117D /* Runner.app */, 113 | ); 114 | name = Products; 115 | sourceTree = ""; 116 | }; 117 | 97C146F01CF9000F007C117D /* Runner */ = { 118 | isa = PBXGroup; 119 | children = ( 120 | 97C146FA1CF9000F007C117D /* Main.storyboard */, 121 | 97C146FD1CF9000F007C117D /* Assets.xcassets */, 122 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */, 123 | 97C147021CF9000F007C117D /* Info.plist */, 124 | 1498D2321E8E86230040F4C2 /* GeneratedPluginRegistrant.h */, 125 | 1498D2331E8E89220040F4C2 /* GeneratedPluginRegistrant.m */, 126 | 74858FAE1ED2DC5600515810 /* AppDelegate.swift */, 127 | 74858FAD1ED2DC5600515810 /* Runner-Bridging-Header.h */, 128 | ); 129 | path = Runner; 130 | sourceTree = ""; 131 | }; 132 | /* End PBXGroup section */ 133 | 134 | /* Begin PBXNativeTarget section */ 135 | 97C146ED1CF9000F007C117D /* Runner */ = { 136 | isa = PBXNativeTarget; 137 | buildConfigurationList = 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */; 138 | buildPhases = ( 139 | BF023009F500BAACAE4BC7CE /* [CP] Check Pods Manifest.lock */, 140 | 9740EEB61CF901F6004384FC /* Run Script */, 141 | 97C146EA1CF9000F007C117D /* Sources */, 142 | 97C146EB1CF9000F007C117D /* Frameworks */, 143 | 97C146EC1CF9000F007C117D /* Resources */, 144 | 9705A1C41CF9048500538489 /* Embed Frameworks */, 145 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | ); 151 | name = Runner; 152 | packageProductDependencies = ( 153 | 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */, 154 | 6E9186B42D3E6B8000E0A62E /* FlutterGeneratedPluginSwiftPackage */, 155 | ); 156 | productName = Runner; 157 | productReference = 97C146EE1CF9000F007C117D /* Runner.app */; 158 | productType = "com.apple.product-type.application"; 159 | }; 160 | /* End PBXNativeTarget section */ 161 | 162 | /* Begin PBXProject section */ 163 | 97C146E61CF9000F007C117D /* Project object */ = { 164 | isa = PBXProject; 165 | attributes = { 166 | LastUpgradeCheck = 1510; 167 | ORGANIZATIONNAME = ""; 168 | TargetAttributes = { 169 | 97C146ED1CF9000F007C117D = { 170 | CreatedOnToolsVersion = 7.3.1; 171 | LastSwiftMigration = 1100; 172 | }; 173 | }; 174 | }; 175 | buildConfigurationList = 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */; 176 | compatibilityVersion = "Xcode 9.3"; 177 | developmentRegion = en; 178 | hasScannedForEncodings = 0; 179 | knownRegions = ( 180 | en, 181 | Base, 182 | ); 183 | mainGroup = 97C146E51CF9000F007C117D; 184 | packageReferences = ( 185 | 6E9186B32D3E6B8000E0A62E /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */, 186 | ); 187 | productRefGroup = 97C146EF1CF9000F007C117D /* Products */; 188 | projectDirPath = ""; 189 | projectRoot = ""; 190 | targets = ( 191 | 97C146ED1CF9000F007C117D /* Runner */, 192 | ); 193 | }; 194 | /* End PBXProject section */ 195 | 196 | /* Begin PBXResourcesBuildPhase section */ 197 | 97C146EC1CF9000F007C117D /* Resources */ = { 198 | isa = PBXResourcesBuildPhase; 199 | buildActionMask = 2147483647; 200 | files = ( 201 | 97C147011CF9000F007C117D /* LaunchScreen.storyboard in Resources */, 202 | 3B3967161E833CAA004F5970 /* AppFrameworkInfo.plist in Resources */, 203 | 97C146FE1CF9000F007C117D /* Assets.xcassets in Resources */, 204 | 97C146FC1CF9000F007C117D /* Main.storyboard in Resources */, 205 | ); 206 | runOnlyForDeploymentPostprocessing = 0; 207 | }; 208 | /* End PBXResourcesBuildPhase section */ 209 | 210 | /* Begin PBXShellScriptBuildPhase section */ 211 | 3B06AD1E1E4923F5004D2608 /* Thin Binary */ = { 212 | isa = PBXShellScriptBuildPhase; 213 | alwaysOutOfDate = 1; 214 | buildActionMask = 2147483647; 215 | files = ( 216 | ); 217 | inputPaths = ( 218 | "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}", 219 | ); 220 | name = "Thin Binary"; 221 | outputPaths = ( 222 | ); 223 | runOnlyForDeploymentPostprocessing = 0; 224 | shellPath = /bin/sh; 225 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" embed_and_thin"; 226 | }; 227 | 9740EEB61CF901F6004384FC /* Run Script */ = { 228 | isa = PBXShellScriptBuildPhase; 229 | alwaysOutOfDate = 1; 230 | buildActionMask = 2147483647; 231 | files = ( 232 | ); 233 | inputPaths = ( 234 | ); 235 | name = "Run Script"; 236 | outputPaths = ( 237 | ); 238 | runOnlyForDeploymentPostprocessing = 0; 239 | shellPath = /bin/sh; 240 | shellScript = "/bin/sh \"$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh\" build"; 241 | }; 242 | BF023009F500BAACAE4BC7CE /* [CP] Check Pods Manifest.lock */ = { 243 | isa = PBXShellScriptBuildPhase; 244 | buildActionMask = 2147483647; 245 | files = ( 246 | ); 247 | inputFileListPaths = ( 248 | ); 249 | inputPaths = ( 250 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 251 | "${PODS_ROOT}/Manifest.lock", 252 | ); 253 | name = "[CP] Check Pods Manifest.lock"; 254 | outputFileListPaths = ( 255 | ); 256 | outputPaths = ( 257 | "$(DERIVED_FILE_DIR)/Pods-Runner-checkManifestLockResult.txt", 258 | ); 259 | runOnlyForDeploymentPostprocessing = 0; 260 | shellPath = /bin/sh; 261 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 262 | showEnvVarsInLog = 0; 263 | }; 264 | /* End PBXShellScriptBuildPhase section */ 265 | 266 | /* Begin PBXSourcesBuildPhase section */ 267 | 97C146EA1CF9000F007C117D /* Sources */ = { 268 | isa = PBXSourcesBuildPhase; 269 | buildActionMask = 2147483647; 270 | files = ( 271 | 74858FAF1ED2DC5600515810 /* AppDelegate.swift in Sources */, 272 | 1498D2341E8E89220040F4C2 /* GeneratedPluginRegistrant.m in Sources */, 273 | ); 274 | runOnlyForDeploymentPostprocessing = 0; 275 | }; 276 | /* End PBXSourcesBuildPhase section */ 277 | 278 | /* Begin PBXVariantGroup section */ 279 | 97C146FA1CF9000F007C117D /* Main.storyboard */ = { 280 | isa = PBXVariantGroup; 281 | children = ( 282 | 97C146FB1CF9000F007C117D /* Base */, 283 | ); 284 | name = Main.storyboard; 285 | sourceTree = ""; 286 | }; 287 | 97C146FF1CF9000F007C117D /* LaunchScreen.storyboard */ = { 288 | isa = PBXVariantGroup; 289 | children = ( 290 | 97C147001CF9000F007C117D /* Base */, 291 | ); 292 | name = LaunchScreen.storyboard; 293 | sourceTree = ""; 294 | }; 295 | /* End PBXVariantGroup section */ 296 | 297 | /* Begin XCBuildConfiguration section */ 298 | 249021D3217E4FDB00AE95B9 /* Profile */ = { 299 | isa = XCBuildConfiguration; 300 | buildSettings = { 301 | ALWAYS_SEARCH_USER_PATHS = NO; 302 | CLANG_ANALYZER_NONNULL = YES; 303 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 304 | CLANG_CXX_LIBRARY = "libc++"; 305 | CLANG_ENABLE_MODULES = YES; 306 | CLANG_ENABLE_OBJC_ARC = YES; 307 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 308 | CLANG_WARN_BOOL_CONVERSION = YES; 309 | CLANG_WARN_COMMA = YES; 310 | CLANG_WARN_CONSTANT_CONVERSION = YES; 311 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 312 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 313 | CLANG_WARN_EMPTY_BODY = YES; 314 | CLANG_WARN_ENUM_CONVERSION = YES; 315 | CLANG_WARN_INFINITE_RECURSION = YES; 316 | CLANG_WARN_INT_CONVERSION = YES; 317 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 318 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 319 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 320 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 321 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 322 | CLANG_WARN_STRICT_PROTOTYPES = YES; 323 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 324 | CLANG_WARN_UNREACHABLE_CODE = YES; 325 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 326 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 327 | COPY_PHASE_STRIP = NO; 328 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 329 | ENABLE_NS_ASSERTIONS = NO; 330 | ENABLE_STRICT_OBJC_MSGSEND = YES; 331 | GCC_C_LANGUAGE_STANDARD = gnu99; 332 | GCC_NO_COMMON_BLOCKS = YES; 333 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 334 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 335 | GCC_WARN_UNDECLARED_SELECTOR = YES; 336 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 337 | GCC_WARN_UNUSED_FUNCTION = YES; 338 | GCC_WARN_UNUSED_VARIABLE = YES; 339 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 340 | MTL_ENABLE_DEBUG_INFO = NO; 341 | SDKROOT = iphoneos; 342 | SUPPORTED_PLATFORMS = iphoneos; 343 | SWIFT_VERSION = 5.0; 344 | TARGETED_DEVICE_FAMILY = "1,2"; 345 | VALIDATE_PRODUCT = YES; 346 | }; 347 | name = Profile; 348 | }; 349 | 249021D4217E4FDB00AE95B9 /* Profile */ = { 350 | isa = XCBuildConfiguration; 351 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 352 | buildSettings = { 353 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 354 | CLANG_ENABLE_MODULES = YES; 355 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 356 | DEVELOPMENT_TEAM = 5F5M64F878; 357 | ENABLE_BITCODE = NO; 358 | INFOPLIST_FILE = Runner/Info.plist; 359 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 360 | LD_RUNPATH_SEARCH_PATHS = ( 361 | "$(inherited)", 362 | "@executable_path/Frameworks", 363 | ); 364 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLockerExample; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 367 | SWIFT_VERSION = 5.0; 368 | VERSIONING_SYSTEM = "apple-generic"; 369 | }; 370 | name = Profile; 371 | }; 372 | 97C147031CF9000F007C117D /* Debug */ = { 373 | isa = XCBuildConfiguration; 374 | buildSettings = { 375 | ALWAYS_SEARCH_USER_PATHS = NO; 376 | CLANG_ANALYZER_NONNULL = YES; 377 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 378 | CLANG_CXX_LIBRARY = "libc++"; 379 | CLANG_ENABLE_MODULES = YES; 380 | CLANG_ENABLE_OBJC_ARC = YES; 381 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 382 | CLANG_WARN_BOOL_CONVERSION = YES; 383 | CLANG_WARN_COMMA = YES; 384 | CLANG_WARN_CONSTANT_CONVERSION = YES; 385 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 386 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 387 | CLANG_WARN_EMPTY_BODY = YES; 388 | CLANG_WARN_ENUM_CONVERSION = YES; 389 | CLANG_WARN_INFINITE_RECURSION = YES; 390 | CLANG_WARN_INT_CONVERSION = YES; 391 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 392 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 393 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 394 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 395 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 396 | CLANG_WARN_STRICT_PROTOTYPES = YES; 397 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 398 | CLANG_WARN_UNREACHABLE_CODE = YES; 399 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 400 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 401 | COPY_PHASE_STRIP = NO; 402 | DEBUG_INFORMATION_FORMAT = dwarf; 403 | ENABLE_STRICT_OBJC_MSGSEND = YES; 404 | ENABLE_TESTABILITY = YES; 405 | GCC_C_LANGUAGE_STANDARD = gnu99; 406 | GCC_DYNAMIC_NO_PIC = NO; 407 | GCC_NO_COMMON_BLOCKS = YES; 408 | GCC_OPTIMIZATION_LEVEL = 0; 409 | GCC_PREPROCESSOR_DEFINITIONS = ( 410 | "DEBUG=1", 411 | "$(inherited)", 412 | ); 413 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 414 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 415 | GCC_WARN_UNDECLARED_SELECTOR = YES; 416 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 417 | GCC_WARN_UNUSED_FUNCTION = YES; 418 | GCC_WARN_UNUSED_VARIABLE = YES; 419 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 420 | MTL_ENABLE_DEBUG_INFO = YES; 421 | ONLY_ACTIVE_ARCH = YES; 422 | SDKROOT = iphoneos; 423 | SWIFT_VERSION = 5.0; 424 | TARGETED_DEVICE_FAMILY = "1,2"; 425 | }; 426 | name = Debug; 427 | }; 428 | 97C147041CF9000F007C117D /* Release */ = { 429 | isa = XCBuildConfiguration; 430 | buildSettings = { 431 | ALWAYS_SEARCH_USER_PATHS = NO; 432 | CLANG_ANALYZER_NONNULL = YES; 433 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 434 | CLANG_CXX_LIBRARY = "libc++"; 435 | CLANG_ENABLE_MODULES = YES; 436 | CLANG_ENABLE_OBJC_ARC = YES; 437 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 438 | CLANG_WARN_BOOL_CONVERSION = YES; 439 | CLANG_WARN_COMMA = YES; 440 | CLANG_WARN_CONSTANT_CONVERSION = YES; 441 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; 442 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 443 | CLANG_WARN_EMPTY_BODY = YES; 444 | CLANG_WARN_ENUM_CONVERSION = YES; 445 | CLANG_WARN_INFINITE_RECURSION = YES; 446 | CLANG_WARN_INT_CONVERSION = YES; 447 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 448 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; 449 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 450 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 451 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 452 | CLANG_WARN_STRICT_PROTOTYPES = YES; 453 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 454 | CLANG_WARN_UNREACHABLE_CODE = YES; 455 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 456 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 457 | COPY_PHASE_STRIP = NO; 458 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 459 | ENABLE_NS_ASSERTIONS = NO; 460 | ENABLE_STRICT_OBJC_MSGSEND = YES; 461 | GCC_C_LANGUAGE_STANDARD = gnu99; 462 | GCC_NO_COMMON_BLOCKS = YES; 463 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 464 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 465 | GCC_WARN_UNDECLARED_SELECTOR = YES; 466 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 467 | GCC_WARN_UNUSED_FUNCTION = YES; 468 | GCC_WARN_UNUSED_VARIABLE = YES; 469 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 470 | MTL_ENABLE_DEBUG_INFO = NO; 471 | SDKROOT = iphoneos; 472 | SUPPORTED_PLATFORMS = iphoneos; 473 | SWIFT_COMPILATION_MODE = wholemodule; 474 | SWIFT_OPTIMIZATION_LEVEL = "-O"; 475 | SWIFT_VERSION = 5.0; 476 | TARGETED_DEVICE_FAMILY = "1,2"; 477 | VALIDATE_PRODUCT = YES; 478 | }; 479 | name = Release; 480 | }; 481 | 97C147061CF9000F007C117D /* Debug */ = { 482 | isa = XCBuildConfiguration; 483 | baseConfigurationReference = 9740EEB21CF90195004384FC /* Debug.xcconfig */; 484 | buildSettings = { 485 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 486 | CLANG_ENABLE_MODULES = YES; 487 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 488 | DEVELOPMENT_TEAM = 5F5M64F878; 489 | ENABLE_BITCODE = NO; 490 | INFOPLIST_FILE = Runner/Info.plist; 491 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 492 | LD_RUNPATH_SEARCH_PATHS = ( 493 | "$(inherited)", 494 | "@executable_path/Frameworks", 495 | ); 496 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLockerExample; 497 | PRODUCT_NAME = "$(TARGET_NAME)"; 498 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 499 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 500 | SWIFT_VERSION = 5.0; 501 | VERSIONING_SYSTEM = "apple-generic"; 502 | }; 503 | name = Debug; 504 | }; 505 | 97C147071CF9000F007C117D /* Release */ = { 506 | isa = XCBuildConfiguration; 507 | baseConfigurationReference = 7AFA3C8E1D35360C0083082E /* Release.xcconfig */; 508 | buildSettings = { 509 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 510 | CLANG_ENABLE_MODULES = YES; 511 | CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; 512 | DEVELOPMENT_TEAM = 5F5M64F878; 513 | ENABLE_BITCODE = NO; 514 | INFOPLIST_FILE = Runner/Info.plist; 515 | IPHONEOS_DEPLOYMENT_TARGET = 12.0; 516 | LD_RUNPATH_SEARCH_PATHS = ( 517 | "$(inherited)", 518 | "@executable_path/Frameworks", 519 | ); 520 | PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterLockerExample; 521 | PRODUCT_NAME = "$(TARGET_NAME)"; 522 | SWIFT_OBJC_BRIDGING_HEADER = "Runner/Runner-Bridging-Header.h"; 523 | SWIFT_VERSION = 5.0; 524 | VERSIONING_SYSTEM = "apple-generic"; 525 | }; 526 | name = Release; 527 | }; 528 | /* End XCBuildConfiguration section */ 529 | 530 | /* Begin XCConfigurationList section */ 531 | 97C146E91CF9000F007C117D /* Build configuration list for PBXProject "Runner" */ = { 532 | isa = XCConfigurationList; 533 | buildConfigurations = ( 534 | 97C147031CF9000F007C117D /* Debug */, 535 | 97C147041CF9000F007C117D /* Release */, 536 | 249021D3217E4FDB00AE95B9 /* Profile */, 537 | ); 538 | defaultConfigurationIsVisible = 0; 539 | defaultConfigurationName = Release; 540 | }; 541 | 97C147051CF9000F007C117D /* Build configuration list for PBXNativeTarget "Runner" */ = { 542 | isa = XCConfigurationList; 543 | buildConfigurations = ( 544 | 97C147061CF9000F007C117D /* Debug */, 545 | 97C147071CF9000F007C117D /* Release */, 546 | 249021D4217E4FDB00AE95B9 /* Profile */, 547 | ); 548 | defaultConfigurationIsVisible = 0; 549 | defaultConfigurationName = Release; 550 | }; 551 | /* End XCConfigurationList section */ 552 | 553 | /* Begin XCLocalSwiftPackageReference section */ 554 | 6E9186B32D3E6B8000E0A62E /* XCLocalSwiftPackageReference "FlutterGeneratedPluginSwiftPackage" */ = { 555 | isa = XCLocalSwiftPackageReference; 556 | relativePath = Flutter/ephemeral/Packages/FlutterGeneratedPluginSwiftPackage; 557 | }; 558 | /* End XCLocalSwiftPackageReference section */ 559 | 560 | /* Begin XCSwiftPackageProductDependency section */ 561 | 6E9186B42D3E6B8000E0A62E /* FlutterGeneratedPluginSwiftPackage */ = { 562 | isa = XCSwiftPackageProductDependency; 563 | productName = FlutterGeneratedPluginSwiftPackage; 564 | }; 565 | 78A3181F2AECB46A00862997 /* FlutterGeneratedPluginSwiftPackage */ = { 566 | isa = XCSwiftPackageProductDependency; 567 | productName = FlutterGeneratedPluginSwiftPackage; 568 | }; 569 | /* End XCSwiftPackageProductDependency section */ 570 | }; 571 | rootObject = 97C146E61CF9000F007C117D /* Project object */; 572 | } 573 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "0be3627628c1af82f0d9a51d1c5fc1433b6fd2bce529eed94e2a0cef2ce09613", 3 | "pins" : [ 4 | { 5 | "identity" : "locker", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/infinum/Locker.git", 8 | "state" : { 9 | "revision" : "6954ffe776d4adf929f470220729b4dbbda0aaa9", 10 | "version" : "3.0.4" 11 | } 12 | } 13 | ], 14 | "version" : 3 15 | } 16 | -------------------------------------------------------------------------------- /example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 11 | 14 | 15 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 33 | 39 | 40 | 41 | 42 | 43 | 48 | 49 | 55 | 56 | 57 | 58 | 59 | 60 | 70 | 72 | 78 | 79 | 80 | 81 | 87 | 89 | 95 | 96 | 97 | 98 | 100 | 101 | 104 | 105 | 106 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /example/ios/Runner.xcworkspace/xcshareddata/swiftpm/Package.resolved: -------------------------------------------------------------------------------- 1 | { 2 | "originHash" : "0be3627628c1af82f0d9a51d1c5fc1433b6fd2bce529eed94e2a0cef2ce09613", 3 | "pins" : [ 4 | { 5 | "identity" : "locker", 6 | "kind" : "remoteSourceControl", 7 | "location" : "https://github.com/infinum/Locker.git", 8 | "state" : { 9 | "revision" : "6954ffe776d4adf929f470220729b4dbbda0aaa9", 10 | "version" : "3.0.4" 11 | } 12 | } 13 | ], 14 | "version" : 3 15 | } 16 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png -------------------------------------------------------------------------------- /example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/infinum/flutter-plugins-locker/e8af05777cb5177a13dddfce5e640b709604c08f/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png -------------------------------------------------------------------------------- /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. -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /example/ios/Runner/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CADisableMinimumFrameDurationOnPhone 6 | 7 | CFBundleDevelopmentRegion 8 | $(DEVELOPMENT_LANGUAGE) 9 | CFBundleDisplayName 10 | Flutter Locker Example 11 | CFBundleExecutable 12 | $(EXECUTABLE_NAME) 13 | CFBundleIdentifier 14 | $(PRODUCT_BUNDLE_IDENTIFIER) 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundleName 18 | flutter_locker_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 | NSFaceIDUsageDescription 51 | Save a secret 52 | 53 | 54 | -------------------------------------------------------------------------------- /example/ios/Runner/Runner-Bridging-Header.h: -------------------------------------------------------------------------------- 1 | #import "GeneratedPluginRegistrant.h" 2 | -------------------------------------------------------------------------------- /example/lib/main.dart: -------------------------------------------------------------------------------- 1 | import 'dart:async'; 2 | 3 | import 'package:flutter/cupertino.dart'; 4 | import 'package:flutter/material.dart'; 5 | import 'package:flutter_locker/flutter_locker.dart'; 6 | 7 | void main() { 8 | runApp(const MaterialApp(home: Scaffold(body: MyApp()))); 9 | } 10 | 11 | class MyApp extends StatefulWidget { 12 | const MyApp({Key? key}) : super(key: key); 13 | 14 | @override 15 | State createState() => _MyAppState(); 16 | } 17 | 18 | class _MyAppState extends State { 19 | String key = 'pwdkey'; 20 | String secret = '1111'; 21 | 22 | Future _canAuthenticate() async { 23 | try { 24 | final canAuthenticate = await FlutterLocker.canAuthenticate(); 25 | 26 | _showMessage('Can authenticate: $canAuthenticate'); 27 | } on Exception catch (exception) { 28 | _showErrorMessage(exception); 29 | } 30 | } 31 | 32 | Future _saveSecret() async { 33 | try { 34 | await FlutterLocker.save( 35 | SaveSecretRequest( 36 | key: key, 37 | secret: secret, 38 | androidPrompt: AndroidPrompt( 39 | title: 'Authenticate', 40 | cancelLabel: 'Cancel', 41 | descriptionLabel: 'Please authenticate')), 42 | ); 43 | 44 | _showMessage('Secret saved, secret: $secret'); 45 | } on Exception catch (exception) { 46 | _showErrorMessage(exception); 47 | } 48 | } 49 | 50 | Future _retrieveSecret() async { 51 | try { 52 | final retrieved = await FlutterLocker.retrieve(RetrieveSecretRequest( 53 | key: key, 54 | androidPrompt: AndroidPrompt( 55 | title: 'Authenticate', 56 | cancelLabel: 'Cancel', 57 | descriptionLabel: 'Please authenticate'), 58 | iOsPrompt: IOsPrompt(touchIdText: 'Authenticate'))); 59 | 60 | _showMessage('Secret retrieved, secret: $retrieved'); 61 | } on Exception catch (exception) { 62 | _showErrorMessage(exception); 63 | } 64 | } 65 | 66 | Future _deleteSecret() async { 67 | try { 68 | await FlutterLocker.delete(key); 69 | 70 | _showMessage('Secret deleted'); 71 | } on Exception catch (exception) { 72 | _showErrorMessage(exception); 73 | } 74 | } 75 | 76 | void _showMessage(String message) { 77 | ScaffoldMessenger.of(context).showSnackBar( 78 | SnackBar(content: Text(message)), 79 | ); 80 | } 81 | 82 | void _showErrorMessage(Exception exception) { 83 | ScaffoldMessenger.of(context).showSnackBar( 84 | SnackBar( 85 | content: Text('Something went wrong: $exception'), 86 | duration: const Duration(seconds: 1), 87 | ), 88 | ); 89 | } 90 | 91 | @override 92 | Widget build(BuildContext context) { 93 | return SafeArea( 94 | child: Column( 95 | children: [ 96 | const SizedBox(height: 100), 97 | const Center( 98 | child: Text( 99 | 'Locker example', 100 | style: TextStyle(fontSize: 24), 101 | ), 102 | ), 103 | const SizedBox(height: 40), 104 | CupertinoButton.filled( 105 | onPressed: _canAuthenticate, 106 | child: const Text('Can authenticate'), 107 | ), 108 | const SizedBox(height: 20), 109 | CupertinoButton.filled( 110 | onPressed: _saveSecret, 111 | child: const Text('Save secret'), 112 | ), 113 | const SizedBox(height: 20), 114 | CupertinoButton.filled( 115 | onPressed: _retrieveSecret, 116 | child: const Text('Retrieve secret'), 117 | ), 118 | const SizedBox(height: 20), 119 | CupertinoButton.filled( 120 | onPressed: _deleteSecret, 121 | child: const Text('Delete secret'), 122 | ) 123 | ], 124 | ), 125 | ); 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /example/pubspec.lock: -------------------------------------------------------------------------------- 1 | # Generated by pub 2 | # See https://dart.dev/tools/pub/glossary#lockfile 3 | packages: 4 | async: 5 | dependency: transitive 6 | description: 7 | name: async 8 | sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" 9 | url: "https://pub.dev" 10 | source: hosted 11 | version: "2.11.0" 12 | boolean_selector: 13 | dependency: transitive 14 | description: 15 | name: boolean_selector 16 | sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" 17 | url: "https://pub.dev" 18 | source: hosted 19 | version: "2.1.1" 20 | characters: 21 | dependency: transitive 22 | description: 23 | name: characters 24 | sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" 25 | url: "https://pub.dev" 26 | source: hosted 27 | version: "1.3.0" 28 | clock: 29 | dependency: transitive 30 | description: 31 | name: clock 32 | sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf 33 | url: "https://pub.dev" 34 | source: hosted 35 | version: "1.1.1" 36 | collection: 37 | dependency: transitive 38 | description: 39 | name: collection 40 | sha256: a1ace0a119f20aabc852d165077c036cd864315bd99b7eaa10a60100341941bf 41 | url: "https://pub.dev" 42 | source: hosted 43 | version: "1.19.0" 44 | fake_async: 45 | dependency: transitive 46 | description: 47 | name: fake_async 48 | sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" 49 | url: "https://pub.dev" 50 | source: hosted 51 | version: "1.3.1" 52 | flutter: 53 | dependency: "direct main" 54 | description: flutter 55 | source: sdk 56 | version: "0.0.0" 57 | flutter_lints: 58 | dependency: "direct dev" 59 | description: 60 | name: flutter_lints 61 | sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" 62 | url: "https://pub.dev" 63 | source: hosted 64 | version: "5.0.0" 65 | flutter_locker: 66 | dependency: "direct main" 67 | description: 68 | path: ".." 69 | relative: true 70 | source: path 71 | version: "2.1.5" 72 | flutter_test: 73 | dependency: "direct dev" 74 | description: flutter 75 | source: sdk 76 | version: "0.0.0" 77 | leak_tracker: 78 | dependency: transitive 79 | description: 80 | name: leak_tracker 81 | sha256: "7bb2830ebd849694d1ec25bf1f44582d6ac531a57a365a803a6034ff751d2d06" 82 | url: "https://pub.dev" 83 | source: hosted 84 | version: "10.0.7" 85 | leak_tracker_flutter_testing: 86 | dependency: transitive 87 | description: 88 | name: leak_tracker_flutter_testing 89 | sha256: "9491a714cca3667b60b5c420da8217e6de0d1ba7a5ec322fab01758f6998f379" 90 | url: "https://pub.dev" 91 | source: hosted 92 | version: "3.0.8" 93 | leak_tracker_testing: 94 | dependency: transitive 95 | description: 96 | name: leak_tracker_testing 97 | sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" 98 | url: "https://pub.dev" 99 | source: hosted 100 | version: "3.0.1" 101 | lints: 102 | dependency: transitive 103 | description: 104 | name: lints 105 | sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 106 | url: "https://pub.dev" 107 | source: hosted 108 | version: "5.1.1" 109 | matcher: 110 | dependency: transitive 111 | description: 112 | name: matcher 113 | sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb 114 | url: "https://pub.dev" 115 | source: hosted 116 | version: "0.12.16+1" 117 | material_color_utilities: 118 | dependency: transitive 119 | description: 120 | name: material_color_utilities 121 | sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec 122 | url: "https://pub.dev" 123 | source: hosted 124 | version: "0.11.1" 125 | meta: 126 | dependency: transitive 127 | description: 128 | name: meta 129 | sha256: bdb68674043280c3428e9ec998512fb681678676b3c54e773629ffe74419f8c7 130 | url: "https://pub.dev" 131 | source: hosted 132 | version: "1.15.0" 133 | path: 134 | dependency: transitive 135 | description: 136 | name: path 137 | sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" 138 | url: "https://pub.dev" 139 | source: hosted 140 | version: "1.9.0" 141 | sky_engine: 142 | dependency: transitive 143 | description: flutter 144 | source: sdk 145 | version: "0.0.0" 146 | source_span: 147 | dependency: transitive 148 | description: 149 | name: source_span 150 | sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" 151 | url: "https://pub.dev" 152 | source: hosted 153 | version: "1.10.0" 154 | stack_trace: 155 | dependency: transitive 156 | description: 157 | name: stack_trace 158 | sha256: "9f47fd3630d76be3ab26f0ee06d213679aa425996925ff3feffdec504931c377" 159 | url: "https://pub.dev" 160 | source: hosted 161 | version: "1.12.0" 162 | stream_channel: 163 | dependency: transitive 164 | description: 165 | name: stream_channel 166 | sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 167 | url: "https://pub.dev" 168 | source: hosted 169 | version: "2.1.2" 170 | string_scanner: 171 | dependency: transitive 172 | description: 173 | name: string_scanner 174 | sha256: "688af5ed3402a4bde5b3a6c15fd768dbf2621a614950b17f04626c431ab3c4c3" 175 | url: "https://pub.dev" 176 | source: hosted 177 | version: "1.3.0" 178 | term_glyph: 179 | dependency: transitive 180 | description: 181 | name: term_glyph 182 | sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 183 | url: "https://pub.dev" 184 | source: hosted 185 | version: "1.2.1" 186 | test_api: 187 | dependency: transitive 188 | description: 189 | name: test_api 190 | sha256: "664d3a9a64782fcdeb83ce9c6b39e78fd2971d4e37827b9b06c3aa1edc5e760c" 191 | url: "https://pub.dev" 192 | source: hosted 193 | version: "0.7.3" 194 | vector_math: 195 | dependency: transitive 196 | description: 197 | name: vector_math 198 | sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" 199 | url: "https://pub.dev" 200 | source: hosted 201 | version: "2.1.4" 202 | vm_service: 203 | dependency: transitive 204 | description: 205 | name: vm_service 206 | sha256: f6be3ed8bd01289b34d679c2b62226f63c0e69f9fd2e50a6b3c1c729a961041b 207 | url: "https://pub.dev" 208 | source: hosted 209 | version: "14.3.0" 210 | sdks: 211 | dart: ">=3.6.0 <4.0.0" 212 | flutter: ">=3.18.0-18.0.pre.54" 213 | -------------------------------------------------------------------------------- /example/pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_locker_example 2 | description: Demonstrates how to use the flutter_locker plugin. 3 | publish_to: 'none' 4 | version: 1.0.0+1 5 | 6 | environment: 7 | sdk: ">=2.12.0 <3.0.0" 8 | 9 | dependencies: 10 | flutter: 11 | sdk: flutter 12 | 13 | flutter_locker: 14 | path: ../ 15 | 16 | dev_dependencies: 17 | flutter_test: 18 | sdk: flutter 19 | flutter_lints: ^5.0.0 20 | 21 | flutter: 22 | uses-material-design: true 23 | -------------------------------------------------------------------------------- /example/test/widget_test.dart: -------------------------------------------------------------------------------- 1 | // This is a basic Flutter widget test. 2 | // 3 | // To perform an interaction with a widget in your test, use the WidgetTester 4 | // utility that Flutter provides. For example, you can send tap and scroll 5 | // gestures. You can also use WidgetTester to find child widgets in the widget 6 | // tree, read text, and verify that the values of widget properties are correct. 7 | 8 | import 'package:flutter_locker_example/main.dart'; 9 | import 'package:flutter_test/flutter_test.dart'; 10 | 11 | void main() { 12 | testWidgets('Verify Platform version', (WidgetTester tester) async { 13 | // Build our app and trigger a frame. 14 | await tester.pumpWidget(const MyApp()); 15 | }); 16 | } 17 | -------------------------------------------------------------------------------- /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 | GeneratedPluginRegistrant.h 13 | GeneratedPluginRegistrant.m 14 | 15 | .generated/ 16 | 17 | *.pbxuser 18 | *.mode1v3 19 | *.mode2v3 20 | *.perspectivev3 21 | 22 | !default.pbxuser 23 | !default.mode1v3 24 | !default.mode2v3 25 | !default.perspectivev3 26 | 27 | xcuserdata 28 | 29 | *.moved-aside 30 | 31 | *.pyc 32 | *sync/ 33 | Icon? 34 | .tags* 35 | 36 | /Flutter/Generated.xcconfig 37 | /Flutter/ephemeral/ 38 | /Flutter/flutter_export_environment.sh 39 | 40 | .build 41 | .swiftpm/ 42 | -------------------------------------------------------------------------------- /ios/flutter_locker.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. 3 | # Run `pod lib lint flutter_locker.podspec` to validate before publishing. 4 | # 5 | Pod::Spec.new do |s| 6 | s.name = 'flutter_locker' 7 | s.version = '0.0.1' 8 | s.summary = 'A new Flutter plugin project.' 9 | s.description = <<-DESC 10 | A new Flutter plugin project. 11 | DESC 12 | s.homepage = 'http://example.com' 13 | s.license = { :file => '../LICENSE' } 14 | s.author = { 'Your Company' => 'email@example.com' } 15 | s.source = { :path => '.' } 16 | s.source_files = 'flutter_locker/Sources/flutter_locker/**/*.swift' 17 | s.dependency 'Flutter' 18 | s.dependency 'Locker', '~> 3.0.4' 19 | s.platform = :ios, '10.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 | end 25 | -------------------------------------------------------------------------------- /ios/flutter_locker/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_locker", 8 | platforms: [ 9 | .iOS("12.0") 10 | ], 11 | products: [ 12 | .library(name: "flutter-locker", targets: ["flutter_locker"]) 13 | ], 14 | dependencies: [ 15 | .package(url: "https://github.com/infinum/Locker.git", from: "3.0.4") 16 | ], 17 | targets: [ 18 | .target( 19 | name: "flutter_locker", 20 | dependencies: ["Locker"], 21 | resources: [] 22 | ) 23 | ] 24 | ) 25 | -------------------------------------------------------------------------------- /ios/flutter_locker/Sources/flutter_locker/FlutterLocker.swift: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v22.7.2), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | 4 | import Foundation 5 | 6 | #if os(iOS) 7 | import Flutter 8 | #elseif os(macOS) 9 | import FlutterMacOS 10 | #else 11 | #error("Unsupported platform.") 12 | #endif 13 | 14 | /// Error class for passing custom error details to Dart side. 15 | final class PigeonError: Error { 16 | let code: String 17 | let message: String? 18 | let details: Any? 19 | 20 | init(code: String, message: String?, details: Any?) { 21 | self.code = code 22 | self.message = message 23 | self.details = details 24 | } 25 | 26 | var localizedDescription: String { 27 | return 28 | "PigeonError(code: \(code), message: \(message ?? ""), details: \(details ?? "")" 29 | } 30 | } 31 | 32 | private func wrapResult(_ result: Any?) -> [Any?] { 33 | return [result] 34 | } 35 | 36 | private func wrapError(_ error: Any) -> [Any?] { 37 | if let pigeonError = error as? PigeonError { 38 | return [ 39 | pigeonError.code, 40 | pigeonError.message, 41 | pigeonError.details, 42 | ] 43 | } 44 | if let flutterError = error as? FlutterError { 45 | return [ 46 | flutterError.code, 47 | flutterError.message, 48 | flutterError.details, 49 | ] 50 | } 51 | return [ 52 | "\(error)", 53 | "\(type(of: error))", 54 | "Stacktrace: \(Thread.callStackSymbols)", 55 | ] 56 | } 57 | 58 | private func isNullish(_ value: Any?) -> Bool { 59 | return value is NSNull || value == nil 60 | } 61 | 62 | private func nilOrValue(_ value: Any?) -> T? { 63 | if value is NSNull { return nil } 64 | return value as! T? 65 | } 66 | 67 | /// Data structure for retrieving the saved secret 68 | /// 69 | /// Generated class from Pigeon that represents data sent in messages. 70 | struct RetrieveSecretRequest { 71 | var key: String 72 | var androidPrompt: AndroidPrompt 73 | var iOsPrompt: IOsPrompt 74 | 75 | 76 | // swift-format-ignore: AlwaysUseLowerCamelCase 77 | static func fromList(_ pigeonVar_list: [Any?]) -> RetrieveSecretRequest? { 78 | let key = pigeonVar_list[0] as! String 79 | let androidPrompt = pigeonVar_list[1] as! AndroidPrompt 80 | let iOsPrompt = pigeonVar_list[2] as! IOsPrompt 81 | 82 | return RetrieveSecretRequest( 83 | key: key, 84 | androidPrompt: androidPrompt, 85 | iOsPrompt: iOsPrompt 86 | ) 87 | } 88 | func toList() -> [Any?] { 89 | return [ 90 | key, 91 | androidPrompt, 92 | iOsPrompt, 93 | ] 94 | } 95 | } 96 | 97 | /// Data structure for saving the saved secret 98 | /// 99 | /// Generated class from Pigeon that represents data sent in messages. 100 | struct SaveSecretRequest { 101 | var key: String 102 | var secret: String 103 | var androidPrompt: AndroidPrompt 104 | 105 | 106 | // swift-format-ignore: AlwaysUseLowerCamelCase 107 | static func fromList(_ pigeonVar_list: [Any?]) -> SaveSecretRequest? { 108 | let key = pigeonVar_list[0] as! String 109 | let secret = pigeonVar_list[1] as! String 110 | let androidPrompt = pigeonVar_list[2] as! AndroidPrompt 111 | 112 | return SaveSecretRequest( 113 | key: key, 114 | secret: secret, 115 | androidPrompt: androidPrompt 116 | ) 117 | } 118 | func toList() -> [Any?] { 119 | return [ 120 | key, 121 | secret, 122 | androidPrompt, 123 | ] 124 | } 125 | } 126 | 127 | /// Defines text that's displayed in native OS prompt for authentication 128 | /// 129 | /// title and cancel are required. 130 | /// 131 | /// Generated class from Pigeon that represents data sent in messages. 132 | struct AndroidPrompt { 133 | var title: String 134 | var cancelLabel: String 135 | var descriptionLabel: String? = nil 136 | 137 | 138 | // swift-format-ignore: AlwaysUseLowerCamelCase 139 | static func fromList(_ pigeonVar_list: [Any?]) -> AndroidPrompt? { 140 | let title = pigeonVar_list[0] as! String 141 | let cancelLabel = pigeonVar_list[1] as! String 142 | let descriptionLabel: String? = nilOrValue(pigeonVar_list[2]) 143 | 144 | return AndroidPrompt( 145 | title: title, 146 | cancelLabel: cancelLabel, 147 | descriptionLabel: descriptionLabel 148 | ) 149 | } 150 | func toList() -> [Any?] { 151 | return [ 152 | title, 153 | cancelLabel, 154 | descriptionLabel, 155 | ] 156 | } 157 | } 158 | 159 | /// The iOS native dialog is only shown when retrieving secret. 160 | /// 161 | /// - For phones with Touch ID, the [touchIdText] is displayed in prompt. 162 | /// - For phones with Face ID, the text is defined in plist file. 163 | /// 164 | /// Generated class from Pigeon that represents data sent in messages. 165 | struct IOsPrompt { 166 | var touchIdText: String 167 | 168 | 169 | // swift-format-ignore: AlwaysUseLowerCamelCase 170 | static func fromList(_ pigeonVar_list: [Any?]) -> IOsPrompt? { 171 | let touchIdText = pigeonVar_list[0] as! String 172 | 173 | return IOsPrompt( 174 | touchIdText: touchIdText 175 | ) 176 | } 177 | func toList() -> [Any?] { 178 | return [ 179 | touchIdText 180 | ] 181 | } 182 | } 183 | 184 | private class FlutterLockerPigeonCodecReader: FlutterStandardReader { 185 | override func readValue(ofType type: UInt8) -> Any? { 186 | switch type { 187 | case 129: 188 | return RetrieveSecretRequest.fromList(self.readValue() as! [Any?]) 189 | case 130: 190 | return SaveSecretRequest.fromList(self.readValue() as! [Any?]) 191 | case 131: 192 | return AndroidPrompt.fromList(self.readValue() as! [Any?]) 193 | case 132: 194 | return IOsPrompt.fromList(self.readValue() as! [Any?]) 195 | default: 196 | return super.readValue(ofType: type) 197 | } 198 | } 199 | } 200 | 201 | private class FlutterLockerPigeonCodecWriter: FlutterStandardWriter { 202 | override func writeValue(_ value: Any) { 203 | if let value = value as? RetrieveSecretRequest { 204 | super.writeByte(129) 205 | super.writeValue(value.toList()) 206 | } else if let value = value as? SaveSecretRequest { 207 | super.writeByte(130) 208 | super.writeValue(value.toList()) 209 | } else if let value = value as? AndroidPrompt { 210 | super.writeByte(131) 211 | super.writeValue(value.toList()) 212 | } else if let value = value as? IOsPrompt { 213 | super.writeByte(132) 214 | super.writeValue(value.toList()) 215 | } else { 216 | super.writeValue(value) 217 | } 218 | } 219 | } 220 | 221 | private class FlutterLockerPigeonCodecReaderWriter: FlutterStandardReaderWriter { 222 | override func reader(with data: Data) -> FlutterStandardReader { 223 | return FlutterLockerPigeonCodecReader(data: data) 224 | } 225 | 226 | override func writer(with data: NSMutableData) -> FlutterStandardWriter { 227 | return FlutterLockerPigeonCodecWriter(data: data) 228 | } 229 | } 230 | 231 | class FlutterLockerPigeonCodec: FlutterStandardMessageCodec, @unchecked Sendable { 232 | static let shared = FlutterLockerPigeonCodec(readerWriter: FlutterLockerPigeonCodecReaderWriter()) 233 | } 234 | 235 | 236 | /// Generated protocol from Pigeon that represents a handler of messages from Flutter. 237 | protocol FlutterLockerHostApi { 238 | func canAuthenticate(completion: @escaping (Result) -> Void) 239 | func save(request: SaveSecretRequest, completion: @escaping (Result) -> Void) 240 | func retrieve(request: RetrieveSecretRequest, completion: @escaping (Result) -> Void) 241 | func delete(key: String, completion: @escaping (Result) -> Void) 242 | } 243 | 244 | /// Generated setup class from Pigeon to handle messages through the `binaryMessenger`. 245 | class FlutterLockerHostApiSetup { 246 | static var codec: FlutterStandardMessageCodec { FlutterLockerPigeonCodec.shared } 247 | /// Sets up an instance of `FlutterLockerHostApi` to handle messages through the `binaryMessenger`. 248 | static func setUp(binaryMessenger: FlutterBinaryMessenger, api: FlutterLockerHostApi?, messageChannelSuffix: String = "") { 249 | let channelSuffix = messageChannelSuffix.count > 0 ? ".\(messageChannelSuffix)" : "" 250 | let canAuthenticateChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.canAuthenticate\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) 251 | if let api = api { 252 | canAuthenticateChannel.setMessageHandler { _, reply in 253 | api.canAuthenticate { result in 254 | switch result { 255 | case .success(let res): 256 | reply(wrapResult(res)) 257 | case .failure(let error): 258 | reply(wrapError(error)) 259 | } 260 | } 261 | } 262 | } else { 263 | canAuthenticateChannel.setMessageHandler(nil) 264 | } 265 | let saveChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.save\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) 266 | if let api = api { 267 | saveChannel.setMessageHandler { message, reply in 268 | let args = message as! [Any?] 269 | let requestArg = args[0] as! SaveSecretRequest 270 | api.save(request: requestArg) { result in 271 | switch result { 272 | case .success: 273 | reply(wrapResult(nil)) 274 | case .failure(let error): 275 | reply(wrapError(error)) 276 | } 277 | } 278 | } 279 | } else { 280 | saveChannel.setMessageHandler(nil) 281 | } 282 | let retrieveChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.retrieve\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) 283 | if let api = api { 284 | retrieveChannel.setMessageHandler { message, reply in 285 | let args = message as! [Any?] 286 | let requestArg = args[0] as! RetrieveSecretRequest 287 | api.retrieve(request: requestArg) { result in 288 | switch result { 289 | case .success(let res): 290 | reply(wrapResult(res)) 291 | case .failure(let error): 292 | reply(wrapError(error)) 293 | } 294 | } 295 | } 296 | } else { 297 | retrieveChannel.setMessageHandler(nil) 298 | } 299 | let deleteChannel = FlutterBasicMessageChannel(name: "dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.delete\(channelSuffix)", binaryMessenger: binaryMessenger, codec: codec) 300 | if let api = api { 301 | deleteChannel.setMessageHandler { message, reply in 302 | let args = message as! [Any?] 303 | let keyArg = args[0] as! String 304 | api.delete(key: keyArg) { result in 305 | switch result { 306 | case .success: 307 | reply(wrapResult(nil)) 308 | case .failure(let error): 309 | reply(wrapError(error)) 310 | } 311 | } 312 | } 313 | } else { 314 | deleteChannel.setMessageHandler(nil) 315 | } 316 | } 317 | } 318 | -------------------------------------------------------------------------------- /ios/flutter_locker/Sources/flutter_locker/FlutterLockerPlugin.swift: -------------------------------------------------------------------------------- 1 | import Flutter 2 | import UIKit 3 | import Locker 4 | 5 | extension FlutterError: Error {} 6 | 7 | public class FlutterLockerPlugin: NSObject, FlutterLockerHostApi, FlutterPlugin { 8 | func canAuthenticate(completion: @escaping (Result) -> Void) { 9 | let supportedBiometrics = Locker.configuredBiometricsAuthentication 10 | completion(.success(supportedBiometrics != BiometricsType.none ? true : false)) 11 | } 12 | 13 | func save(request: SaveSecretRequest, completion: @escaping (Result) -> Void) { 14 | Locker.setSecret(request.secret, for: request.key) 15 | // This can never fail 16 | Locker.setShouldUseAuthenticationWithBiometrics(true, for: request.key) 17 | completion(.success(Void())) 18 | } 19 | 20 | func retrieve(request: RetrieveSecretRequest, completion: @escaping (Result) -> Void) { 21 | Locker.retrieveCurrentSecret( 22 | for: request.key, 23 | operationPrompt: request.iOsPrompt.touchIdText, 24 | success: { (secret) in 25 | completion(.success(secret)) 26 | }, 27 | failure: { (failureStatus) in 28 | var code: String; 29 | 30 | switch failureStatus { 31 | case errSecItemNotFound: 32 | code = "secretNotFound" 33 | case errSecUserCanceled: 34 | code = "authenticationCanceled" 35 | case errSecAuthFailed: 36 | code = "authenticationFailed" 37 | default: 38 | code = "other" 39 | } 40 | 41 | completion(.failure(FlutterError(code: code, message: failureStatus.description, details: nil))) 42 | }) 43 | } 44 | 45 | func delete(key: String, completion: @escaping (Result) -> Void) { 46 | Locker.deleteSecret(for: key) 47 | completion(.success(Void())) 48 | } 49 | 50 | public static func register(with registrar: FlutterPluginRegistrar) { 51 | let instance = FlutterLockerPlugin() 52 | FlutterLockerHostApiSetup.setUp(binaryMessenger: registrar.messenger(), api: instance) 53 | } 54 | 55 | public func handle(_ call: FlutterMethodCall, result: @escaping FlutterResult) { 56 | result("iOS " + UIDevice.current.systemVersion) 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /lib/flutter_locker.dart: -------------------------------------------------------------------------------- 1 | library flutter_locker; 2 | 3 | import 'dart:async'; 4 | 5 | import 'package:flutter/services.dart'; 6 | import 'package:flutter_locker/gen/locker_api.gen.dart'; 7 | 8 | export 'package:flutter_locker/gen/locker_api.gen.dart'; 9 | 10 | part 'src/flutter_locker.dart'; 11 | 12 | part 'src/locker_exception.dart'; 13 | -------------------------------------------------------------------------------- /lib/gen/locker_api.gen.dart: -------------------------------------------------------------------------------- 1 | // Autogenerated from Pigeon (v22.7.2), do not edit directly. 2 | // See also: https://pub.dev/packages/pigeon 3 | // ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers 4 | 5 | import 'dart:async'; 6 | import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List; 7 | 8 | import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer; 9 | import 'package:flutter/services.dart'; 10 | 11 | PlatformException _createConnectionError(String channelName) { 12 | return PlatformException( 13 | code: 'channel-error', 14 | message: 'Unable to establish connection on channel: "$channelName".', 15 | ); 16 | } 17 | 18 | /// Data structure for retrieving the saved secret 19 | class RetrieveSecretRequest { 20 | RetrieveSecretRequest({ 21 | required this.key, 22 | required this.androidPrompt, 23 | required this.iOsPrompt, 24 | }); 25 | 26 | String key; 27 | 28 | AndroidPrompt androidPrompt; 29 | 30 | IOsPrompt iOsPrompt; 31 | 32 | Object encode() { 33 | return [ 34 | key, 35 | androidPrompt, 36 | iOsPrompt, 37 | ]; 38 | } 39 | 40 | static RetrieveSecretRequest decode(Object result) { 41 | result as List; 42 | return RetrieveSecretRequest( 43 | key: result[0]! as String, 44 | androidPrompt: result[1]! as AndroidPrompt, 45 | iOsPrompt: result[2]! as IOsPrompt, 46 | ); 47 | } 48 | } 49 | 50 | /// Data structure for saving the saved secret 51 | class SaveSecretRequest { 52 | SaveSecretRequest({ 53 | required this.key, 54 | required this.secret, 55 | required this.androidPrompt, 56 | }); 57 | 58 | String key; 59 | 60 | String secret; 61 | 62 | AndroidPrompt androidPrompt; 63 | 64 | Object encode() { 65 | return [ 66 | key, 67 | secret, 68 | androidPrompt, 69 | ]; 70 | } 71 | 72 | static SaveSecretRequest decode(Object result) { 73 | result as List; 74 | return SaveSecretRequest( 75 | key: result[0]! as String, 76 | secret: result[1]! as String, 77 | androidPrompt: result[2]! as AndroidPrompt, 78 | ); 79 | } 80 | } 81 | 82 | /// Defines text that's displayed in native OS prompt for authentication 83 | /// 84 | /// title and cancel are required. 85 | class AndroidPrompt { 86 | AndroidPrompt({ 87 | required this.title, 88 | required this.cancelLabel, 89 | this.descriptionLabel, 90 | }); 91 | 92 | String title; 93 | 94 | String cancelLabel; 95 | 96 | String? descriptionLabel; 97 | 98 | Object encode() { 99 | return [ 100 | title, 101 | cancelLabel, 102 | descriptionLabel, 103 | ]; 104 | } 105 | 106 | static AndroidPrompt decode(Object result) { 107 | result as List; 108 | return AndroidPrompt( 109 | title: result[0]! as String, 110 | cancelLabel: result[1]! as String, 111 | descriptionLabel: result[2] as String?, 112 | ); 113 | } 114 | } 115 | 116 | /// The iOS native dialog is only shown when retrieving secret. 117 | /// 118 | /// - For phones with Touch ID, the [touchIdText] is displayed in prompt. 119 | /// - For phones with Face ID, the text is defined in plist file. 120 | class IOsPrompt { 121 | IOsPrompt({ 122 | required this.touchIdText, 123 | }); 124 | 125 | String touchIdText; 126 | 127 | Object encode() { 128 | return [ 129 | touchIdText, 130 | ]; 131 | } 132 | 133 | static IOsPrompt decode(Object result) { 134 | result as List; 135 | return IOsPrompt( 136 | touchIdText: result[0]! as String, 137 | ); 138 | } 139 | } 140 | 141 | 142 | class _PigeonCodec extends StandardMessageCodec { 143 | const _PigeonCodec(); 144 | @override 145 | void writeValue(WriteBuffer buffer, Object? value) { 146 | if (value is int) { 147 | buffer.putUint8(4); 148 | buffer.putInt64(value); 149 | } else if (value is RetrieveSecretRequest) { 150 | buffer.putUint8(129); 151 | writeValue(buffer, value.encode()); 152 | } else if (value is SaveSecretRequest) { 153 | buffer.putUint8(130); 154 | writeValue(buffer, value.encode()); 155 | } else if (value is AndroidPrompt) { 156 | buffer.putUint8(131); 157 | writeValue(buffer, value.encode()); 158 | } else if (value is IOsPrompt) { 159 | buffer.putUint8(132); 160 | writeValue(buffer, value.encode()); 161 | } else { 162 | super.writeValue(buffer, value); 163 | } 164 | } 165 | 166 | @override 167 | Object? readValueOfType(int type, ReadBuffer buffer) { 168 | switch (type) { 169 | case 129: 170 | return RetrieveSecretRequest.decode(readValue(buffer)!); 171 | case 130: 172 | return SaveSecretRequest.decode(readValue(buffer)!); 173 | case 131: 174 | return AndroidPrompt.decode(readValue(buffer)!); 175 | case 132: 176 | return IOsPrompt.decode(readValue(buffer)!); 177 | default: 178 | return super.readValueOfType(type, buffer); 179 | } 180 | } 181 | } 182 | 183 | class FlutterLockerHostApi { 184 | /// Constructor for [FlutterLockerHostApi]. The [binaryMessenger] named argument is 185 | /// available for dependency injection. If it is left null, the default 186 | /// BinaryMessenger will be used which routes to the host platform. 187 | FlutterLockerHostApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''}) 188 | : pigeonVar_binaryMessenger = binaryMessenger, 189 | pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : ''; 190 | final BinaryMessenger? pigeonVar_binaryMessenger; 191 | 192 | static const MessageCodec pigeonChannelCodec = _PigeonCodec(); 193 | 194 | final String pigeonVar_messageChannelSuffix; 195 | 196 | Future canAuthenticate() async { 197 | final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.canAuthenticate$pigeonVar_messageChannelSuffix'; 198 | final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 199 | pigeonVar_channelName, 200 | pigeonChannelCodec, 201 | binaryMessenger: pigeonVar_binaryMessenger, 202 | ); 203 | final List? pigeonVar_replyList = 204 | await pigeonVar_channel.send(null) as List?; 205 | if (pigeonVar_replyList == null) { 206 | throw _createConnectionError(pigeonVar_channelName); 207 | } else if (pigeonVar_replyList.length > 1) { 208 | throw PlatformException( 209 | code: pigeonVar_replyList[0]! as String, 210 | message: pigeonVar_replyList[1] as String?, 211 | details: pigeonVar_replyList[2], 212 | ); 213 | } else if (pigeonVar_replyList[0] == null) { 214 | throw PlatformException( 215 | code: 'null-error', 216 | message: 'Host platform returned null value for non-null return value.', 217 | ); 218 | } else { 219 | return (pigeonVar_replyList[0] as bool?)!; 220 | } 221 | } 222 | 223 | Future save(SaveSecretRequest request) async { 224 | final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.save$pigeonVar_messageChannelSuffix'; 225 | final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 226 | pigeonVar_channelName, 227 | pigeonChannelCodec, 228 | binaryMessenger: pigeonVar_binaryMessenger, 229 | ); 230 | final List? pigeonVar_replyList = 231 | await pigeonVar_channel.send([request]) as List?; 232 | if (pigeonVar_replyList == null) { 233 | throw _createConnectionError(pigeonVar_channelName); 234 | } else if (pigeonVar_replyList.length > 1) { 235 | throw PlatformException( 236 | code: pigeonVar_replyList[0]! as String, 237 | message: pigeonVar_replyList[1] as String?, 238 | details: pigeonVar_replyList[2], 239 | ); 240 | } else { 241 | return; 242 | } 243 | } 244 | 245 | Future retrieve(RetrieveSecretRequest request) async { 246 | final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.retrieve$pigeonVar_messageChannelSuffix'; 247 | final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 248 | pigeonVar_channelName, 249 | pigeonChannelCodec, 250 | binaryMessenger: pigeonVar_binaryMessenger, 251 | ); 252 | final List? pigeonVar_replyList = 253 | await pigeonVar_channel.send([request]) as List?; 254 | if (pigeonVar_replyList == null) { 255 | throw _createConnectionError(pigeonVar_channelName); 256 | } else if (pigeonVar_replyList.length > 1) { 257 | throw PlatformException( 258 | code: pigeonVar_replyList[0]! as String, 259 | message: pigeonVar_replyList[1] as String?, 260 | details: pigeonVar_replyList[2], 261 | ); 262 | } else if (pigeonVar_replyList[0] == null) { 263 | throw PlatformException( 264 | code: 'null-error', 265 | message: 'Host platform returned null value for non-null return value.', 266 | ); 267 | } else { 268 | return (pigeonVar_replyList[0] as String?)!; 269 | } 270 | } 271 | 272 | Future delete(String key) async { 273 | final String pigeonVar_channelName = 'dev.flutter.pigeon.flutter_locker.FlutterLockerHostApi.delete$pigeonVar_messageChannelSuffix'; 274 | final BasicMessageChannel pigeonVar_channel = BasicMessageChannel( 275 | pigeonVar_channelName, 276 | pigeonChannelCodec, 277 | binaryMessenger: pigeonVar_binaryMessenger, 278 | ); 279 | final List? pigeonVar_replyList = 280 | await pigeonVar_channel.send([key]) as List?; 281 | if (pigeonVar_replyList == null) { 282 | throw _createConnectionError(pigeonVar_channelName); 283 | } else if (pigeonVar_replyList.length > 1) { 284 | throw PlatformException( 285 | code: pigeonVar_replyList[0]! as String, 286 | message: pigeonVar_replyList[1] as String?, 287 | details: pigeonVar_replyList[2], 288 | ); 289 | } else { 290 | return; 291 | } 292 | } 293 | } 294 | -------------------------------------------------------------------------------- /lib/src/flutter_locker.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_locker.dart'; 2 | 3 | /// Flutter plugin that secures your secrets in keychain using biometric authentication. 4 | class FlutterLocker { 5 | FlutterLocker._(); 6 | 7 | static final FlutterLockerHostApi _hostApi = FlutterLockerHostApi(); 8 | 9 | /// Checks if the devices has biometric features. 10 | static Future canAuthenticate() { 11 | return _hostApi.canAuthenticate(); 12 | } 13 | 14 | /// Saves the secret. 15 | /// 16 | /// On Android prompt is shown, while on iOS there is no need for the prompt when saving. 17 | static Future save(SaveSecretRequest request) async { 18 | await _catchCommonError(() async { 19 | await _hostApi.save(request); 20 | return ''; 21 | }); 22 | } 23 | 24 | /// Retrieves the secret. 25 | /// 26 | /// You need to provide a prompt for Android and iOS. Prompt for iOS is used only with TouchID. FaceID uses strings for Info.plist. 27 | static Future retrieve(RetrieveSecretRequest request) async { 28 | return await _catchCommonError(() async { 29 | final value = await _hostApi.retrieve(request); 30 | return value; 31 | }); 32 | } 33 | 34 | /// Deletes the secret. 35 | static Future delete(String key) async { 36 | await _hostApi.delete(key); 37 | } 38 | 39 | static Future _catchCommonError( 40 | Future Function() function, 41 | ) async { 42 | try { 43 | return await function(); 44 | } on PlatformException catch (exception) { 45 | final lockerException = LockerException.fromCode(exception.code); 46 | if (lockerException != null) { 47 | throw lockerException; 48 | } else { 49 | rethrow; 50 | } 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /lib/src/locker_exception.dart: -------------------------------------------------------------------------------- 1 | part of '../flutter_locker.dart'; 2 | 3 | /// Common exception that Locker recognizes on both platforms. 4 | /// 5 | /// Locker will throw PlatformException for all different kind of platform specific issues. 6 | class LockerException implements Exception { 7 | LockerException({required this.reason}); 8 | 9 | final LockerExceptionReason reason; 10 | 11 | static LockerException? fromCode(String? code) { 12 | switch (code) { 13 | case "secretNotFound": 14 | return LockerException(reason: LockerExceptionReason.secretNotFound); 15 | case "authenticationCanceled": 16 | return LockerException( 17 | reason: LockerExceptionReason.authenticationCanceled); 18 | case "authenticationFailed": 19 | return LockerException( 20 | reason: LockerExceptionReason.authenticationFailed); 21 | default: 22 | return null; 23 | } 24 | } 25 | 26 | @override 27 | String toString() { 28 | return 'LockerException: ${_reasonToMessage()}'; 29 | } 30 | 31 | /// Returns message for developer 32 | String _reasonToMessage() { 33 | switch (reason) { 34 | case LockerExceptionReason.secretNotFound: 35 | return 'Secret not found for key.'; 36 | case LockerExceptionReason.authenticationCanceled: 37 | return 'Authentication canceled by user.'; 38 | case LockerExceptionReason.authenticationFailed: 39 | return 'User failed to authenticate.'; 40 | } 41 | } 42 | } 43 | 44 | /// Common exceptions that are currently handled 45 | enum LockerExceptionReason { 46 | // Happens when you try to retrieve a secret that was never saved for that key 47 | secretNotFound, 48 | // User canceled the authentication prompt 49 | authenticationCanceled, 50 | // User failed authentication, e.g. by too many wrong attempts 51 | authenticationFailed, 52 | } 53 | -------------------------------------------------------------------------------- /pigeons/locker_api.dart: -------------------------------------------------------------------------------- 1 | import 'package:pigeon/pigeon.dart'; 2 | 3 | /// Run pigeon: 4 | /// dart run pigeon --input pigeons/locker_api.dart 5 | 6 | @ConfigurePigeon(PigeonOptions( 7 | dartOut: 'lib/gen/locker_api.gen.dart', 8 | swiftOut: 'ios/flutter_locker/Sources/flutter_locker/FlutterLocker.swift', 9 | kotlinOut: 10 | 'android/src/main/kotlin/com/infinum/flutter_locker/FlutterLocker.kt', 11 | kotlinOptions: KotlinOptions( 12 | package: 'com.infinum.flutter_locker', 13 | ), 14 | )) 15 | 16 | /// Data structure for retrieving the saved secret 17 | class RetrieveSecretRequest { 18 | RetrieveSecretRequest(this.key, this.androidPrompt, this.iOsPrompt); 19 | 20 | final String key; 21 | final AndroidPrompt androidPrompt; 22 | final IOsPrompt iOsPrompt; 23 | } 24 | 25 | /// Data structure for saving the saved secret 26 | class SaveSecretRequest { 27 | SaveSecretRequest(this.key, this.secret, this.androidPrompt); 28 | 29 | final String key; 30 | final String secret; 31 | final AndroidPrompt androidPrompt; 32 | } 33 | 34 | /// Defines text that's displayed in native OS prompt for authentication 35 | /// 36 | /// title and cancel are required. 37 | class AndroidPrompt { 38 | AndroidPrompt(this.title, this.cancelLabel, {this.descriptionLabel}); 39 | 40 | final String title; 41 | final String cancelLabel; 42 | final String? descriptionLabel; 43 | } 44 | 45 | /// The iOS native dialog is only shown when retrieving secret. 46 | /// 47 | /// - For phones with Touch ID, the [touchIdText] is displayed in prompt. 48 | /// - For phones with Face ID, the text is defined in plist file. 49 | class IOsPrompt { 50 | IOsPrompt(this.touchIdText); 51 | 52 | final String touchIdText; 53 | } 54 | 55 | @HostApi() 56 | abstract class FlutterLockerHostApi { 57 | @async 58 | bool canAuthenticate(); 59 | 60 | @async 61 | void save(SaveSecretRequest request); 62 | 63 | @async 64 | String retrieve(RetrieveSecretRequest request); 65 | 66 | @async 67 | void delete(String key); 68 | } 69 | -------------------------------------------------------------------------------- /pubspec.yaml: -------------------------------------------------------------------------------- 1 | name: flutter_locker 2 | description: Secures your secrets in keychain using biometric authentication (Fingerprint, Touch ID, Face ID...) 3 | version: 2.1.6 4 | repository: https://github.com/infinum/flutter-plugins-locker 5 | homepage: https://github.com/infinum/flutter-plugins-locker 6 | 7 | environment: 8 | sdk: '>=2.16.0 <4.0.0' 9 | flutter: '>=2.0.0' 10 | 11 | dependencies: 12 | flutter: 13 | sdk: flutter 14 | 15 | dev_dependencies: 16 | flutter_test: 17 | sdk: flutter 18 | 19 | pigeon: ^22.7.0 20 | build_runner: ^2.4.14 21 | flutter_lints: ^5.0.0 22 | 23 | flutter: 24 | plugin: 25 | platforms: 26 | android: 27 | package: com.infinum.flutter_locker 28 | pluginClass: FlutterLockerPlugin 29 | ios: 30 | pluginClass: FlutterLockerPlugin 31 | --------------------------------------------------------------------------------