kotlin-toolkit
kotlin-toolkit copied to clipboard
Proguard minification breaks LicenseValidation
With minification and Proguard enabled, LCP licenses validation doesn't work anymore.
fun findOneValidPassphrase(jsonLicense: String, hashedPassphrases: List<String>): String =
try {
klass
.getMethod("findOneValidPassphrase", String::class.java, Array<String>::class.java)
.invoke(instance, jsonLicense, hashedPassphrases.toTypedArray()) as String
} catch (e: InvocationTargetException) {
throw mapException(e.targetException)
}
As the name of the function is changed by Proguard, findOneValidPassphrase
(in LcpClient.kt:67) breaks and throws an exception.
It seems that adding the following exceptions in Proguard rules restores the functionality:
-keep class org.readium.lcp.sdk.* { *; }