Skip to content

Commit 1357c90

Browse files
committed
Port DirectAccess feature from Wallet to TestApp.
- Wallet DirectAccess code ported into multipaz.directaccess module. - Refactored to avoid APDU initialization lock up (removed runBlocking calls). - Removed explicit document slot handling in favor of automatic handling as there is only one slot available so far. - Improved APDU calling logic to avoid calls without requesting document slot. Test: All Unit tests are passing (bar KI). Test: Manually tested via samples/testapp on Android and iOS. Signed-off-by: koukarine <koukarine@google.com>
1 parent 6734026 commit 1357c90

File tree

27 files changed

+1951
-29
lines changed

27 files changed

+1951
-29
lines changed

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ androidx-core-ktx = "1.16.0"
99
androidx-espresso-core = "3.7.0"
1010
androidx-material = "1.12.0"
1111
androidx-test-junit = "1.3.0"
12+
annotation = "1.9.1"
1213
compose-plugin = "1.8.2"
1314
faceDetection = "16.1.7"
1415
junit = "4.13.2"
@@ -59,6 +60,7 @@ litertMetadata = "1.4.0"
5960
litertSupport = "1.4.0"
6061

6162
[libraries]
63+
androidx-annotation = { module = "androidx.annotation:annotation", version.ref = "annotation" }
6264
androidx-ui-tooling-preview = { module = "androidx.compose.ui:ui-tooling-preview", version.ref = "uiToolingPreview" }
6365
face-detection = { module = "com.google.mlkit:face-detection", version.ref = "faceDetection" }
6466
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }

multipaz-directaccess/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi
2+
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
3+
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSetTree
4+
5+
plugins {
6+
alias(libs.plugins.kotlinMultiplatform)
7+
alias(libs.plugins.androidLibrary)
8+
id("maven-publish")
9+
}
10+
11+
val projectVersionName: String by rootProject.extra
12+
13+
kotlin {
14+
jvmToolchain(17)
15+
16+
androidTarget {
17+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
18+
instrumentedTestVariant.sourceSetTree.set(KotlinSourceSetTree.test)
19+
20+
@OptIn(ExperimentalKotlinGradlePluginApi::class)
21+
compilerOptions {
22+
jvmTarget.set(JvmTarget.JVM_17)
23+
}
24+
25+
publishLibraryVariants("release")
26+
}
27+
28+
listOf(
29+
iosX64(),
30+
iosArm64(),
31+
iosSimulatorArm64()
32+
).forEach {
33+
val platform = when (it.name) {
34+
"iosX64" -> "iphonesimulator"
35+
"iosArm64" -> "iphoneos"
36+
"iosSimulatorArm64" -> "iphonesimulator"
37+
else -> error("Unsupported target ${it.name}")
38+
}
39+
it.binaries.all {
40+
linkerOpts(
41+
"-L/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/${platform}/",
42+
)
43+
}
44+
}
45+
46+
sourceSets {
47+
val commonMain by getting {
48+
dependencies {
49+
implementation(project(":multipaz"))
50+
}
51+
}
52+
53+
val commonTest by getting {
54+
dependencies {
55+
implementation(libs.kotlin.test)
56+
implementation(libs.kotlinx.coroutines.test)
57+
}
58+
}
59+
60+
val androidMain by getting {
61+
dependencies {
62+
implementation(project(":multipaz"))
63+
implementation(libs.androidx.annotation)
64+
implementation(libs.kotlinx.datetime)
65+
implementation(libs.kotlinx.io.bytestring)
66+
implementation(libs.kotlinx.serialization.json)
67+
implementation(libs.bouncy.castle.bcprov)
68+
69+
api(project(":multipaz"))
70+
}
71+
}
72+
}
73+
}
74+
75+
android {
76+
namespace = "org.multipaz.mlkit"
77+
compileSdk = libs.versions.android.compileSdk.get().toInt()
78+
79+
defaultConfig {
80+
minSdk = 26
81+
testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
82+
}
83+
84+
compileOptions {
85+
sourceCompatibility = JavaVersion.VERSION_17
86+
targetCompatibility = JavaVersion.VERSION_17
87+
}
88+
dependencies {
89+
debugImplementation(libs.androidx.ui.tooling.preview)
90+
androidTestImplementation(libs.compose.junit4)
91+
debugImplementation(libs.compose.test.manifest)
92+
}
93+
94+
packaging {
95+
resources {
96+
excludes += listOf("/META-INF/{AL2.0,LGPL2.1}")
97+
excludes += listOf("/META-INF/versions/9/OSGI-INF/MANIFEST.MF")
98+
}
99+
}
100+
101+
publishing {
102+
singleVariant("release") {
103+
withSourcesJar()
104+
}
105+
}
106+
}
107+
108+
group = "org.multipaz"
109+
version = projectVersionName
110+
111+
publishing {
112+
repositories {
113+
maven {
114+
url = uri("${rootProject.rootDir}/repo")
115+
}
116+
}
117+
publications.withType(MavenPublication::class) {
118+
pom {
119+
licenses {
120+
license {
121+
name = "Apache 2.0"
122+
url = "https://opensource.org/licenses/Apache-2.0"
123+
}
124+
}
125+
}
126+
}
127+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
3+
4+
</manifest>

0 commit comments

Comments
 (0)