Skip to content

Commit

Permalink
fix(Reddit is Fun - Spoof client): Use a more convincing user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
oSumAtrIX committed Aug 3, 2023
1 parent 6bc51cd commit 236a18f
Showing 1 changed file with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,16 @@ class SpoofClientPatch : AbstractSpoofClientPatch(
}

override fun List<MethodFingerprintResult>.patchUserAgent(context: BytecodeContext): PatchResult {
// Use a random number as the user agent string.
val randomUserAgent = (0..100000).random()
// Use a random user agent.
val randomName = (0..100000).random()
val userAgent = "android:app.revanced.$randomName:v1.0.0 (by /u/revanced)\n"

first().mutableMethod.addInstructions(
0,
"""
const-string v0, "$randomUserAgent"
return-object v0
"""
const-string v0, "$userAgent"
return-object v0
"""
)

return PatchResultSuccess()
Expand Down

0 comments on commit 236a18f

Please sign in to comment.