generated from ReVanced/revanced-patches-template
-
-
Notifications
You must be signed in to change notification settings - Fork 279
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(YouTube - Client Spoof): Restore missing high qualities by spoofi…
…ng the iOS client user agent (#3468) Co-authored-by: LisoUseInAIKyrios <[email protected]> Co-authored-by: oSumAtrIX <[email protected]>
- Loading branch information
1 parent
cf9f49b
commit 0e6ae5f
Showing
4 changed files
with
99 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
...in/app/revanced/patches/youtube/misc/fix/playback/fingerprints/BuildRequestFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.Opcode | ||
|
||
internal object BuildRequestFingerprint : MethodFingerprint( | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.STATIC, | ||
returnType = "Lorg/chromium/net/UrlRequest;", | ||
opcodes = listOf( | ||
Opcode.INVOKE_DIRECT, | ||
Opcode.INVOKE_VIRTUAL | ||
) | ||
) |
31 changes: 31 additions & 0 deletions
31
...be/misc/fix/playback/fingerprints/CreatePlayerRequestBodyWithVersionReleaseFingerprint.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package app.revanced.patches.youtube.misc.fix.playback.fingerprints | ||
|
||
import app.revanced.patcher.extensions.or | ||
import app.revanced.patcher.fingerprint.MethodFingerprint | ||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.CreatePlayerRequestBodyWithVersionReleaseFingerprint.indexOfBuildVersionReleaseInstruction | ||
import app.revanced.util.containsWideLiteralInstructionValue | ||
import app.revanced.util.getReference | ||
import app.revanced.util.indexOfFirstInstruction | ||
import com.android.tools.smali.dexlib2.AccessFlags | ||
import com.android.tools.smali.dexlib2.iface.Method | ||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference | ||
|
||
internal object CreatePlayerRequestBodyWithVersionReleaseFingerprint : MethodFingerprint( | ||
returnType = "L", | ||
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL, | ||
parameters = listOf(), | ||
customFingerprint = { methodDef, _ -> | ||
methodDef.containsWideLiteralInstructionValue(1073741824) && | ||
indexOfBuildVersionReleaseInstruction(methodDef) >= 0 | ||
}, | ||
) { | ||
fun indexOfBuildVersionReleaseInstruction(methodDef: Method) = | ||
methodDef.indexOfFirstInstruction { | ||
val reference = getReference<FieldReference>() | ||
reference?.definingClass == "Landroid/os/Build\$VERSION;" && | ||
reference.name == "RELEASE" && | ||
reference.type == "Ljava/lang/String;" | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters