Skip to content

Commit

Permalink
update: new aes key
Browse files Browse the repository at this point in the history
  • Loading branch information
muedsa committed Apr 7, 2024
1 parent 15d2ad3 commit 033fbc5
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
6 changes: 4 additions & 2 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ android {
applicationId = "com.muedsa.agetv"
minSdk = 24
targetSdk = 34
versionCode = 4
versionName = "0.0.1-alpha04"
versionCode = 5
versionName = "0.0.1-alpha05"
archivesName = "AGETV"
}

Expand Down Expand Up @@ -177,6 +177,8 @@ dependencies {
implementation(libs.firebase.crashlytics)

//implementation(libs.material.icons.extended)

testImplementation(libs.bcprov.jdk15to18)
}

ksp {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ class AgePlayerService {
companion object {
private var DEFAULT_RETROFIT: Retrofit? = null
private var DEFAULT_VIP_API_SERVICE: AgeVipPlayerApiService? = null
private const val WASM_AES_KEY = "ni po jie ni nb "
private const val WASM_AES_KEY = "ni po jie ni ** "
const val TIMEOUT_MS = 10 * 1000

const val SUCCESS_CODE = 200
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@ package com.muedsa.agetv.service

import com.muedsa.agetv.exception.AgeParseException
import kotlinx.coroutines.runBlocking
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.junit.Test
import java.security.Security


class AgePlayerServiceTest {

init {
Security.removeProvider("BC")
// Confirm that positioning this provider at the end works for your needs!
Security.addProvider(BouncyCastleProvider())
}

private val service = AgePlayerService()

// @Test
Expand All @@ -22,15 +30,15 @@ class AgePlayerServiceTest {
@Test
fun decryptPlayUrlTest() {
runBlocking {
val baseUrl = "https://43.240.74.134:8443/vip/?url="
val baseUrl = "https://43.240.156.118:8443/vip/?url="
val param =
"age_f382WV3AMFb1D%2FX2k5HO6m%2FjJxWGHSNwtMnyxFFeulNHddlKfzLiFZRY9md2wwxuM8Z%2BfkAchU98L%2BXRCcNRCaFZG9eTMJZODOgSUH8"
"age_533cFgY%2BIyrX8iwo4ALoVsK2DmAm0%2BOIhl%2Bi%2BB409SwC5mONYNo%2BoX%2FFrXC7FduZu719GwSIfKaTPvZRq9aoO40WIA"
val playInfo = service.getPlayInfo("$baseUrl$param")
println("$playInfo")
if (playInfo.vUrl.isEmpty()) {
throw AgeParseException("vurl is empty")
}
val playUrl = service.decryptPlayUrl(playInfo, "https://43.240.74.134:8443/vip/")
val playUrl = service.decryptPlayUrl(playInfo, "https://43.240.156.118:8443/vip/")
println(playUrl)
}
}
Expand Down
13 changes: 11 additions & 2 deletions app/src/test/kotlin/com/muedsa/util/StrCodecKtTest.kt
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
package com.muedsa.util

import com.muedsa.uitl.encryptAES128CBCPKCS7
import org.bouncycastle.jce.provider.BouncyCastleProvider
import org.junit.Test
import java.security.Security

class StrCodecKtTest {

init {
Security.removeProvider("BC")
// Confirm that positioning this provider at the end works for your needs!
Security.addProvider(BouncyCastleProvider())
}

@OptIn(ExperimentalStdlibApi::class)
@Test
fun decryptPlayUrlTest() {
val key = "ni po jie ni nb "
println("muedsa".encryptAES128CBCPKCS7(key, key))
val key = "ni po jie ni ** "
println("muedsa".encryptAES128CBCPKCS7(key, key).toHexString())
}
}
2 changes: 2 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ retrofit2 = "2.11.0"
retrofit2-ktx-serialization = "1.0.0"
okhttp3-logging = "4.12.0"
room = "2.6.1"
bcprov-jdk15to18 = "1.77"

[libraries]
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "core-ktx" }
Expand Down Expand Up @@ -82,6 +83,7 @@ okhttp3-logging = { group = "com.squareup.okhttp3", name = "logging-interceptor"
room = { group = "androidx.room", name = "room-runtime", version.ref = "room" }
room-compiler = { group = "androidx.room", name = "room-compiler", version.ref = "room" }
room-ktx = { group = "androidx.room", name = "room-ktx", version.ref = "room" }
bcprov-jdk15to18 = { module = "org.bouncycastle:bcprov-jdk15to18", version.ref = "bcprov-jdk15to18" }

[plugins]
androidApplication = { id = "com.android.application", version.ref = "agp" }
Expand Down

0 comments on commit 033fbc5

Please sign in to comment.