Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ object M3u8Helper2 {
}

@OptIn(DelicateCryptographyApi::class)
fun getDecrypted(
suspend fun getDecrypted(

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This breaks the ABI, contrary to expectations.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I know and forgot to add a PR description (the whole reason I just opened this PR lol). What I wanted was some opinion on how not to do that while still doing a suspended version of this.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know of no good way beyond the standard deprecation method 😕

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay I will figure something out later then lol. Thanks for the comment though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am marking this as a draft until then.

secretKey: ByteArray,
data: ByteArray,
iv: ByteArray = byteArrayOf(),
index: Int,
): ByteArray {
val ivKey = if (iv.isEmpty()) defaultIv(index) else iv
val aesKey = aesCbc.keyDecoder().decodeFromByteArrayBlocking(AES.Key.Format.RAW, secretKey)
return aesKey.cipher(padding = true).decryptWithIvBlocking(ivKey, data)
val aesKey = aesCbc.keyDecoder().decodeFromByteArray(AES.Key.Format.RAW, secretKey)
return aesKey.cipher(padding = true).decryptWithIv(ivKey, data)
}

private fun getParentLink(url: String): String {
Expand Down