6177214e-ce7c-49e3-99de-ff9721b26f63 — Commit 335f09d2

AuthorNKL<nikolaj.king@gmail.com>
Date2025-06-18 08:54:26 +0200
Updated android to 9.0.1 and fixed changes in kotlin code

Changed files

comwell_key_app/android/app/build.gradle           |   7 +-
 .../android/app/src/main/assets/logback.xml        |  39 +--
 comwell_key_app/lib/check_in/check_in_page.dart    |  14 +-
 .../check_out/pages/check_out_processing_page.dart |  28 +-
 .../components/get_a_phone_call_section.dart       |   3 -
 comwell_key_app/lib/contact/contact_page.dart      |   1 -
 .../pregistration/bloc/preregistration_cubit.dart  |   1 -
 .../android/.gradle/7.3/checksums/checksums.lock   | Bin 17 -> 0 bytes
 .../dependencies-accessors.lock                    | Bin 17 -> 0 bytes
 .../7.3/dependencies-accessors/gc.properties       |   0
 .../android/.gradle/7.3/fileChanges/last-build.bin | Bin 1 -> 0 bytes
 .../android/.gradle/7.3/fileHashes/fileHashes.lock | Bin 17 -> 0 bytes
 .../android/.gradle/7.3/gc.properties              |   0
 .../android/.gradle/7.5/checksums/checksums.lock   | Bin 17 -> 0 bytes
 .../dependencies-accessors.lock                    | Bin 17 -> 0 bytes
 .../7.5/dependencies-accessors/gc.properties       |   0
 .../android/.gradle/7.5/fileChanges/last-build.bin | Bin 1 -> 0 bytes
 .../android/.gradle/7.5/fileHashes/fileHashes.lock | Bin 17 -> 0 bytes
 .../android/.gradle/7.5/gc.properties              |   0
 .../android/.gradle/8.1.1/checksums/checksums.lock | Bin 0 -> 17 bytes
 .../dependencies-accessors.lock                    | Bin 0 -> 17 bytes
 .../8.1.1/dependencies-accessors/gc.properties     |   0
 .../.gradle/8.1.1/fileChanges/last-build.bin       | Bin 0 -> 1 bytes
 .../.gradle/8.1.1/fileHashes/fileHashes.lock       | Bin 0 -> 17 bytes
 .../android/.gradle/8.1.1/gc.properties            |   0
 .../buildOutputCleanup/buildOutputCleanup.lock     | Bin 17 -> 17 bytes
 .../.gradle/buildOutputCleanup/cache.properties    |   4 +-
 .../android/.gradle/config.properties              |   2 -
 mobilekeys_sdk_plugin/android/build.gradle         |  13 +-
 .../gradle/wrapper/gradle-wrapper.properties       |   2 +-
 .../libs/mobilekeys-android-sdk-debug-8.1.2.aar    | Bin 4188961 -> 0 bytes
 .../libs/mobilekeys-android-sdk-debug-9.0.1.aar    | Bin 0 -> 4815504 bytes
 .../libs/mobilekeys-android-sdk-release-8.1.2.aar  | Bin 5456329 -> 0 bytes
 .../libs/mobilekeys-android-sdk-release-9.0.1.aar  | Bin 0 -> 6287863 bytes
 mobilekeys_sdk_plugin/android/local.properties     |   8 -
 .../seos_mobile_keys_plugin/AppUsage.kt            | 343 ++++++++++-----------
 .../EndpointInfoExtension.kt                       |  62 ++--
 .../seos_mobile_keys_plugin/KeyExtension.kt        |  52 ++++
 .../seos_mobile_keys_plugin/MobileKeyExtension.kt  |  25 --
 .../SeosMobileKeysPlugin.kt                        |  63 ++--
 40 files changed, 338 insertions(+), 329 deletions(-)

Diff

