fix(Reddit is Fun - Spoof client): Use a more convincing user agent
This commit is contained in:
parent
6bc51cd906
commit
236a18f935
|
@ -58,15 +58,16 @@ 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
|
||||||
"""
|
"""
|
||||||
)
|
)
|
||||||
|
|
||||||
return PatchResultSuccess()
|
return PatchResultSuccess()
|
||||||
|
|
Loading…
Reference in a new issue