SReverseby Simpa Labs

Offline media workflows

Rebuilding offline DRM download, restore and renewal in ExoPlayer

An offline media integration needs to keep downloaded content usable across app launches and licence renewal. Trace the stored licence reference and the player’s state changes through the whole workflow.

Follow the download beyond the licence response

A successful licence response is one event in an offline download. The app also stores media, a content identifier and the offline licence reference returned by its DRM flow. Record where those values are saved and how the next app launch finds them.

Media3’s DRM guide explains restoring offline keys through the media item’s key-set ID. Match that ID to the downloaded item. A database row pointing at the wrong licence can look like an authentication failure even though the earlier exchange succeeded.

Distinguish restore, renewal and release

Restore uses an existing offline licence. Renewal asks for updated rights. Release gives up the stored licence through the DRM flow. Treat them as separate operations in the client and its records.

OfflineLicenseHelper exposes download, duration, renewal and release methods. In a rebuild, save the key-set ID returned by the operation and test the next restore against it. Keep the old record until the new operation has succeeded and the replacement has been stored.

download → save returned keySetId
close app → reopen → restore saved keySetId
renew → save returned keySetId → restore again
release → update the local download record

This is an integration sequence, not a recording of a tested device. It gives each device test a clear checkpoint. Record the key-set reference separately from bearer tokens, user IDs and content IDs.

Read the renewal call in its actual mode

A renewal is not always a copy of the first licence request. MediaDrm permits null initialization data for renewal. Follow the key type, scope and parameters used by the app instead of requiring the original initialization bytes in every case.

Trace the app’s network callback too. It can refresh an access token before sending the DRM message or wrap the message in another request format. Preserve the binary challenge while rebuilding the app-controlled URL, headers and response unwrapping.

Test a second launch and a failed renewal

Use a content item and licence service that you control. Complete a download, stop the app, reopen it offline and play the stored item. Then return online, renew and repeat the restore. Those runs establish more than a single successful streaming session.

Interrupt renewal before the local record is updated. The next launch should find a consistent licence reference and a clear retry state. Check account changes, deleted downloads and released licences separately. Log operation type, content ID and outcome without placing credentials or licence bodies in routine logs.

Deliver the whole media flow

The working result connects catalogue and entitlement calls to download, stored state and playback. Keep the app’s framework bridge in that trace: a Flutter or React Native method can hand work to native Media3 code, so record the plugin version and follow the call into that version’s implementation.

Media3 request flows explains the native wiring; player network analysis separates media, licence and application calls. Send the app or describe the media workflow you need through SReverse.

Reviewed 22 October 2026 · SReverse research desk

Start your full APK reconstruction

Send the full APK

Projects start at $70. Choose WhatsApp or email, then attach the APK in the app that opens. We reply within one hour with the next step and send the fixed quote after review.

Want us to contact you?