diff --git a/comwell_key_app/android/app/build.gradle b/comwell_key_app/android/app/build.gradle
index 781f4072..d22a0d1b 100644
--- a/comwell_key_app/android/app/build.gradle
+++ b/comwell_key_app/android/app/build.gradle
@@ -89,6 +89,11 @@ android {
flavorDimensions += "env"
namespace 'com.comwell.phoenix'
+ packaging {
+ resources {
+ excludes += ['META-INF/INDEX.LIST']
+ }
+ }
productFlavors{
@@ -128,5 +133,5 @@ dependencies {
//aar file from libs dir. Name and version is from the filename.
debugImplementation fileTree(dir: '../../..//mobilekeys_sdk_plugin/android/libs', include: ['mobilekeys-android-sdk-debug-*.aar'])
releaseImplementation fileTree(dir: '../../..//mobilekeys_sdk_plugin/android/libs', include: ['mobilekeys-android-sdk-release-*.aar'])
- debugImplementation 'com.github.tony19:logback-android:3.0.0'
+ implementation 'com.github.tony19:logback-android:3.0.0'
}
diff --git a/comwell_key_app/android/app/src/main/assets/logback.xml b/comwell_key_app/android/app/src/main/assets/logback.xml
index da813716..67e1c57e 100644
--- a/comwell_key_app/android/app/src/main/assets/logback.xml
+++ b/comwell_key_app/android/app/src/main/assets/logback.xml
@@ -1,41 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
<configuration>
- <!-- Create a file appender for a log in the application's data directory -->
- <appender name="file" class="ch.qos.logback.core.rolling.RollingFileAppender">
- <file>${DATA_DIR}/logback_log.log</file>
+ <appender name="logcat" class="ch.qos.logback.classic.android.LogcatAppender">
<encoder>
- <pattern>%date|%-5level [%thread]: %logger{25}[%line] - %msg%n</pattern>
+ <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
-
- <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
- <!-- daily rollover period -->
- <fileNamePattern>${DATA_DIR}/logback_log.%d{yyyy-MM-dd}.%i.zip</fileNamePattern>
-
- <!-- size based rollover trigger -->
- <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
- <maxFileSize>1MB</maxFileSize>
- </timeBasedFileNamingAndTriggeringPolicy>
-
- <!-- keep 7 days' worth of history -->
- <maxHistory>7</maxHistory>
- <totalSizeCap>10MB</totalSizeCap>
- </rollingPolicy>
-
</appender>
- <!-- log to normal LogCat -->
- <appender name="LOGCAT" class="ch.qos.logback.classic.android.LogcatAppender">
- <tagEncoder>
- <pattern>%logger{12}</pattern>
- </tagEncoder>
- <encoder>
- <pattern>%line: %msg%n</pattern>
- </encoder>
- </appender>
-
- <!-- Write DEBUG (and higher-level) messages to the log -->
- <root level="TRACE">
- <appender-ref ref="file" />
- <appender-ref ref="LOGCAT" />
+ <root level="DEBUG">
+ <appender-ref ref="logcat" />
</root>
-
</configuration>
\ No newline at end of file
diff --git a/comwell_key_app/lib/check_in/check_in_page.dart b/comwell_key_app/lib/check_in/check_in_page.dart
index 22463e9e..d04ba509 100644
--- a/comwell_key_app/lib/check_in/check_in_page.dart
+++ b/comwell_key_app/lib/check_in/check_in_page.dart
@@ -18,7 +18,7 @@ class CheckInPage extends StatefulWidget {
class _CheckInPageState extends State<CheckInPage>
with SingleTickerProviderStateMixin {
var animationDone = false;
- late final LottieComposition loadingComposition;
+ LottieComposition? loadingComposition;
late final AnimationController animationController;
late final Widget loadingAnimation;
@@ -29,8 +29,10 @@ class _CheckInPageState extends State<CheckInPage>
'assets/animations/load_animation.json',
controller: animationController,
onLoaded: (composition) {
- loadingComposition = composition;
- animationController.duration = composition.duration;
+ if (loadingComposition == null) {
+ loadingComposition = composition;
+ animationController.duration = composition.duration;
+ }
},
fit: BoxFit.cover,
width: 64,
@@ -50,16 +52,16 @@ class _CheckInPageState extends State<CheckInPage>
}
void playLoading() {
- loadingComposition.playBetween(animationController, "spinner",
+ loadingComposition?.playBetween(animationController, "spinner",
markerEnd: "success", repeat: true);
}
void playError() {
- loadingComposition.playBetween(animationController, "error");
+ loadingComposition?.playBetween(animationController, "error");
}
void playSuccess() {
- loadingComposition.playBetween(animationController, "success",
+ loadingComposition?.playBetween(animationController, "success",
markerEnd: "error");
}
diff --git a/comwell_key_app/lib/check_out/pages/check_out_processing_page.dart b/comwell_key_app/lib/check_out/pages/check_out_processing_page.dart
index a5903ff7..48bc3ad0 100644
--- a/comwell_key_app/lib/check_out/pages/check_out_processing_page.dart
+++ b/comwell_key_app/lib/check_out/pages/check_out_processing_page.dart
@@ -21,7 +21,7 @@ class CheckOutProcessingPage extends StatefulWidget {
class _CheckOutProcessingPageState extends State<CheckOutProcessingPage>
with SingleTickerProviderStateMixin {
- late final LottieComposition loadingComposition;
+ LottieComposition? loadingComposition;
late final AnimationController animationController;
@override
@@ -41,7 +41,7 @@ class _CheckOutProcessingPageState extends State<CheckOutProcessingPage>
}
void playLoading() {
- loadingComposition.playBetween(
+ loadingComposition?.playBetween(
animationController,
"spinner",
markerEnd: "success",
@@ -50,11 +50,11 @@ class _CheckOutProcessingPageState extends State<CheckOutProcessingPage>
}
void playError() {
- loadingComposition.playBetween(animationController, "error");
+ loadingComposition?.playBetween(animationController, "error");
}
void playSuccess() async {
- await loadingComposition.playBetween(
+ await loadingComposition?.playBetween(
animationController,
"success",
markerEnd: "error",
@@ -203,15 +203,17 @@ class _CheckOutProcessingPageState extends State<CheckOutProcessingPage>
'assets/animations/load_animation.json',
controller: animationController,
onLoaded: (composition) {
- loadingComposition = composition;
- animationController.duration = composition.duration;
- switch (cubit.state.processingState) {
- case CheckoutProcessingStateSuccess _:
- playSuccess();
- case CheckoutProcessingStateError _:
- playError();
- default:
- playLoading();
+ if (loadingComposition == null) {
+ loadingComposition = composition;
+ animationController.duration = composition.duration;
+ switch (cubit.state.processingState) {
+ case CheckoutProcessingStateSuccess _:
+ playSuccess();
+ case CheckoutProcessingStateError _:
+ playError();
+ default:
+ playLoading();
+ }
}
},
fit: BoxFit.cover,
diff --git a/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart b/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
index 9e6f4529..19149c30 100644
--- a/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
+++ b/comwell_key_app/lib/contact/components/get_a_phone_call_section.dart
@@ -1,8 +1,5 @@
import 'package:comwell_key_app/contact/cubit/contact_cubit.dart';
import 'package:comwell_key_app/profile_settings/components/intl_phone_field.dart';
-import 'package:comwell_key_app/profile_settings/model/user.dart';
-import 'package:comwell_key_app/utils/launch_util.dart';
-import 'package:comwell_key_app/utils/phone_utils.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
diff --git a/comwell_key_app/lib/contact/contact_page.dart b/comwell_key_app/lib/contact/contact_page.dart
index 883bb0ff..7d417180 100644
--- a/comwell_key_app/lib/contact/contact_page.dart
+++ b/comwell_key_app/lib/contact/contact_page.dart
@@ -2,7 +2,6 @@ import 'package:comwell_key_app/common/components/comwell_app_bar.dart';
import 'package:comwell_key_app/contact/components/call_us_section.dart';
import 'package:comwell_key_app/contact/components/get_a_phone_call_section.dart';
import 'package:comwell_key_app/contact/cubit/contact_cubit.dart';
-import 'package:comwell_key_app/profile_settings/model/user.dart';
import 'package:comwell_key_app/themes/light_theme.dart';
import 'package:easy_localization/easy_localization.dart';
import 'package:flutter/material.dart';
diff --git a/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart b/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
index 62b1ed36..354eb1c6 100644
--- a/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
+++ b/comwell_key_app/lib/pregistration/bloc/preregistration_cubit.dart
@@ -2,7 +2,6 @@ import 'package:bloc/bloc.dart';
import 'package:comwell_key_app/overview/models/booking.dart';
import 'package:comwell_key_app/pregistration/bloc/preregistration_state.dart';
import 'package:comwell_key_app/pregistration/pregistration_repository.dart';
-import 'package:comwell_key_app/pregistration/preregistration_flow.dart';
import 'package:comwell_key_app/pregistration/utils/utils.dart';
import 'package:comwell_key_app/profile/profile_repository.dart';
import 'package:comwell_key_app/profile_settings/model/address.dart';
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/checksums/checksums.lock b/mobilekeys_sdk_plugin/android/.gradle/7.3/checksums/checksums.lock
deleted file mode 100644
index ae747426..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.3/checksums/checksums.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/dependencies-accessors/dependencies-accessors.lock b/mobilekeys_sdk_plugin/android/.gradle/7.3/dependencies-accessors/dependencies-accessors.lock
deleted file mode 100644
index 3b40a3d1..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.3/dependencies-accessors/dependencies-accessors.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/dependencies-accessors/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/7.3/dependencies-accessors/gc.properties
deleted file mode 100644
index e69de29b..00000000
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/fileChanges/last-build.bin b/mobilekeys_sdk_plugin/android/.gradle/7.3/fileChanges/last-build.bin
deleted file mode 100644
index f76dd238..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.3/fileChanges/last-build.bin and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/fileHashes/fileHashes.lock b/mobilekeys_sdk_plugin/android/.gradle/7.3/fileHashes/fileHashes.lock
deleted file mode 100644
index 03d5e477..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.3/fileHashes/fileHashes.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.3/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/7.3/gc.properties
deleted file mode 100644
index e69de29b..00000000
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/checksums/checksums.lock b/mobilekeys_sdk_plugin/android/.gradle/7.5/checksums/checksums.lock
deleted file mode 100644
index 303600aa..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.5/checksums/checksums.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock b/mobilekeys_sdk_plugin/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock
deleted file mode 100644
index dc4c47b6..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.5/dependencies-accessors/dependencies-accessors.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/dependencies-accessors/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/7.5/dependencies-accessors/gc.properties
deleted file mode 100644
index e69de29b..00000000
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/fileChanges/last-build.bin b/mobilekeys_sdk_plugin/android/.gradle/7.5/fileChanges/last-build.bin
deleted file mode 100644
index f76dd238..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.5/fileChanges/last-build.bin and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/fileHashes/fileHashes.lock b/mobilekeys_sdk_plugin/android/.gradle/7.5/fileHashes/fileHashes.lock
deleted file mode 100644
index 5aaa5fc7..00000000
Binary files a/mobilekeys_sdk_plugin/android/.gradle/7.5/fileHashes/fileHashes.lock and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/7.5/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/7.5/gc.properties
deleted file mode 100644
index e69de29b..00000000
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
new file mode 100644
index 00000000..a8e450bf
Binary files /dev/null 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/dependencies-accessors/dependencies-accessors.lock b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock
new file mode 100644
index 00000000..bae13c27
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/dependencies-accessors/dependencies-accessors.lock differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/dependencies-accessors/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/dependencies-accessors/gc.properties
new file mode 100644
index 00000000..e69de29b
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileChanges/last-build.bin b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileChanges/last-build.bin
new file mode 100644
index 00000000..f76dd238
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileChanges/last-build.bin differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileHashes/fileHashes.lock b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileHashes/fileHashes.lock
new file mode 100644
index 00000000..b7187c94
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/fileHashes/fileHashes.lock differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/8.1.1/gc.properties b/mobilekeys_sdk_plugin/android/.gradle/8.1.1/gc.properties
new file mode 100644
index 00000000..e69de29b
diff --git a/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock b/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
index 6404be7d..835b2e40 100644
Binary files a/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock and b/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/buildOutputCleanup.lock differ
diff --git a/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/cache.properties b/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/cache.properties
index 891315a6..321c3b81 100644
--- a/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/cache.properties
+++ b/mobilekeys_sdk_plugin/android/.gradle/buildOutputCleanup/cache.properties
@@ -1,2 +1,2 @@
-#Wed Jul 31 11:34:30 CEST 2024
-gradle.version=7.3
+#Mon Jun 16 13:08:50 CEST 2025
+gradle.version=8.1.1
diff --git a/mobilekeys_sdk_plugin/android/.gradle/config.properties b/mobilekeys_sdk_plugin/android/.gradle/config.properties
deleted file mode 100644
index 73a6ef72..00000000
--- a/mobilekeys_sdk_plugin/android/.gradle/config.properties
+++ /dev/null
@@ -1,2 +0,0 @@
-#Fri Jan 10 14:59:51 CET 2025
-java.home=/Applications/Android Studio.app/Contents/jbr/Contents/Home
diff --git a/mobilekeys_sdk_plugin/android/build.gradle b/mobilekeys_sdk_plugin/android/build.gradle
index 3d1883a3..612d1cd6 100644
--- a/mobilekeys_sdk_plugin/android/build.gradle
+++ b/mobilekeys_sdk_plugin/android/build.gradle
@@ -5,9 +5,6 @@ allprojects {
repositories {
google()
mavenCentral()
- flatDir {
- dirs 'libs'
- }
}
}
@@ -15,15 +12,15 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
- compileSdkVersion 35
+ compileSdk 35
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility JavaVersion.VERSION_17
+ targetCompatibility JavaVersion.VERSION_17
}
kotlinOptions {
- jvmTarget = '1.8'
+ jvmTarget = '17'
}
sourceSets {
@@ -38,7 +35,6 @@ android {
dependencies {
compileOnly fileTree(dir: 'libs', include: ['mobilekeys-android-sdk-release-*.aar'])
- compileOnly fileTree(dir: 'libs', include: ['mobilekeys-android-sdk-debug-*.aar'])
// Mobile Keys SDK transitive dependencies
implementation "org.bouncycastle:bcprov-jdk15to18:1.78.1"
@@ -46,4 +42,5 @@ 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/wrapper/gradle-wrapper.properties b/mobilekeys_sdk_plugin/android/gradle/wrapper/gradle-wrapper.properties
index ac2064c9..80187ac3 100644
--- a/mobilekeys_sdk_plugin/android/gradle/wrapper/gradle-wrapper.properties
+++ b/mobilekeys_sdk_plugin/android/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
diff --git a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-8.1.2.aar b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-8.1.2.aar
deleted file mode 100644
index f6cf99f0..00000000
Binary files a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-8.1.2.aar and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-9.0.1.aar b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-9.0.1.aar
new file mode 100644
index 00000000..a19c5426
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-debug-9.0.1.aar differ
diff --git a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-8.1.2.aar b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-8.1.2.aar
deleted file mode 100644
index 92f1c227..00000000
Binary files a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-8.1.2.aar and /dev/null differ
diff --git a/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-9.0.1.aar b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-9.0.1.aar
new file mode 100644
index 00000000..791ef2a4
Binary files /dev/null and b/mobilekeys_sdk_plugin/android/libs/mobilekeys-android-sdk-release-9.0.1.aar differ
diff --git a/mobilekeys_sdk_plugin/android/local.properties b/mobilekeys_sdk_plugin/android/local.properties
deleted file mode 100644
index bc14d75f..00000000
--- a/mobilekeys_sdk_plugin/android/local.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-## This file must *NOT* be checked into Version Control Systems,
-# as it contains information specific to your local configuration.
-#
-# Location of the SDK. This is only used by Gradle.
-# For customization when using a Version Control System, please read the
-# header note.
-#Fri Jan 10 14:59:51 CET 2025
-sdk.dir=/Users/mth/Library/Android/sdk
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 a3484484..06fcfaab 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,12 +1,15 @@
-// Autogenerated from Pigeon (v17.3.0), do not edit directly.
+// Autogenerated from Pigeon (v22.7.4), 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
@@ -16,14 +19,14 @@ private fun wrapResult(result: Any?): List<Any?> {
}
private fun wrapError(exception: Throwable): List<Any?> {
- if (exception is FlutterError) {
- return listOf(
+ return if (exception is FlutterError) {
+ listOf(
exception.code,
exception.message,
exception.details
)
} else {
- return listOf(
+ listOf(
exception.javaClass.simpleName,
exception.toString(),
"Cause: " + exception.cause + ", Stacktrace: " + Log.getStackTraceString(exception)
@@ -140,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 {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List<Any?>): MobileKeysOpeningType {
- val openingType = OpeningType.ofRaw(list[0] as Int)!!
+ fun fromList(pigeonVar_list: List<Any?>): MobileKeysOpeningType {
+ val openingTypeRaw = pigeonVar_list[0] as Int
+ val openingType = OpeningType.ofRaw(openingTypeRaw) ?: OpeningType.UNKNOWN
return MobileKeysOpeningType(openingType)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
openingType.raw,
)
}
@@ -160,18 +163,16 @@ data class MobileKeysOpeningType (
data class DataTypeDate (
val date: String,
val format: String
-
) {
companion object {
- @Suppress("UNCHECKED_CAST")
- fun fromList(list: List<Any?>): DataTypeDate {
- val date = list[0] as String
- val format = list[1] as String
+ fun fromList(pigeonVar_list: List<Any?>): DataTypeDate {
+ val date = pigeonVar_list[0] as String
+ val format = pigeonVar_list[1] as String
return DataTypeDate(date, format)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
date,
format,
)
@@ -192,32 +193,31 @@ data class MobileKeysKey (
val keyType: String? = null,
val cardNumber: String? = null,
val active: Boolean
-
-) {
+)
+ {
companion object {
- @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
+ 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
return MobileKeysKey(credentialType, beginDate, endDate, keyId, externalId, label, configUrl, readbackUrl, issuer, keyType, cardNumber, active)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
credentialType,
beginDate?.toList(),
endDate?.toList(),
@@ -237,7 +237,7 @@ data class MobileKeysKey (
/** Generated class from Pigeon that represents data sent in messages. */
data class MobileKeysEndpointInfo (
val endpointId: Long,
- val mobileKeysEnvironmentType: MobileKeysEnvironmentType,
+ val environmentType: MobileKeysEnvironmentType,
val seosAppletVersion: String,
val fileSystemAppletVersion: String,
val toolsAppletVersion: String,
@@ -251,35 +251,35 @@ data class MobileKeysEndpointInfo (
val hashAlg: Long? = null,
val encAlg: Long? = null,
val lastServerSyncDate: DataTypeDate? = null
-
-) {
+)
+ {
companion object {
- @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 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)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
endpointId,
- mobileKeysEnvironmentType.raw,
+ environmentType.ordinal,
seosAppletVersion,
fileSystemAppletVersion,
toolsAppletVersion,
@@ -302,20 +302,19 @@ data class MobileKeysLastAuthenticationInfo (
val lastAuthenticatedMobileKey: MobileKeysKey,
val isModified: Boolean,
val authenticationCounter: Long
-
-) {
+)
+ {
companion object {
- @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 }
+ 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
return MobileKeysLastAuthenticationInfo(lastAuthenticatedMobileKey, isModified, authenticationCounter)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
- lastAuthenticatedMobileKey.toList(),
+ return listOf(
+ lastAuthenticatedMobileKey,
isModified,
authenticationCounter,
)
@@ -327,19 +326,18 @@ data class MobileKeysTimeoutConfiguration (
val maxTimeBetweenFragments: Double,
val maxTimeBetweenApdus: Double,
val maxConnectionTime: Double
-
-) {
+)
+ {
companion object {
- @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
+ 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
return MobileKeysTimeoutConfiguration(maxTimeBetweenFragments, maxTimeBetweenApdus, maxConnectionTime)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
maxTimeBetweenFragments,
maxTimeBetweenApdus,
maxConnectionTime,
@@ -351,18 +349,17 @@ data class MobileKeysTimeoutConfiguration (
data class MobileKeysRssiMeasurement (
val rssiValue: Long,
val measuredAtIntervalSince1970: Double
-
-) {
+)
+ {
companion object {
- @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
+ fun fromList(pigeonVar_list: List<Any?>): MobileKeysRssiMeasurement {
+ val rssiValue = pigeonVar_list[0] as Long
+ val measuredAtIntervalSince1970 = pigeonVar_list[1] as Double
return MobileKeysRssiMeasurement(rssiValue, measuredAtIntervalSince1970)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
rssiValue,
measuredAtIntervalSince1970,
)
@@ -386,58 +383,49 @@ data class MobileKeysReader (
val appSpecificData: ByteArray? = null,
val protocolVersion: BleProtocol,
val txPowerLevel: Long
-
-) {
+)
+ {
companion object {
- @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 }
+ 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
return MobileKeysReader(rssiValueLimitsForOpeningTypeKeys, uuid, readerCanConnect, latestRssiMeasurement, lastSuccessfulConnection, name, localName, supportedOpeningTypes, lastRSSIUpdate, readerType, optionalScanResponseData, serialNumberData, appSpecificData, protocolVersion, txPowerLevel)
}
}
fun toList(): List<Any?> {
- return listOf<Any?>(
+ return listOf(
rssiValueLimitsForOpeningTypeKeys,
uuid,
readerCanConnect,
- latestRssiMeasurement?.toList(),
- lastSuccessfulConnection?.toList(),
+ latestRssiMeasurement,
+ lastSuccessfulConnection,
name,
localName,
supportedOpeningTypes,
- lastRSSIUpdate?.toList(),
- readerType.raw,
+ lastRSSIUpdate,
+ readerType,
optionalScanResponseData,
serialNumberData,
appSpecificData,
- protocolVersion.raw,
+ protocolVersion,
txPowerLevel,
)
}
}
-
-@Suppress("UNCHECKED_CAST")
-private object AppUsageAPICodec : StandardMessageCodec() {
+private open class AppUsagePigeonCodec : StandardMessageCodec() {
override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? {
return when (type) {
128.toByte() -> {
@@ -522,6 +510,7 @@ private object AppUsageAPICodec : 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)
@@ -547,8 +536,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 connect(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
- fun forceConnect(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
+ fun connectToReader(reader: MobileKeysReader, openingType: MobileKeysOpeningType, callback: (Result<Unit>) -> Unit)
+ fun forceConnectToReader(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)
@@ -559,13 +548,14 @@ interface AppUsageAPI {
companion object {
/** The codec used by AppUsageAPI. */
val codec: MessageCodec<Any?> by lazy {
- AppUsageAPICodec
+ AppUsagePigeonCodec()
}
/** Sets up an instance of `AppUsageAPI` to handle messages through the `binaryMessenger`. */
- @Suppress("UNCHECKED_CAST")
- fun setUp(binaryMessenger: BinaryMessenger, api: AppUsageAPI?) {
+ @JvmOverloads
+ fun setUp(binaryMessenger: BinaryMessenger, api: AppUsageAPI?, messageChannelSuffix: String = "") {
+ val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else ""
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startUp", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startUp$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -584,10 +574,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceHasBluetoothTurnedOn", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceHasBluetoothTurnedOn$separatedMessageChannelSuffix", 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))
@@ -602,10 +592,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceSupportsBluetoothLowEnergy", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deviceSupportsBluetoothLowEnergy$separatedMessageChannelSuffix", 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))
@@ -620,10 +610,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isEndpointSetup", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isEndpointSetup$separatedMessageChannelSuffix", 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))
@@ -638,7 +628,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setupEndpoint", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setupEndpoint$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -657,10 +647,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.updateEndpoint", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.updateEndpoint$separatedMessageChannelSuffix", 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))
@@ -674,10 +664,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.terminateEndpoint", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.terminateEndpoint$separatedMessageChannelSuffix", 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))
@@ -691,10 +681,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listMobileKeys", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listMobileKeys$separatedMessageChannelSuffix", 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))
@@ -709,7 +699,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.activateMobileKey", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.activateMobileKey$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -729,7 +719,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deactivateMobileKey", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.deactivateMobileKey$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -749,7 +739,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.generateOTPForKey", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.generateOTPForKey$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -769,7 +759,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.otpCounterForKey", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.otpCounterForKey$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -789,10 +779,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.endpointInfo", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.endpointInfo$separatedMessageChannelSuffix", 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))
@@ -807,10 +797,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.healthCheck", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.healthCheck$separatedMessageChannelSuffix", 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))
@@ -825,10 +815,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.apiVersion", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.apiVersion$separatedMessageChannelSuffix", 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))
@@ -843,10 +833,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isScanning", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isScanning$separatedMessageChannelSuffix", 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))
@@ -861,11 +851,12 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startReaderScan", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.startReaderScan$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
- val modeArg = MobileKeysScanMode.ofRaw(args[0] as Int)!!
+ val modeRaw = args[0] as Int
+ val modeArg = MobileKeysScanMode.ofRaw(modeRaw) ?: MobileKeysScanMode.OPTIMIZE_PERFORMANCE
val supportedOpeningTypesArg = args[1] as List<MobileKeysOpeningType>
val lockServiceCodesArg = args[2] as List<Long>
api.startReaderScan(modeArg, supportedOpeningTypesArg, lockServiceCodesArg) { result: Result<Unit> ->
@@ -882,7 +873,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setSupportedOpeningTypes", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setSupportedOpeningTypes$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -901,7 +892,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setTimeoutConfiguration", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setTimeoutConfiguration$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -920,10 +911,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.stopReaderScan", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.stopReaderScan$separatedMessageChannelSuffix", 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))
@@ -937,10 +928,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.lastAuthenticationInfo", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.lastAuthenticationInfo$separatedMessageChannelSuffix", 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))
@@ -955,10 +946,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listReaders", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.listReaders$separatedMessageChannelSuffix", 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))
@@ -973,7 +964,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.closestReaderWithinRangeOfOpeningType", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.closestReaderWithinRangeOfOpeningType$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -993,13 +984,13 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.connect", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.connectToReader$separatedMessageChannelSuffix", 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.connect(readerArg, openingTypeArg) { result: Result<Unit> ->
+ api.connectToReader(readerArg, openingTypeArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1013,13 +1004,13 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.forceConnect", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.forceConnectToReader$separatedMessageChannelSuffix", 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.forceConnect(readerArg, openingTypeArg) { result: Result<Unit> ->
+ api.forceConnectToReader(readerArg, openingTypeArg) { result: Result<Unit> ->
val error = result.exceptionOrNull()
if (error != null) {
reply.reply(wrapError(error))
@@ -1033,7 +1024,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.cancelReaderConnection", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.cancelReaderConnection$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
@@ -1052,10 +1043,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.openClosestReader", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.openClosestReader$separatedMessageChannelSuffix", 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))
@@ -1069,10 +1060,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setRootOpeningTrigger", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.setRootOpeningTrigger$separatedMessageChannelSuffix", 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))
@@ -1086,10 +1077,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.removeRootOpeningTrigger", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.removeRootOpeningTrigger$separatedMessageChannelSuffix", 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))
@@ -1103,10 +1094,10 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isAnalyticsEnabled", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.isAnalyticsEnabled$separatedMessageChannelSuffix", 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))
@@ -1121,7 +1112,7 @@ interface AppUsageAPI {
}
}
run {
- val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.analytics", codec)
+ val channel = BasicMessageChannel<Any?>(binaryMessenger, "dev.flutter.pigeon.seos_mobile_keys_plugin.AppUsageAPI.analytics$separatedMessageChannelSuffix", codec)
if (api != null) {
channel.setMessageHandler { message, reply ->
val args = message as List<Any?>
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 a049d6c1..81e59aa9 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
@@ -5,32 +5,50 @@ import com.assaabloy.mobilekeys.api.tsm.Environment
import java.text.SimpleDateFormat
fun EndpointInfo.mobileKeysEndpointInfo(): MobileKeysEndpointInfo {
- val pattern = dartDatePattern
- val formatter = SimpleDateFormat(pattern)
- val date = lastServerSyncDate.let { DataTypeDate(formatter.format(it), pattern) }
- return MobileKeysEndpointInfo(
- endpointId = seosId.toLongOrNull() ?: 0,
- mobileKeysEnvironmentType = mobileKeysEnvironmentType(),
- seosAppletVersion = mobileKeysAPIVersion,
- fileSystemAppletVersion = fileSystemVersion,
- toolsAppletVersion = toolsVersion,
- javaCardVersion = javaCardVersion,
- optionFlags = optionFlags.toString(),
- allocatedFileSystemSize = allocatedFileSystemSize.toLongOrNull() ?: 0,
- currentTopOfFileSystem = currentTopOfFileSystem.toLongOrNull() ?: 0,
- snmpBufferSize = 0,
- remainingEPROMSize = remainingSpaceInEPROM.toLongOrNull() ?: 0,
- remainingTransientObjectSpace = availableTransientObjectSpace.toLongOrNull() ?: 0,
- hashAlg = hashAlgorithm.algorithmId().toLong(),
- encAlg = encryptionAlgorithm.algorithmId().toLong(),
- lastServerSyncDate = date,
- )
+ try {
+ val pattern = dartDatePattern
+ val formatter = SimpleDateFormat(pattern)
+
+ val date = lastServerSyncDate?.let {
+ try {
+ val formattedDate = formatter.format(it)
+ DataTypeDate(date = formattedDate, format = pattern)
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+ return MobileKeysEndpointInfo(
+ endpointId = seosId.toLongOrNull() ?: 0,
+ environmentType = mobileKeysEnvironmentType(),
+ seosAppletVersion = mobileKeysAPIVersion,
+ fileSystemAppletVersion = fileSystemVersion,
+ toolsAppletVersion = toolsVersion,
+ javaCardVersion = javaCardVersion,
+ optionFlags = optionFlags.toString(),
+ allocatedFileSystemSize = allocatedFileSystemSize.toLongOrNull() ?: 0,
+ currentTopOfFileSystem = currentTopOfFileSystem.toLongOrNull() ?: 0,
+ snmpBufferSize = 0,
+ remainingEPROMSize = remainingSpaceInEPROM.toLongOrNull() ?: 0,
+ remainingTransientObjectSpace = availableTransientObjectSpace.toLongOrNull() ?: 0,
+ hashAlg = hashAlgorithm.algorithmId().toLong(),
+ encAlg = encryptionAlgorithm.algorithmId().toLong(),
+ lastServerSyncDate = date,
+ )
+ } catch (e: Exception) {
+ throw e
+ }
}
private fun EndpointInfo.mobileKeysEnvironmentType(): MobileKeysEnvironmentType {
return when (server) {
- Environment.PROD.displayName() -> MobileKeysEnvironmentType.PROD
- Environment.INTEGRATION.displayName() -> MobileKeysEnvironmentType.STAGING
+ "PROD" -> MobileKeysEnvironmentType.PROD
+ "DEMO" -> MobileKeysEnvironmentType.DEMO
+ "TEST" -> MobileKeysEnvironmentType.TEST
+ "DEV" -> MobileKeysEnvironmentType.DEV
+ "LOCAL" -> MobileKeysEnvironmentType.LOCAL
+ "STAGING" -> MobileKeysEnvironmentType.STAGING
+ "ACCEPTANCE" -> MobileKeysEnvironmentType.ACCEPTANCE
else -> MobileKeysEnvironmentType.UNKNOWN
}
}
\ No newline at end of file
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/KeyExtension.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/KeyExtension.kt
new file mode 100644
index 00000000..69f9630e
--- /dev/null
+++ b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/KeyExtension.kt
@@ -0,0 +1,52 @@
+package com.assaabloy.flutter.seosmobilekeyssdk.seos_mobile_keys_plugin
+
+import android.util.Log
+import com.assaabloy.mobilekeys.api.MobileKey
+import java.text.SimpleDateFormat
+import java.util.*
+
+private const val TAG = "SEOS_KEY_EXTENSION"
+
+fun MobileKey.mobileKeysKey(): MobileKeysKey {
+ Log.d(TAG, "Converting key: $label")
+
+ val pattern = dartDatePattern
+ val formatter = SimpleDateFormat(pattern)
+
+ val beginDate = beginDate?.let {
+ try {
+ val formattedDate = formatter.format(it)
+ Log.d(TAG, "Begin date: $formattedDate")
+ DataTypeDate(date = formattedDate, format = pattern)
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+ val endDate = endDate?.let {
+ try {
+ val formattedDate = formatter.format(it)
+ Log.d(TAG, "End date: $formattedDate")
+ DataTypeDate(date = formattedDate, format = pattern)
+ } catch (e: Exception) {
+ null
+ }
+ }
+
+ return MobileKeysKey(
+ label = label,
+ cardNumber = cardNumber,
+ credentialType = type.toLong(),
+ beginDate = beginDate,
+ endDate = endDate,
+ keyId = identifier.value(),
+ externalId = externalId,
+ configUrl = configurationURL,
+ readbackUrl = readbackURL,
+ issuer = issuer,
+ keyType = type.toString(),
+ active = isActivated
+ ).also {
+ Log.d(TAG, "Converted key: ${it.label} (ID: ${it.keyId})")
+ }
+}
\ No newline at end of file
diff --git a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/MobileKeyExtension.kt b/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/MobileKeyExtension.kt
deleted file mode 100644
index e397da72..00000000
--- a/mobilekeys_sdk_plugin/android/src/main/kotlin/com/assaabloy/flutter/seosmobilekeyssdk/seos_mobile_keys_plugin/MobileKeyExtension.kt
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.assaabloy.flutter.seosmobilekeyssdk.seos_mobile_keys_plugin
-
-import com.assaabloy.mobilekeys.api.MobileKey
-import java.text.SimpleDateFormat
-
-fun MobileKey.mobileKeysKey(): MobileKeysKey {
- val pattern = dartDatePattern
- val formatter = SimpleDateFormat(pattern)
- val keyBeginDate = beginDate?.time?.let { DataTypeDate(formatter.format(it), pattern) }
- val keyEndDate = endDate?.time?.let { DataTypeDate(formatter.format(it), pattern) }
- return MobileKeysKey(
- type.toLongOrNull() ?: 1,
- keyBeginDate,
- keyEndDate,
- identifier?.value(),
- externalId,
- label,
- configurationURL,
- readbackURL,
- issuer,
- type,
- cardNumber,
- isActivated,
- )
-}
\ No newline at end of file
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 a7f4a7b5..4435f90c 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
@@ -20,6 +20,9 @@ import android.app.NotificationManager
import androidx.core.app.NotificationCompat
import androidx.core.app.NotificationCompat.BigTextStyle
import androidx.core.content.ContextCompat
+import android.util.Log
+import java.lang.Exception
+import java.text.ParseException
const val dartDatePattern = "yyyy-MM-dd'T'HH:mm:ssZ"
private typealias ResultCompletionCallback = (Result<Unit>) -> Unit
@@ -65,7 +68,7 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
.build()
val scanConfiguration = ScanConfiguration.Builder(
openingTriggers,
- *lockServiceCodes.toTypedArray()
+ 1,2
)
.setBluetoothModeIfSupported(BluetoothMode.DUAL)
.build()
@@ -177,20 +180,21 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
override fun listMobileKeys(callback: (Result<List<MobileKeysKey>>) -> Unit) {
try {
- val keys = mobileKeysApi.mobileKeys
- .listMobileKeys()
- .map {
- it.mobileKeysKey()
- }
- callback(
- Result.success(
- keys
- )
- )
+ Log.d("SeosMobileKeysPlugin", "Attempting to list mobile keys")
+ val rawKeys = mobileKeysApi.mobileKeys.listMobileKeys()
+ Log.d("SeosMobileKeysPlugin", "Raw keys from SDK: $rawKeys")
+
+ val keys = rawKeys.map {
+ Log.d("SeosMobileKeysPlugin", "Converting key: $it")
+ it.mobileKeysKey()
+ }
+ Log.d("SeosMobileKeysPlugin", "Final converted keys list: $keys")
+
+ callback(Result.success(keys))
} catch (e: Exception) {
- callback(
- Result.failure(e)
- )
+ Log.e("SeosMobileKeysPlugin", "Error listing mobile keys", e)
+ Log.e("SeosMobileKeysPlugin", "Stack trace: ${e.stackTraceToString()}")
+ callback(Result.failure(e))
}
}
@@ -236,17 +240,24 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
override fun endpointInfo(callback: (Result<MobileKeysEndpointInfo>) -> Unit) {
try {
- callback(
- Result.success(
- mobileKeysApi.mobileKeys
- .endpointInfo
- .mobileKeysEndpointInfo()
- )
- )
+ Log.d("SeosMobileKeysPlugin", "Attempting to get endpoint info")
+ val endpointInfo = mobileKeysApi.mobileKeys.endpointInfo
+ Log.d("SeosMobileKeysPlugin", "Raw endpoint info: $endpointInfo")
+
+ val convertedInfo = endpointInfo.mobileKeysEndpointInfo()
+ Log.d("SeosMobileKeysPlugin", "Converted endpoint info: $convertedInfo")
+
+ callback(Result.success(convertedInfo))
} catch (e: Exception) {
- callback(
- Result.failure(e)
- )
+ Log.e("SeosMobileKeysPlugin", "Error getting endpoint info", e)
+ when (e) {
+ is ParseException -> {
+ Log.e("SeosMobileKeysPlugin", "ParseException details: ${e.message}")
+ Log.e("SeosMobileKeysPlugin", "Stack trace: ${e.stackTraceToString()}")
+ }
+ else -> Log.e("SeosMobileKeysPlugin", "Other exception: ${e.javaClass.simpleName}")
+ }
+ callback(Result.failure(e))
}
}
@@ -341,7 +352,7 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
TODO("Not yet implemented")
}
- override fun connect(
+ override fun connectToReader(
reader: MobileKeysReader,
openingType: MobileKeysOpeningType,
callback: (Result<Unit>) -> Unit
@@ -349,7 +360,7 @@ class SeosMobileKeysPlugin: FlutterPlugin, AppUsageAPI {
TODO("Not yet implemented")
}
- override fun forceConnect(
+ override fun forceConnectToReader(
reader: MobileKeysReader,
openingType: MobileKeysOpeningType,
callback: (Result<Unit>) -> Unit