commit 3fc4c91b74c169f28b1b527fd1411f7569925020
parent 947e1f909628169e1c40cfe54a6a980f28ec8890
Author: t3sserakt <t3ss@posteo.de>
Date: Fri, 2 Jan 2026 21:40:13 +0100
production friendly reset
Diffstat:
3 files changed, 13 insertions(+), 2 deletions(-)
diff --git a/.gitignore b/.gitignore
@@ -4,3 +4,4 @@ GNUnetMessenger/app/release/
GNUnetMessenger/.idea/*.xml
/.idea/
+TEST_REPORT.md
diff --git a/GNUnetMessenger/app/build.gradle.kts b/GNUnetMessenger/app/build.gradle.kts
@@ -27,6 +27,10 @@ android {
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
+ buildConfigField("boolean", "ALLOW_RESET", "false")
+ }
+ debug {
+ buildConfigField("boolean", "ALLOW_RESET", "true")
}
}
compileOptions {
@@ -40,6 +44,7 @@ android {
dataBinding = true
viewBinding = true
aidl = true
+ buildConfig = true
}
}
@@ -66,4 +71,4 @@ dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-android:1.8.1")
androidTestImplementation("org.jetbrains.kotlinx:kotlinx-coroutines-test:1.8.1")
testImplementation("junit:junit:4.13.2")
-}
-\ No newline at end of file
+}
diff --git a/GNUnetMessenger/app/src/main/java/org/gnunet/gnunetmessenger/service/mock/GnunetChatMock.kt b/GNUnetMessenger/app/src/main/java/org/gnunet/gnunetmessenger/service/mock/GnunetChatMock.kt
@@ -377,6 +377,12 @@ class GnunetChatMock : GnunetChat {
}
override suspend fun reset() {
+ // SAFETY CHECK: Only allow reset in debug builds
+ if (!org.gnunet.gnunetmessenger.BuildConfig.ALLOW_RESET) {
+ println("reset: BLOCKED - Reset not allowed in production builds")
+ throw SecurityException("Reset operation is not allowed in production")
+ }
+
println("reset mock service - clearing all state")
uuidCounter = 0
lastDestroyedUri = null