mirror of
https://github.com/revanced/revanced-patches
synced 2024-09-03 04:56:05 +02:00
fix(Reddit is Fun - Spoof client): Use a more convincing user agent
This commit is contained in:
parent
6bc51cd906
commit
236a18f935
@ -58,13 +58,14 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult {
|
override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult {
|
||||||
// Use a random number as the user agent string.
|
// Use a random user agent.
|
||||||
val randomUserAgent = (0..100000).random()
|
val randomName = (0..100000).random()
|
||||||
|
val userAgent = "android:app.revanced.$randomName:v1.0.0 (by /u/revanced)\n"
|
||||||
|
|
||||||
first().mutableMethod.addInstructions(
|
first().mutableMethod.addInstructions(
|
||||||
0,
|
0,
|
||||||
"""
|
"""
|
||||||
const-string v0, "$randomUserAgent"
|
const-string v0, "$userAgent"
|
||||||
return-object v0
|
return-object v0
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user