Skip to content

Commit

Permalink
Add new 'wallet' module.
Browse files Browse the repository at this point in the history
Test: All unit tests pass
Test: Manually tested all apps

Signed-off-by: David Zeuthen <[email protected]>
  • Loading branch information
davidz25 committed Jan 19, 2024
1 parent 273ed93 commit 3919847
Show file tree
Hide file tree
Showing 33 changed files with 1,256 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,10 @@ reachable on the left side bar of the Android Studio, or by selecting: _View ->
Inside the `Build Variants` panel, at the `appholder` row, the desired flavor can be chosen. Once a
flavor is selected, by running the app it will install it on the target device/emulator.

The `wallet` module is a rewrite of the `appholder` reference application
with an eye towards a production-quality and easily rebrandable identity
wallet application.

## ISO 18013-7 Reader Website

The `wwwverifier` module contains the source code for a website acting as an
Expand Down
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
espresso-core = "3.5.1"
junit-jupiter = "5.10.0"
truth = "1.1.5"
navigation-compose = "2.7.5"

[libraries]
androidx-core-ktx = { module = "androidx.core:core-ktx", version.ref = "core-ktx" }
Expand Down Expand Up @@ -85,6 +86,7 @@
junit-jupiter-engine = { module = "org.junit.jupiter:junit-jupiter-engine", version.ref = "junit-jupiter" }
kotlinx-coroutine-test = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-test", version.ref = "coroutines-version" }
truth = { module = "com.google.truth:truth", version.ref = "truth" }
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigation-compose" }

[bundles]
androidx-core = ["androidx-core-ktx", "androidx-appcompat", "androidx-material", "androidx-contraint-layout", "androidx-fragment-ktx", "androidx-legacy-v4", "androidx-preference-ktx", "androidx-work"]
Expand Down
2 changes: 1 addition & 1 deletion secure-area-test-app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ android {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion '1.4.6'
kotlinCompilerExtensionVersion libs.versions.kotlin.compiler.extension.get()
}
packagingOptions {
resources {
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ dependencyResolutionManagement {
}
}
}
include ':appholder', ':appverifier', ':identity', ':identity-android', ':secure-area-test-app', ':wwwverifier'
include ':appholder', ':appverifier', ':identity', ':identity-android', ':secure-area-test-app', ':wwwverifier', ':wallet'
rootProject.name = 'Identity Credential'

1 change: 1 addition & 0 deletions wallet/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
70 changes: 70 additions & 0 deletions wallet/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
plugins {
alias(libs.plugins.android.application)
alias(libs.plugins.kotlin.android)
}

android {
namespace 'com.android.identity_credential.wallet'
compileSdk 34

defaultConfig {
applicationId "com.android.identity_credential.wallet"
minSdk 27
targetSdk 34
versionCode 1
versionName "1.0"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
useSupportLibrary true
}
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
kotlinOptions {
jvmTarget = '11'
}
buildFeatures {
compose true
}
composeOptions {
kotlinCompilerExtensionVersion libs.versions.kotlin.compiler.extension.get()
}
packagingOptions {
resources {
excludes += '/META-INF/{AL2.0,LGPL2.1}'
}
}
}

dependencies {
implementation project(':identity')
implementation project(':identity-android')

implementation libs.cbor
implementation libs.androidx.core.ktx
implementation libs.bundles.androidx.lifecycle
implementation libs.androidx.activity.compose
implementation libs.bundles.androidx.navigation
implementation platform(libs.compose.bom)
implementation libs.compose.ui.tooling
implementation libs.compose.material
implementation libs.bundles.bouncy.castle
implementation libs.androidx.navigation.compose
debugImplementation libs.compose.icons

androidTestImplementation libs.androidx.test.ext.junit
androidTestImplementation libs.androidx.test.espresso
androidTestImplementation platform(libs.compose.bom)
testImplementation libs.bundles.unit.testing
testRuntimeOnly libs.junit.jupiter.engine
}
21 changes: 21 additions & 0 deletions wallet/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
package com.android.identity_credential.wallet

import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.ext.junit.runners.AndroidJUnit4

import org.junit.Test
import org.junit.runner.RunWith

import org.junit.Assert.*

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.android.identity_credential.wallet", appContext.packageName)
}
}
25 changes: 25 additions & 0 deletions wallet/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:name=".WalletApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.IdentityCredential">
<activity
android:name=".MainActivity"
android:exported="true"
android:label="@string/app_name"
android:theme="@style/Theme.IdentityCredential">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Loading

0 comments on commit 3919847

Please sign in to comment.