Skip to content

Commit

Permalink
[APT-10344] Use EncryptedSharedPreferences
Browse files Browse the repository at this point in the history
 Encrypts widevine drm keys. The Android minSDK has been changed to version 23 in order to do this.

 Old DRM storage contents are migrated to the new one in SecureStorage

 The DRM storage backup files are excluded from syncing with Google Backup.
  • Loading branch information
kabliz committed Sep 10, 2024
1 parent 26be2af commit d7a6d86
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,20 @@ internal class ArmadilloSecureStorage @Inject constructor(
return download
}

override fun getAllDrmDownloads(context: Context): Map<String, DrmDownload> =
legacyDrmStorage.all.keys.mapNotNull { key ->
legacyDrmStorage.getString(key, null)?.let { drmResult ->
key to drmResult.decodeToDrmDownload()
override fun getAllDrmDownloads(context: Context): Map<String, DrmDownload> {
val drmDownloads = secureDrmStorage.all.keys.mapNotNull { alias ->
secureDrmStorage.getString(alias, null)?.let { drmResult ->
alias to drmResult.decodeToDrmDownload()
}
}.toMap()
val legacyDownloads = legacyDrmStorage.all.keys.mapNotNull { alias ->
legacyDrmStorage.getString(alias, null)?.let { drmResult ->
alias to drmResult.decodeToDrmDownload()
}
}.toMap()

return drmDownloads.plus(legacyDownloads)
}

override fun removeDrmDownload(context: Context, audioUrl: String, drmType: DrmType) {
val alias = getDrmDownloadAlias(audioUrl, drmType)
Expand Down

0 comments on commit d7a6d86

Please sign in to comment.