fix(YouTube - Spoof streaming data): On iOS clients, livestreams always start from the beginning

This commit is contained in:
inotia00
2024-12-16 21:54:57 +09:00
parent e8090243b1
commit d1b2fe16db
5 changed files with 31 additions and 10 deletions

View File

@ -12,6 +12,7 @@ import app.revanced.patcher.util.smali.ExternalLabel
import app.revanced.patches.shared.extension.Constants.SPOOF_PATH
import app.revanced.util.findInstructionIndicesReversedOrThrow
import app.revanced.util.fingerprint.definingClassOrThrow
import app.revanced.util.fingerprint.injectLiteralInstructionBooleanCall
import app.revanced.util.fingerprint.matchOrThrow
import app.revanced.util.fingerprint.methodOrThrow
import app.revanced.util.getReference
@ -209,6 +210,15 @@ fun baseSpoofStreamingDataPatch(
// endregion
// region Fix iOS livestream current time.
hlsCurrentTimeFingerprint.injectLiteralInstructionBooleanCall(
HLS_CURRENT_TIME_FEATURE_FLAG,
"$EXTENSION_CLASS_DESCRIPTOR->fixHLSCurrentTime(Z)Z"
)
// endregion
executeBlock()
}

View File

@ -134,3 +134,12 @@ internal val protobufClassParseByteBufferFingerprint = legacyFingerprint(
),
customFingerprint = { method, _ -> method.name == "parseFrom" },
)
internal const val HLS_CURRENT_TIME_FEATURE_FLAG = 45355374L
internal val hlsCurrentTimeFingerprint = legacyFingerprint(
name = "hlsCurrentTimeFingerprint",
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Z", "L"),
literals = listOf(HLS_CURRENT_TIME_FEATURE_FLAG),
)