Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proguard minification breaks LicenseValidation #204

Open
olivierkorner opened this issue Feb 23, 2021 · 0 comments
Open

Proguard minification breaks LicenseValidation #204

olivierkorner opened this issue Feb 23, 2021 · 0 comments

Comments

@olivierkorner
Copy link

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.* { *; }
@mickael-menu mickael-menu transferred this issue from readium/r2-lcp-kotlin Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants