diff --git a/build.gradle b/build.gradle index b3788245..9514586e 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = "1.4.31" + ext.kotlin_version = "1.5.30" repositories { google() mavenCentral() diff --git a/common/build.gradle b/common/build.gradle index 27e30667..61c8d5d6 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -62,19 +62,19 @@ android { dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - api 'ch.admin.bag.covidcertificate:sdk-android:1.3.1' - api 'ch.admin.bag.covidcertificate:sdk-core:1.1.4' + api 'ch.admin.bag.covidcertificate:sdk-android:1.5' + api 'ch.admin.bag.covidcertificate:sdk-core:2.0' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.fragment:fragment-ktx:1.3.3' - implementation 'com.google.android.material:material:1.3.0' + implementation 'androidx.core:core-ktx:1.6.0' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.fragment:fragment-ktx:1.3.6' + implementation 'com.google.android.material:material:1.4.0' implementation 'androidx.security:security-crypto:1.0.0' kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.12.0' - api 'androidx.camera:camera-camera2:1.0.0' - api 'androidx.camera:camera-view:1.0.0-alpha25' - api 'androidx.camera:camera-lifecycle:1.0.0' + api 'androidx.camera:camera-camera2:1.0.1' + api 'androidx.camera:camera-view:1.0.0-alpha28' + api 'androidx.camera:camera-lifecycle:1.0.1' api "com.augustcellars.cose:cose-java:1.1.0" api 'org.bouncycastle:bcprov-jdk15on:1.69' diff --git a/common/src/main/res/values-de/strings.xml b/common/src/main/res/values-de/strings.xml index 6ec9c53b..14483d58 100644 --- a/common/src/main/res/values-de/strings.xml +++ b/common/src/main/res/values-de/strings.xml @@ -938,6 +938,7 @@ erstellt werden" "nur muss keine" + "reduziert" @@ -1024,4 +1025,9 @@ Das «Zertifikat Light» ist lediglich elektronisch innerhalb der App verfügbar "Sprache" + + + + "Date format used: dd.mm.yyyy" + "Hersteller/ Name" \ No newline at end of file diff --git a/common/src/main/res/values-fr/strings.xml b/common/src/main/res/values-fr/strings.xml index 6ad9368f..eba47ce3 100644 --- a/common/src/main/res/values-fr/strings.xml +++ b/common/src/main/res/values-fr/strings.xml @@ -906,9 +906,11 @@ et avec un document d’identité" "n’est utilisable qu’en doit être aucun" + "réduit" + "étendu" @@ -990,4 +992,9 @@ Le certificat light, reconnu uniquement en Suisse, n’est disponible que sous f "Langue" + + + + "Date format used: dd.mm.yyyy" + "Fabricant/ Nom" \ No newline at end of file diff --git a/common/src/main/res/values-it/strings.xml b/common/src/main/res/values-it/strings.xml index bd0ca392..f230fec4 100644 --- a/common/src/main/res/values-it/strings.xml +++ b/common/src/main/res/values-it/strings.xml @@ -911,9 +911,11 @@ con un documento di legittimazione" "solamente deve alcun" + "compressa" + "espansa" @@ -995,4 +997,9 @@ Il «certificato light» è disponibile unicamente in versione elettronica nell' "Lingua" + + + + "Date format used: dd.mm.yyyy" + "Fabbricante/ Nome" \ No newline at end of file diff --git a/common/src/main/res/values-rm/strings.xml b/common/src/main/res/values-rm/strings.xml index 997357c5..6df09077 100644 --- a/common/src/main/res/values-rm/strings.xml +++ b/common/src/main/res/values-rm/strings.xml @@ -50,7 +50,7 @@ "Agiuntar" - "Certificat covid" + "Certificat COVID" "Scannai il code QR sin il certificat COVID per al agiuntar a l'app." @@ -905,9 +905,11 @@ e mo en Svizra" "mo danovamain nagins" + "reducì" + "extendì" @@ -989,4 +991,9 @@ Il «certificat light» è disponibel mo en moda electronica entaifer l'app e ve "Lingua" + + + + "Date format used: dd.mm.yyyy" + "Producent/ Num" \ No newline at end of file diff --git a/common/src/main/res/values/strings.xml b/common/src/main/res/values/strings.xml index 6a5988ce..c30c6eed 100644 --- a/common/src/main/res/values/strings.xml +++ b/common/src/main/res/values/strings.xml @@ -766,7 +766,7 @@ invalid" However, in order to show whether your certificate meets Switzerland’s validity criteria and how long it is valid for, the COVID Certificate app has to be online at regular intervals." "What are the current validity criteria in Switzerland?" - "The current validity period of Covid certificates can be found here:" + "The current validity period of COVID certificates can be found here:" "Further information" "https://www.bag.admin.ch/bag/en/home/krankheiten/ausbrueche-epidemien-pandemien/aktuelle-ausbrueche-epidemien/novel-cov/covid-zertifikat.html#-837133624" "Is it possible to verify the certificates offline?" @@ -907,9 +907,11 @@ and in combination with an identity document" "only has to does not" + "reduced" + "expanded" @@ -991,4 +993,9 @@ The 'Certificate light' is only available electronically in the app and is only "Language" + + + + "Date format used: dd.mm.yyyy" + "Manufacturer/ Name" \ No newline at end of file diff --git a/verifier/build.gradle b/verifier/build.gradle index a544c969..28e4be99 100644 --- a/verifier/build.gradle +++ b/verifier/build.gradle @@ -40,8 +40,8 @@ android { applicationId "ch.admin.bag.covidcertificate.verifier" minSdkVersion 23 targetSdkVersion 30 - versionCode 2400 - versionName "2.4.0" + versionCode 2500 + versionName "2.5.0" // Stops the Gradle plugin’s automatic rasterization of vectors generatedDensities = [] @@ -117,15 +117,15 @@ sonarqube { dependencies { implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.4.0' implementation project(':common') coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.fragment:fragment-ktx:1.3.3' + implementation 'androidx.core:core-ktx:1.6.0' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.0' + implementation 'androidx.fragment:fragment-ktx:1.3.6' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' implementation "androidx.viewpager2:viewpager2:1.0.0" @@ -133,11 +133,11 @@ dependencies { implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-moshi:2.9.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0' implementation 'com.squareup.moshi:moshi:1.12.0' kapt "com.squareup.moshi:moshi-kotlin-codegen:1.12.0" - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } \ No newline at end of file diff --git a/wallet/build.gradle b/wallet/build.gradle index c2275bf3..6e304816 100644 --- a/wallet/build.gradle +++ b/wallet/build.gradle @@ -40,8 +40,8 @@ android { applicationId "ch.admin.bag.covidcertificate.wallet" minSdkVersion 23 targetSdkVersion 30 - versionCode 2400 - versionName "2.4.0" + versionCode 2500 + versionName "2.5.0" // Stops the Gradle plugin’s automatic rasterization of vectors generatedDensities = [] @@ -124,13 +124,13 @@ dependencies { coreLibraryDesugaring 'com.android.tools:desugar_jdk_libs:1.1.5' implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" - implementation 'com.google.android.material:material:1.3.0' + implementation 'com.google.android.material:material:1.4.0' implementation project(':common') - implementation 'androidx.core:core-ktx:1.3.2' - implementation 'androidx.appcompat:appcompat:1.2.0' - implementation 'androidx.constraintlayout:constraintlayout:2.0.4' - implementation 'androidx.fragment:fragment-ktx:1.3.3' + implementation 'androidx.core:core-ktx:1.6.0' + implementation 'androidx.appcompat:appcompat:1.3.1' + implementation 'androidx.constraintlayout:constraintlayout:2.1.0' + implementation 'androidx.fragment:fragment-ktx:1.3.6' implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0' implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1' implementation 'androidx.viewpager2:viewpager2:1.0.0' @@ -139,11 +139,11 @@ dependencies { implementation 'com.squareup.retrofit2:retrofit:2.9.0' implementation 'com.squareup.retrofit2:converter-moshi:2.9.0' - implementation 'com.squareup.okhttp3:logging-interceptor:4.7.2' + implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0' implementation 'com.squareup.moshi:moshi:1.12.0' kapt 'com.squareup.moshi:moshi-kotlin-codegen:1.12.0' - testImplementation 'junit:junit:4.+' - androidTestImplementation 'androidx.test.ext:junit:1.1.2' - androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' + testImplementation 'junit:junit:4.13.2' + androidTestImplementation 'androidx.test.ext:junit:1.1.3' + androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0' } \ No newline at end of file diff --git a/wallet/src/main/java/ch/admin/bag/covidcertificate/wallet/detail/CertificateDetailItemListBuilder.kt b/wallet/src/main/java/ch/admin/bag/covidcertificate/wallet/detail/CertificateDetailItemListBuilder.kt index 14ed3976..1f1433a8 100644 --- a/wallet/src/main/java/ch/admin/bag/covidcertificate/wallet/detail/CertificateDetailItemListBuilder.kt +++ b/wallet/src/main/java/ch/admin/bag/covidcertificate/wallet/detail/CertificateDetailItemListBuilder.kt @@ -18,23 +18,16 @@ import ch.admin.bag.covidcertificate.sdk.android.extensions.DEFAULT_DISPLAY_DATE import ch.admin.bag.covidcertificate.sdk.android.extensions.DEFAULT_DISPLAY_DATE_TIME_FORMATTER import ch.admin.bag.covidcertificate.sdk.android.extensions.prettyPrint import ch.admin.bag.covidcertificate.sdk.android.extensions.prettyPrintIsoDateTime -import ch.admin.bag.covidcertificate.sdk.core.extensions.getCertificateIdentifier -import ch.admin.bag.covidcertificate.sdk.core.extensions.getFormattedResultDate -import ch.admin.bag.covidcertificate.sdk.core.extensions.getFormattedSampleDate -import ch.admin.bag.covidcertificate.sdk.core.extensions.getIssuer -import ch.admin.bag.covidcertificate.sdk.core.extensions.getNumberOverTotalDose -import ch.admin.bag.covidcertificate.sdk.core.extensions.getRecoveryCountry -import ch.admin.bag.covidcertificate.sdk.core.extensions.getTestCenter -import ch.admin.bag.covidcertificate.sdk.core.extensions.getTestCountry -import ch.admin.bag.covidcertificate.sdk.core.extensions.getVaccinationCountry -import ch.admin.bag.covidcertificate.sdk.core.extensions.isNegative -import ch.admin.bag.covidcertificate.sdk.core.extensions.isNotFullyProtected -import ch.admin.bag.covidcertificate.sdk.core.extensions.isTargetDiseaseCorrect +import ch.admin.bag.covidcertificate.sdk.core.extensions.* import ch.admin.bag.covidcertificate.sdk.core.models.healthcert.CertificateHolder import ch.admin.bag.covidcertificate.sdk.core.models.healthcert.eu.DccCert import ch.admin.bag.covidcertificate.wallet.R -class CertificateDetailItemListBuilder(val context: Context, val certificateHolder: CertificateHolder, val showEnglishVersion: Boolean = true) { +class CertificateDetailItemListBuilder( + val context: Context, + val certificateHolder: CertificateHolder, + val showEnglishVersion: Boolean = true +) { private val showEnglishVersionForLabels = showEnglishVersion && LocaleUtil.isSystemLangNotEnglish(context) fun buildAll(): List { @@ -66,24 +59,42 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold for (vaccinationEntry in vaccinations) { detailItems.add(DividerItem) - detailItems.add(ValueItem(R.string.wallet_certificate_impfdosis_title, vaccinationEntry.getNumberOverTotalDose(), - showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_impfdosis_title, vaccinationEntry.getNumberOverTotalDose(), + showEnglishVersionForLabels + ) + ) // Vaccine data if (vaccinationEntry.isTargetDiseaseCorrect()) { detailItems.add( - ValueItem(R.string.wallet_certificate_target_disease_title, + ValueItem( + R.string.wallet_certificate_target_disease_title, context.getString(R.string.target_disease_name), - showEnglishVersionForLabels) + showEnglishVersionForLabels + ) ) } val acceptedTestProvider = AcceptedVaccineProvider.getInstance(context) - detailItems.add(ValueItem(R.string.wallet_certificate_vaccine_prophylaxis, - acceptedTestProvider.getProphylaxis(vaccinationEntry), showEnglishVersionForLabels)) - detailItems.add(ValueItem(R.string.wallet_certificate_impfstoff_product_name_title, - acceptedTestProvider.getVaccineName(vaccinationEntry), showEnglishVersionForLabels)) - detailItems.add(ValueItem(R.string.wallet_certificate_impfstoff_holder, - acceptedTestProvider.getAuthHolder(vaccinationEntry), showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_vaccine_prophylaxis, + acceptedTestProvider.getProphylaxis(vaccinationEntry), showEnglishVersionForLabels + ) + ) + detailItems.add( + ValueItem( + R.string.wallet_certificate_impfstoff_product_name_title, + acceptedTestProvider.getVaccineName(vaccinationEntry), showEnglishVersionForLabels + ) + ) + detailItems.add( + ValueItem( + R.string.wallet_certificate_impfstoff_holder, + acceptedTestProvider.getAuthHolder(vaccinationEntry), showEnglishVersionForLabels + ) + ) // Vaccination date + country detailItems.add(DividerItem) @@ -96,31 +107,34 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold ) detailItems.add( - ValueItem(R.string.wallet_certificate_vaccination_country_title, + ValueItem( + R.string.wallet_certificate_vaccination_country_title, vaccinationEntry.getVaccinationCountry(showEnglishVersionForLabels), showEnglishVersionForLabels - )) + ) + ) // Issuer detailItems.add(DividerItem) - detailItems.add(ValueItem(R.string.wallet_certificate_vaccination_issuer_title, - vaccinationEntry.getIssuer(), showEnglishVersionForLabels)) - detailItems.add(ValueItem(R.string.wallet_certificate_identifier, - vaccinationEntry.getCertificateIdentifier(), - false)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_vaccination_issuer_title, + vaccinationEntry.getIssuer(), showEnglishVersionForLabels + ) + ) + detailItems.add( + ValueItem( + R.string.wallet_certificate_identifier, + vaccinationEntry.getCertificateIdentifier(), + false + ) + ) var issuerText: Int = R.string.wallet_certificate_date if (vaccinationEntry.isNotFullyProtected()) { issuerText = R.string.wallet_certificate_evidence_creation_date } certificateHolder.issuedAt?.prettyPrint(DEFAULT_DISPLAY_DATE_TIME_FORMATTER)?.let { dateString -> - val dateText = context.getString(issuerText).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateText)) - if (showEnglishVersionForLabels) { - val dateTextEnglish = - getEnglishTranslation(context, issuerText).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateTextEnglish, true)) - } - + detailItems.addAll(getIssuedAtLabbels(issuerText, dateString)) } } return detailItems @@ -143,9 +157,11 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold detailItems.add(DividerItem) if (recoveryEntry.isTargetDiseaseCorrect()) { detailItems.add( - ValueItem(R.string.wallet_certificate_target_disease_title, + ValueItem( + R.string.wallet_certificate_target_disease_title, context.getString(R.string.target_disease_name), - showEnglishVersionForLabels) + showEnglishVersionForLabels + ) ) } @@ -158,24 +174,26 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold ) ) - detailItems.add(ValueItem(R.string.wallet_certificate_test_land, - recoveryEntry.getRecoveryCountry(showEnglishVersionForLabels), showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_test_land, + recoveryEntry.getRecoveryCountry(showEnglishVersionForLabels), showEnglishVersionForLabels + ) + ) // Issuer detailItems.add(DividerItem) - detailItems.add(ValueItem(R.string.wallet_certificate_vaccination_issuer_title, - recoveryEntry.getIssuer(), - showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_vaccination_issuer_title, + recoveryEntry.getIssuer(), + showEnglishVersionForLabels + ) + ) detailItems.add(ValueItem(R.string.wallet_certificate_identifier, recoveryEntry.getCertificateIdentifier(), false)) certificateHolder.issuedAt?.prettyPrint(DEFAULT_DISPLAY_DATE_TIME_FORMATTER)?.let { dateString -> - val dateText = context.getString(R.string.wallet_certificate_date).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateText)) - if (showEnglishVersionForLabels) { - val dateTextEnglish = - getEnglishTranslation(context, R.string.wallet_certificate_date).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateTextEnglish, true)) - } + detailItems.addAll(getIssuedAtLabbels(R.string.wallet_certificate_date, dateString)) } } return detailItems @@ -200,9 +218,11 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold // Test result if (testEntry.isTargetDiseaseCorrect()) { detailItems.add( - ValueItem(R.string.wallet_certificate_target_disease_title, + ValueItem( + R.string.wallet_certificate_target_disease_title, context.getString(R.string.target_disease_name), - showEnglishVersionForLabels) + showEnglishVersionForLabels + ) ) } @@ -216,14 +236,16 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold // Test details val acceptedTestProvider = AcceptedTestProvider.getInstance(context) - detailItems.add(ValueItem(R.string.wallet_certificate_test_type, - acceptedTestProvider.getTestType(testEntry), - showEnglishVersionForLabels)) - acceptedTestProvider.getTestName(testEntry)?.let { - detailItems.add(ValueItem(R.string.wallet_certificate_test_name, it, showEnglishVersionForLabels)) - } - acceptedTestProvider.getManufacturesIfExists(testEntry)?.let { - detailItems.add(ValueItem(R.string.wallet_certificate_test_holder, it, showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_test_type, + acceptedTestProvider.getTestType(testEntry), + showEnglishVersionForLabels + ) + ) + + acceptedTestProvider.getManufacturesAndNameLabelIfExists(testEntry)?.let { + detailItems.add(ValueItem(R.string.wallet_certificate_test_holder_and_name, it, showEnglishVersionForLabels)) } // Test dates + country @@ -250,27 +272,47 @@ class CertificateDetailItemListBuilder(val context: Context, val certificateHold testEntry.getTestCenter()?.let { testCenter -> detailItems.add(ValueItem(R.string.wallet_certificate_test_done_by, testCenter, showEnglishVersionForLabels)) } - detailItems.add(ValueItem(R.string.wallet_certificate_test_land, - testEntry.getTestCountry(showEnglishVersionForLabels), showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_test_land, + testEntry.getTestCountry(showEnglishVersionForLabels), showEnglishVersionForLabels + ) + ) // Issuer detailItems.add(DividerItem) - detailItems.add(ValueItem(R.string.wallet_certificate_vaccination_issuer_title, - testEntry.getIssuer(), - showEnglishVersionForLabels)) + detailItems.add( + ValueItem( + R.string.wallet_certificate_vaccination_issuer_title, + testEntry.getIssuer(), + showEnglishVersionForLabels + ) + ) detailItems.add(ValueItem(R.string.wallet_certificate_identifier, testEntry.getCertificateIdentifier(), false)) certificateHolder.issuedAt?.prettyPrint(DEFAULT_DISPLAY_DATE_TIME_FORMATTER)?.let { dateString -> - val dateText = context.getString(R.string.wallet_certificate_date).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateText)) - if (showEnglishVersionForLabels) { - val dateTextEnglish = - getEnglishTranslation(context, R.string.wallet_certificate_date).replace("{DATE}", dateString) - detailItems.add(ValueItemWithoutLabel(dateTextEnglish, true)) - } + detailItems.addAll(getIssuedAtLabbels(R.string.wallet_certificate_date, dateString)) } } return detailItems } + private fun getIssuedAtLabbels(issuerText: Int, dateString: String): List { + val items = arrayListOf() + val dateText = context.getString(issuerText).replace("{DATE}", dateString) + items.add(ValueItemWithoutLabel(dateText)) + if (showEnglishVersionForLabels) { + val dateTextEnglish = + getEnglishTranslation(context, issuerText).replace("{DATE}", dateString) + items.add(ValueItemWithoutLabel(dateTextEnglish, true)) + } + items.add( + ValueItemWithoutLabel( + context.getString(R.string.wallet_certificate_detail_date_format_info), + showEnglishVersionForLabels + ) + ) + return items + } + } \ No newline at end of file