[#1435] Eliminate logging with Proguard

- Closes #1435
- Changelog update
This commit is contained in:
Honza Rychnovský 2024-04-17 09:26:39 +02:00 committed by GitHub
parent 2c09776f9f
commit 652487e563
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 19 additions and 0 deletions

View File

@ -7,6 +7,7 @@ and this library adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Changed
- The SDK components no longer contain logging statements in the release build
- Gradle 8.7
- Android Gradle Plugin 8.3.0
- Kotlin 1.9.23

View File

@ -0,0 +1,9 @@
# Strip out log messages
-assumenosideeffects public class cash.z.ecc.android.sdk.internal.Twig {
public static *** verbose(...);
public static *** debug(...);
public static *** info(...);
public static *** warn(...);
public static *** error(...);
public static *** assertLoggingStripped();
}

View File

@ -571,6 +571,8 @@ interface Synchronizer {
validateAlias(alias)
validateLogging()
val saplingParamTool = SaplingParamTool.new(applicationContext)
val loadedCheckpoint =
@ -739,3 +741,10 @@ private fun validateAlias(alias: String) {
"characters and only contain letters, digits, hyphens, and underscores."
}
}
private fun validateLogging() {
if (!BuildConfig.DEBUG) {
// In release builds, logs should be stripped by R8 rules
Twig.assertLoggingStripped()
}
}