Skip to content

Commit

Permalink
fix(package_info_plus): Address changed fields nullability on Android…
Browse files Browse the repository at this point in the history
… 15 (API 35) (#2975)

Co-authored-by: Volodymyr Buberenko <vbuberen@users.noreply.github.com>
Co-authored-by: Miguel Beltran <m@beltran.work>
  • Loading branch information
3 people authored Jul 9, 2024
1 parent 6bdbbad commit dfa3bc2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ class PackageInfoPlugin : MethodCallHandler, FlutterPlugin {

val infoMap = HashMap<String, String>()
infoMap.apply {
put("appName", info.applicationInfo.loadLabel(packageManager).toString())
put("appName", info.applicationInfo?.loadLabel(packageManager)?.toString() ?: "")
put("packageName", applicationContext!!.packageName)
put("version", info.versionName)
put("version", info.versionName ?: "")
put("buildNumber", getLongVersionCode(info).toString())
if (buildSignature != null) put("buildSignature", buildSignature)
if (installerPackage != null) put("installerStore", installerPackage)
Expand Down Expand Up @@ -105,7 +105,7 @@ class PackageInfoPlugin : MethodCallHandler, FlutterPlugin {
)
val signatures = packageInfo.signatures

if (signatures.isNullOrEmpty() || packageInfo.signatures.first() == null) {
if (signatures.isNullOrEmpty() || signatures.first() == null) {
null
} else {
signatureToSha256(signatures.first().toByteArray())
Expand Down

0 comments on commit dfa3bc2

Please sign in to comment.