Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

[local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation in example and README #6032

Merged
merged 3 commits into from
Aug 1, 2022

Conversation

iamsahilsonawane
Copy link
Contributor

@iamsahilsonawane iamsahilsonawane commented Jun 23, 2022

Replacing deprecated android.permission.USE_FINGERPRINT permission with android.permission.USE_BIOMETRIC

Fixes flutter/flutter#106298
Part of flutter/flutter#78137

No change in flutter/tests

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the relevant style guides and ran the auto-formatter. (Unlike the flutter/flutter repo, the flutter/plugins repo does use dart format.)
  • I signed the CLA.
  • The title of the PR starts with the name of the plugin surrounded by square brackets, e.g. [shared_preferences]
  • I listed at least one issue that this PR fixes in the description above.
  • I updated pubspec.yaml with an appropriate new version according to the pub versioning philosophy, or this PR is exempt from version changes.
  • I updated CHANGELOG.md to add a description of the change, following repository CHANGELOG style.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

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

@flutter-dashboard
Copy link

It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!).

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

@iamsahilsonawane iamsahilsonawane changed the title [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprication [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation Jun 23, 2022
@iamsahilsonawane
Copy link
Contributor Author

Maintainers, please let me know what I need to add/update more for passing tests. I am new to contributing to the flutter/* open source.

Thanks

@iamsahilsonawane iamsahilsonawane marked this pull request as draft June 23, 2022 10:00
@iamsahilsonawane
Copy link
Contributor Author

This pull is not ready to by reviewed for now

@iamsahilsonawane
Copy link
Contributor Author

@blasten @stuartmorgan
The USE_FINGERPRINT is deprecated from API 28. In the code, there's implementation done for using biometrics for API 28 and higher and use fingerprint manager for less than that. How do we add biometric permission just for API 29 and higher but keep the fingerprint permission for API versions below 29?

I just added the USE_BIOMETRIC instead but that will add errors in the FingerprintManager, it requires USE_FINGERPRINT permission.

I am new to open source. I've marked this pull as draft. Thanks for the support.

@stuartmorgan-g
Copy link
Contributor

stuartmorgan-g commented Jun 23, 2022

How do we add biometric permission just for API 29 and higher but keep the fingerprint permission for API versions below 29?

You can't; what's in the manifest is decided at build time, not runtime.

If you want to remove the need for this permission you'll need to restructure the code somewhat so that it doesn't use FingerprintManager at all. Since the primary flow uses an AndroidX library that internally falls back to fingerprints on older versions, that should be doable.

@stuartmorgan-g
Copy link
Contributor

Maintainers, please let me know what I need to add/update more for passing tests.

The "Details" link for publishable will tell you why it is failing. The steps you skipped in the checklist have useful links for resolving that failure.

@iamsahilsonawane
Copy link
Contributor Author

Maintainers, please let me know what I need to add/update more for passing tests.

The "Details" link for publishable will tell you why it is failing. The steps you skipped in the checklist have useful links for resolving that failure.

Thank you @stuartmorgan for the help. I'll check and continue on that.

@stuartmorgan-g
Copy link
Contributor

stuartmorgan-g commented Jul 27, 2022

If you want to remove the need for this permission you'll need to restructure the code somewhat so that it doesn't use FingerprintManager at all.

This was done in #6059, so you could update this PR to just update the local_auth README and example.

@iamsahilsonawane
Copy link
Contributor Author

iamsahilsonawane commented Jul 29, 2022

@stuartmorgan Okay works! I'll update the README and example.

Thanks

@iamsahilsonawane iamsahilsonawane changed the title [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation in example and REAME Jul 29, 2022
@iamsahilsonawane iamsahilsonawane changed the title [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation in example and REAME [local_auth] Replace USE_FINGERPRINT to USE_BIOMETRIC post deprecation in example and README Jul 29, 2022
@iamsahilsonawane iamsahilsonawane marked this pull request as ready for review July 29, 2022 09:42
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps are needed for the local_auth change. (local_auth_android's change only affects running a local checkout, so doesn't need them.)

@iamsahilsonawane
Copy link
Contributor Author

@stuartmorgan

These steps are needed for the local_auth change. (local_auth_android's change only affects running a local checkout, so doesn't need them.)

I am not 100% sure if I should update the version from 2.1.0 to 2.1.1? Or just update to 2.1.0+1?

@iamsahilsonawane
Copy link
Contributor Author

Yes as our change in the example doesn't fall into:

PRs that only affect unpublished parts of example apps.

I think we should increase the version to 2.1.1

@iamsahilsonawane
Copy link
Contributor Author

Sorry for the commits, I messed up with the message

@iamsahilsonawane
Copy link
Contributor Author

Fixed the commit message issue

@iamsahilsonawane
Copy link
Contributor Author

Please, let me know if there is still pending stuff. I'll update them ASAP. Thanks

@stuartmorgan-g
Copy link
Contributor

Or just update to 2.1.0+1?

We follow the guidance at https://dart.dev/tools/pub/versioning#semantic-versions (linked from the PR checklist), and do not use build numbers for anything >= 1.0.0.

@stuartmorgan-g
Copy link
Contributor

Adding changelog override for local_auth_android per my comment above.

@stuartmorgan-g stuartmorgan-g added the override: no changelog needed Override the check requiring CHANGELOG updates for most changes label Jul 29, 2022
Copy link
Contributor

@stuartmorgan-g stuartmorgan-g left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@camsim99 will do the secondary review.

Copy link
Contributor

@camsim99 camsim99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!!

@iamsahilsonawane
Copy link
Contributor Author

Thank you guys!

@stuartmorgan-g stuartmorgan-g added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 29, 2022
@auto-submit auto-submit bot merged commit a6d42f1 into flutter:main Aug 1, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Aug 1, 2022
yutaaraki-toydium pushed a commit to yutaaraki-toydium/plugins that referenced this pull request Aug 12, 2022
mauricioluz pushed a commit to mauricioluz/plugins that referenced this pull request Jan 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App needs tests override: no changelog needed Override the check requiring CHANGELOG updates for most changes p: local_auth platform-android
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[local_auth] USE_FINGERPRINT android permission is deprecated
3 participants