From 7c563c00c91c812cfd5dd36ef306c003b851d0d1 Mon Sep 17 00:00:00 2001 From: oSumAtrIX Date: Sat, 2 Jul 2022 16:15:48 +0200 Subject: [PATCH] refactor: add package for fingerprints --- .../fingerprints/AudioOnlyEnablerFingerprint.kt | 2 ++ .../audio/exclusiveaudio/patch/ExclusiveAudioPatch.kt | 2 +- .../ad/video/fingerprints/ShowVideoAdsFingerprint.kt | 2 ++ .../patches/youtube/ad/video/patch/VideoAdsPatch.kt | 2 +- .../layout/branding/icon/patch/CustomBrandingPatch.kt | 8 ++++---- .../fingerprints/OldQualityFingerprint.kt | 2 ++ .../oldqualitylayout/patch/OldQualityLayoutPatch.kt | 8 ++++---- 7 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/fingerprints/AudioOnlyEnablerFingerprint.kt b/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/fingerprints/AudioOnlyEnablerFingerprint.kt index e9ad0e5fa..77db34b2a 100644 --- a/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/fingerprints/AudioOnlyEnablerFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/fingerprints/AudioOnlyEnablerFingerprint.kt @@ -1,3 +1,5 @@ +package app.revanced.patches.music.audio.exclusiveaudio.fingerprints + import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.extensions.or diff --git a/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/patch/ExclusiveAudioPatch.kt b/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/patch/ExclusiveAudioPatch.kt index 752045779..167e9b30d 100644 --- a/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/patch/ExclusiveAudioPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/audio/exclusiveaudio/patch/ExclusiveAudioPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.music.audio.exclusiveaudio.patch -import AudioOnlyEnablerFingerprint import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -13,6 +12,7 @@ import app.revanced.patcher.patch.PatchResultSuccess import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patches.music.audio.exclusiveaudio.annotations.ExclusiveAudioCompatibility +import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.AudioOnlyEnablerFingerprint import app.revanced.patches.music.audio.exclusiveaudio.fingerprints.ExclusiveAudioFingerprint @Patch diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt index 67e70ecf3..52dee1c9b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/fingerprints/ShowVideoAdsFingerprint.kt @@ -1,3 +1,5 @@ +package app.revanced.patches.youtube.ad.video.fingerprints + import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.extensions.or diff --git a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt index 789e0d081..a4909b8a5 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/ad/video/patch/VideoAdsPatch.kt @@ -1,6 +1,5 @@ package app.revanced.patches.youtube.ad.video.patch -import ShowVideoAdsFingerprint import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version @@ -14,6 +13,7 @@ import app.revanced.patcher.patch.annotations.Patch import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patches.youtube.ad.video.annotations.VideoAdsCompatibility import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsConstructorFingerprint +import app.revanced.patches.youtube.ad.video.fingerprints.ShowVideoAdsFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch @Patch diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt index bccde067c..abbf7ca7b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/branding/icon/patch/CustomBrandingPatch.kt @@ -4,12 +4,12 @@ import app.revanced.patcher.annotation.Description import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.data.impl.ResourceData -import app.revanced.patcher.patch.annotations.Dependencies -import app.revanced.patcher.patch.annotations.Patch -import app.revanced.patcher.patch.impl.ResourcePatch import app.revanced.patcher.patch.PatchResult import app.revanced.patcher.patch.PatchResultError 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.ResourcePatch import app.revanced.patches.youtube.layout.branding.icon.annotations.CustomBrandingCompatibility import app.revanced.patches.youtube.misc.manifest.patch.FixLocaleConfigErrorPatch import java.nio.file.Files @@ -24,7 +24,7 @@ import java.nio.file.Files @Version("0.0.1") class CustomBrandingPatch : ResourcePatch() { override fun execute(data: ResourceData): PatchResult { - val resDirectory = data.get("res") + val resDirectory = data["res"] if (!resDirectory.isDirectory) return PatchResultError("The res folder can not be found.") val iconNames = arrayOf( diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/fingerprints/OldQualityFingerprint.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/fingerprints/OldQualityFingerprint.kt index e972153fd..b6f072262 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/fingerprints/OldQualityFingerprint.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/fingerprints/OldQualityFingerprint.kt @@ -1,3 +1,5 @@ +package app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints + import app.revanced.patcher.annotation.Name import app.revanced.patcher.annotation.Version import app.revanced.patcher.extensions.or diff --git a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/patch/OldQualityLayoutPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/patch/OldQualityLayoutPatch.kt index 7bcab9ee2..7366c1cf8 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/patch/OldQualityLayoutPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/layout/oldqualitylayout/patch/OldQualityLayoutPatch.kt @@ -1,19 +1,19 @@ package app.revanced.patches.youtube.layout.oldqualitylayout.patch -import OldQualityFingerprint 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.fingerprint.method.utils.MethodFingerprintUtils.resolve -import app.revanced.patcher.patch.annotations.Dependencies -import app.revanced.patcher.patch.annotations.Patch -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.patch.annotations.Dependencies +import app.revanced.patcher.patch.annotations.Patch +import app.revanced.patcher.patch.impl.BytecodePatch import app.revanced.patches.youtube.layout.oldqualitylayout.annotations.OldQualityLayoutCompatibility +import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.OldQualityFingerprint import app.revanced.patches.youtube.layout.oldqualitylayout.fingerprints.OldQualityParentFingerprint import app.revanced.patches.youtube.misc.integrations.patch.IntegrationsPatch import org.jf.dexlib2.Opcode