Skip to content

Commit

Permalink
Introduce IC Wallet and IC Purse Flavors for Holder (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
mitrejcevski authored Oct 4, 2023
1 parent f2293ea commit 0a47c45
Show file tree
Hide file tree
Showing 102 changed files with 334 additions and 425 deletions.
16 changes: 13 additions & 3 deletions appholder/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ plugins {
}

android {
namespace "com.android.identity.wallet"
compileSdk libs.versions.compile.sdk.get() as int

defaultConfig {
applicationId "com.android.mdl.app"
applicationId "com.android.identity.wallet"
minSdkVersion libs.versions.min.sdk.get() as int
targetSdkVersion libs.versions.compile.sdk.get() as int
versionCode 1
Expand All @@ -27,6 +28,17 @@ android {
}
}

flavorDimensions.addAll("standard")
productFlavors {
wallet {
dimension "standard"
}
purse {
dimension "standard"
applicationIdSuffix ".purse"
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
Expand All @@ -46,15 +58,13 @@ android {
kotlinCompilerExtensionVersion libs.versions.kotlin.compiler.extension.get()
}


testOptions.unitTests.all {
useJUnitPlatform()
testLogging {
events 'passed', 'failed', 'skipped', 'standardOut', 'standardError'
}
}

namespace 'com.android.mdl.app'
lint {
lintConfig file('lint.xml')
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package com.android.mdl.app
package com.android.identity.wallet

import android.app.Application
import com.android.identity.android.util.AndroidLogPrinter
import com.android.identity.util.Logger
import com.android.mdl.app.util.PreferencesHelper
import com.android.identity.wallet.util.PreferencesHelper
import com.google.android.material.color.DynamicColors

class HolderApp: Application() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app
package com.android.identity.wallet

import android.app.PendingIntent
import android.content.Intent
Expand All @@ -15,12 +15,12 @@ import androidx.navigation.ui.NavigationUI.setupActionBarWithNavController
import androidx.navigation.ui.setupWithNavController
import com.android.identity.mdoc.origininfo.OriginInfo
import com.android.identity.mdoc.origininfo.OriginInfoReferrerUrl
import com.android.mdl.app.databinding.ActivityMainBinding
import com.android.mdl.app.util.log
import com.android.mdl.app.util.logError
import com.android.mdl.app.util.logInfo
import com.android.mdl.app.util.logWarning
import com.android.mdl.app.viewmodel.ShareDocumentViewModel
import com.android.identity.wallet.databinding.ActivityMainBinding
import com.android.identity.wallet.util.log
import com.android.identity.wallet.util.logError
import com.android.identity.wallet.util.logInfo
import com.android.identity.wallet.util.logWarning
import com.android.identity.wallet.viewmodel.ShareDocumentViewModel
import com.google.android.material.elevation.SurfaceColors
import java.security.Security
import org.bouncycastle.jce.provider.BouncyCastleProvider
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.adapter
package com.android.identity.wallet.adapter

import android.icu.text.SimpleDateFormat
import android.widget.TextView
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.android.mdl.app.adapter
package com.android.identity.wallet.adapter


import android.view.LayoutInflater
Expand All @@ -24,10 +24,10 @@ import androidx.navigation.findNavController
import androidx.recyclerview.widget.DiffUtil
import androidx.recyclerview.widget.ListAdapter
import androidx.recyclerview.widget.RecyclerView
import com.android.mdl.app.R
import com.android.mdl.app.databinding.ListItemDocumentBinding
import com.android.mdl.app.document.DocumentInformation
import com.android.mdl.app.wallet.SelectDocumentFragmentDirections
import com.android.identity.wallet.R
import com.android.identity.wallet.databinding.ListItemDocumentBinding
import com.android.identity.wallet.document.DocumentInformation
import com.android.identity.wallet.wallet.SelectDocumentFragmentDirections

/**
* Adapter for the [RecyclerView].
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import android.content.DialogInterface
import android.os.Bundle
Expand All @@ -22,13 +22,13 @@ import androidx.navigation.fragment.navArgs
import com.android.identity.android.securearea.AndroidKeystoreSecureArea
import com.android.identity.securearea.BouncyCastleSecureArea
import com.android.identity.securearea.SecureArea.ALGORITHM_ES256
import com.android.mdl.app.R
import com.android.mdl.app.authprompt.UserAuthPromptBuilder
import com.android.mdl.app.theme.HolderAppTheme
import com.android.mdl.app.transfer.AddDocumentToResponseResult
import com.android.mdl.app.util.DocumentData
import com.android.mdl.app.util.log
import com.android.mdl.app.viewmodel.TransferDocumentViewModel
import com.android.identity.wallet.R
import com.android.identity.wallet.authprompt.UserAuthPromptBuilder
import com.android.identity.wallet.theme.HolderAppTheme
import com.android.identity.wallet.transfer.AddDocumentToResponseResult
import com.android.identity.wallet.util.DocumentData
import com.android.identity.wallet.util.log
import com.android.identity.wallet.viewmodel.TransferDocumentViewModel
import com.google.android.material.bottomsheet.BottomSheetDialogFragment
import kotlinx.coroutines.launch

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import android.content.res.Configuration.UI_MODE_NIGHT_YES
import androidx.compose.animation.AnimatedVisibility
Expand Down Expand Up @@ -43,9 +43,9 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.android.mdl.app.R
import com.android.mdl.app.authconfirmation.ConfirmationSheetData.DocumentElement
import com.android.mdl.app.theme.HolderAppTheme
import com.android.identity.wallet.R
import com.android.identity.wallet.authconfirmation.ConfirmationSheetData.DocumentElement
import com.android.identity.wallet.theme.HolderAppTheme

@Composable
fun ConfirmationSheet(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import androidx.compose.runtime.Immutable
import androidx.compose.runtime.Stable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

sealed class PassphraseAuthResult {
object Idle: PassphraseAuthResult()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import android.os.Bundle
import android.view.LayoutInflater
Expand Down Expand Up @@ -32,9 +32,9 @@ import androidx.fragment.app.DialogFragment
import androidx.fragment.app.activityViewModels
import androidx.navigation.fragment.findNavController
import androidx.navigation.fragment.navArgs
import com.android.mdl.app.R
import com.android.mdl.app.composables.PreviewLightDark
import com.android.mdl.app.theme.HolderAppTheme
import com.android.identity.wallet.R
import com.android.identity.wallet.composables.PreviewLightDark
import com.android.identity.wallet.theme.HolderAppTheme

class PassphrasePrompt : DialogFragment() {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import androidx.lifecycle.ViewModel
import kotlinx.coroutines.flow.MutableStateFlow
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

import com.android.identity.mdoc.request.DeviceRequestParser

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

data class RequestedElement(
val namespace: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

class SignedDocumentData(
private val signedElements: List<RequestedElement>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authconfirmation
package com.android.identity.wallet.authconfirmation

class SignedElementsCollection {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authprompt
package com.android.identity.wallet.authprompt

import androidx.biometric.BiometricPrompt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.authprompt
package com.android.identity.wallet.authprompt

import androidx.biometric.BiometricManager
import androidx.biometric.BiometricManager.Authenticators.BIOMETRIC_STRONG
Expand All @@ -7,7 +7,7 @@ import androidx.biometric.BiometricManager.BIOMETRIC_SUCCESS
import androidx.biometric.BiometricPrompt
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.android.mdl.app.util.log
import com.android.identity.wallet.util.log

class UserAuthPromptBuilder private constructor(private val fragment: Fragment) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.android.mdl.app.composables
package com.android.identity.wallet.composables

import androidx.annotation.StringRes
import androidx.compose.ui.graphics.Brush
import com.android.mdl.app.R
import com.android.mdl.app.document.DocumentColor
import com.android.mdl.app.document.SecureAreaImplementationState
import com.android.mdl.app.theme.BlueGradient
import com.android.mdl.app.theme.GreenGradient
import com.android.mdl.app.theme.RedGradient
import com.android.mdl.app.theme.YellowGradient
import com.android.identity.wallet.R
import com.android.identity.wallet.document.DocumentColor
import com.android.identity.wallet.document.SecureAreaImplementationState
import com.android.identity.wallet.theme.BlueGradient
import com.android.identity.wallet.theme.GreenGradient
import com.android.identity.wallet.theme.RedGradient
import com.android.identity.wallet.theme.YellowGradient

@StringRes
fun keystoreNameFor(implementation: SecureAreaImplementationState): Int {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.composables
package com.android.identity.wallet.composables

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -9,7 +9,7 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import com.android.mdl.app.theme.HolderAppTheme
import com.android.identity.wallet.theme.HolderAppTheme

@Composable
fun LoadingIndicator(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.android.mdl.app.composables
package com.android.identity.wallet.composables

import android.content.res.Configuration
import androidx.compose.ui.tooling.preview.Preview
Expand Down
Loading

0 comments on commit 0a47c45

Please sign in to comment.