mirror of
https://github.com/ReVanced/revanced-patches.git
synced 2024-11-10 01:01:56 +01:00
feat(X): Add Hide view count
patch
This commit is contained in:
parent
884c5ea1b3
commit
bf064ecc1d
3 changed files with 44 additions and 0 deletions
|
@ -1065,6 +1065,12 @@ public final class app/revanced/patches/twitch/misc/settings/SettingsResourcePat
|
|||
public static final field INSTANCE Lapp/revanced/patches/twitch/misc/settings/SettingsResourcePatch;
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch : app/revanced/patcher/patch/BytecodePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/twitter/layout/viewcount/HideViewCountPatch;
|
||||
public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
}
|
||||
|
||||
public final class app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch : app/revanced/patcher/patch/ResourcePatch {
|
||||
public static final field INSTANCE Lapp/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch;
|
||||
public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
package app.revanced.patches.twitter.layout.viewcount
|
||||
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.twitter.layout.viewcount.fingerprints.ViewCountsEnabledFingerprint
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Hide view count",
|
||||
description = "Hides the view count of Posts.",
|
||||
compatiblePackages = [CompatiblePackage("com.twitter.android")],
|
||||
use = false
|
||||
)
|
||||
@Suppress("unused")
|
||||
object HideViewCountPatch : BytecodePatch(
|
||||
setOf(ViewCountsEnabledFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) =
|
||||
ViewCountsEnabledFingerprint.result?.mutableMethod?.addInstructions(
|
||||
0,
|
||||
"""
|
||||
const/4 v0, 0x0
|
||||
return v0
|
||||
"""
|
||||
) ?: throw ViewCountsEnabledFingerprint.exception
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package app.revanced.patches.twitter.layout.viewcount.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object ViewCountsEnabledFingerprint : MethodFingerprint(
|
||||
returnType = "Z",
|
||||
strings = listOf("view_counts_public_visibility_enabled")
|
||||
)
|
Loading…
Reference in a new issue