Skip to content

Fix retrieving an expired LCP license to allow renewing it - #816

Draft
mickael-menu wants to merge 1 commit into
developfrom
fix-issue-772
Draft

mickael-menu wants to merge 1 commit into
developfrom
fix-issue-772

Conversation

@mickael-menu

Copy link
Copy Markdown
Member

LcpService.retrieveLicense() eagerly resolved the DRM context, which throws for licenses whose status is no longer valid (expired, returned, revoked), so no License was ever returned and renewal was impossible on Android — while the Swift toolkit allows it (its LicensesService resolves the context lazily, only at decryption time).

The eager getContext() check is removed so the License is returned after successful validation. Decrypting content with such a license still fails with the corresponding LcpError.LicenseStatus error, surfaced lazily by License.decrypt(). Also removes a no-op try/catch around the removed call.

Behavior change: opening a publication with an expired license no longer reports it as restricted (isRestricted is false, publication.protectionError is null). Apps that relied on protectionError to detect expiry should check lcpLicense.status or handle LcpError.LicenseStatus decryption errors instead. This matches iOS and is called out in the CHANGELOG.

Fixes #772

🤖 Generated with Claude Code

LcpService.retrieveLicense() eagerly resolved the DRM context, which
throws for licenses whose status is no longer valid (expired, returned,
revoked), so no License was ever returned and renewal was impossible -
while the Swift toolkit allows it. The eager getContext() check is
removed so the License is returned after successful validation; the
status error now surfaces lazily when decrypting content, matching iOS.

As a result, opening a publication with an expired license no longer
reports it as restricted: apps that relied on protectionError to detect
expiry should check lcpLicense.status or handle LcpError.LicenseStatus
decryption errors instead.

Fixes #772

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cannot retrieve an expired license from Asset

1 participant