6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 3cccbb0e
Changed files
.vscode/settings.json | 3 + .../android/.gradle/8.1.1/checksums/checksums.lock | Bin 17 -> 17 bytes .../.gradle/8.1.1/checksums/md5-checksums.bin | Bin 0 -> 19897 bytes .../.gradle/8.1.1/checksums/sha1-checksums.bin | Bin 0 -> 22385 bytes .../8.1.1/executionHistory/executionHistory.lock | Bin 0 -> 17 bytes mobilekeys_sdk_plugin/android/build.gradle | 14 +- mobilekeys_sdk_plugin/android/gradle.properties | 4 + .../seos_mobile_keys_plugin/AppUsage.kt | 445 +++++++++++++-------- .../EndpointInfoExtension.kt | 4 +- .../SeosMobileKeysPlugin.kt | 4 +- 10 files changed, 302 insertions(+), 172 deletions(-)
Diff
diff --git a/.vscode/settings.json b/.vscode/settings.json
new file mode 100644
index 00000000..c5f3f6b9
--- /dev/null
+++ b/.vscode/settings.json
@@ -0,0 +1,3 @@
+{
+ "java.configuration.updateBuildConfiguration": "interactive"
+}
\ No newline at end of file
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/checksums.lock b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/checksums.lock
index a8e450bf..ea24b3a5 100644
Binary files a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/checksums.lock and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/checksums.lock differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/md5-checksums.bin b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/md5-checksums.bin
new file mode 100644
index 00000000..72dcc603
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/md5-checksums.bin differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/sha1-checksums.bin b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/sha1-checksums.bin
new file mode 100644
index 00000000..f2b93daf
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/checksums/sha1-checksums.bin differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/executionHistory/executionHistory.lock b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/executionHistory/executionHistory.lock
new file mode 100644
index 00000000..08247c6d
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/executionHistory/executionHistory.lock differ
diff --git a/mobilekeys_sdk_plugin/android/build.gradle b/mobilekeys_sdk_plugin/android/build.gradle
index 612d1cd6..6f857b05 100644
--- a/mobilekeys_sdk_plugin/android/build.gradle
+++ b/mobilekeys_sdk_plugin/android/build.gradle
@@ -1,3 +1,15 @@
+buildscript {
+ ext.kotlin_version = '1.9.22'
+ repositories {
+ google()
+ mavenCentral()
+ }
+ dependencies {
+ classpath 'com.android.tools.build:gradle:8.1.3'
+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
+ }
+}
+
group 'com.assaabloy.flutter.seosmobilekeyssdk.seos_mobile_keys_plugin'
version '1.0-SNAPSHOT'
@@ -34,6 +46,7 @@ android {
}
dependencies {
+ implementation "org.jetbrains.kotlin:kotlin-stdlib:1.9.22"
compileOnly fileTree(dir: 'libs', include: ['mobilekeys-android-sdk-release-*.aar'])
// Mobile Keys SDK transitive dependencies
@@ -42,5 +55,4 @@ dependencies {
implementation "org.slf4j:slf4j-api:2.0.9"
implementation "com.squareup.okhttp3:okhttp:4.12.0"
implementation "androidx.security:security-crypto:1.1.0-alpha06"
-
}
\ No newline at end of file
diff --git a/mobilekeys_sdk_plugin/android/gradle.properties b/mobilekeys_sdk_plugin/android/gradle.properties
new file mode 100644
index 00000000..aa464b69
--- /dev/null
+++ b/mobilekeys_sdk_plugin/android/gradle.properties
@@ -0,0 +1,4 @@
+org.gradle.jvmargs=-Xmx4096m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
+org.gradle.parallel=true
+org.gradle.configureondemand=true
+org.gradle.daemon=true
\ No newline at end of file
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
index 06fcfaab..c4a7f9bd 100644
--- a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
+++ b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/AppUsage.kt
@@ -1,15 +1,12 @@
-// Autogenerated from Pigeon (v22.7.4), do not edit directly.
+// Autogenerated from Pigeon (v17.3.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon
-@file:Suppress("UNCHECKED_CAST", "ArrayInDataClass")
package com.assaabloy.flutter.seosmobilekeyssdk.seos_mobile_keys_plugin
import android.util.Log
import io.flutter.plugin.common.BasicMessageChannel
import io.flutter.plugin.common.BinaryMessenger
-import io.flutter.plugin.common.EventChannel
import io.flutter.plugin.common.MessageCodec
-import io.flutter.plugin.common.StandardMethodCodec
import io.flutter.plugin.common.StandardMessageCodec
import java.io.ByteArrayOutputStream
import java.nio.ByteBuffer
@@ -19,14 +16,14 @@ private fun wrapResult(result: Any?): List<Any?> {
}
private fun wrapError(exception: Throwable): List<Any?> {
- return if (exception is FlutterError) {
- listOf(
+ if (exception is FlutterError) {
+ return listOf(
exception.code,
exception.message,
exception.details
)
} else {
- listOf(
+ return listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
@@ -34,6 +31,9 @@ private fun wrapError(exception: Throwable): List<Any?> {
}
}
+private fun createConnectionError(channelName: String): FlutterError {
+ return FlutterError("channel-error", "Unable to establish connection on channel: '$channelName'.", "")}
+
/**
* Error class for passing custom error details to Flutter via a thrown PlatformException.
* @property code The error code.
@@ -143,17 +143,17 @@ enum class BleProtocol(val raw: Int) {
/** Generated class from Pigeon that represents data sent in messages. */
data class MobileKeysOpeningType (
val openingType: OpeningType
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysOpeningType {
- val openingTypeRaw = pigeonVar_list[0] as Int
- val openingType = OpeningType.ofRaw(openingTypeRaw) ?: OpeningType.UNKNOWN
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysOpeningType {
+ val openingType = OpeningType.ofRaw(list[0] as Int)!!
return MobileKeysOpeningType(openingType)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
openingType.raw,
)
}
@@ -163,16 +163,18 @@ data class MobileKeysOpeningType (
data class DataTypeDate (
val date: String,
val format: String
+
) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): DataTypeDate {
- val date = pigeonVar_list[0] as String
- val format = pigeonVar_list[1] as String
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): DataTypeDate {
+ val date = list[0] as String
+ val format = list[1] as String
return DataTypeDate(date, format)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
date,
format,
)
@@ -193,31 +195,32 @@ data class MobileKeysKey (
val keyType: String? = null,
val cardNumber: String? = null,
val active: Boolean
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysKey {
- val credentialType = pigeonVar_list[0] as Long
- val beginDate = if (pigeonVar_list[1] != null) {
- DataTypeDate.fromList(pigeonVar_list[1] as List<Any?>)
- } else null
- val endDate = if (pigeonVar_list[2] != null) {
- DataTypeDate.fromList(pigeonVar_list[2] as List<Any?>)
- } else null
- val keyId = pigeonVar_list[3] as String?
- val externalId = pigeonVar_list[4] as String?
- val label = pigeonVar_list[5] as String?
- val configUrl = pigeonVar_list[6] as String?
- val readbackUrl = pigeonVar_list[7] as String?
- val issuer = pigeonVar_list[8] as String?
- val keyType = pigeonVar_list[9] as String?
- val cardNumber = pigeonVar_list[10] as String?
- val active = pigeonVar_list[11] as Boolean
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysKey {
+ val credentialType = list[0].let { if (it is Int) it.toLong() else it as Long }
+ val beginDate: DataTypeDate? = (list[1] as List<Any?>?)?.let {
+ DataTypeDate.fromList(it)
+ }
+ val endDate: DataTypeDate? = (list[2] as List<Any?>?)?.let {
+ DataTypeDate.fromList(it)
+ }
+ val keyId = list[3] as String?
+ val externalId = list[4] as String?
+ val label = list[5] as String?
+ val configUrl = list[6] as String?
+ val readbackUrl = list[7] as String?
+ val issuer = list[8] as String?
+ val keyType = list[9] as String?
+ val cardNumber = list[10] as String?
+ val active = list[11] as Boolean
return MobileKeysKey(credentialType, beginDate, endDate, keyId, externalId, label, configUrl, readbackUrl, issuer, keyType, cardNumber, active)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
credentialType,
beginDate?.toList(),
endDate?.toList(),
@@ -237,7 +240,7 @@ data class MobileKeysKey (
/** Generated class from Pigeon that represents data sent in messages. */
data class MobileKeysEndpointInfo (
val endpointId: Long,
- val environmentType: MobileKeysEnvironmentType,
+ val mobileKeysEnvironmentType: MobileKeysEnvironmentType,
val seosAppletVersion: String,
val fileSystemAppletVersion: String,
val toolsAppletVersion: String,
@@ -251,35 +254,35 @@ data class MobileKeysEndpointInfo (
val hashAlg: Long? = null,
val encAlg: Long? = null,
val lastServerSyncDate: DataTypeDate? = null
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysEndpointInfo {
- val endpointId = pigeonVar_list[0] as Long
- val environmentTypeIndex = pigeonVar_list[1] as Int
- val environmentType = MobileKeysEnvironmentType.values()[environmentTypeIndex]
- val seosAppletVersion = pigeonVar_list[2] as String
- val fileSystemAppletVersion = pigeonVar_list[3] as String
- val toolsAppletVersion = pigeonVar_list[4] as String
- val javaCardVersion = pigeonVar_list[5] as String
- val optionFlags = pigeonVar_list[6] as String
- val allocatedFileSystemSize = pigeonVar_list[7] as Long
- val currentTopOfFileSystem = pigeonVar_list[8] as Long
- val snmpBufferSize = pigeonVar_list[9] as Long
- val remainingEPROMSize = pigeonVar_list[10] as Long
- val remainingTransientObjectSpace = pigeonVar_list[11] as Long
- val hashAlg = pigeonVar_list[12] as Long?
- val encAlg = pigeonVar_list[13] as Long?
- val lastServerSyncDate = if (pigeonVar_list[14] != null) {
- DataTypeDate.fromList(pigeonVar_list[14] as List<Any?>)
- } else null
- return MobileKeysEndpointInfo(endpointId, environmentType, seosAppletVersion, fileSystemAppletVersion, toolsAppletVersion, javaCardVersion, optionFlags, allocatedFileSystemSize, currentTopOfFileSystem, snmpBufferSize, remainingEPROMSize, remainingTransientObjectSpace, hashAlg, encAlg, lastServerSyncDate)
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysEndpointInfo {
+ val endpointId = list[0].let { if (it is Int) it.toLong() else it as Long }
+ val mobileKeysEnvironmentType = MobileKeysEnvironmentType.ofRaw(list[1] as Int)!!
+ val seosAppletVersion = list[2] as String
+ val fileSystemAppletVersion = list[3] as String
+ val toolsAppletVersion = list[4] as String
+ val javaCardVersion = list[5] as String
+ val optionFlags = list[6] as String
+ val allocatedFileSystemSize = list[7].let { if (it is Int) it.toLong() else it as Long }
+ val currentTopOfFileSystem = list[8].let { if (it is Int) it.toLong() else it as Long }
+ val snmpBufferSize = list[9].let { if (it is Int) it.toLong() else it as Long }
+ val remainingEPROMSize = list[10].let { if (it is Int) it.toLong() else it as Long }
+ val remainingTransientObjectSpace = list[11].let { if (it is Int) it.toLong() else it as Long }
+ val hashAlg = list[12].let { if (it is Int) it.toLong() else it as Long? }
+ val encAlg = list[13].let { if (it is Int) it.toLong() else it as Long? }
+ val lastServerSyncDate: DataTypeDate? = (list[14] as List<Any?>?)?.let {
+ DataTypeDate.fromList(it)
+ }
+ return MobileKeysEndpointInfo(endpointId, mobileKeysEnvironmentType, seosAppletVersion, fileSystemAppletVersion, toolsAppletVersion, javaCardVersion, optionFlags, allocatedFileSystemSize, currentTopOfFileSystem, snmpBufferSize, remainingEPROMSize, remainingTransientObjectSpace, hashAlg, encAlg, lastServerSyncDate)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
endpointId,
- environmentType.ordinal,
+ mobileKeysEnvironmentType.raw,
seosAppletVersion,
fileSystemAppletVersion,
toolsAppletVersion,
@@ -302,19 +305,20 @@ data class MobileKeysLastAuthenticationInfo (
val lastAuthenticatedMobileKey: MobileKeysKey,
val isModified: Boolean,
val authenticationCounter: Long
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysLastAuthenticationInfo {
- val lastAuthenticatedMobileKey = pigeonVar_list[0] as MobileKeysKey
- val isModified = pigeonVar_list[1] as Boolean
- val authenticationCounter = pigeonVar_list[2] as Long
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysLastAuthenticationInfo {
+ val lastAuthenticatedMobileKey = MobileKeysKey.fromList(list[0] as List<Any?>)
+ val isModified = list[1] as Boolean
+ val authenticationCounter = list[2].let { if (it is Int) it.toLong() else it as Long }
return MobileKeysLastAuthenticationInfo(lastAuthenticatedMobileKey, isModified, authenticationCounter)
}
}
fun toList(): List<Any?> {
- return listOf(
- lastAuthenticatedMobileKey,
+ return listOf<Any?>(
+ lastAuthenticatedMobileKey.toList(),
isModified,
authenticationCounter,
)
@@ -326,18 +330,19 @@ data class MobileKeysTimeoutConfiguration (
val maxTimeBetweenFragments: Double,
val maxTimeBetweenApdus: Double,
val maxConnectionTime: Double
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysTimeoutConfiguration {
- val maxTimeBetweenFragments = pigeonVar_list[0] as Double
- val maxTimeBetweenApdus = pigeonVar_list[1] as Double
- val maxConnectionTime = pigeonVar_list[2] as Double
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysTimeoutConfiguration {
+ val maxTimeBetweenFragments = list[0] as Double
+ val maxTimeBetweenApdus = list[1] as Double
+ val maxConnectionTime = list[2] as Double
return MobileKeysTimeoutConfiguration(maxTimeBetweenFragments, maxTimeBetweenApdus, maxConnectionTime)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
maxTimeBetweenFragments,
maxTimeBetweenApdus,
maxConnectionTime,
@@ -349,17 +354,18 @@ data class MobileKeysTimeoutConfiguration (
data class MobileKeysRssiMeasurement (
val rssiValue: Long,
val measuredAtIntervalSince1970: Double
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysRssiMeasurement {
- val rssiValue = pigeonVar_list[0] as Long
- val measuredAtIntervalSince1970 = pigeonVar_list[1] as Double
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysRssiMeasurement {
+ val rssiValue = list[0].let { if (it is Int) it.toLong() else it as Long }
+ val measuredAtIntervalSince1970 = list[1] as Double
return MobileKeysRssiMeasurement(rssiValue, measuredAtIntervalSince1970)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
rssiValue,
measuredAtIntervalSince1970,
)
@@ -383,49 +389,58 @@ data class MobileKeysReader (
val appSpecificData: ByteArray? = null,
val protocolVersion: BleProtocol,
val txPowerLevel: Long
-)
- {
+
+) {
companion object {
- fun fromList(pigeonVar_list: List<Any?>): MobileKeysReader {
- val rssiValueLimitsForOpeningTypeKeys = pigeonVar_list[0] as Map<Long?, Long?>
- val uuid = pigeonVar_list[1] as String?
- val readerCanConnect = pigeonVar_list[2] as Boolean
- val latestRssiMeasurement = pigeonVar_list[3] as MobileKeysRssiMeasurement?
- val lastSuccessfulConnection = pigeonVar_list[4] as DataTypeDate?
- val name = pigeonVar_list[5] as String?
- val localName = pigeonVar_list[6] as String?
- val supportedOpeningTypes = pigeonVar_list[7] as List<Long?>
- val lastRSSIUpdate = pigeonVar_list[8] as DataTypeDate?
- val readerType = pigeonVar_list[9] as MobileKeysReaderType
- val optionalScanResponseData = pigeonVar_list[10] as ByteArray?
- val serialNumberData = pigeonVar_list[11] as ByteArray?
- val appSpecificData = pigeonVar_list[12] as ByteArray?
- val protocolVersion = pigeonVar_list[13] as BleProtocol
- val txPowerLevel = pigeonVar_list[14] as Long
+ @Suppress("UNCHECKED_CAST")
+ fun fromList(list: List<Any?>): MobileKeysReader {
+ val rssiValueLimitsForOpeningTypeKeys = list[0] as Map<Long?, Long?>
+ val uuid = list[1] as String?
+ val readerCanConnect = list[2] as Boolean
+ val latestRssiMeasurement: MobileKeysRssiMeasurement? = (list[3] as List<Any?>?)?.let {
+ MobileKeysRssiMeasurement.fromList(it)
+ }
+ val lastSuccessfulConnection: DataTypeDate? = (list[4] as List<Any?>?)?.let {
+ DataTypeDate.fromList(it)
+ }
+ val name = list[5] as String?
+ val localName = list[6] as String?
+ val supportedOpeningTypes = list[7] as List<Long?>
+ val lastRSSIUpdate: DataTypeDate? = (list[8] as List<Any?>?)?.let {
+ DataTypeDate.fromList(it)
+ }
+ val readerType = MobileKeysReaderType.ofRaw(list[9] as Int)!!
+ val optionalScanResponseData = list[10] as ByteArray?
+ val serialNumberData = list[11] as ByteArray?
+ val appSpecificData = list[12] as ByteArray?
+ val protocolVersion = BleProtocol.ofRaw(list[13] as Int)!!
+ val txPowerLevel = list[14].let { if (it is Int) it.toLong() else it as Long }
return MobileKeysReader(rssiValueLimitsForOpeningTypeKeys, uuid, readerCanConnect, latestRssiMeasurement, lastSuccessfulConnection, name, localName, supportedOpeningTypes, lastRSSIUpdate, readerType, optionalScanResponseData, serialNumberData, appSpecificData, protocolVersion, txPowerLevel)
}
}
fun toList(): List<Any?> {
- return listOf(
+ return listOf<Any?>(
rssiValueLimitsForOpeningTypeKeys,
uuid,
readerCanConnect,
- latestRssiMeasurement,
- lastSuccessfulConnection,
+ latestRssiMeasurement?.toList(),
+ lastSuccessfulConnection?.toList(),
name,
localName,
supportedOpeningTypes,
- lastRSSIUpdate,
- readerType,
+ lastRSSIUpdate?.toList(),
+ readerType.raw,
optionalScanResponseData,
serialNumberData,
appSpecificData,
- protocolVersion,
+ protocolVersion.raw,
txPowerLevel,
)
}
}
-private open class AppUsagePigeonCodec : StandardMessageCodec() {
+
+@Suppress("UNCHECKED_CAST")
+private object AppUsageAPICodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
return when (type) {
128.toByte() -> {
@@ -510,7 +525,6 @@ private open class AppUsagePigeonCodec : StandardMessageCodec() {
}
}
-
/** Generated interface from Pigeon that represents a handler of messages from Flutter. */
interface AppUsageAPI {
fun startUp(options: Map<String?, Any?>, callback: (Result<Unit>) -> Unit)
@@ -536,8 +550,8 @@ interface AppUsageAPI {
fun lastAuthenticationInfo(callback: (Result<MobileKeysLastAuthenticationInfo>) -> Unit)
fun listReaders(callback: (Result<List<MobileKeysReader>>) -> Unit)
fun closestReaderWithinRangeOfOpeningType(type: MobileKeysOpeningType, callback: (Result<MobileKeysReader?>) -> Unit)
- fun connectToReader(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
- fun forceConnectToReader(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
+ fun connect(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
+ fun forceConnect(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
fun cancelReaderConnection(reader: MobileKeysReader, callback: (Result<Unit>) -> Unit)
fun openClosestReader(callback: (Result<Unit>) -> Unit)
fun setRootOpeningTrigger(callback: (Result<Unit>) -> Unit)
@@ -548,14 +562,13 @@ interface AppUsageAPI {
companion object {
/** The codec used by AppUsageAPI. */
val codec: MessageCodec<Any?> by lazy {
- AppUsagePigeonCodec()
+ AppUsageAPICodec
}
/** Sets up an instance of `AppUsageAPI` to handle messages through the `binaryMessenger`. */
- @JvmOverloads
- fun setUp(binaryMessenger: BinaryMessenger, api: AppUsageAPI?, messageChannelSuffix: String = "") {
- val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
+ @Suppress("UNCHECKED_CAST")
+ fun setUp(binaryMessenger: BinaryMessenger, api: AppUsageAPI?) {
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startUp$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startUp", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -574,10 +587,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceHasBluetoothTurnedOn$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceHasBluetoothTurnedOn", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.deviceHasBluetoothTurnedOn{ result: Result<Boolean> ->
+ api.deviceHasBluetoothTurnedOn() { result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -592,10 +605,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceSupportsBluetoothLowEnergy$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceSupportsBluetoothLowEnergy", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.deviceSupportsBluetoothLowEnergy{ result: Result<Boolean> ->
+ api.deviceSupportsBluetoothLowEnergy() { result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -610,10 +623,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isEndpointSetup$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isEndpointSetup", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.isEndpointSetup{ result: Result<Boolean> ->
+ api.isEndpointSetup() { result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -628,7 +641,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setupEndpoint$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setupEndpoint", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -647,10 +660,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.updateEndpoint$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.updateEndpoint", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.updateEndpoint{ result: Result<Unit> ->
+ api.updateEndpoint() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -664,10 +677,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.terminateEndpoint$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.terminateEndpoint", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.terminateEndpoint{ result: Result<Unit> ->
+ api.terminateEndpoint() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -681,10 +694,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listMobileKeys$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listMobileKeys", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.listMobileKeys{ result: Result<List<MobileKeysKey>> ->
+ api.listMobileKeys() { result: Result<List<MobileKeysKey>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -699,7 +712,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.activateMobileKey$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.activateMobileKey", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -719,7 +732,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deactivateMobileKey$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deactivateMobileKey", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -739,7 +752,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.generateOTPForKey$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.generateOTPForKey", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -759,7 +772,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.otpCounterForKey$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.otpCounterForKey", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -779,10 +792,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.endpointInfo$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.endpointInfo", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.endpointInfo{ result: Result<MobileKeysEndpointInfo> ->
+ api.endpointInfo() { result: Result<MobileKeysEndpointInfo> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -797,10 +810,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.healthCheck$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.healthCheck", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.healthCheck{ result: Result<List<MobileKeysInfoType>> ->
+ api.healthCheck() { result: Result<List<MobileKeysInfoType>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -815,10 +828,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.apiVersion$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.apiVersion", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.apiVersion{ result: Result<String> ->
+ api.apiVersion() { result: Result<String> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -833,10 +846,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isScanning$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isScanning", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.isScanning{ result: Result<Boolean> ->
+ api.isScanning() { result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -851,12 +864,11 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startReaderScan$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startReaderScan", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
- val modeRaw = args[0] as Int
- val modeArg = MobileKeysScanMode.ofRaw(modeRaw) ?: MobileKeysScanMode.OPTIMIZE_PERFORMANCE
+ val modeArg = MobileKeysScanMode.ofRaw(args[0] as Int)!!
val supportedOpeningTypesArg = args[1] as List<MobileKeysOpeningType>
val lockServiceCodesArg = args[2] as List<Long>
api.startReaderScan(modeArg, supportedOpeningTypesArg, lockServiceCodesArg) { result: Result<Unit> ->
@@ -873,7 +885,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setSupportedOpeningTypes$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setSupportedOpeningTypes", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -892,7 +904,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setTimeoutConfiguration$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setTimeoutConfiguration", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -911,10 +923,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.stopReaderScan$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.stopReaderScan", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.stopReaderScan{ result: Result<Unit> ->
+ api.stopReaderScan() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -928,10 +940,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.lastAuthenticationInfo$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.lastAuthenticationInfo", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.lastAuthenticationInfo{ result: Result<MobileKeysLastAuthenticationInfo> ->
+ api.lastAuthenticationInfo() { result: Result<MobileKeysLastAuthenticationInfo> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -946,10 +958,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listReaders$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listReaders", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.listReaders{ result: Result<List<MobileKeysReader>> ->
+ api.listReaders() { result: Result<List<MobileKeysReader>> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -964,7 +976,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.closestReaderWithinRangeOfOpeningType$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.closestReaderWithinRangeOfOpeningType", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -984,13 +996,13 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.connectToReader$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.connect", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val readerArg = args[0] as MobileKeysReader
val openingTypeArg = args[1] as MobileKeysOpeningType
- api.connectToReader(readerArg, openingTypeArg) { result: Result<Unit> ->
+ api.connect(readerArg, openingTypeArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1004,13 +1016,13 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.forceConnectToReader$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.forceConnect", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
val readerArg = args[0] as MobileKeysReader
val openingTypeArg = args[1] as MobileKeysOpeningType
- api.forceConnectToReader(readerArg, openingTypeArg) { result: Result<Unit> ->
+ api.forceConnect(readerArg, openingTypeArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1024,7 +1036,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.cancelReaderConnection$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.cancelReaderConnection", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -1043,10 +1055,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.openClosestReader$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.openClosestReader", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.openClosestReader{ result: Result<Unit> ->
+ api.openClosestReader() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1060,10 +1072,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setRootOpeningTrigger$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setRootOpeningTrigger", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.setRootOpeningTrigger{ result: Result<Unit> ->
+ api.setRootOpeningTrigger() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1077,10 +1089,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.removeRootOpeningTrigger$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.removeRootOpeningTrigger", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.removeRootOpeningTrigger{ result: Result<Unit> ->
+ api.removeRootOpeningTrigger() { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1094,10 +1106,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isAnalyticsEnabled$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isAnalyticsEnabled", codec)
if (api != null) {
channel.setMessageHandler { _, reply ->
- api.isAnalyticsEnabled{ result: Result<Boolean> ->
+ api.isAnalyticsEnabled() { result: Result<Boolean> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1112,7 +1124,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.analytics$separatedMessageChannelSuffix", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.analytics", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -1133,3 +1145,102 @@ interface AppUsageAPI {
}
}
}
+@Suppress("UNCHECKED_CAST")
+private object MobileKeysCallbackCodec : StandardMessageCodec() {
+ override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
+ return when (type) {
+ 128.toByte() -> {
+ return (readValue(buffer) as? List<Any?>)?.let {
+ DataTypeDate.fromList(it)
+ }
+ }
+ 129.toByte() -> {
+ return (readValue(buffer) as? List<Any?>)?.let {
+ MobileKeysReader.fromList(it)
+ }
+ }
+ 130.toByte() -> {
+ return (readValue(buffer) as? List<Any?>)?.let {
+ MobileKeysRssiMeasurement.fromList(it)
+ }
+ }
+ else -> super.readValueOfType(type, buffer)
+ }
+ }
+ override fun writeValue(stream: ByteArrayOutputStream, value: Any?) {
+ when (value) {
+ is DataTypeDate -> {
+ stream.write(128)
+ writeValue(stream, value.toList())
+ }
+ is MobileKeysReader -> {
+ stream.write(129)
+ writeValue(stream, value.toList())
+ }
+ is MobileKeysRssiMeasurement -> {
+ stream.write(130)
+ writeValue(stream, value.toList())
+ }
+ else -> super.writeValue(stream, value)
+ }
+ }
+}
+
+/** Generated class from Pigeon that represents Flutter messages that can be called from Kotlin. */
+@Suppress("UNCHECKED_CAST")
+class MobileKeysCallback(private val binaryMessenger: BinaryMessenger) {
+ companion object {
+ /** The codec used by MobileKeysCallback. */
+ val codec: MessageCodec<Any?> by lazy {
+ MobileKeysCallbackCodec
+ }
+ }
+ fun onReaderConnected(readerArg: MobileKeysReader, openingTypeArg: OpeningType, callback: (Result<Unit>) -> Unit)
+{
+ val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderConnected"
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
+ channel.send(listOf(readerArg, openingTypeArg.raw)) {
+ if (it is List<*>) {
+ if (it.size > 1) {
+ callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
+ } else {
+ callback(Result.success(Unit))
+ }
+ } else {
+ callback(Result.failure(createConnectionError(channelName)))
+ }
+ }
+ }
+ fun onReaderConnectionFailed(readerArg: MobileKeysReader, openingTypeArg: OpeningType, statusArg: String, callback: (Result<Unit>) -> Unit)
+{
+ val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderConnectionFailed"
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
+ channel.send(listOf(readerArg, openingTypeArg.raw, statusArg)) {
+ if (it is List<*>) {
+ if (it.size > 1) {
+ callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
+ } else {
+ callback(Result.success(Unit))
+ }
+ } else {
+ callback(Result.failure(createConnectionError(channelName)))
+ }
+ }
+ }
+ fun onReaderDisconnected(readerArg: MobileKeysReader, openingTypeArg: OpeningType, wasSuccessfulArg: Boolean, callback: (Result<Unit>) -> Unit)
+{
+ val channelName = "dev.flutter.pigeon.seos_mobile_keys_plugin.MobileKeysCallback.onReaderDisconnected"
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, channelName, codec)
+ channel.send(listOf(readerArg, openingTypeArg.raw, wasSuccessfulArg)) {
+ if (it is List<*>) {
+ if (it.size > 1) {
+ callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?)))
+ } else {
+ callback(Result.success(Unit))
+ }
+ } else {
+ callback(Result.failure(createConnectionError(channelName)))
+ }
+ }
+ }
+}
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/EndpointInfoExtension.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/EndpointInfoExtension.kt
index 81e59aa9..9b9e0cc5 100644
--- a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/EndpointInfoExtension.kt
+++ b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/EndpointInfoExtension.kt
@@ -20,7 +20,7 @@ fun EndpointInfo.mobileKeysEndpointInfo(): MobileKeysEndpointInfo {
return MobileKeysEndpointInfo(
endpointId = seosId.toLongOrNull() ?: 0,
- environmentType = mobileKeysEnvironmentType(),
+ mobileKeysEnvironmentType = mobileKeysEnvironmentType(),
seosAppletVersion = mobileKeysAPIVersion,
fileSystemAppletVersion = fileSystemVersion,
toolsAppletVersion = toolsVersion,
@@ -40,7 +40,7 @@ fun EndpointInfo.mobileKeysEndpointInfo(): MobileKeysEndpointInfo {
}
}
-private fun EndpointInfo.mobileKeysEnvironmentType(): MobileKeysEnvironmentType {
+fun EndpointInfo.mobileKeysEnvironmentType(): MobileKeysEnvironmentType {
return when (server) {
"PROD" -> MobileKeysEnvironmentType.PROD
"DEMO" -> MobileKeysEnvironmentType.DEMO
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/SeosMobileKeysPlugin.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/SeosMobileKeysPlugin.kt
index 4435f90c..4d037687 100644
--- a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/SeosMobileKeysPlugin.kt
+++ b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/SeosMobileKeysPlugin.kt
@@ -352,7 +352,7 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
TODO("Not yet implemented")
}
- override fun connectToReader(
+ override fun connect(
reader: MobileKeysReader,
openingType: MobileKeysOpeningType,
callback: (Result<Unit>) -> Unit
@@ -360,7 +360,7 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
TODO("Not yet implemented")
}
- override fun forceConnectToReader(
+ override fun forceConnect(
reader: MobileKeysReader,
openingType: MobileKeysOpeningType,
callback: (Result<Unit>) -> Unit