diff --git a/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt index aa64423f9..41a3ab74a 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/settings/resource/patch/SettingsPatch.kt @@ -130,10 +130,19 @@ class SettingsPatch : AbstractSettingsResourcePatch( category: CategoryType, key: String, defaultValue: String + ) { + addMusicPreference(category, key, defaultValue, "") + } + + internal fun addMusicPreference( + category: CategoryType, + key: String, + defaultValue: String, + dependencyKey: String ) { val categoryValue = category.value contexts.addMusicPreferenceCategory(categoryValue) - contexts.addMusicPreference(categoryValue, key, defaultValue) + contexts.addMusicPreference(categoryValue, key, defaultValue, dependencyKey) } internal fun addMusicPreferenceWithoutSummary( @@ -146,6 +155,13 @@ class SettingsPatch : AbstractSettingsResourcePatch( contexts.addMusicPreferenceWithoutSummary(categoryValue, key, defaultValue) } + internal fun addMusicPreferenceWithIntent( + category: CategoryType, + key: String + ) { + addMusicPreferenceWithIntent(category, key, "") + } + internal fun addMusicPreferenceWithIntent( category: CategoryType, key: String, diff --git a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/bytecode/patch/SponsorBlockBytecodePatch.kt b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/bytecode/patch/SponsorBlockBytecodePatch.kt index a78f15dff..19b965420 100644 --- a/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/bytecode/patch/SponsorBlockBytecodePatch.kt +++ b/src/main/kotlin/app/revanced/patches/music/utils/sponsorblock/bytecode/patch/SponsorBlockBytecodePatch.kt @@ -14,7 +14,6 @@ import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.Music import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.MusicPlaybackControlsTimeBarOnMeasureFingerprint import app.revanced.patches.music.utils.sponsorblock.bytecode.fingerprints.SeekbarOnDrawFingerprint import app.revanced.patches.music.video.information.patch.VideoInformationPatch -import app.revanced.patches.music.utils.videoinformation.patch.VideoInformationPatch import com.android.tools.smali.dexlib2.Opcode import com.android.tools.smali.dexlib2.builder.instruction.BuilderInstruction3rc import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction @@ -26,7 +25,6 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference @DependsOn( [ SharedResourceIdPatch::class, - VideoInformationPatch::class, VideoInformationPatch::class ] ) diff --git a/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt b/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt index 92a6e80a9..74d990c9b 100644 --- a/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt +++ b/src/main/kotlin/app/revanced/util/resources/MusicResourceHelper.kt @@ -110,7 +110,8 @@ internal object MusicResourceHelper { internal fun ResourceContext.addMusicPreference( category: String, key: String, - defaultValue: String + defaultValue: String, + dependencyKey: String ) { this.xmlEditor[YOUTUBE_MUSIC_SETTINGS_PATH].use { editor -> val tags = editor.file.getElementsByTagName(YOUTUBE_MUSIC_PREFERENCE_SCREEN_TAG_NAME) @@ -122,6 +123,9 @@ internal object MusicResourceHelper { setAttribute("android:summary", "@string/$key" + "_summary") setAttribute("android:key", key) setAttribute("android:defaultValue", defaultValue) + if (dependencyKey != "") { + setAttribute("android:dependency", dependencyKey) + } } } } @@ -141,7 +145,9 @@ internal object MusicResourceHelper { setAttribute("android:title", "@string/$key" + "_title") setAttribute("android:summary", "@string/$key" + "_summary") setAttribute("android:key", key) - setAttribute("android:dependency", dependencyKey) + if (dependencyKey != "") { + setAttribute("android:dependency", dependencyKey) + } this.adoptChild("intent") { setAttribute("android:targetPackage", targetPackage) setAttribute("android:data", key) diff --git a/src/main/resources/music/settings/host/values/strings.xml b/src/main/resources/music/settings/host/values/strings.xml index 1a529df68..7c3148c46 100644 --- a/src/main/resources/music/settings/host/values/strings.xml +++ b/src/main/resources/music/settings/host/values/strings.xml @@ -8,9 +8,9 @@ Navigation Player Video - Filter component names by line-seperated + Filter component names by line-seperated. Edit custom filter - Enables custom filters + Enables custom filter to hide layout components. Enable custom filter Disables forced auto captions. Disable forced auto captions @@ -21,7 +21,7 @@ Enable color match player Enable compact dialog on phone. Enable compact dialog - Prints the debug log + Prints the debug log. Enable debug logging Add an playback speed button to the flyout panel. Enable playback speed @@ -48,7 +48,7 @@ Adds a grey tint to the video player to reduce eye strain. Enable zen mode %s is not installed. Please install it. - Package name of your installed external downloader app, such as NewPipe or Seal + Package name of your installed external downloader app, such as NewPipe or Seal. External downloader package name Watch on YouTube Hide labels in button container.