From 86e8db441341852e6bbeab62bd683bd2288b0752 Mon Sep 17 00:00:00 2001 From: Sakari <20642596+sakarie9@users.noreply.github.com> Date: Mon, 30 Dec 2024 13:05:16 +0800 Subject: [PATCH] feat: adapt play 3.20.0 --- gradle.properties | 2 +- gradle/libs.versions.toml | 10 +++++----- .../misc/okhttp/fingerprints/HttpUrlFingerprint.kt | 7 ++++++- .../okhttp/fingerprints/MediaTypeGetFingerprint.kt | 7 ++++++- .../okhttp/fingerprints/ResponseBodyFingerprint.kt | 5 ++++- .../misc/okhttp/fingerprints/ResponseFingerprint.kt | 1 + .../fingerprints/IjkMediaPlayerOptionsFingerprint.kt | 2 +- settings.gradle.kts | 2 +- 8 files changed, 25 insertions(+), 11 deletions(-) diff --git a/gradle.properties b/gradle.properties index 5b29adc2..2507ee8d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -2,6 +2,6 @@ org.gradle.parallel=true org.gradle.caching=true kotlin.code.style=official android.useAndroidX=true -version=1.23.3.5 +version=1.23.3.6 ksp.useKSP2=true org.gradle.jvmargs=-Xmx2g \ No newline at end of file diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 612b77b5..40d5b305 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,6 @@ [versions] # integrations -agp = "8.7.2" +agp = "8.7.3" hiddenapibypass = "4.3" truetypeparser = "2.1.4" androidx-documentfile = "1.0.1" @@ -8,15 +8,15 @@ androidx-annotation = "1.9.1" androidx-appcompat = "1.7.0" androidx-preference = "1.2.1" androidx-recyclerview = "1.3.2" -protobuf = "4.28.3" +protobuf = "4.29.2" kotlinx-serialization = "1.7.3" fastjson = "2.0.53" # patches revanced-patcher = "19.3.1" -smali = "3.0.3" +smali = "3.0.5" gson = "2.11.0" -kotlin = "2.0.21" -ksp = "2.0.21-1.0.26" +kotlin = "2.1.0" +ksp = "2.1.0-1.0.29" kotlinpoet-ksp = "2.0.0" [libraries] diff --git a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HttpUrlFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HttpUrlFingerprint.kt index 90e89b05..46bbd683 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HttpUrlFingerprint.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/HttpUrlFingerprint.kt @@ -2,4 +2,9 @@ package app.revanced.patches.bilibili.misc.okhttp.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -object HttpUrlFingerprint : MethodFingerprint(strings = listOf("javaWhitespace")) +object HttpUrlFingerprint : MethodFingerprint( + strings = listOf("javaWhitespace"), + customFingerprint = { _, classDef -> + classDef.startsWith("Lokhttp3") + } +) diff --git a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/MediaTypeGetFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/MediaTypeGetFingerprint.kt index 7c21f4f3..72dda4b5 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/MediaTypeGetFingerprint.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/MediaTypeGetFingerprint.kt @@ -2,4 +2,9 @@ package app.revanced.patches.bilibili.misc.okhttp.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint -object MediaTypeGetFingerprint : MethodFingerprint(strings = listOf("No subtype found for:")) +object MediaTypeGetFingerprint : MethodFingerprint( + strings = listOf("No subtype found for:"), + customFingerprint = { _, classDef -> + classDef.startsWith("Lokhttp3") + } +) diff --git a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseBodyFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseBodyFingerprint.kt index 3e2e9357..6dde5b51 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseBodyFingerprint.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseBodyFingerprint.kt @@ -3,5 +3,8 @@ package app.revanced.patches.bilibili.misc.okhttp.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint object ResponseBodyFingerprint : MethodFingerprint( - strings = listOf("Cannot buffer entire body for content length: ") + strings = listOf("Cannot buffer entire body for content length: "), + customFingerprint = { _, classDef -> + classDef.startsWith("Lokhttp3") + } ) diff --git a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseFingerprint.kt index 138c680f..a44a66fb 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseFingerprint.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bilibili/misc/okhttp/fingerprints/ResponseFingerprint.kt @@ -7,5 +7,6 @@ object ResponseFingerprint : MethodFingerprint( strings = listOf("Response{protocol="), customFingerprint = { _, classDef -> classDef.interfaces == listOf("Ljava/io/Closeable;") && classDef.methods.none { it.accessFlags.isNative() } + && classDef.toString() != "Lcom/tencent/cloud/ai/network/okhttp3/Response;" } ) diff --git a/patches/src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/IjkMediaPlayerOptionsFingerprint.kt b/patches/src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/IjkMediaPlayerOptionsFingerprint.kt index 15fea194..95fdc343 100644 --- a/patches/src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/IjkMediaPlayerOptionsFingerprint.kt +++ b/patches/src/main/kotlin/app/revanced/patches/bilibili/video/player/fingerprints/IjkMediaPlayerOptionsFingerprint.kt @@ -3,7 +3,7 @@ package app.revanced.patches.bilibili.video.player.fingerprints import app.revanced.patcher.fingerprint.MethodFingerprint object IjkMediaPlayerOptionsFingerprint : MethodFingerprint( - strings = listOf("enable-decoder-switch", "enable-use-https-when-forbidden"), + strings = listOf("enable-decoder-switch", "enable-accurate-seek"), parameters = listOf(), returnType = "V" ) diff --git a/settings.gradle.kts b/settings.gradle.kts index 4f6a3a1d..dcbb0a01 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,7 +33,7 @@ dependencyResolutionManagement { } plugins { - id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0" + id("org.gradle.toolchains.foojay-resolver-convention") version "0.9.0" } include(