diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/patch/HideInfocardSuggestionsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/patch/HideInfocardSuggestionsPatch.kt index 26edb949..dfad4950 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/patch/HideInfocardSuggestionsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/infocardsuggestions/patch/HideInfocardSuggestionsPatch.kt @@ -4,10 +4,8 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData -import app.revanced.patcher.extensions.addInstruction import app.revanced.patcher.extensions.addInstructions import app.revanced.patcher.extensions.removeInstruction -import app.revanced.patcher.extensions.removeInstructions import app.revanced.patcher.fingerprint.method.utils.MethodFingerprintUtils.resolve import app.revanced.patcher.patch.annotations.Dependencies import app.revanced.patcher.patch.annotations.Patch @@ -15,18 +13,12 @@ import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.util.smali.toBuilderInstruction import app.revanced.patches.youtube.ad.infocardsuggestions.annotations.HideInfocardSuggestionsCompatibility import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsFingerprint import app.revanced.patches.youtube.ad.infocardsuggestions.fingerprints.HideInfocardSuggestionsParentFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch -import org.jf.dexlib2.Opcode -import org.jf.dexlib2.builder.instruction.BuilderInstruction21t import org.jf.dexlib2.builder.instruction.BuilderInstruction35c import org.jf.dexlib2.iface.instruction.FiveRegisterInstruction -import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction -import org.jf.dexlib2.iface.instruction.OneRegisterInstruction -import org.jf.dexlib2.iface.instruction.TwoRegisterInstruction @Patch @Dependencies(dependencies = [IntegrationsPatch::class]) diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneFingerprint.kt similarity index 92% rename from src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneFingerprint.kt index 67418ab3..42077c41 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodone +package app.revanced.patches.youtube.layout.widesearchbar.fingerprints import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -7,6 +7,7 @@ import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMetho import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility +import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.Opcode @@ -15,7 +16,7 @@ import org.jf.dexlib2.Opcode "Ljkg;", "i" ) @DirectPatternScanMethod -@HideReelsCompatibility +@WideSearchbarCompatibility @Version("0.0.1") /* diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneParentFingerprint.kt similarity index 93% rename from src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneParentFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneParentFingerprint.kt index bf838519..3d4810f0 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodone/WideSearchbarOneParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarOneParentFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodone +package app.revanced.patches.youtube.layout.widesearchbar.fingerprints import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -7,6 +7,7 @@ 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.reels.annotations.HideReelsCompatibility +import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility import org.jf.dexlib2.AccessFlags @Name("wide-searchbar-methodone-parent-fingerprint") @@ -14,7 +15,7 @@ import org.jf.dexlib2.AccessFlags "Ljkg;", "l" ) @FuzzyPatternScanMethod(3) -@HideReelsCompatibility +@WideSearchbarCompatibility @Version("0.0.1") /* diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoFingerprint.kt similarity index 92% rename from src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoFingerprint.kt index 5b7d2817..29f2ae32 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodtwo +package app.revanced.patches.youtube.layout.widesearchbar.fingerprints import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -7,6 +7,7 @@ import app.revanced.patcher.fingerprint.method.annotation.DirectPatternScanMetho import app.revanced.patcher.fingerprint.method.annotation.MatchingMethod import app.revanced.patcher.fingerprint.method.impl.MethodFingerprint import app.revanced.patches.youtube.layout.reels.annotations.HideReelsCompatibility +import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility import org.jf.dexlib2.AccessFlags import org.jf.dexlib2.Opcode @@ -15,7 +16,7 @@ import org.jf.dexlib2.Opcode "Lkrf;", "h" ) @DirectPatternScanMethod -@HideReelsCompatibility +@WideSearchbarCompatibility @Version("0.0.1") /* diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoParentFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoParentFingerprint.kt similarity index 89% rename from src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoParentFingerprint.kt rename to src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoParentFingerprint.kt index 867f1b52..ae3a3f97 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/methodtwo/WideSearchbarTwoParentFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/fingerprints/WideSearchbarTwoParentFingerprint.kt @@ -1,4 +1,4 @@ -package app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodtwo +package app.revanced.patches.youtube.layout.widesearchbar.fingerprints import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -7,6 +7,7 @@ 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.reels.annotations.HideReelsCompatibility +import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility import org.jf.dexlib2.AccessFlags @Name("wide-searchbar-methodtwo-parent-fingerprint") @@ -14,7 +15,7 @@ import org.jf.dexlib2.AccessFlags "Lkrf;", "i" ) @FuzzyPatternScanMethod(3) -@HideReelsCompatibility +@WideSearchbarCompatibility @Version("0.0.1") /* diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/patch/WideSearchbarPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/patch/WideSearchbarPatch.kt index ea448382..2bf2b9bc 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/patch/WideSearchbarPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/widesearchbar/patch/WideSearchbarPatch.kt @@ -14,10 +14,10 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod import app.revanced.patches.youtube.layout.widesearchbar.annotations.WideSearchbarCompatibility -import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodone.WideSearchbarOneFingerprint -import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodone.WideSearchbarOneParentFingerprint -import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodtwo.WideSearchbarTwoFingerprint -import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.methodtwo.WideSearchbarTwoParentFingerprint +import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneFingerprint +import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarOneParentFingerprint +import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoFingerprint +import app.revanced.patches.youtube.layout.widesearchbar.fingerprints.WideSearchbarTwoParentFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch @Patch(include = false) @@ -39,7 +39,7 @@ class WideSearchbarPatch : BytecodePatch( //This should be the method aF in class fbn val targetMethodOne = - data.toMethodWalker(resultOne!!.method).nextMethod(resultOne!!.patternScanResult!!.endIndex, true).getMethod() as MutableMethod + data.toMethodWalker(resultOne!!.method).nextMethod(resultOne.patternScanResult!!.endIndex, true).getMethod() as MutableMethod //Since both methods have the same smali code, inject instructions using a method. addInstructions(targetMethodOne) @@ -48,7 +48,7 @@ class WideSearchbarPatch : BytecodePatch( //This should be the method aB in class fbn val targetMethodTwo = - data.toMethodWalker(resultTwo!!.method).nextMethod(resultTwo!!.patternScanResult!!.startIndex, true).getMethod() as MutableMethod + data.toMethodWalker(resultTwo!!.method).nextMethod(resultTwo.patternScanResult!!.startIndex, true).getMethod() as MutableMethod //Since both methods have the same smali code, inject instructions using a method. addInstructions(targetMethodTwo) diff --git a/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch.kt index 2d17a54d..5fdfd6a7 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/misc/hdrbrightness/patch/HDRBrightnessPatch.kt @@ -1,20 +1,17 @@ -package app.revanced.patches.youtube.misc.hdrbrightness.patch; +package app.revanced.patches.youtube.misc.hdrbrightness.patch -import app.revanced.patcher.annotation.Description; -import app.revanced.patcher.annotation.Name; -import app.revanced.patcher.annotation.Version; +import app.revanced.patcher.annotation.Description +import app.revanced.patcher.annotation.Name +import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.BytecodeData import app.revanced.patcher.extensions.addInstructions -import app.revanced.patcher.extensions.removeInstruction import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultError import app.revanced.patcher.patch.PatchResultSuccess -import app.revanced.patcher.patch.annotations.Patch; -import app.revanced.patcher.patch.impl.BytecodePatch; -import app.revanced.patcher.util.smali.toBuilderInstruction -import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility; +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patcher.patch.impl.BytecodePatch +import app.revanced.patches.youtube.misc.hdrbrightness.annotations.HDRBrightnessCompatibility import app.revanced.patches.youtube.misc.hdrbrightness.fingerprints.HDRBrightnessFingerprint -import org.jf.dexlib2.Opcode import org.jf.dexlib2.iface.instruction.NarrowLiteralInstruction import org.jf.dexlib2.iface.instruction.OneRegisterInstruction @@ -35,7 +32,7 @@ class HDRBrightnessPatch : BytecodePatch( val method = result.mutableMethod - //Get the index here so we know where to inject our code to override -1.0f + //Get the index here, so we know where to inject our code to override -1.0f val index = method.implementation!!.instructions.indexOfFirst { ((it as? NarrowLiteralInstruction)?.narrowLiteral == (-1.0f).toRawBits()) } val register = (method.implementation!!.instructions.get(index) as OneRegisterInstruction).registerA