-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Open
Labels
Description
Platform
15
Plugin
image_picker_android
Version
main
Flutter SDK
3.35
Steps to reproduce
In packages/package_info_plus/package_info_plus/android/src/main/kotlin/dev/fluttercommunity/plus/packageinfo/PackageInfoPlugin.kt code is copied from https://gist.github.com/scottyab/b849701972d57cf9562e and there is no License or Copyright.
Code Snippet from main branch:
// Credits https://gist.github.com/scottyab/b849701972d57cf9562e
@Throws(NoSuchAlgorithmException::class)
private fun signatureToSha256(sig: ByteArray): String {
val digest = MessageDigest.getInstance("SHA-256")
digest.update(sig)
val hashText = digest.digest()
return bytesToHex(hashText)
}
// Credits https://gist.github.com/scottyab/b849701972d57cf9562e
private fun bytesToHex(bytes: ByteArray): String {
val hexArray = charArrayOf(
'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
)
val hexChars = CharArray(bytes.size * 2)
var v: Int
for (j in bytes.indices) {
v = bytes[j].toInt() and 0xFF
hexChars[j * 2] = hexArray[v ushr 4]
hexChars[j * 2 + 1] = hexArray[v and 0x0F]
}
return String(hexChars)
}
Code Sample
Logs
-
Flutter Doctor
-
Checklist before submitting a bug
- I searched issues in this repository and couldn't find such bug/problem
- I Google'd a solution and I couldn't find it
- I searched on StackOverflow for a solution and I couldn't find it
- I read the README.md file of the plugin
- I'm using the latest version of the plugin
- All dependencies are up to date with
flutter pub upgrade
- I did a
flutter clean
- I tried running the example project