fix: autorepeat-by-default patch (#148)

This commit is contained in:
TheJeterLP 2022-07-11 08:56:33 +02:00 committed by GitHub
parent 1fbc7b4337
commit fe628ba909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 14 deletions

View File

@ -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.Compatibility
import app.revanced.patcher.annotation.Package import app.revanced.patcher.annotation.Package

View File

@ -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.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
import app.revanced.patcher.extensions.or 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.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod 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 import org.jf.dexlib2.AccessFlags
@Name("auto-repeat-fingerprint") @Name("auto-repeat-fingerprint")
@ -25,8 +25,8 @@ public final void ae() {
object AutoRepeatFingerprint : MethodFingerprint( object AutoRepeatFingerprint : MethodFingerprint(
"V", "V",
AccessFlags.PUBLIC or AccessFlags.FINAL, AccessFlags.PUBLIC or AccessFlags.FINAL,
listOf(),
null, null,
null, null,
null, customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 && methodDef.annotations.isEmpty()}
customFingerprint = { methodDef -> methodDef.implementation!!.instructions.count() == 3 }
) )

View File

@ -1,4 +1,4 @@
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.Name
import app.revanced.patcher.annotation.Version import app.revanced.patcher.annotation.Version
@ -6,7 +6,7 @@ import app.revanced.patcher.extensions.or
import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint
import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod import app.revanced.patcher.fingerprint.method.annotation.FuzzyPatternScanMethod
import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod 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 import org.jf.dexlib2.AccessFlags
@Name("auto-repeat-parent-fingerprint") @Name("auto-repeat-parent-fingerprint")

View File

@ -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.Description
import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Name
@ -13,9 +13,9 @@ import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.Dependencies import app.revanced.patcher.patch.annotations.Dependencies
import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.patch.impl.BytecodePatch
import app.revanced.patches.youtube.layout.autorepeat.annotations.AutoRepeatCompatibility import app.revanced.patches.youtube.misc.autorepeat.annotations.AutoRepeatCompatibility
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatFingerprint import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatFingerprint
import app.revanced.patches.youtube.layout.autorepeat.fingerprints.AutoRepeatParentFingerprint import app.revanced.patches.youtube.misc.autorepeat.fingerprints.AutoRepeatParentFingerprint
import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch
@Patch(include = false) @Patch(include = false)
@ -50,8 +50,7 @@ class AutoRepeatPatch : BytecodePatch(
invoke-static {}, Lapp/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat()Z invoke-static {}, Lapp/revanced/integrations/patches/AutoRepeatPatch;->shouldAutoRepeat()Z
move-result v0 move-result v0
if-eqz v0, :noautorepeat if-eqz v0, :noautorepeat
const/4 v0, 0x0 invoke-virtual {p0}, $methodToCall
invoke-virtual {}, $methodToCall
:noautorepeat :noautorepeat
return-void return-void
""" """