File tree Expand file tree Collapse file tree 3 files changed +44
-0
lines changed
src/main/kotlin/app/revanced/patches/twitter/layout/viewcount Expand file tree Collapse file tree 3 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -1065,6 +1065,12 @@ public final class app/revanced/patches/twitch/misc/settings/SettingsResourcePat
10651065 public static final field INSTANCE Lapp/revanced/patches/twitch/misc/settings/SettingsResourcePatch;
10661066}
10671067
1068+ public final class app/revanced/patches/twitter/layout/viewcount/HideViewCountPatch : app/revanced/patcher/patch/BytecodePatch {
1069+ public static final field INSTANCE Lapp/revanced/patches/twitter/layout/viewcount/HideViewCountPatch;
1070+ public fun execute (Lapp/revanced/patcher/data/BytecodeContext;)V
1071+ public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
1072+ }
1073+
10681074public final class app/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch : app/revanced/patcher/patch/ResourcePatch {
10691075 public static final field INSTANCE Lapp/revanced/patches/twitter/misc/dynamiccolor/DynamicColorPatch;
10701076 public synthetic fun execute (Lapp/revanced/patcher/data/Context;)V
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.twitter.layout.viewcount
2+
3+
4+ import app.revanced.patcher.data.BytecodeContext
5+ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
6+ import app.revanced.patcher.patch.BytecodePatch
7+ import app.revanced.patcher.patch.annotation.CompatiblePackage
8+ import app.revanced.patcher.patch.annotation.Patch
9+ import app.revanced.patches.twitter.layout.viewcount.fingerprints.ViewCountsEnabledFingerprint
10+ import app.revanced.util.exception
11+
12+ @Patch(
13+ name = " Hide view count" ,
14+ description = " Hides the view count of Posts." ,
15+ compatiblePackages = [CompatiblePackage (" com.twitter.android" )],
16+ use = false
17+ )
18+ @Suppress(" unused" )
19+ object HideViewCountPatch : BytecodePatch(
20+ setOf(ViewCountsEnabledFingerprint )
21+ ) {
22+ override fun execute (context : BytecodeContext ) =
23+ ViewCountsEnabledFingerprint .result?.mutableMethod?.addInstructions(
24+ 0 ,
25+ """
26+ const/4 v0, 0x0
27+ return v0
28+ """
29+ ) ? : throw ViewCountsEnabledFingerprint .exception
30+ }
Original file line number Diff line number Diff line change 1+ package app.revanced.patches.twitter.layout.viewcount.fingerprints
2+
3+ import app.revanced.patcher.fingerprint.MethodFingerprint
4+
5+ internal object ViewCountsEnabledFingerprint : MethodFingerprint(
6+ returnType = " Z" ,
7+ strings = listOf("view_counts_public_visibility_enabled")
8+ )
You can’t perform that action at this time.
0 commit comments