Skip to content

Conversation

@StanleyCocos
Copy link
Contributor

@StanleyCocos StanleyCocos commented Sep 5, 2025

Description

fix: #3655

This method is essentially unavailable for most developers and can only be used in a very small number of special cases. However, some manufacturers have now tightened restrictions—even performing static scans and blocking app submission if your code references it. Therefore, I believe this method should be removed to lift these restrictions. For the rare special cases, using the old version or a fork is a more reasonable approach.

Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I titled the PR using Conventional Commits.
  • I did not modify the CHANGELOG.md nor the plugin version in pubspec.yaml files.
  • All existing and new tests are passing.
  • The analyzer (flutter analyze) does not report any problems on my PR.

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 that with a ! in the title as explained in Conventional Commits).
  • No, this is not a breaking change.

@StanleyCocos StanleyCocos marked this pull request as ready for review September 5, 2025 09:20
@miquelbeltran
Copy link
Member

I would be in favor of removing the property, so doing a deprecation that returns unknown sounds good to me.

Reading the docs on the getSerial, this is way too exclusive to be included in general device info, and so it is probably giving more headaches that helping: https://developer.android.com/reference/android/os/Build#getSerial()

I am kind of surprised that in #3655 the author managed to make it work on version 10 of the plugin, I don't think there should be any difference? Anyway, I am in favor of removing the property.

@vbuberen what do you think?

@vbuberen
Copy link
Collaborator

vbuberen commented Sep 9, 2025

I am with you here about deletion.
Considering that it is nearly impossible to get the required permission to get serial + the fact that I want to make the next release a major release with breaking changes (to make us safe from all the people affected by Android build config updates) we have a good opportunity to just delete this serial property without deprecation period and call it a day.

@miquelbeltran
Copy link
Member

Agreed, let's remove it. @StanleyCocos if you can, update the PR and remove the parameter completely instead, and mark the PR as breaking change so we don't forget.

@StanleyCocos StanleyCocos changed the title refactor(device_info_plus): mark serialNumber as deprecated and always return "unknown" refactor(device_info_plus)!: remove deprecated serialNumber property Sep 10, 2025
@StanleyCocos
Copy link
Contributor Author

Thank you all. Considering the next version is a breaking change, directly removing it is a good idea for me. I have already removed it and marked it as a breaking change.

@miquelbeltran miquelbeltran changed the title refactor(device_info_plus)!: remove deprecated serialNumber property refactor(device_info_plus)!: remove serialNumber property Sep 10, 2025
Copy link
Collaborator

@vbuberen vbuberen left a comment

Choose a reason for hiding this comment

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

Looks good to me as well.

@vbuberen vbuberen merged commit d0fdc58 into fluttercommunity:main Sep 10, 2025
31 of 37 checks passed
@StanleyCocos StanleyCocos deleted the remove/get_serial branch September 12, 2025 02:36
rjahn added a commit to sibvisions/flutter_debug_overlay that referenced this pull request Oct 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Automatic getSerial() call after updating to v11.5.0

3 participants