Skip to content

Commit

Permalink
chore: Add support for Core 0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sirambd committed Dec 17, 2024
1 parent 5bebbbe commit 0efb87a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ package com.infomaniak.swisstransfer.di
import android.app.Application
import com.infomaniak.core2.appintegrity.AppIntegrityManager
import com.infomaniak.multiplatform_swisstransfer.SwissTransferInjection
import com.infomaniak.multiplatform_swisstransfer.common.utils.ApiEnvironment
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
Expand All @@ -32,7 +33,9 @@ object SwissTransferInjectionModule {

@Provides
@Singleton
fun providesSwissTransferInjection() = SwissTransferInjection(userAgent = "Ktor client") // TODO: Waiting for api support
fun providesSwissTransferInjection(): SwissTransferInjection {
return SwissTransferInjection(environment = ApiEnvironment.Prod, userAgent = "Ktor client")
}

@Provides
@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.infomaniak.core2.appintegrity.AppIntegrityManager
import com.infomaniak.core2.appintegrity.AppIntegrityManager.Companion.APP_INTEGRITY_MANAGER_TAG
import com.infomaniak.multiplatform_swisstransfer.SharedApiUrlCreator
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload.RemoteUploadFile
import com.infomaniak.multiplatform_swisstransfer.common.interfaces.upload.UploadFileSession
import com.infomaniak.multiplatform_swisstransfer.common.utils.mapToList
import com.infomaniak.multiplatform_swisstransfer.data.NewUploadSession
import com.infomaniak.multiplatform_swisstransfer.managers.AppSettingsManager
import com.infomaniak.multiplatform_swisstransfer.managers.UploadManager
import com.infomaniak.multiplatform_swisstransfer.network.utils.SharedApiRoutes
import com.infomaniak.sentry.SentryLog
import com.infomaniak.swisstransfer.BuildConfig
import com.infomaniak.swisstransfer.di.IoDispatcher
Expand Down Expand Up @@ -65,6 +65,7 @@ class ImportFilesViewModel @Inject constructor(
private val appIntegrityManager: AppIntegrityManager,
private val savedStateHandle: SavedStateHandle,
private val importationFilesManager: ImportationFilesManager,
private val sharedApiUrlCreator: SharedApiUrlCreator,
private val uploadManager: UploadManager,
private val uploadWorkerScheduler: UploadWorker.Scheduler,
@IoDispatcher private val ioDispatcher: CoroutineDispatcher,
Expand Down Expand Up @@ -193,7 +194,7 @@ class ImportFilesViewModel @Inject constructor(
appIntegrityManager.getApiIntegrityVerdict(
integrityToken = appIntegrityToken,
packageName = BuildConfig.APPLICATION_ID,
targetUrl = SharedApiRoutes.createUploadContainer,
targetUrl = sharedApiUrlCreator.createUploadContainerUrl,
onSuccess = { attestationToken ->
SentryLog.i(APP_INTEGRITY_MANAGER_TAG, "Api verdict check")
Log.i(APP_INTEGRITY_MANAGER_TAG, "getApiIntegrityVerdict: $attestationToken")
Expand Down

0 comments on commit 0efb87a

Please sign in to comment.