fix: only use vm strict mode in debug

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2025-08-21 19:37:46 +02:00
parent 6ea094e1b5
commit e4d58120aa
1 changed files with 14 additions and 9 deletions

View File

@ -17,15 +17,20 @@ class RevoltApplication : Application() {
super.onCreate()
AndroidLogcatLogger.installOnDebuggableApp(this, minPriority = LogPriority.VERBOSE)
StrictMode.setVmPolicy(
StrictMode.VmPolicy
.Builder()
.apply {
detectAll()
penaltyLog()
}
.build()
)
if (BuildConfig.DEBUG) {
// Enable strict mode primarily to catch non-API usage, although we detect all
// violations for our reference.
// https://developer.android.com/reference/android/os/StrictMode
StrictMode.setVmPolicy(
StrictMode.VmPolicy
.Builder()
.apply {
detectAll()
penaltyLog()
}
.build()
)
}
}
init {