Commit 50a9b7ed authored by stopcovid@lunabee.com's avatar stopcovid@lunabee.com
Browse files

Update to 3.3.0

- DCC converter
- Vaccine complete 馃帄
- Allow skip maintenance
- Filter future news
- Improve performance on wallet
parent 1651fc1f
......@@ -36,3 +36,11 @@ BSD 3-Clause
Component: Android Scanner Compat Library
License Text URL: https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library/blob/master/LICENSE
Source Code: https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library
================================================================================
ISC License
================================================================================
Component: Konfetti
License Text URL: https://opensource.org/licenses/ISC
Source Code: https://github.com/DanielMartinus/Konfetti
\ No newline at end of file
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Authors
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Created by Lunabee Studio / Date - 2021/25/6 - for the TOUS-ANTI-COVID project
*/
package com.lunabeestudio.analytics.model
object AnalyticsServiceName {
const val CERTIFICATE_CONVERSION: String = "certificateConversion"
const val ANALYTICS: String = "analytics"
const val CAPTCHA_TYPE: String = "captcha-%s"
const val CAPTCHA: String = "captcha"
const val REGISTER: String = "register"
const val STATUS: String = "status"
const val REPORT: String = "report"
const val WREPORT: String = "wreport"
const val UNREGISTER: String = "unregister"
const val DELETE_EXPOSURE_HISTORY: String = "deleteExposureHistory"
}
\ No newline at end of file
......@@ -31,4 +31,5 @@ enum class AppEventName {
e17,
e18,
e19,
e20,
}
\ No newline at end of file
......@@ -15,6 +15,7 @@ import android.os.Build
import com.lunabeestudio.analytics.BuildConfig
import com.lunabeestudio.analytics.manager.AnalyticsManager
import com.lunabeestudio.analytics.model.AnalyticsResult
import com.lunabeestudio.analytics.model.AnalyticsServiceName
import com.lunabeestudio.analytics.network.model.SendAnalyticsRQ
import com.lunabeestudio.analytics.network.model.SendAppAnalyticsRQ
import com.lunabeestudio.analytics.network.model.SendHealthAnalyticsRQ
......@@ -118,14 +119,21 @@ internal object AnalyticsServerManager {
if (result.isSuccessful) {
AnalyticsResult.Success()
} else {
AnalyticsManager.reportWSError(context, context.filesDir, "analytics", apiVersion, result.code(), result.message())
AnalyticsManager.reportWSError(
context,
context.filesDir,
AnalyticsServiceName.ANALYTICS,
apiVersion,
result.code(),
result.message()
)
AnalyticsResult.Failure(HttpException(result))
}
} catch (e: Exception) {
AnalyticsManager.reportWSError(
context,
context.filesDir,
"analytics",
AnalyticsServiceName.ANALYTICS,
apiVersion,
(e as? HttpException)?.code() ?: 0,
e.message
......
......@@ -25,6 +25,7 @@ enum class EnvConstant {
override val serverPublicKey: String =
"MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAc9IDt6qJq453SwyWPB94JaLB2VfTAcL43YVtMr3HhDCd22gKaQXIbX1d+tNhfvaKM51sxeaXziPjntUzbTNiw=="
override val dccCertificatesFilename: String = "dcc-certs.json"
override val conversionCertificateSha256: String = "sha256/tlRuGxB3uGL0nVnnz6bXoGQi5aGuZ0rfqGlUlndK/yc="
};
abstract val captchaApiKey: String
......@@ -39,4 +40,6 @@ enum class EnvConstant {
abstract val calibrationFilename: String
abstract val serverPublicKey: String
abstract val dccCertificatesFilename: String
abstract val conversionCertificateSha256: String
}
......@@ -32,7 +32,8 @@ object UiConstants {
BLUETOOTH("error", 6),
NEWS("news", 7),
ACTIVATE_REMINDER("reminder", 8),
ISOLATION_REMINDER("reminder", 9)
ISOLATION_REMINDER("reminder", 9),
CERTIFICATE_REMINDER("reminder", 10),
}
val SUPPORTED_LANGUAGE: Array<String> = arrayOf("en", "fr")
......
......@@ -20,11 +20,13 @@ import com.lunabeestudio.stopcovid.coreui.ConfigConstant
import com.lunabeestudio.stopcovid.coreui.network.OkHttpClient
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.CacheControl
import okhttp3.Request
import retrofit2.HttpException
import retrofit2.Response
import java.io.File
import java.net.HttpURLConnection
import java.util.concurrent.TimeUnit
@Suppress("BlockingMethodInNonBlockingContext")
suspend fun String.saveTo(context: Context, file: File): Boolean {
......@@ -32,6 +34,7 @@ suspend fun String.saveTo(context: Context, file: File): Boolean {
val cacheConfig = CacheConfig(File(context.cacheDir, "http_cache"), 30 * 1024 * 1024)
val okHttpClient = OkHttpClient.getDefaultOKHttpClient(context, this@saveTo, ConfigConstant.SERVER_CERTIFICATE_SHA256, cacheConfig)
val request: Request = Request.Builder().apply {
cacheControl(CacheControl.Builder().maxAge(10, TimeUnit.MINUTES).build())
url(this@saveTo)
}.build()
......@@ -58,6 +61,7 @@ suspend fun String.saveTo(context: Context, atomicFile: AtomicFile, validData: s
val cacheConfig = CacheConfig(File(context.cacheDir, "http_cache"), 30 * 1024 * 1024)
val okHttpClient = OkHttpClient.getDefaultOKHttpClient(context, this@saveTo, ConfigConstant.SERVER_CERTIFICATE_SHA256, cacheConfig)
val request: Request = Request.Builder().apply {
cacheControl(CacheControl.Builder().maxAge(10, TimeUnit.MINUTES).build())
url(this@saveTo)
}.build()
......
......@@ -14,13 +14,16 @@ import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.annotation.LayoutRes
import androidx.core.view.isVisible
import androidx.lifecycle.lifecycleScope
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.google.android.material.appbar.AppBarLayout
import com.lunabeestudio.stopcovid.coreui.R
import com.lunabeestudio.stopcovid.coreui.databinding.FragmentRecyclerViewBinding
import com.lunabeestudio.stopcovid.coreui.extension.closeKeyboardOnScroll
import com.lunabeestudio.stopcovid.coreui.extension.setTextOrHide
import com.lunabeestudio.stopcovid.coreui.extension.viewLifecycleOwnerOrNull
import com.mikepenz.fastadapter.GenericItem
import com.mikepenz.fastadapter.adapters.FastItemAdapter
......@@ -38,17 +41,21 @@ abstract class FastAdapterFragment : BaseFragment() {
private var onScrollListener: RecyclerView.OnScrollListener? = null
private var refreshScreenJob: Job? = null
@LayoutRes
protected open val layout: Int = R.layout.fragment_recycler_view
override fun onCreateView(
inflater: LayoutInflater,
container: ViewGroup?,
savedInstanceState: Bundle?,
): View? {
adapter.attachDefaultListeners = false
binding = FragmentRecyclerViewBinding.inflate(inflater, container, false)
val view = inflater.inflate(layout, container, false)
binding = FragmentRecyclerViewBinding.bind(view)
binding?.recyclerView?.layoutManager = LinearLayoutManager(requireContext())
binding?.recyclerView?.adapter = adapter
onScrollListener = binding?.recyclerView?.closeKeyboardOnScroll(context)
return binding?.root
return view
}
override fun refreshScreen() {
......@@ -65,10 +72,11 @@ abstract class FastAdapterFragment : BaseFragment() {
}
}
protected fun showLoading() {
protected fun showLoading(loadingText: String? = null) {
binding?.recyclerView?.isVisible = false
binding?.emptyLayout?.isVisible = false
binding?.loadingLayout?.isVisible = true
binding?.loadingDescriptionTextView?.setTextOrHide(loadingText)
}
protected fun showEmpty() {
......
......@@ -129,6 +129,14 @@ internal class ApiConfiguration(
val covidPlusWarning: Int,
@SerializedName("app.covidPlusNoTracing")
val covidPlusNoTracing: Int,
@SerializedName("app.displayCertificateConversion")
val displayCertificateConversion: Boolean,
@SerializedName("app.certificateConversionUrl")
val certificateConversionUrl: String,
@SerializedName("app.wallet.vaccin.daysAfterCompletion")
val daysAfterCompletion: String,
@SerializedName("app.wallet.certificateConversionSidepOnlyCode")
val certificateConversionSidepOnlyCode: String,
)
internal fun ApiConfiguration.toDomain(gson: Gson) = Configuration(
......@@ -201,6 +209,16 @@ internal fun ApiConfiguration.toDomain(gson: Gson) = Configuration(
cleaUrls,
object : TypeToken<List<String>?>() {}.type
),
covidPlusWarning = covidPlusWarning,
covidPlusNoTracing = covidPlusNoTracing,
displayCertificateConversion = displayCertificateConversion,
certificateConversionUrl = certificateConversionUrl,
daysAfterCompletion = (
gson.fromJson(
daysAfterCompletion,
object : TypeToken<List<ApiDaysAfterCompletionEntry>>() {}.type
) as List<ApiDaysAfterCompletionEntry>
).associate { Pair(it.code, it.value) },
certificateConversionSidepOnlyCode = gson.fromJson(certificateConversionSidepOnlyCode, object : TypeToken<List<String>>() {}.type),
)
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Authors
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Created by Lunabee Studio / Date - 2020/28/05 - for the TOUS-ANTI-COVID project
*/
package com.lunabeestudio.stopcovid.coreui.model
class ApiDaysAfterCompletionEntry(
val code: String,
val value: Int,
)
\ No newline at end of file
<!--
~ This Source Code Form is subject to the terms of the Mozilla Public
~ License, v. 2.0. If a copy of the MPL was not distributed with this
~ file, You can obtain one at https://mozilla.org/MPL/2.0/.
~
~ Authors
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Created by Lunabee Studio / Date - 2021/24/6 - for the TOUS-ANTI-COVID project
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="96dp"
android:height="96dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="#5770BE"
android:pathData="M20.4079,23.7279C21.3031,23.4905 22.1763,22.9366 22.1763,21.8288C22.1763,21.3766 22.0658,21.0601 21.911,20.8001C21.8226,20.6531 21.8337,20.5288 21.9774,20.4723C22.6847,20.1783 23.2816,19.5001 23.2816,18.5618C23.2816,18.0418 23.1268,17.567 22.8837,17.2392C22.751,17.0696 22.7732,16.9227 22.9721,16.787C23.4916,16.4818 23.8453,15.8261 23.8453,15.0574C23.8453,14.5261 23.6795,13.9383 23.37,13.6557C23.1932,13.4861 23.2263,13.3731 23.4142,13.2035C23.7789,12.8983 24,12.3557 24,11.7C24,10.5696 23.1379,9.6539 22.0105,9.6539L17.9763,9.6539C16.9484,9.6539 16.2742,9.1113 16.2742,8.2522C16.2742,6.6696 18.1863,3.7983 18.1863,1.7296C18.1863,0.6444 17.501,0 16.6057,0C15.7878,0 15.3789,0.5765 14.9368,1.4583C13.2457,4.8496 10.9689,7.5966 9.2336,9.9479C7.7636,11.9487 7.0452,13.6557 7.001,16.4253C6.9346,20.6983 10.3278,23.9427 15.6442,23.9879L17.2136,23.9992C18.6947,24.0105 19.7889,23.8975 20.4079,23.7279ZM8,23C5.9366,21.4496 5.0048,19.0954 5.0491,16.4081C5.0935,13.4223 6.2029,11.2977 7.2124,10L5.5483,10C2.9746,10 1,12.871 1,16.523C1,20.0486 3.13,23 5.9699,23L8,23Z" />
</vector>
......@@ -7,7 +7,7 @@
~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~ Created by Lunabee Studio / Date - 2020/04/05 - for the TOUS-ANTI-COVID project
-->
<FrameLayout
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
......@@ -20,23 +20,14 @@
android:layout_height="match_parent"
android:clipToPadding="false" />
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/floatingActionButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_margin="@dimen/spacing_large"
android:visibility="gone"
app:icon="@drawable/ic_qrscan"
tools:text="Scanner un QR code"
tools:visibility="visible" />
<androidx.constraintlayout.widget.ConstraintLayout
android:id="@+id/emptyLayout"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:visibility="gone"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent"
tools:visibility="visible">
<ImageView
......@@ -104,11 +95,27 @@
tools:visibility="visible">
<ProgressBar
android:id="@+id/progressBar"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/loadingDescriptionTextView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginHorizontal="@dimen/spacing_large"
android:layout_marginVertical="@dimen/spacing_medium"
android:gravity="center"
android:textAppearance="@style/TextAppearance.StopCovid.Caption"
android:textIsSelectable="false"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/progressBar"
tools:text="@tools:sample/lorem[15]" />
</androidx.constraintlayout.widget.ConstraintLayout>
</FrameLayout>
\ No newline at end of file
</androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
......@@ -67,4 +67,8 @@ class Configuration(
val cleaUrls: List<String>,
val covidPlusWarning: Int,
val covidPlusNoTracing: Int,
var displayCertificateConversion: Boolean,
var certificateConversionUrl: String,
var daysAfterCompletion: Map<String, Int>,
var certificateConversionSidepOnlyCode: List<String>,
)
......@@ -70,7 +70,7 @@ object RetrofitClient {
fun getDefaultOKHttpClient(
context: Context,
url: String,
url: String?,
certificateSHA256: String?,
cacheConfig: CacheConfig?,
onProgressUpdate: ((Float) -> Unit)? = null,
......@@ -82,7 +82,7 @@ object RetrofitClient {
if (!BuildConfig.DEBUG) {
connectionSpecs(listOf(requireTls12))
}
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N && certificateSHA256 != null) {
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.N && certificateSHA256 != null && url != null) {
certificatePinner(
CertificatePinner.Builder()
.add(url.toHttpUrl().host, certificateSHA256)
......@@ -94,6 +94,8 @@ object RetrofitClient {
.addTrustedCertificate(certificateFromString(context, "app_tousanticovid_gouv_fr"))
.addTrustedCertificate(certificateFromString(context, "s3_fr_par_scw_cloud"))
.addTrustedCertificate(certificateFromString(context, "signal_api_tousanticovid_gouv_fr"))
.addTrustedCertificate(certificateFromString(context, "ingroupe_com_isrg_root_x1"))
.addTrustedCertificate(certificateFromString(context, "ingroupe_com_r3"))
.build()
sslSocketFactory(certificates.sslSocketFactory(), certificates.trustManager)
}
......
package com.lunabeestudio.framework.remote.datasource
import android.content.Context
import com.lunabeestudio.analytics.model.AnalyticsServiceName
import com.lunabeestudio.domain.model.CacheConfig
import com.lunabeestudio.domain.model.Cluster
import com.lunabeestudio.domain.model.ClusterIndex
......@@ -48,7 +49,7 @@ class CleaDataSource(
pivotDate: Long,
venueQrCodeList: List<VenueQrCode>,
): RobertResult {
return RequestHelper.tryCatchRequest(context, filesDir, cleaApiVersion, "wreport") {
return RequestHelper.tryCatchRequest(context, filesDir, cleaApiVersion, AnalyticsServiceName.WREPORT) {
cleaReportApi.wreport(cleaApiVersion, "Bearer $token", ApiWReportClea.fromVenueQrCodeList(pivotDate, venueQrCodeList))
}
}
......
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Authors
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Created by Lunabee Studio / Date - 2021/22/6 - for the TOUS-ANTI-COVID project
*/
package com.lunabeestudio.framework.remote.datasource
import android.content.Context
import com.google.gson.Gson
import com.google.gson.JsonSyntaxException
import com.lunabeestudio.analytics.manager.AnalyticsManager
import com.lunabeestudio.analytics.model.AnalyticsServiceName
import com.lunabeestudio.domain.model.WalletCertificateType
import com.lunabeestudio.framework.remote.RetrofitClient
import com.lunabeestudio.framework.remote.model.ApiConvertErrorRS
import com.lunabeestudio.framework.remote.model.ApiConvertRQ
import com.lunabeestudio.robert.datasource.RemoteCertificateDataSource
import com.lunabeestudio.robert.model.BackendException
import com.lunabeestudio.robert.model.RobertResultData
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import okhttp3.MediaType.Companion.toMediaTypeOrNull
import okhttp3.Request
import okhttp3.RequestBody.Companion.toRequestBody
class InGroupeDatasource(
private val context: Context,
private val certificateSHA256: String,
) : RemoteCertificateDataSource {
override suspend fun convertCertificate(
url: String,
encodedCertificate: String,
from: WalletCertificateType.Format,
to: WalletCertificateType.Format
): RobertResultData<String> {
val okHttpClient = RetrofitClient.getDefaultOKHttpClient(
context = context,
url = url,
certificateSHA256 = certificateSHA256,
cacheConfig = null
)
val gson = Gson()
val apiConvertRQ = ApiConvertRQ(chainEncoded = encodedCertificate, destination = to.toApiKey(), source = from.toApiKey())
val mediaType = "application/json".toMediaTypeOrNull()
val bodyRq = gson.toJson(apiConvertRQ).toRequestBody(mediaType)
val request: Request = Request.Builder()
.url(url)
.post(bodyRq)
.build()
@Suppress("BlockingMethodInNonBlockingContext")
return withContext(Dispatchers.IO) {
val response = okHttpClient.newCall(request).execute()
val bodyRs = response.body?.string()
if (response.isSuccessful && bodyRs != null) {
RobertResultData.Success(bodyRs)
} else {
var analyticsErrorDesc: String? = null
try {
val error = gson.fromJson(bodyRs, ApiConvertErrorRS::class.java)
analyticsErrorDesc = "${error.msgError} (${error.codeError})"
RobertResultData.Failure(BackendException("${error.msgError} (${error.codeError})"))
} catch (e: Exception) {
RobertResultData.Failure(BackendException("Unable to parse body result: $bodyRs"))
} finally {
AnalyticsManager.reportWSError(
context,
context.filesDir,
AnalyticsServiceName.CERTIFICATE_CONVERSION,
"0",
response.code,
analyticsErrorDesc,
)
}
}
}
}
fun WalletCertificateType.Format.toApiKey(): String {
return when (this) {
WalletCertificateType.Format.WALLET_2D -> "DEUX_D_DOC"
WalletCertificateType.Format.WALLET_DCC -> "DGCA"
}
}
}
\ No newline at end of file
......@@ -11,6 +11,7 @@
package com.lunabeestudio.framework.remote.datasource
import android.content.Context
import com.lunabeestudio.analytics.model.AnalyticsServiceName
import com.lunabeestudio.domain.model.LocalProximity
import com.lunabeestudio.domain.model.RegisterReport
import com.lunabeestudio.domain.model.ReportResponse
......@@ -54,7 +55,12 @@ class ServiceDataSource(
override suspend fun generateCaptcha(apiVersion: String, type: String, language: String): RobertResultData<String> {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, "captcha-$type") {
val result = RequestHelper.tryCatchRequestData(
context,
filesDir,
apiVersion,
AnalyticsServiceName.CAPTCHA_TYPE.format(type)
) {
api.captcha(apiVersion, CaptchaRQ(type = type, locale = language))
}
return when (result) {
......@@ -65,7 +71,7 @@ class ServiceDataSource(
override suspend fun getCaptcha(apiVersion: String, captchaId: String, type: String, path: String): RobertResult {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, "captcha") {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, AnalyticsServiceName.CAPTCHA) {
fileApi.getCaptcha(apiVersion, captchaId, type)
}
return when (result) {
......@@ -92,7 +98,7 @@ class ServiceDataSource(
clientPublicECDHKey: String,
): RobertResultData<RegisterReport> {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, "register") {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, AnalyticsServiceName.REGISTER) {
api.registerV2(apiVersion, ApiRegisterV2RQ(captcha = captcha, captchaId = captchaId, clientPublicECDHKey = clientPublicECDHKey))
}
return when (result) {
......@@ -102,13 +108,13 @@ class ServiceDataSource(
}
override suspend fun unregister(apiVersion: String, ssu: ServerStatusUpdate): RobertResult {
return RequestHelper.tryCatchRequest(context, filesDir, apiVersion, "unregister") {
return RequestHelper.tryCatchRequest(context, filesDir, apiVersion, AnalyticsServiceName.UNREGISTER) {
api.unregister(apiVersion, ApiUnregisterRQ(ebid = ssu.ebid, epochId = ssu.epochId, time = ssu.time, mac = ssu.mac))
}
}
override suspend fun status(apiVersion: String, ssu: ServerStatusUpdate): RobertResultData<StatusReport> {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, "status") {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, AnalyticsServiceName.STATUS) {
api.status(
apiVersion,
ApiStatusRQ(
......@@ -132,7 +138,7 @@ class ServiceDataSource(
onProgressUpdate: ((Float) -> Unit)?,
): RobertResultData<ReportResponse> {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, "report") {
val result = RequestHelper.tryCatchRequestData(context, filesDir, apiVersion, AnalyticsServiceName.REPORT) {
reportProgressUpdate = onProgressUpdate
reportApi.report(apiVersion, ApiReportRQ.fromLocalProximityList(token, localProximityList))
}
......@@ -144,7 +150,7 @@ class ServiceDataSource(
}
override suspend fun deleteExposureHistory(apiVersion: String, ssu: ServerStatusUpdate): RobertResult {
return RequestHelper.tryCatchRequest(context, filesDir, apiVersion, "deleteExposureHistory") {
return RequestHelper.tryCatchRequest(context, filesDir, apiVersion, AnalyticsServiceName.DELETE_EXPOSURE_HISTORY) {
api.deleteExposureHistory(
apiVersion,
ApiDeleteExposureHistoryRQ(ebid = ssu.ebid, epochId = ssu.epochId, time = ssu.time, mac = ssu.mac)
......
......@@ -5,12 +5,12 @@
*
* Authors
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
* Created by Lunabee Studio / Date - 2020/04/05 - for the TOUS-ANTI-COVID project
* Created by Lunabee Studio / Date - 2021/23/6 - for the TOUS-ANTI-COVID project
*/
package com.lunabeestudio.framework.remote.model
internal class ApiRegisterRQ(
val captcha: String,
val clientPublicECDHKey: String
internal class ApiConvertErrorRS private constructor(
val codeError: String,
val msgError: String,
)
\ No newline at end of file
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*
* Authors
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~