Skip to content

Commit

Permalink
fix(package_info_plus): fix PackageInfoPlugin.kt on latest Android 34
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristianEdwardPadilla authored May 31, 2024
1 parent e453087 commit 5d603dc
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 5d603dc

Please sign in to comment.