Skip to content

2.0.0

Choose a tag to compare

@DatL4g DatL4g released this 01 Feb 15:12
· 25 commits to master since this release
3d4f811

We finally reached a new full release.

Changes since 1.x.x

Skip this if you are already using previous 2.0.0-alpha-09 release.

Gradle Setup

Sekret is now following a minimal setup approch.
This means you have to explicitly enable secret properties:

sekret {
	/** Configuration for generating secrets */
    properties {
        enabled.set(true) // Important if you wan't to keep using generated secret
        packageName.set("your.package.name")
		// other value changes
    }
}

Code changes

Sekret comes with common code now, so it can fully be used multiplatform.

// Make sure to load the binary first on Android / JVM
Sekret.yourKey("...")

Credential leaking

You can apply a Secret annotation to data and value class properties to prevent accidentally leaking the values.

For example you log user info:

data class User(
	val name: String,
	@Secret val password: String
)

val user = User("my-name", "my-password")
println(user.toString())

// can still be called
login(user.name, user.password)

Will result in something like this:

User(name=my-name, password=***)

Supported types

Type Kotlin Java
String ✅ ✅
StringBuilder ✅ ✅
CharSequence ✅ ✅
Appendable ✅ ✅
StringBuffer NaN ✅
CharArray ❌ ❌

Changes since 2.0.0-alpha-09

Updated to Kotlin 2.1.10 and fixes the mentioned Kotlin bug on Android.

Code changes

If you are using Application Secrets you have to re-generate properties because 2.0.0 has the ability to prevent JNI tracing.

⚠️ Don't forget to update the library in sekret/build.gradle.kts

This ability can be managed like this (read more here):

Sekret.yourKey("...", SekretConfig {
	jni {
		decryptDirectly = false
		fallbackToDirectDecryption = true
	}
})

Google-Services

This new release can parse google-services.json commonly used for Firebase for example.
So you no longer need to extract the values yourself and add them in sekret.properties again.

Full Changelog: v1.0.1...v2.0.0