Skip to content

Commit

Permalink
fix: autorepeat-by-default patch (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
TheJeterLP authored Jul 11, 2022
1 parent 1fbc7b4 commit fe628ba
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.autorepeat.annotations
package app.revanced.patches.youtube.misc.autorepeat.annotations

import app.revanced.patcher.annotation.Compatibility
import app.revanced.patcher.annotation.Package
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package app.revanced.patches.youtube.layout.autorepeat.fingerprints
package app.revanced.patches.youtube.misc.autorepeat.fingerprints

import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import org.jf.dexlib2.AccessFlags

@Name("auto-repeat-fingerprint")
Expand All @@ -25,8 +25,8 @@ public final void ae() {
object AutoRepeatFingerprint : MethodFingerprint(
"V",
AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf(),
null,
null,
null,
customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 }
customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 && methodDef.annotations.isEmpty()}
)
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package app.revanced.patches.youtube.layout.autorepeat.fingerprints
package app.revanced.patches.youtube.misc.autorepeat.fingerprints

import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import org.jf.dexlib2.AccessFlags

@Name("auto-repeat-parent-fingerprint")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package app.revanced.patches.youtube.layout.autorepeat.patch
package app.revanced.patches.youtube.misc.autorepeat.patch

import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
Expand All @@ -13,9 +13,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatFingerprint
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatParentFingerprint
import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatFingerprint
import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch

@Patch(include = false)
Expand Down Expand Up @@ -50,8 +50,7 @@ class AutoRepeatPatch : BytecodePatch(
invoke-static {}, Lapp/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat()Z
move-result v0
if-eqz v0, :noautorepeat
const/4 v0, 0x0
invoke-virtual {}, $methodToCall
invoke-virtual {p0}, $methodToCall
:noautorepeat
return-void
"""
Expand Down

0 comments on commit fe628ba

Please sign in to comment.