From 236a18f9356cede156417c0d55a876d25a98cd4d Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Thu, 3 Aug 2023 16:22:57 +0200 Subject: [PATCH] fix(Reddit is Fun - Spoof client): Use a more convincing user agent --- .../redditisfun/api/patch/SpoofClientPatch.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/patch/SpoofClientPatch.kt b/src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/patch/SpoofClientPatch.kt index b5228a2a..79ce2044 100644 --- a/src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/patch/SpoofClientPatch.kt +++ b/src/main/kotlin/app/revanced/patches/reddit/customclients/redditisfun/api/patch/SpoofClientPatch.kt @@ -58,15 +58,16 @@ class SpoofClientPatch : AbstractSpoofClientPatch( } override fun List.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()