Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 37 additions & 32 deletions app/src/main/assets/databasenew.json

Large diffs are not rendered by default.

Binary file modified app/src/main/assets/openid4vp1_0.wasm
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -46,5 +46,7 @@ data class CredentialKeyHardware(
data class CredentialDisplayData(
val title: String,
val subtitle: String?,
val icon: String?
val icon: String?,
val explainer: String? = null,
val metadataDisplayText: String? = null,
)
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ class CredentialRepository {
val displayName = item.config.claims?.firstOrNull{
it.path[0] == namespace && it.path[1] == element
}?.display?.first()?.name!!
val namespaceData = mdoc.issuerSignedNamespaces[namespace]?.get(element)
mdocFields.add(
MdocField(
namespace = namespace,
Expand All @@ -261,7 +262,7 @@ class CredentialRepository {
fieldDisplayPropertySet = setOf(
VerificationFieldDisplayProperties(
displayName = displayName,
// displayValue = namespaceData.value.displayValue
displayValue = namespaceData as? String
)
)
)
Expand All @@ -277,7 +278,9 @@ class CredentialRepository {
subtitle = item.displayData.subtitle,
icon = item.displayData.icon?.decodeBase64()?.let {
BitmapFactory.decodeByteArray(it, 0, it.size)
} ?: CmWalletApplication.walletIcon
} ?: CmWalletApplication.walletIcon,
explainer = item.displayData.explainer,
metadataDisplayText = item.displayData.metadataDisplayText
)),
id = item.id,
))
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ktorClient = "3.0.1"
lifecycleRuntimeKtx = "2.6.1"
activityCompose = "1.10.0"
composeBom = "2024.12.01"
registryDigitalcredentialsMdoc = "1.0.0-alpha04"
registryDigitalcredentialsMdoc = "1.0.0-SNAPSHOT"
lifecycleRuntimeComposeAndroid = "2.8.7"
roomRuntime = "2.6.1"
fragment = "1.8.5"
Expand Down
5 changes: 5 additions & 0 deletions matcher/credentialmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,11 @@ __attribute__((import_module("credman_v4"), import_name("SelfDeclarePackageInfo"
#endif
void SelfDeclarePackageInfo(const char* package_display_name, const char* package_icon, size_t package_icon_len);

#if defined(__wasm__)
__attribute__((import_module("credman_v5"), import_name("AddMetadataDisplayTextToEntrySet")))
#endif
void AddMetadataDisplayTextToEntrySet(const char *cred_id, const char *metadata_display_text, const char *set_id, int set_index);

#ifdef __cplusplus
}
#endif
Expand Down
7 changes: 6 additions & 1 deletion matcher/openid4vp1_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ void report_matched_credential(uint32_t wasm_version, cJSON* matched_doc, cJSON*
cJSON* c_display = cJSON_GetObjectItem(cJSON_GetObjectItem(c, "display"), "verification");
char *title = cJSON_GetStringValue(cJSON_GetObjectItem(c_display, "title"));
char *subtitle = cJSON_GetStringValue(cJSON_GetObjectItem(c_display, "subtitle"));
char *explainer = cJSON_GetStringValue(cJSON_GetObjectItem(c_display, "explainer"));
char *metadata_display_text = cJSON_GetStringValue(cJSON_GetObjectItem(c_display, "metadata_display_text"));
cJSON *icon = cJSON_GetObjectItem(c_display, "icon");
int icon_start_int = 0;
int icon_len = 0;
Expand All @@ -129,7 +131,7 @@ void report_matched_credential(uint32_t wasm_version, cJSON* matched_doc, cJSON*
if (wasm_version > 1)
{
printf("AddEntryToSet %s, metadata: %s\n", matched_id, metadata);
AddEntryToSet(matched_id, creds_blob + icon_start_int, icon_len, title, subtitle, NULL, NULL, metadata, set_id, doc_idx);
AddEntryToSet(matched_id, creds_blob + icon_start_int, icon_len, title, subtitle, explainer, NULL, metadata, set_id, doc_idx);
}
else
{ // TODO: remove
Expand Down Expand Up @@ -161,6 +163,9 @@ void report_matched_credential(uint32_t wasm_version, cJSON* matched_doc, cJSON*
AddFieldForStringIdEntry(id, claim_display, claim_value);
}
}
if (wasm_version >= 5) {
AddMetadataDisplayTextToEntrySet(matched_id, metadata_display_text, set_id, doc_idx);
}
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ dependencyResolutionManagement {
repositories {
google()
mavenCentral()
maven(url="https://androidx.dev/snapshots/builds/14144115/artifacts/repository")
maven(url="https://androidx.dev/snapshots/builds/14903984/artifacts/repository")
}
}

Expand Down
69 changes: 37 additions & 32 deletions testdata/database.json

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions testdata/database_in.json
Original file line number Diff line number Diff line change
Expand Up @@ -1879,7 +1879,10 @@
]
},
"displayData": {
"title": "Jon's Boarding Pass"
"title": "Jon's Boarding Pass",
"subtitle": "SFO to DEN",
"metadataDisplayText": "Boarding pass info",
"explainer": "[Google's privacy policy](www.google.com) describes how your data is being handled by Google Wallet. Look to [TSA's privacy policy](www.google.com) to learn how your data is being handled by TSA"

},
"credentials": [
Expand Down Expand Up @@ -2001,8 +2004,9 @@
]
},
"displayData": {
"title": "Jane's ID Pass"

"title": "Jane's ID Pass",
"subtitle": "Elisa Beckett",
"explainer": "[Google's privacy policy](www.google.com) describes how your data is being handled by Google Wallet. Look to [TSA's privacy policy](www.google.com) to learn how your data is being handled by TSA"
},
"credentials": [
{
Expand Down