Skip to content

Commit

Permalink
feat(AppIntegrity): Force debug build to check app integrity on preprod
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianDevel committed Dec 16, 2024
1 parent 12ab95f commit f8d6423
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
11 changes: 10 additions & 1 deletion Core2/AppIntegrity/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,18 @@ android {
release {
isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
buildConfigField("String", "APP_INTEGRITY_BASE_URL", "\"https://api.infomaniak.com\"")
}

debug {
buildConfigField("String", "APP_INTEGRITY_BASE_URL", "\"https://api.preprod.dev.infomaniak.ch\"")
}
}

buildFeatures {
buildConfig = true
}

compileOptions {
sourceCompatibility = sharedJavaVersion
targetCompatibility = sharedJavaVersion
Expand All @@ -39,7 +48,7 @@ android {
dependencies {

implementation(project(":Core2:Sentry"))

implementation(core2.integrity)
implementation(core2.ktor.client.core)
implementation(core2.ktor.client.content.negociation)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ internal class AppIntegrityRepository {
"package_name" to packageName,
"target_url" to targetUrl,
"challenge_id" to challengeId,
"force_integrity_test" to "true",
"force_integrity_test" to "false",
)

return post<ApiResponse<String>>(url = Url(AppIntegrityRoutes.requestApiIntegrityCheck), data = body)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,9 @@ package com.infomaniak.core2.appintegrity

object AppIntegrityRoutes {

private const val PROD_URL = "https://https://api.infomaniak.com"
private const val PREPROD_BASE_URL = "https://api.preprod.dev.infomaniak.ch"
private const val BASE_URL_V1 = "$PREPROD_BASE_URL/1/attest"
private val BASE_URL_V1 = "${BuildConfig.APP_INTEGRITY_BASE_URL}/1/attest"

internal const val requestChallenge = "$BASE_URL_V1/challenge"
internal const val requestApiIntegrityCheck = "$BASE_URL_V1/integrity"
internal val requestChallenge = "$BASE_URL_V1/challenge"
internal val requestApiIntegrityCheck = "$BASE_URL_V1/integrity"
const val demo = "https://api-core.devd471.dev.infomaniak.ch/1/attest/demo"
}

0 comments on commit f8d6423

Please sign in to comment.