Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(package_info_plus): Added build signature to package info data #340

Merged

Conversation

acoutts
Copy link
Contributor

@acoutts acoutts commented Jul 1, 2021

Description

Re-submission from flutter/plugins#4013

This adds the android build signature to the package_info result. It returns an empty string on all other platforms.

For android this is useful when you need to get the SHA1 fingerprint which signed the current running app, for example when using platform-specific API keys for the Google Maps API where you must provide the signing certificate in a x-android-cert header.

Related Issues

flutter/flutter#83996

Checklist

Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes ([x]).
This will ensure a smooth and quick review process. Updating the pubspec.yaml and changelogs is not required.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • My PR includes unit or integration tests for all changed/updated/fixed behaviors (See Contributor Guide).
  • All existing and new tests are passing.
  • I updated/added relevant documentation (doc comments with ///).
  • The analyzer (flutter analyze) does not report any problems on my PR.
  • I read and followed the Flutter Style Guide.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Does your PR require plugin users to manually update their apps to accommodate your change?

  • Yes, this is a breaking change (please indicate a breaking change in CHANGELOG.md and increment major revision).
  • No, this is not a breaking change.

@mhadaily
Copy link
Member

mhadaily commented Jul 6, 2021

Can you please merge with main

@acoutts
Copy link
Contributor Author

acoutts commented Jul 6, 2021

@mhadaily you want me to merge this into the main on my fork?

@mhadaily
Copy link
Member

mhadaily commented Jul 6, 2021

yes, please on your fork, update main branch with upstream and then merge your branch with main so you get the latest updates from our main branch

@mhadaily mhadaily added the package_info_plus stuff related to package_info_plus label Jul 6, 2021
@acoutts
Copy link
Contributor Author

acoutts commented Jul 6, 2021

Done.

@mhadaily
Copy link
Member

mhadaily commented Jul 9, 2021

Thanks for the PR,

this seems to be valuable for Android only.

Let me ask @jpnurmi and @miquelbeltran about their opinion. What do you guys think about this PR?

@acoutts
Copy link
Contributor Author

acoutts commented Jul 9, 2021

Thanks for the PR,

this seems to be valuable for Android only.

Let me ask @jpnurmi and @miquelbeltran about their opinion. What do you guys think about this PR?

I think it's valuable because of the use case I laid out - when using Google Maps, Google Place, and other APIs which use platform-specific API keys you need to send the build signature as a header. There are probably other use cases to have the build signature at runtime.

It seems like there might be other data that is platform specific people may want in the future. What about taking the approach of Device Info where they return platform data objects specific to each platform?

@miquelbeltran
Copy link
Member

  1. Fine for adding the SHA signature, although I had never the need for it
  2. the changes on the iOS code must be removed
  3. we need to be sure that all dependencies between the platform interface and platform implementation projects are updated correctly

@acoutts
Copy link
Contributor Author

acoutts commented Jul 9, 2021

Just removed the inadvertent iOS changes.

Copy link
Member

@mhadaily mhadaily left a comment

Choose a reason for hiding this comment

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

LGTM ,thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package_info_plus stuff related to package_info_plus
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants