chore(YouTube): replace with a fingerprint that supports a wider range of versions

This commit is contained in:
inotia00
2024-09-15 18:48:29 +09:00
parent 088f0ebf6b
commit 67d365e509
27 changed files with 392 additions and 143 deletions

View File

@ -102,8 +102,8 @@ abstract class BaseCronetImageUrlHookPatch(
// Add a helper get method that returns the URL field.
RequestFingerprint.resultOrThrow().apply {
// The url is the only string field that is set inside the constructor.
val urlFieldInstruction = mutableMethod.getInstructions().single {
if (it.opcode != Opcode.IPUT_OBJECT) return@single false
val urlFieldInstruction = mutableMethod.getInstructions().first {
if (it.opcode != Opcode.IPUT_OBJECT) return@first false
val reference = (it as ReferenceInstruction).reference as FieldReference
reference.type == "Ljava/lang/String;"