feat: Move strings to resources for localization (#2440)
Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de> Co-authored-by: semantic-release-bot <semantic-release-bot@martynus.net> Co-authored-by: Aunali321 <aunvakil.aa@gmail.com> BREAKING CHANGE: Various APIs have been changed.
This commit is contained in:
committed by
GitHub
co-authored by
oSumAtrIX
semantic-release-bot
Aunali321
parent
15a83a6d28
commit
55fb1ebd9d
@@ -3,9 +3,9 @@ package app.revanced.patches.youtube.ad.general
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen
|
||||
@@ -14,7 +14,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch.PreferenceScreen
|
||||
dependencies = [
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
object HideAdsResourcePatch : ResourcePatch() {
|
||||
@@ -24,61 +25,18 @@ object HideAdsResourcePatch : ResourcePatch() {
|
||||
internal var adAttributionId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
PreferenceScreen.ADS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_general_ads",
|
||||
StringResource("revanced_hide_general_ads_title", "Hide general ads"),
|
||||
StringResource("revanced_hide_general_ads_summary_on", "General ads are hidden"),
|
||||
StringResource("revanced_hide_general_ads_summary_off", "General ads are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_fullscreen_ads",
|
||||
StringResource("revanced_hide_fullscreen_ads_title", "Hide fullscreen ads"),
|
||||
StringResource("revanced_hide_fullscreen_ads_summary_on", "Fullscreen ads are hidden"),
|
||||
StringResource("revanced_hide_fullscreen_ads_summary_off", "Fullscreen ads are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_buttoned_ads",
|
||||
StringResource("revanced_hide_buttoned_ads_title", "Hide buttoned ad"),
|
||||
StringResource("revanced_hide_buttoned_ads_summary_on", "Buttoned ads are hidden"),
|
||||
StringResource("revanced_hide_buttoned_ads_summary_off", "Buttoned ads are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_paid_content_ads",
|
||||
StringResource("revanced_hide_paid_content_ads_title", "Hide paid content"),
|
||||
StringResource("revanced_hide_paid_content_ads_summary_on", "Paid content is hidden"),
|
||||
StringResource("revanced_hide_paid_content_ads_summary_off", "Paid content is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_self_sponsor_ads",
|
||||
StringResource("revanced_hide_self_sponsor_ads_title", "Hide self sponsored cards"),
|
||||
StringResource("revanced_hide_self_sponsor_ads_summary_on", "Self sponsored cards are hidden"),
|
||||
StringResource("revanced_hide_self_sponsor_ads_summary_off", "Self sponsored cards are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_products_banner",
|
||||
StringResource("revanced_hide_products_banner_title", "Hide banner to view products"),
|
||||
StringResource("revanced_hide_products_banner_summary_on", "Banner is hidden"),
|
||||
StringResource("revanced_hide_products_banner_summary_off", "Banner is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shopping_links",
|
||||
StringResource("revanced_hide_shopping_links_title", "Hide shopping links in video description"),
|
||||
StringResource("revanced_hide_shopping_links_summary_on", "Shopping links are hidden"),
|
||||
StringResource("revanced_hide_shopping_links_summary_off", "Shopping links are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_web_search_results",
|
||||
StringResource("revanced_hide_web_search_results_title", "Hide web search results"),
|
||||
StringResource("revanced_hide_web_search_results_summary_on", "Web search results are hidden"),
|
||||
StringResource("revanced_hide_web_search_results_summary_off", "Web search results are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_merchandise_banners",
|
||||
StringResource("revanced_hide_merchandise_banners_title", "Hide merchandise banners"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_on", "Merchandise banners are hidden"),
|
||||
StringResource("revanced_hide_merchandise_banners_summary_off", "Merchandise banners are shown")
|
||||
)
|
||||
SwitchPreference("revanced_hide_general_ads"),
|
||||
SwitchPreference("revanced_hide_fullscreen_ads"),
|
||||
SwitchPreference("revanced_hide_buttoned_ads"),
|
||||
SwitchPreference("revanced_hide_paid_content_ads"),
|
||||
SwitchPreference("revanced_hide_self_sponsor_ads"),
|
||||
SwitchPreference("revanced_hide_products_banner"),
|
||||
SwitchPreference("revanced_hide_shopping_links"),
|
||||
SwitchPreference("revanced_hide_web_search_results"),
|
||||
SwitchPreference("revanced_hide_merchandise_banners")
|
||||
)
|
||||
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
package app.revanced.patches.youtube.ad.getpremium
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.ad.getpremium.fingerprints.GetPremiumViewFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
description = "Hides YouTube Premium signup promotions under the video player.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -40,23 +40,9 @@ object HideGetPremiumPatch : BytecodePatch(setOf(GetPremiumViewFingerprint)) {
|
||||
"Lapp/revanced/integrations/youtube/patches/HideGetPremiumPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.ADS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_get_premium",
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_title",
|
||||
"Hide YouTube Premium promotions"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_on",
|
||||
"YouTube Premium promotions under video player are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_get_premium_summary_off",
|
||||
"YouTube Premium promotions under video player are shown"
|
||||
)
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.ADS.addPreferences(SwitchPreference("revanced_hide_get_premium"))
|
||||
|
||||
GetPremiumViewFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
||||
@@ -7,8 +7,8 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.ad.video.fingerprints.LoadVideoAdsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@@ -18,7 +18,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
description = "Adds an option to remove ads in the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -44,14 +45,9 @@ object VideoAdsPatch : BytecodePatch(
|
||||
setOf(LoadVideoAdsFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.ADS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_video_ads",
|
||||
StringResource("revanced_hide_video_ads_title", "Hide video ads"),
|
||||
StringResource("revanced_hide_video_ads_summary_on", "Video ads are hidden"),
|
||||
StringResource("revanced_hide_video_ads_summary_off", "Video ads are shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.ADS.addPreferences(SwitchPreference("revanced_hide_video_ads"))
|
||||
|
||||
val loadVideoAdsFingerprintMethod = LoadVideoAdsFingerprint.result!!.mutableMethod
|
||||
|
||||
|
||||
+11
-30
@@ -3,50 +3,31 @@ package app.revanced.patches.youtube.interaction.copyvideourl
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
BottomControlsResourcePatch::class
|
||||
BottomControlsResourcePatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_copy_video_url_preference_screen",
|
||||
StringResource("revanced_copy_video_url_preference_screen_title", "Copy video URL settings"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_copy_video_url",
|
||||
StringResource("revanced_copy_video_url_title", "Show copy video URL button"),
|
||||
StringResource(
|
||||
"revanced_copy_video_url_summary_on",
|
||||
"Button is shown. Tap to copy video URL. Tap and hold to copy video URL with timestamp"
|
||||
),
|
||||
StringResource("revanced_copy_video_url_summary_off", "Button is not shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_copy_video_url_timestamp",
|
||||
StringResource("revanced_copy_video_url_timestamp_title", "Show copy timestamp URL button"),
|
||||
StringResource(
|
||||
"revanced_copy_video_url_timestamp_summary_on",
|
||||
"Button is shown. Tap to copy video URL with timestamp. Tap and hold to copy video without timestamp"
|
||||
),
|
||||
StringResource("revanced_copy_video_url_timestamp_summary_off", "Button is not shown")
|
||||
)
|
||||
),
|
||||
StringResource(
|
||||
"revanced_copy_video_url_preference_screen_summary",
|
||||
"Settings related to copy URL buttons in video player"
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_copy_video_url"),
|
||||
SwitchPreference("revanced_copy_video_url_timestamp")
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -59,7 +40,7 @@ internal object CopyVideoUrlResourcePatch : ResourcePatch() {
|
||||
)
|
||||
)
|
||||
|
||||
context.mergeStrings("copyvideourl/host/values/strings.xml")
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
BottomControlsResourcePatch.addControls("copyvideourl")
|
||||
}
|
||||
|
||||
+6
-24
@@ -6,8 +6,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.dialog.fingerprints.CreateDialogFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@@ -18,7 +18,7 @@ import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
name = "Remove viewer discretion dialog",
|
||||
description = "Adds an option to remove the dialog that appears when opening a video that has been age-restricted " +
|
||||
"by accepting it automatically. This does not bypass the age restriction.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -46,27 +46,9 @@ object RemoveViewerDiscretionDialogPatch : BytecodePatch(
|
||||
"confirmDialog(Landroid/app/AlertDialog;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_remove_viewer_discretion_dialog",
|
||||
StringResource(
|
||||
"revanced_remove_viewer_discretion_dialog_title",
|
||||
"Remove viewer discretion dialog"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remove_viewer_discretion_dialog_summary_on",
|
||||
"Dialog will be removed"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remove_viewer_discretion_dialog_summary_off",
|
||||
"Dialog will be shown"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remove_viewer_discretion_dialog_user_dialog_message",
|
||||
"This does not bypass the age restriction. It just accepts it automatically."
|
||||
)
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(SwitchPreference("revanced_remove_viewer_discretion_dialog"))
|
||||
|
||||
CreateDialogFingerprint.result?.mutableMethod?.apply {
|
||||
val showDialogIndex = implementation!!.instructions.lastIndex - 2
|
||||
|
||||
+12
-30
@@ -3,55 +3,37 @@ package app.revanced.patches.youtube.interaction.downloads
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.misc.playercontrols.BottomControlsResourcePatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
BottomControlsResourcePatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class,
|
||||
]
|
||||
)
|
||||
internal object ExternalDownloadsResourcePatch : ResourcePatch() {
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_external_downloader_preference_screen",
|
||||
StringResource("revanced_external_downloader_preference_screen_title", "External download settings"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_external_downloader",
|
||||
StringResource("revanced_external_downloader_title", "Show external download button"),
|
||||
StringResource("revanced_external_downloader_summary_on", "Download button shown in player"),
|
||||
StringResource(
|
||||
"revanced_external_downloader_summary_off",
|
||||
"Download button not shown in player"
|
||||
)
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_external_downloader_name",
|
||||
StringResource("revanced_external_downloader_name_title", "Downloader package name"),
|
||||
StringResource(
|
||||
"revanced_external_downloader_name_summary",
|
||||
"Package name of your installed external downloader app, such as NewPipe or Seal"
|
||||
),
|
||||
InputType.TEXT
|
||||
)
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_external_downloader"),
|
||||
TextPreference("revanced_external_downloader_name", inputType = InputType.TEXT)
|
||||
),
|
||||
StringResource(
|
||||
"revanced_external_downloader_preference_screen_summary",
|
||||
"Settings for using an external downloader"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
context.mergeStrings("downloads/host/values/strings.xml")
|
||||
|
||||
context.copyResources(
|
||||
"downloads",
|
||||
ResourceGroup("drawable", "revanced_yt_download_button.xml")
|
||||
|
||||
+7
-10
@@ -1,23 +1,23 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.IsSwipingUpFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable precise seeking gesture",
|
||||
description = "Adds an option to disable precise seeking when swiping up on the seekbar.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -46,13 +46,10 @@ object DisablePreciseSeekingGesturePatch : BytecodePatch(
|
||||
"disableGesture(Landroid/view/VelocityTracker;Landroid/view/MotionEvent;)V"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_precise_seeking_gesture",
|
||||
StringResource("revanced_disable_precise_seeking_gesture_title", "Disable precise seeking gesture"),
|
||||
StringResource("revanced_disable_precise_seeking_gesture_summary_on", "Gesture is disabled"),
|
||||
StringResource("revanced_disable_precise_seeking_gesture_summary_off", "Gesture is enabled"),
|
||||
)
|
||||
SwitchPreference("revanced_disable_precise_seeking_gesture")
|
||||
)
|
||||
|
||||
IsSwipingUpFingerprint.result?.let {
|
||||
|
||||
+7
-12
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -8,12 +7,13 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.OnTouchEventHandlerFingerprint
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SeekbarTappingFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction35c
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
@@ -22,7 +22,7 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
name = "Seekbar tapping",
|
||||
description = "Adds an option to enable tap-to-seek on the seekbar of the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class, SettingsPatch::class],
|
||||
IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -47,14 +47,9 @@ object EnableSeekbarTappingPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_seekbar_tapping",
|
||||
StringResource("revanced_seekbar_tapping_title", "Enable seekbar tapping"),
|
||||
StringResource("revanced_seekbar_tapping_summary_on", "Seekbar tapping is enabled"),
|
||||
StringResource("revanced_seekbar_tapping_summary_off", "Seekbar tapping is disabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(SwitchPreference("revanced_seekbar_tapping"))
|
||||
|
||||
// Find the required methods to tap the seekbar.
|
||||
val seekbarTappingMethods = OnTouchEventHandlerFingerprint.result?.let {
|
||||
|
||||
+7
-21
@@ -1,24 +1,24 @@
|
||||
package app.revanced.patches.youtube.interaction.seekbar
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.DoubleSpeedSeekNoticeFingerprint
|
||||
import app.revanced.patches.youtube.interaction.seekbar.fingerprints.SlideToSeekFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Enable slide to seek",
|
||||
description = "Adds an option to enable slide to seek instead of playing at 2x speed when pressing and holding in the video player. Including this patch may cause issues with tapping or double tapping the video player overlay.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -46,23 +46,9 @@ object EnableSlideToSeekPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/SlideToSeekPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_slide_to_seek",
|
||||
StringResource(
|
||||
"revanced_slide_to_seek_title",
|
||||
"Enable slide to seek"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_slide_to_seek_summary_on",
|
||||
"Slide to seek is enabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_slide_to_seek_summary_off",
|
||||
"Slide to seek is not enabled"
|
||||
),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(SwitchPreference("revanced_slide_to_seek"))
|
||||
|
||||
arrayOf(
|
||||
// Restore the behaviour to slide to seek.
|
||||
|
||||
+23
-79
@@ -3,92 +3,36 @@ package app.revanced.patches.youtube.interaction.swipecontrols
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class]
|
||||
dependencies = [SettingsPatch::class, AddResourcesPatch::class]
|
||||
)
|
||||
internal object SwipeControlsResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.INTERACTIONS.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_swipe_controls_preference_screen",
|
||||
StringResource("revanced_swipe_controls_preference_screen_title", "Swipe controls"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_swipe_brightness",
|
||||
StringResource("revanced_swipe_brightness_title", "Enable brightness gesture"),
|
||||
StringResource("revanced_swipe_brightness_summary_on", "Brightness swipe is enabled"),
|
||||
StringResource("revanced_swipe_brightness_summary_off", "Brightness swipe is disabled")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_swipe_volume",
|
||||
StringResource("revanced_swipe_volume_title", "Enable volume gesture"),
|
||||
StringResource("revanced_swipe_volume_summary_on", "Volume swipe is enabled"),
|
||||
StringResource("revanced_swipe_volume_summary_off", "Volume swipe is disabled")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_swipe_press_to_engage",
|
||||
StringResource("revanced_swipe_press_to_engage_title", "Enable press-to-swipe gesture"),
|
||||
StringResource("revanced_swipe_press_to_engage_summary_on", "Press-to-swipe is enabled"),
|
||||
StringResource("revanced_swipe_press_to_engage_summary_off", "Press-to-swipe is disabled")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_swipe_haptic_feedback",
|
||||
StringResource("revanced_swipe_haptic_feedback_title", "Enable haptic feedback"),
|
||||
StringResource("revanced_swipe_haptic_feedback_summary_on", "Haptic feedback is enabled"),
|
||||
StringResource("revanced_swipe_haptic_feedback_summary_off", "Haptic feedback is disabled")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_swipe_save_and_restore_brightness",
|
||||
StringResource("revanced_swipe_save_and_restore_brightness_title", "Save and restore brightness"),
|
||||
StringResource(
|
||||
"revanced_swipe_save_and_restore_brightness_summary_on",
|
||||
"Save and restore brightness when exiting or entering fullscreen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_swipe_save_and_restore_brightness_summary_off",
|
||||
"Do not save and restore brightness when exiting or entering fullscreen"
|
||||
)
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_swipe_overlay_timeout",
|
||||
StringResource("revanced_swipe_overlay_timeout_title", "Swipe overlay timeout"),
|
||||
StringResource(
|
||||
"revanced_swipe_overlay_timeout_summary",
|
||||
"The amount of milliseconds the overlay is visible"
|
||||
),
|
||||
InputType.NUMBER
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_swipe_text_overlay_size",
|
||||
StringResource("revanced_swipe_text_overlay_size_title", "Swipe overlay text size"),
|
||||
StringResource("revanced_swipe_text_overlay_size_summary", "The text size for swipe overlay"),
|
||||
InputType.NUMBER
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_swipe_overlay_background_alpha",
|
||||
StringResource("revanced_swipe_overlay_background_alpha_title", "Swipe background visibility"),
|
||||
StringResource(
|
||||
"revanced_swipe_overlay_background_alpha_summary",
|
||||
"The visibility of swipe overlay background"
|
||||
),
|
||||
InputType.NUMBER
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_swipe_threshold",
|
||||
StringResource("revanced_swipe_threshold_title", "Swipe magnitude threshold"),
|
||||
StringResource(
|
||||
"revanced_swipe_threshold_summary",
|
||||
"The amount of threshold for swipe to occur"
|
||||
),
|
||||
InputType.NUMBER
|
||||
)
|
||||
key = "revanced_swipe_controls_preference_screen",
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_swipe_brightness"),
|
||||
SwitchPreference("revanced_swipe_volume"),
|
||||
SwitchPreference("revanced_swipe_press_to_engage"),
|
||||
SwitchPreference("revanced_swipe_haptic_feedback"),
|
||||
SwitchPreference("revanced_swipe_save_and_restore_brightness"),
|
||||
TextPreference("revanced_swipe_overlay_timeout", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_text_overlay_size", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_overlay_background_alpha", inputType = InputType.NUMBER),
|
||||
TextPreference("revanced_swipe_threshold", inputType = InputType.NUMBER)
|
||||
),
|
||||
StringResource("revanced_swipe_controls_preference_screen_summary","Control volume and brightness")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -96,10 +40,10 @@ internal object SwipeControlsResourcePatch : ResourcePatch() {
|
||||
"swipecontrols",
|
||||
ResourceGroup(
|
||||
"drawable",
|
||||
"ic_sc_brightness_auto.xml",
|
||||
"ic_sc_brightness_manual.xml",
|
||||
"ic_sc_volume_mute.xml",
|
||||
"ic_sc_volume_normal.xml"
|
||||
"revanced_ic_sc_brightness_auto.xml",
|
||||
"revanced_ic_sc_brightness_manual.xml",
|
||||
"revanced_ic_sc_volume_mute.xml",
|
||||
"revanced_ic_sc_volume_normal.xml"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+7
-12
@@ -1,25 +1,25 @@
|
||||
package app.revanced.patches.youtube.layout.autocaptions
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.StartVideoInformerFingerprint
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.SubtitleTrackFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
|
||||
@Patch(
|
||||
name = "Disable auto captions",
|
||||
description = "Adds an option to disable captions from being automatically enabled.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -44,14 +44,9 @@ object AutoCaptionsPatch : BytecodePatch(
|
||||
setOf(StartVideoInformerFingerprint, SubtitleButtonControllerFingerprint, SubtitleTrackFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_auto_captions",
|
||||
StringResource("revanced_auto_captions_title", "Disable auto captions"),
|
||||
StringResource("revanced_auto_captions_summary_on", "Auto captions are disabled"),
|
||||
StringResource("revanced_auto_captions_summary_off", "Auto captions are enabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_auto_captions"))
|
||||
|
||||
mapOf(
|
||||
StartVideoInformerFingerprint to 0,
|
||||
|
||||
+19
-68
@@ -4,10 +4,10 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@@ -16,7 +16,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
description = "Adds options to hide action buttons (such as the Download button) under videos.",
|
||||
dependencies = [
|
||||
ResourceMappingPatch::class,
|
||||
LithoFilterPatch::class
|
||||
LithoFilterPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -43,73 +44,23 @@ object HideButtonsPatch : ResourcePatch() {
|
||||
"Lapp/revanced/integrations/youtube/patches/components/ButtonsFilter;"
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_hide_buttons_preference_screen",
|
||||
StringResource("revanced_hide_buttons_preference_screen_title", "Hide action buttons"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_like_dislike_button",
|
||||
StringResource("revanced_hide_like_dislike_button_title", "Hide like and dislike buttons"),
|
||||
StringResource("revanced_hide_like_dislike_button_summary_on", "Like and dislike buttons are hidden"),
|
||||
StringResource("revanced_hide_like_dislike_button_summary_off", "Like and dislike buttons are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_live_chat_button",
|
||||
StringResource("revanced_hide_live_chat_button_title", "Hide live chat button"),
|
||||
StringResource("revanced_hide_live_chat_button_summary_on", "Live chat button is hidden"),
|
||||
StringResource("revanced_hide_live_chat_button_summary_off", "Live chat button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_share_button",
|
||||
StringResource("revanced_hide_share_button_title", "Hide share button"),
|
||||
StringResource("revanced_hide_share_button_summary_on", "Share button is hidden"),
|
||||
StringResource("revanced_hide_share_button_summary_off", "Share button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_report_button",
|
||||
StringResource("revanced_hide_report_button_title", "Hide report button"),
|
||||
StringResource("revanced_hide_report_button_summary_on", "Report button is hidden"),
|
||||
StringResource("revanced_hide_report_button_summary_off", "Report button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_remix_button",
|
||||
StringResource("revanced_hide_remix_button_title", "Hide remix button"),
|
||||
StringResource("revanced_hide_remix_button_summary_on", "Remix button is hidden"),
|
||||
StringResource("revanced_hide_remix_button_summary_off", "Remix button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_download_button",
|
||||
StringResource("revanced_hide_download_button_title", "Hide download button"),
|
||||
StringResource("revanced_hide_download_button_summary_on", "Download button is hidden"),
|
||||
StringResource("revanced_hide_download_button_summary_off", "Download button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_thanks_button",
|
||||
StringResource("revanced_hide_thanks_button_title", "Hide thanks button"),
|
||||
StringResource("revanced_hide_thanks_button_summary_on", "Thanks button is hidden"),
|
||||
StringResource("revanced_hide_thanks_button_summary_off", "Thanks button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_clip_button",
|
||||
StringResource("revanced_hide_clip_button_title", "Hide clip button"),
|
||||
StringResource("revanced_hide_clip_button_summary_on", "Clip button is hidden"),
|
||||
StringResource("revanced_hide_clip_button_summary_off", "Clip button is shown"),
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_playlist_button",
|
||||
StringResource("revanced_hide_playlist_button_title", "Hide save to playlist button"),
|
||||
StringResource("revanced_hide_playlist_button_summary_on", "Save button is hidden"),
|
||||
StringResource("revanced_hide_playlist_button_summary_off", "Save button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shop_button",
|
||||
StringResource("revanced_hide_shop_button_title", "Hide shop button"),
|
||||
StringResource("revanced_hide_shop_button_summary_on", "Shop button is hidden"),
|
||||
StringResource("revanced_hide_shop_button_summary_off", "Shop button is shown")
|
||||
)
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_like_dislike_button"),
|
||||
SwitchPreference("revanced_hide_live_chat_button"),
|
||||
SwitchPreference("revanced_hide_share_button"),
|
||||
SwitchPreference("revanced_hide_report_button"),
|
||||
SwitchPreference("revanced_hide_remix_button"),
|
||||
SwitchPreference("revanced_hide_download_button"),
|
||||
SwitchPreference("revanced_hide_thanks_button"),
|
||||
SwitchPreference("revanced_hide_clip_button"),
|
||||
SwitchPreference("revanced_hide_playlist_button"),
|
||||
SwitchPreference("revanced_hide_shop_button")
|
||||
),
|
||||
StringResource("revanced_hide_buttons_preference_screen_summary", "Hide or show buttons under videos")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+10
-14
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.buttons.autoplay
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.findIndexForIdResource
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -9,12 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.shared.fingerprints.LayoutConstructorFingerprint
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.findIndexForIdResource
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
@@ -26,7 +26,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -52,14 +53,9 @@ object HideAutoplayButtonPatch : BytecodePatch(
|
||||
setOf(LayoutConstructorFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_autoplay_button",
|
||||
StringResource("revanced_hide_autoplay_button_title", "Hide autoplay button"),
|
||||
StringResource("revanced_hide_autoplay_button_summary_on", "Autoplay button is hidden"),
|
||||
StringResource("revanced_hide_autoplay_button_summary_off", "Autoplay button is shown")
|
||||
),
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_autoplay_button"))
|
||||
|
||||
LayoutConstructorFingerprint.result?.mutableMethod?.apply {
|
||||
val layoutGenMethodInstructions = implementation!!.instructions
|
||||
|
||||
+7
-11
@@ -5,8 +5,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.autocaptions.fingerprints.SubtitleButtonControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@@ -17,7 +17,8 @@ import com.android.tools.smali.dexlib2.Opcode
|
||||
description = "Adds an option to hide the captions button in the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -43,14 +44,9 @@ object HideCaptionsButtonPatch : BytecodePatch(
|
||||
setOf(SubtitleButtonControllerFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_captions_button",
|
||||
StringResource("revanced_hide_captions_button_title", "Hide captions button"),
|
||||
StringResource("revanced_hide_captions_button_summary_on", "Captions button is hidden"),
|
||||
StringResource("revanced_hide_captions_button_summary_off", "Captions button is shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_captions_button"))
|
||||
|
||||
val subtitleButtonControllerMethod = SubtitleButtonControllerFingerprint.result!!.mutableMethod
|
||||
|
||||
|
||||
+7
-11
@@ -6,8 +6,8 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@@ -16,7 +16,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
description = "Adds an option to hide the cast button in the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage("com.google.android.youtube")
|
||||
@@ -24,14 +25,9 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
)
|
||||
object HideCastButtonPatch : BytecodePatch() {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_cast_button",
|
||||
StringResource("revanced_hide_cast_button_title", "Hide cast button"),
|
||||
StringResource("revanced_hide_cast_button_summary_on", "Cast button is hidden"),
|
||||
StringResource("revanced_hide_cast_button_summary_off", "Cast button is shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_cast_button"))
|
||||
|
||||
val buttonClass = context.findClass("MediaRouteButton")
|
||||
?: throw PatchException("MediaRouteButton class not found.")
|
||||
|
||||
+17
-56
@@ -1,20 +1,20 @@
|
||||
package app.revanced.patches.youtube.layout.buttons.navigation
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.buttons.navigation.fingerprints.*
|
||||
import app.revanced.patches.youtube.layout.buttons.navigation.utils.InjectionUtils.REGISTER_TEMPLATE_REPLACEMENT
|
||||
import app.revanced.patches.youtube.layout.buttons.navigation.utils.InjectionUtils.injectHook
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@@ -23,7 +23,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
ResolvePivotBarFingerprintsPatch::class
|
||||
ResolvePivotBarFingerprintsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -52,58 +53,18 @@ object NavigationButtonsPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/NavigationButtonsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_navigation_buttons_preference_screen",
|
||||
StringResource("revanced_navigation_buttons_preference_screen_title", "Navigation buttons"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_home_button",
|
||||
StringResource("revanced_hide_home_button_title", "Hide home button"),
|
||||
StringResource("revanced_hide_home_button_summary_on", "Home button is hidden"),
|
||||
StringResource("revanced_hide_home_button_summary_off", "Home button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_button",
|
||||
StringResource("revanced_hide_shorts_button_title", "Hide Shorts button"),
|
||||
StringResource("revanced_hide_shorts_button_summary_on", "Shorts button is hidden"),
|
||||
StringResource("revanced_hide_shorts_button_summary_off", "Shorts button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_subscriptions_button",
|
||||
StringResource("revanced_hide_subscriptions_button_title", "Hide subscriptions button"),
|
||||
StringResource(
|
||||
"revanced_hide_subscriptions_button_summary_on",
|
||||
"Home subscriptions is hidden"
|
||||
),
|
||||
StringResource("revanced_hide_subscriptions_button_summary_off", "Home subscriptions is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_create_button",
|
||||
StringResource("revanced_hide_create_button_title", "Hide create button"),
|
||||
StringResource("revanced_hide_create_button_summary_on", "Create button is hidden"),
|
||||
StringResource("revanced_hide_create_button_summary_off", "Create button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_switch_create_with_notifications_button",
|
||||
StringResource(
|
||||
"revanced_switch_create_with_notifications_button_title",
|
||||
"Switch create with notifications button"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_switch_create_with_notifications_button_summary_on",
|
||||
"Create button is switched with notifications"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_switch_create_with_notifications_button_summary_off",
|
||||
"Create button is not switched with notifications"
|
||||
),
|
||||
),
|
||||
key = "revanced_navigation_buttons_preference_screen",
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_home_button"),
|
||||
SwitchPreference("revanced_hide_shorts_button"),
|
||||
SwitchPreference("revanced_hide_subscriptions_button"),
|
||||
SwitchPreference("revanced_hide_create_button"),
|
||||
SwitchPreference("revanced_switch_create_with_notifications_button"),
|
||||
),
|
||||
StringResource(
|
||||
"revanced_navigation_buttons_preference_screen_summary",
|
||||
"Hide or change buttons in the navigation bar"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -156,8 +117,8 @@ object NavigationButtonsPatch : BytecodePatch(
|
||||
|
||||
AddCreateButtonViewFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val stringIndex = it.scanResult.stringsScanResult!!.matches.find {
|
||||
match -> match.string == ANDROID_AUTOMOTIVE_STRING
|
||||
val stringIndex = it.scanResult.stringsScanResult!!.matches.find { match ->
|
||||
match.string == ANDROID_AUTOMOTIVE_STRING
|
||||
}!!.index
|
||||
|
||||
val conditionalCheckIndex = stringIndex - 1
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.layout.buttons.navigation.fingerprints.InitializeButtonsFingerprint
|
||||
import app.revanced.patches.youtube.layout.buttons.navigation.fingerprints.PivotBarConstructorFingerprint
|
||||
|
||||
|
||||
+8
-21
@@ -1,19 +1,19 @@
|
||||
package app.revanced.patches.youtube.layout.buttons.player.hide
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtonsPatch.ParameterOffsets.HAS_NEXT
|
||||
import app.revanced.patches.youtube.layout.buttons.player.hide.HidePlayerButtonsPatch.ParameterOffsets.HAS_PREVIOUS
|
||||
import app.revanced.patches.youtube.layout.buttons.player.hide.fingerprints.PlayerControlsVisibilityModelFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
|
||||
|
||||
@Patch(
|
||||
@@ -21,7 +21,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.formats.Instruction3rc
|
||||
description = "Adds an option to hide the previous and next buttons in the video player.",
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -47,23 +48,9 @@ object HidePlayerButtonsPatch : BytecodePatch(
|
||||
setOf(PlayerControlsVisibilityModelFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_player_buttons",
|
||||
StringResource(
|
||||
"revanced_hide_player_buttons_title",
|
||||
"Hide previous & next video buttons"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_player_buttons_summary_on",
|
||||
"Buttons are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_player_buttons_summary_off",
|
||||
"Buttons are shown"
|
||||
)
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_player_buttons"))
|
||||
|
||||
PlayerControlsVisibilityModelFingerprint.result?.apply {
|
||||
val callIndex = scanResult.patternScanResult!!.endIndex
|
||||
|
||||
+8
-12
@@ -3,29 +3,25 @@ package app.revanced.patches.youtube.layout.hide.albumcards
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
internal object AlbumCardsResourcePatch : ResourcePatch() {
|
||||
internal var albumCardId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_album_cards",
|
||||
StringResource("revanced_hide_album_cards_title", "Hide album cards"),
|
||||
StringResource("revanced_hide_album_cards_summary_on", "Album cards are hidden"),
|
||||
StringResource("revanced_hide_album_cards_summary_off", "Album cards are shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_album_cards"))
|
||||
|
||||
albumCardId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "album_card"
|
||||
|
||||
+8
-12
@@ -3,29 +3,25 @@ package app.revanced.patches.youtube.layout.hide.breakingnews
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
internal object BreakingNewsResourcePatch : ResourcePatch() {
|
||||
internal var horizontalCardListId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_breaking_news",
|
||||
StringResource("revanced_hide_breaking_news_title", "Hide breaking news"),
|
||||
StringResource("revanced_hide_breaking_news_summary_on", "Breaking news are hidden"),
|
||||
StringResource("revanced_hide_breaking_news_summary_off", "Breaking news are shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_breaking_news"))
|
||||
|
||||
horizontalCardListId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "horizontal_card_list"
|
||||
|
||||
+13
-22
@@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@@ -15,7 +15,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
description = "Adds options to hide components related to comments.",
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
LithoFilterPatch::class
|
||||
LithoFilterPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -42,28 +43,18 @@ object CommentsPatch : ResourcePatch() {
|
||||
"Lapp/revanced/integrations/youtube/patches/components/CommentsFilter;"
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_comments_preference_screen",
|
||||
StringResource("revanced_comments_preference_screen_title", "Comments"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_comments_section",
|
||||
StringResource("revanced_hide_comments_section_title", "Hide comments section"),
|
||||
StringResource("revanced_hide_comments_section_summary_on", "Comment section is hidden"),
|
||||
StringResource("revanced_hide_comments_section_summary_off", "Comment section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_preview_comment",
|
||||
StringResource("revanced_hide_preview_comment_title", "Hide preview comment"),
|
||||
StringResource("revanced_hide_preview_comment_on", "Preview comment is hidden"),
|
||||
StringResource("revanced_hide_preview_comment_off", "Preview comment is shown")
|
||||
)
|
||||
),
|
||||
StringResource("revanced_comments_preference_screen_summary", "Manage the visibility of comments section components")
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_comments_section"),
|
||||
SwitchPreference("revanced_hide_preview_comment")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
LithoFilterPatch.addFilter(FILTER_CLASS_DESCRIPTOR)
|
||||
}
|
||||
}
|
||||
|
||||
+8
-12
@@ -3,29 +3,25 @@ package app.revanced.patches.youtube.layout.hide.crowdfundingbox
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
internal object CrowdfundingBoxResourcePatch : ResourcePatch() {
|
||||
internal var crowdfundingBoxId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_crowdfunding_box",
|
||||
StringResource("revanced_hide_crowdfunding_box_title", "Hide crowdfunding box"),
|
||||
StringResource("revanced_hide_crowdfunding_box_summary_on", "Crowdfunding box is hidden"),
|
||||
StringResource("revanced_hide_crowdfunding_box_summary_off", "Crowdfunding box is shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_crowdfunding_box"))
|
||||
|
||||
crowdfundingBoxId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "donation_companion"
|
||||
|
||||
+8
-12
@@ -3,15 +3,16 @@ package app.revanced.patches.youtube.layout.hide.endscreencards
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
internal object HideEndscreenCardsResourcePatch : ResourcePatch() {
|
||||
@@ -20,14 +21,9 @@ internal object HideEndscreenCardsResourcePatch : ResourcePatch() {
|
||||
internal var layoutVideo: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_endscreen_cards",
|
||||
StringResource("revanced_hide_endscreen_cards_title", "Hide end screen cards"),
|
||||
StringResource("revanced_hide_endscreen_cards_summary_on", "End screen cards are hidden"),
|
||||
StringResource("revanced_hide_endscreen_cards_summary_off", "End screen cards are shown")
|
||||
),
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_endscreen_cards"))
|
||||
|
||||
fun findEndscreenResourceId(name: String) = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "endscreen_element_layout_$name"
|
||||
|
||||
+14
-62
@@ -3,76 +3,28 @@ package app.revanced.patches.youtube.layout.hide.filterbar
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class])
|
||||
internal object HideFilterBarResourcePatch : ResourcePatch() {
|
||||
internal var filterBarHeightId = -1L
|
||||
internal var relatedChipCloudMarginId = -1L
|
||||
internal var barContainerHeightId = -1L
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_hide_filter_bar_preference",
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_preference_title",
|
||||
"Hide filter bar"
|
||||
),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_filter_bar_feed_in_feed",
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_feed_title",
|
||||
"Hide in feed"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_feed_summary_on",
|
||||
"Hidden in feed"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_feed_summary_off",
|
||||
"Shown in feed"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_filter_bar_feed_in_search",
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_search_title",
|
||||
"Hide in search"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_search_summary_on",
|
||||
"Hidden in search"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_search_summary_off",
|
||||
"Shown in search"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_filter_bar_feed_in_related_videos",
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_related_videos_title",
|
||||
"Hide in related videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_related_videos_summary_on",
|
||||
"Hidden in related videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_feed_in_related_videos_summary_off",
|
||||
"Shown in related videos"
|
||||
)
|
||||
),
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_filter_bar_preference_summary",
|
||||
"Manage the visibility of the filter bar in the feed, search and related videos"
|
||||
key = "revanced_hide_filter_bar_preference",
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_filter_bar_feed_in_feed"),
|
||||
SwitchPreference("revanced_hide_filter_bar_feed_in_search"),
|
||||
SwitchPreference("revanced_hide_filter_bar_feed_in_related_videos"),
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -82,6 +34,6 @@ internal object HideFilterBarResourcePatch : ResourcePatch() {
|
||||
barContainerHeightId = "bar_container_height".layoutResourceId()
|
||||
}
|
||||
|
||||
private fun String.layoutResourceId(type: String = "dimen") =
|
||||
ResourceMappingPatch.resourceMappings.single { it.type == type && it.name == this }.id
|
||||
private fun String.layoutResourceId(type: String = "dimen") =
|
||||
ResourceMappingPatch.resourceMappings.single { it.type == type && it.name == this }.id
|
||||
}
|
||||
+8
-15
@@ -4,32 +4,25 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object HideFloatingMicrophoneButtonResourcePatch : ResourcePatch() {
|
||||
internal var fabButtonId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_floating_microphone_button",
|
||||
StringResource(
|
||||
"revanced_hide_floating_microphone_button_enabled_title",
|
||||
"Hide floating microphone button"
|
||||
),
|
||||
StringResource("revanced_hide_floating_microphone_button_summary_on", "Microphone button hidden"),
|
||||
StringResource("revanced_hide_floating_microphone_button_summary_off", "Microphone button shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_floating_microphone_button"))
|
||||
|
||||
fabButtonId = ResourceMappingPatch.resourceMappings.find { it.type == "id" && it.name == "fab" }?.id
|
||||
?: throw PatchException("Can not find required fab button resource id")
|
||||
|
||||
+7
-19
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.layout.hide.fullscreenambientmode
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.fullscreenambientmode.fingerprints.InitializeAmbientModeFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Disable fullscreen ambient mode",
|
||||
description = "Adds an option to disable the ambient mode when in fullscreen.",
|
||||
dependencies = [SettingsPatch::class, IntegrationsPatch::class],
|
||||
dependencies = [SettingsPatch::class, IntegrationsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -41,22 +41,10 @@ object DisableFullscreenAmbientModePatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/DisableFullscreenAmbientModePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_fullscreen_ambient_mode",
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_title",
|
||||
"Disable ambient mode in fullscreen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_on",
|
||||
"Ambient mode disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_fullscreen_ambient_mode_summary_off",
|
||||
"Ambient mode enabled"
|
||||
),
|
||||
)
|
||||
SwitchPreference("revanced_disable_fullscreen_ambient_mode")
|
||||
)
|
||||
|
||||
InitializeAmbientModeFingerprint.result?.let {
|
||||
|
||||
+55
-383
@@ -10,7 +10,10 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.layout.hide.general.fingerprints.ParseElementFromBufferFingerprint
|
||||
import app.revanced.patches.youtube.layout.hide.general.fingerprints.PlayerOverlayFingerprint
|
||||
import app.revanced.patches.youtube.layout.hide.general.fingerprints.ShowWatermarkFingerprint
|
||||
@@ -27,7 +30,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
description = "Adds options to hide general layout components.",
|
||||
dependencies = [
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -57,383 +61,55 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/components/DescriptionComponentsFilter;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_gray_separator",
|
||||
StringResource("revanced_hide_gray_separator_title", "Hide gray separator"),
|
||||
StringResource("revanced_hide_gray_separator_summary_on", "Gray separators are hidden"),
|
||||
StringResource("revanced_hide_gray_separator_summary_off", "Gray separators are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_join_membership_button",
|
||||
StringResource("revanced_hide_join_membership_button_title", "Hide \\\'Join\\\' button"),
|
||||
StringResource("revanced_hide_join_membership_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_join_membership_button_summary_off", "Button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_watermark_title",
|
||||
StringResource(
|
||||
"revanced_hide_channel_watermark_title",
|
||||
"Hide channel watermark in video player"
|
||||
),
|
||||
StringResource("revanced_hide_channel_watermark_title_summary_on", "Watermark is hidden"),
|
||||
StringResource("revanced_hide_channel_watermark_title_summary_off", "Watermark is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_for_you_shelf",
|
||||
StringResource("revanced_hide_for_you_shelf_title", "Hide \\\'For you\\\' shelf in channel page"),
|
||||
StringResource("revanced_hide_for_you_shelf_summary_on", "Shelf is hidden"),
|
||||
StringResource("revanced_hide_for_you_shelf_summary_off", "Shelf is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_notify_me_button",
|
||||
StringResource("revanced_hide_notify_me_button_title", "Hide \\\'Notify me\\\' button"),
|
||||
StringResource("revanced_hide_notify_me_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_notify_me_button_summary_off", "Button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_timed_reactions",
|
||||
StringResource("revanced_hide_timed_reactions_title", "Hide timed reactions"),
|
||||
StringResource("revanced_hide_timed_reactions_summary_on", "Timed reactions are hidden"),
|
||||
StringResource("revanced_hide_timed_reactions_summary_off", "Timed reactions are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_search_result_recommendations",
|
||||
StringResource(
|
||||
"revanced_hide_search_result_recommendations_title",
|
||||
"Hide \\\'People also watched\\\' recommendations"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_search_result_recommendations_summary_on",
|
||||
"Recommendations are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_search_result_recommendations_summary_off",
|
||||
"Recommendations are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_search_result_shelf_header",
|
||||
StringResource(
|
||||
"revanced_hide_search_result_shelf_header_title",
|
||||
"Hide search result shelf header"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_search_result_shelf_header_summary_on",
|
||||
"Shelf header is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_search_result_shelf_header_summary_off",
|
||||
"Shelf header is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_guidelines",
|
||||
StringResource("revanced_hide_channel_guidelines_title", "Hide channel guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_on",
|
||||
"Channel guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_guidelines_summary_off",
|
||||
"Channel guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_expandable_chip",
|
||||
StringResource(
|
||||
"revanced_hide_expandable_chip_title",
|
||||
"Hide expandable chip under videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_expandable_chip_summary_on",
|
||||
"Expandable chips are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_expandable_chip_summary_off",
|
||||
"Expandable chips are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_video_quality_menu_footer",
|
||||
StringResource(
|
||||
"revanced_hide_video_quality_menu_footer_title",
|
||||
"Hide video quality menu footer"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_video_quality_menu_footer_summary_on",
|
||||
"Video quality menu footer is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_video_quality_menu_footer_summary_off",
|
||||
"Video quality menu footer is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_chapters",
|
||||
StringResource(
|
||||
"revanced_hide_chapters_title",
|
||||
"Hide chapters in the video description"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapters_summary_on",
|
||||
"Chapters are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_chapters_summary_off",
|
||||
"Chapters are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_posts",
|
||||
StringResource("revanced_hide_community_posts_title", "Hide community posts"),
|
||||
StringResource("revanced_hide_community_posts_summary_on", "Community posts are hidden"),
|
||||
StringResource("revanced_hide_community_posts_summary_off", "Community posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_compact_banner",
|
||||
StringResource("revanced_hide_compact_banner_title", "Hide compact banners"),
|
||||
StringResource("revanced_hide_compact_banner_summary_on", "Compact banners are hidden"),
|
||||
StringResource("revanced_hide_compact_banner_summary_off", "Compact banners are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_movies_section",
|
||||
StringResource("revanced_hide_movies_section_title", "Hide movies section"),
|
||||
StringResource("revanced_hide_movies_section_summary_on", "Movies section is hidden"),
|
||||
StringResource("revanced_hide_movies_section_summary_off", "Movies section is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_feed_survey",
|
||||
StringResource("revanced_hide_feed_survey_title", "Hide feed surveys"),
|
||||
StringResource("revanced_hide_feed_survey_summary_on", "Feed surveys are hidden"),
|
||||
StringResource("revanced_hide_feed_survey_summary_off", "Feed surveys are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_community_guidelines",
|
||||
StringResource("revanced_hide_community_guidelines_title", "Hide community guidelines"),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_on",
|
||||
"Community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_community_guidelines_summary_off",
|
||||
"Community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_subscribers_community_guidelines",
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_title",
|
||||
"Hide subscribers community guidelines"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_on",
|
||||
"Subscribers community guidelines are hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_subscribers_community_guidelines_summary_off",
|
||||
"Subscribers community guidelines are shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_member_shelf",
|
||||
StringResource("revanced_hide_channel_member_shelf_title", "Hide channel member shelf"),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_on",
|
||||
"Channel member shelf is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_channel_member_shelf_summary_off",
|
||||
"Channel member shelf is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_emergency_box",
|
||||
StringResource("revanced_hide_emergency_box_title", "Hide emergency boxes"),
|
||||
StringResource("revanced_hide_emergency_box_summary_on", "Emergency boxes are hidden"),
|
||||
StringResource("revanced_hide_emergency_box_summary_off", "Emergency boxes are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_info_panels",
|
||||
StringResource("revanced_hide_info_panels_title", "Hide info panels"),
|
||||
StringResource("revanced_hide_info_panels_summary_on", "Info panels are hidden"),
|
||||
StringResource("revanced_hide_info_panels_summary_off", "Info panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_medical_panels",
|
||||
StringResource("revanced_hide_medical_panels_title", "Hide medical panels"),
|
||||
StringResource("revanced_hide_medical_panels_summary_on", "Medical panels are hidden"),
|
||||
StringResource("revanced_hide_medical_panels_summary_off", "Medical panels are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_channel_bar",
|
||||
StringResource("revanced_hide_channel_bar_title", "Hide channel bar"),
|
||||
StringResource("revanced_hide_channel_bar_summary_on", "Channel bar is hidden"),
|
||||
StringResource("revanced_hide_channel_bar_summary_off", "Channel bar is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_quick_actions",
|
||||
StringResource("revanced_hide_quick_actions_title", "Hide quick actions in fullscreen"),
|
||||
StringResource("revanced_hide_quick_actions_summary_on", "Quick actions are hidden"),
|
||||
StringResource("revanced_hide_quick_actions_summary_off", "Quick actions are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_related_videos",
|
||||
StringResource("revanced_hide_related_videos_title", "Hide related videos in quick actions"),
|
||||
StringResource("revanced_hide_related_videos_summary_on", "Related videos are hidden"),
|
||||
StringResource("revanced_hide_related_videos_summary_off", "Related videos are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_image_shelf",
|
||||
StringResource("revanced_hide_image_shelf", "Hide image shelf in search results"),
|
||||
StringResource("revanced_hide_image_shelf_summary_on", "Image shelf is hidden"),
|
||||
StringResource("revanced_hide_image_shelf_summary_off", "Image shelf is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_latest_posts_ads",
|
||||
StringResource("revanced_hide_latest_posts_ads_title", "Hide latest posts"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_on", "Latest posts are hidden"),
|
||||
StringResource("revanced_hide_latest_posts_ads_summary_off", "Latest posts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_mix_playlists",
|
||||
StringResource("revanced_hide_mix_playlists_title", "Hide mix playlists"),
|
||||
StringResource("revanced_hide_mix_playlists_summary_on", "Mix playlists are hidden"),
|
||||
StringResource("revanced_hide_mix_playlists_summary_off", "Mix playlists are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_artist_cards",
|
||||
StringResource("revanced_hide_artist_cards_title", "Hide artist cards"),
|
||||
StringResource("revanced_hide_artist_cards_on", "Artist cards are hidden"),
|
||||
StringResource("revanced_hide_artist_cards_off", "Artist cards are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_chips_shelf",
|
||||
StringResource("revanced_hide_chips_shelf_title", "Hide chips shelf"),
|
||||
StringResource("revanced_hide_chips_shelf_on", "Chips shelf is hidden"),
|
||||
StringResource("revanced_hide_chips_shelf_off", "Chips shelf is shown")
|
||||
),
|
||||
PreferenceScreen(
|
||||
SwitchPreference("revanced_hide_gray_separator"),
|
||||
SwitchPreference("revanced_hide_join_membership_button"),
|
||||
SwitchPreference("revanced_hide_channel_watermark"),
|
||||
SwitchPreference("revanced_hide_for_you_shelf"),
|
||||
SwitchPreference("revanced_hide_notify_me_button"),
|
||||
SwitchPreference("revanced_hide_timed_reactions"),
|
||||
SwitchPreference("revanced_hide_search_result_recommendations"),
|
||||
SwitchPreference("revanced_hide_search_result_shelf_header"),
|
||||
SwitchPreference("revanced_hide_channel_guidelines"),
|
||||
SwitchPreference("revanced_hide_expandable_chip"),
|
||||
SwitchPreference("revanced_hide_video_quality_menu_footer"),
|
||||
SwitchPreference("revanced_hide_chapters"),
|
||||
SwitchPreference("revanced_hide_community_posts"),
|
||||
SwitchPreference("revanced_hide_compact_banner"),
|
||||
SwitchPreference("revanced_hide_movies_section"),
|
||||
SwitchPreference("revanced_hide_feed_survey"),
|
||||
SwitchPreference("revanced_hide_community_guidelines"),
|
||||
SwitchPreference("revanced_hide_subscribers_community_guidelines"),
|
||||
SwitchPreference("revanced_hide_channel_member_shelf"),
|
||||
SwitchPreference("revanced_hide_emergency_box"),
|
||||
SwitchPreference("revanced_hide_info_panels"),
|
||||
SwitchPreference("revanced_hide_medical_panels"),
|
||||
SwitchPreference("revanced_hide_channel_bar"),
|
||||
SwitchPreference("revanced_hide_quick_actions"),
|
||||
SwitchPreference("revanced_hide_related_videos"),
|
||||
SwitchPreference("revanced_hide_image_shelf"),
|
||||
SwitchPreference("revanced_hide_latest_posts_ads"),
|
||||
SwitchPreference("revanced_hide_mix_playlists"),
|
||||
SwitchPreference("revanced_hide_artist_cards"),
|
||||
SwitchPreference("revanced_hide_chips_shelf"),
|
||||
app.revanced.patches.shared.misc.settings.preference.PreferenceScreen(
|
||||
"revanced_hide_description_components_preference_screen",
|
||||
StringResource(
|
||||
"revanced_hide_description_components_preference_screen_title",
|
||||
"Hide components in the video description"
|
||||
),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_info_cards_section",
|
||||
StringResource(
|
||||
"revanced_hide_info_cards_section_title",
|
||||
"Hide info cards section"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_info_cards_section_summary_on",
|
||||
"Info cards section is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_info_cards_section_summary_off",
|
||||
"Info cards section is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_game_section",
|
||||
StringResource(
|
||||
"revanced_hide_game_section_title",
|
||||
"Hide game section"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_game_section_summary_on",
|
||||
"Game section is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_game_section_summary_off",
|
||||
"Game section is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_music_section",
|
||||
StringResource(
|
||||
"revanced_hide_music_section_title",
|
||||
"Hide music section"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_music_section_summary_on",
|
||||
"Music section is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_music_section_summary_off",
|
||||
"Music section is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_podcast_section",
|
||||
StringResource(
|
||||
"revanced_hide_podcast_section_title",
|
||||
"Hide podcast section"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_podcast_section_summary_on",
|
||||
"Podcast section is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_podcast_section_summary_off",
|
||||
"Podcast section is shown"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_transcript_section",
|
||||
StringResource(
|
||||
"revanced_hide_transcript_section_title",
|
||||
"Hide transcript section"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_transcript_section_summary_on",
|
||||
"Transcript section is hidden"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_transcript_section_summary_off",
|
||||
"Transcript section is shown"
|
||||
)
|
||||
),
|
||||
),
|
||||
StringResource(
|
||||
"revanced_hide_description_components_preference_screen_summary",
|
||||
"Hide components under the video description"
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_info_cards_section"),
|
||||
SwitchPreference("revanced_hide_game_section"),
|
||||
SwitchPreference("revanced_hide_music_section"),
|
||||
SwitchPreference("revanced_hide_podcast_section"),
|
||||
SwitchPreference("revanced_hide_transcript_section"),
|
||||
)
|
||||
),
|
||||
PreferenceScreen(
|
||||
app.revanced.patches.shared.misc.settings.preference.PreferenceScreen(
|
||||
"revanced_custom_filter_preference_screen",
|
||||
StringResource("revanced_custom_filter_preference_screen_title", "Custom filter"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_custom_filter",
|
||||
StringResource(
|
||||
"revanced_custom_filter_title",
|
||||
"Enable custom filter"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_on",
|
||||
"Custom filter is enabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_summary_off",
|
||||
"Custom filter is disabled"
|
||||
)
|
||||
),
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_custom_filter"),
|
||||
// TODO: This should be a dynamic ListPreference, which does not exist yet
|
||||
TextPreference(
|
||||
"revanced_custom_filter_strings",
|
||||
StringResource("revanced_custom_filter_strings_title", "Custom filter"),
|
||||
StringResource(
|
||||
"revanced_custom_filter_strings_summary",
|
||||
"List of component path builder strings to filter separated by new line"
|
||||
),
|
||||
inputType = InputType.TEXT_MULTI_LINE
|
||||
)
|
||||
),
|
||||
StringResource(
|
||||
"revanced_custom_filter_preference_screen_summary",
|
||||
"Hide components using custom filters"
|
||||
TextPreference("revanced_custom_filter_strings", inputType = InputType.TEXT_MULTI_LINE)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -444,24 +120,21 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
||||
// region Mix playlists
|
||||
|
||||
ParseElementFromBufferFingerprint.result?.let { result ->
|
||||
val returnEmptyComponentInstruction = result.mutableMethod.getInstructions()
|
||||
.last { it.opcode == Opcode.INVOKE_STATIC }
|
||||
val returnEmptyComponentInstruction =
|
||||
result.mutableMethod.getInstructions().last { it.opcode == Opcode.INVOKE_STATIC }
|
||||
|
||||
result.mutableMethod.apply {
|
||||
val consumeByteBufferIndex = result.scanResult.patternScanResult!!.startIndex
|
||||
val conversionContextRegister =
|
||||
getInstruction<TwoRegisterInstruction>(consumeByteBufferIndex - 2).registerA
|
||||
val byteBufferRegister =
|
||||
getInstruction<FiveRegisterInstruction>(consumeByteBufferIndex).registerD
|
||||
val byteBufferRegister = getInstruction<FiveRegisterInstruction>(consumeByteBufferIndex).registerD
|
||||
|
||||
addInstructionsWithLabels(
|
||||
consumeByteBufferIndex,
|
||||
"""
|
||||
consumeByteBufferIndex, """
|
||||
invoke-static {v$conversionContextRegister, v$byteBufferRegister}, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->filterMixPlaylists(Ljava/lang/Object;[B)Z
|
||||
move-result v0 # Conveniently same register happens to be free.
|
||||
if-nez v0, :return_empty_component
|
||||
""",
|
||||
ExternalLabel("return_empty_component", returnEmptyComponentInstruction)
|
||||
""", ExternalLabel("return_empty_component", returnEmptyComponentInstruction)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -478,8 +151,7 @@ object HideLayoutComponentsPatch : BytecodePatch(
|
||||
|
||||
removeInstruction(index)
|
||||
addInstructions(
|
||||
index,
|
||||
"""
|
||||
index, """
|
||||
invoke-static {}, $LAYOUT_COMPONENTS_FILTER_CLASS_DESCRIPTOR->showWatermark()Z
|
||||
move-result p2
|
||||
"""
|
||||
|
||||
+8
-12
@@ -3,29 +3,25 @@ package app.revanced.patches.youtube.layout.hide.infocards
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
object HideInfocardsResourcePatch : ResourcePatch() {
|
||||
internal var drawerResourceId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_info_cards",
|
||||
StringResource("revanced_hide_info_cards_title", "Hide info cards"),
|
||||
StringResource("revanced_hide_info_cards_summary_on", "Info cards are hidden"),
|
||||
StringResource("revanced_hide_info_cards_summary_off", "Info cards are shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_info_cards"))
|
||||
|
||||
drawerResourceId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "id" && it.name == "info_cards_drawer_header"
|
||||
|
||||
+8
-12
@@ -3,29 +3,25 @@ package app.revanced.patches.youtube.layout.hide.loadmorebutton
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object HideLoadMoreButtonResourcePatch : ResourcePatch() {
|
||||
internal var expandButtonDownId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_load_more_button",
|
||||
StringResource("revanced_hide_load_more_button_title", "Hide \\\'Load More\\\' button"),
|
||||
StringResource("revanced_hide_load_more_button_summary_on", "Button is hidden"),
|
||||
StringResource("revanced_hide_load_more_button_summary_off", "Button is shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_load_more_button"))
|
||||
|
||||
expandButtonDownId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "layout" && it.name == "expand_button_down"
|
||||
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.hide.personalinformation
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.youtube.layout.hide.personalinformation.fingerprints.AccountSwitcherAccessibilityLabelFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Deprecated("This patch is no longer working and will be removed in a future release.")
|
||||
@Patch(
|
||||
description = "Hides the email address in the account switcher.",
|
||||
dependencies = [IntegrationsPatch::class, HideEmailAddressResourcePatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
"18.32.39",
|
||||
"18.37.36",
|
||||
"18.38.44",
|
||||
"18.43.45",
|
||||
"18.44.41",
|
||||
"18.45.43",
|
||||
"18.48.39",
|
||||
"18.49.37",
|
||||
"19.01.34",
|
||||
"19.02.39",
|
||||
"19.03.35"
|
||||
]
|
||||
)
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object HideEmailAddressPatch : BytecodePatch(
|
||||
setOf(AccountSwitcherAccessibilityLabelFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AccountSwitcherAccessibilityLabelFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
val setVisibilityConstIndex = it.scanResult.patternScanResult!!.endIndex
|
||||
|
||||
val setVisibilityConstRegister =
|
||||
getInstruction<OneRegisterInstruction>(setVisibilityConstIndex - 2).registerA
|
||||
|
||||
addInstructions(
|
||||
setVisibilityConstIndex,
|
||||
"""
|
||||
invoke-static {v$setVisibilityConstRegister}, Lapp/revanced/integrations/youtube/patches/HideEmailAddressPatch;->hideEmailAddress(I)I
|
||||
move-result v$setVisibilityConstRegister
|
||||
"""
|
||||
)
|
||||
}
|
||||
} ?: throw AccountSwitcherAccessibilityLabelFingerprint.exception
|
||||
}
|
||||
}
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.hide.personalinformation
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Suppress("unused")
|
||||
internal object HideEmailAddressResourcePatch : ResourcePatch() {
|
||||
internal var accountSwitcherAccessibilityLabelId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_email_address",
|
||||
StringResource("revanced_hide_email_address_title", "Hide email in account switcher"),
|
||||
StringResource("revanced_hide_email_address_summary_on", "Email address is hidden"),
|
||||
StringResource("revanced_hide_email_address_summary_off", "Email address is shown")
|
||||
)
|
||||
)
|
||||
|
||||
accountSwitcherAccessibilityLabelId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "string" && it.name == "account_switcher_accessibility_label"
|
||||
}.id
|
||||
}
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package app.revanced.patches.youtube.layout.hide.personalinformation.fingerprints
|
||||
|
||||
import app.revanced.patches.youtube.layout.hide.personalinformation.HideEmailAddressResourcePatch
|
||||
import app.revanced.util.patch.LiteralValueFingerprint
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
internal object AccountSwitcherAccessibilityLabelFingerprint : LiteralValueFingerprint(
|
||||
returnType = "V",
|
||||
parameters = listOf("L", "Ljava/lang/Object;"),
|
||||
opcodes = listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.IGET_OBJECT,
|
||||
Opcode.NEW_ARRAY,
|
||||
Opcode.CONST_4,
|
||||
Opcode.APUT_OBJECT,
|
||||
Opcode.CONST,
|
||||
),
|
||||
literalSupplier = { HideEmailAddressResourcePatch.accountSwitcherAccessibilityLabelId }
|
||||
)
|
||||
+19
-68
@@ -4,9 +4,9 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@@ -17,7 +17,8 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
dependencies = [
|
||||
LithoFilterPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -45,73 +46,23 @@ object HidePlayerFlyoutMenuPatch : ResourcePatch() {
|
||||
"Lapp/revanced/integrations/youtube/patches/components/PlayerFlyoutMenuItemsFilter;"
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
KEY,
|
||||
StringResource("${KEY}_title", "Player flyout menu items"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"${KEY}_captions",
|
||||
StringResource("${KEY}_captions_title", "Hide Captions menu"),
|
||||
StringResource("${KEY}_captions_on", "Captions menu item is hidden"),
|
||||
StringResource("${KEY}_captions_off", "Captions menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_additional_settings",
|
||||
StringResource("${KEY}_additional_settings_title", "Hide Additional settings menu"),
|
||||
StringResource("${KEY}_additional_settings_on", "Additional settings menu item is hidden"),
|
||||
StringResource("${KEY}_additional_settings_off", "Additional settings menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_loop_video",
|
||||
StringResource("${KEY}_loop_video_title", "Hide Loop video menu"),
|
||||
StringResource("${KEY}_loop_video_on", "Loop video menu item is hidden"),
|
||||
StringResource("${KEY}_loop_video_off", "Loop video menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_ambient_mode",
|
||||
StringResource("${KEY}_ambient_mode_title", "Hide Ambient mode menu"),
|
||||
StringResource("${KEY}_ambient_mode_on", "Ambient mode menu item is hidden"),
|
||||
StringResource("${KEY}_ambient_mode_off", "Ambient mode menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_report",
|
||||
StringResource("${KEY}_report_title", "Hide Report menu"),
|
||||
StringResource("${KEY}_report_on", "Report menu item is hidden"),
|
||||
StringResource("${KEY}_report_off", "Report menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_help",
|
||||
StringResource("${KEY}_help_title", "Hide Help menu"),
|
||||
StringResource("${KEY}_help_on", "Help menu item is hidden"),
|
||||
StringResource("${KEY}_help_off", "Help menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_speed",
|
||||
StringResource("${KEY}_speed_title", "Hide Speed menu"),
|
||||
StringResource("${KEY}_speed_on", "Speed menu item is hidden"),
|
||||
StringResource("${KEY}_speed_off", "Speed menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_more_info",
|
||||
StringResource("${KEY}_more_info_title", "Hide More info menu"),
|
||||
StringResource("${KEY}_more_info_on", "More info menu item is hidden"),
|
||||
StringResource("${KEY}_more_info_off", "More info menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_audio_track",
|
||||
StringResource("${KEY}_audio_track_title", "Hide Audio track menu"),
|
||||
StringResource("${KEY}_audio_track_on", "Audio track menu item is hidden"),
|
||||
StringResource("${KEY}_audio_track_off", "Audio track menu item is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"${KEY}_watch_in_vr",
|
||||
StringResource("${KEY}_watch_in_vr_title", "Hide Watch in VR menu"),
|
||||
StringResource("${KEY}_watch_in_vr_on", "Watch in VR menu item is hidden"),
|
||||
StringResource("${KEY}_watch_in_vr_off", "Watch in VR menu item is shown")
|
||||
),
|
||||
key = KEY,
|
||||
preferences = setOf(
|
||||
SwitchPreference("${KEY}_captions"),
|
||||
SwitchPreference("${KEY}_additional_settings"),
|
||||
SwitchPreference("${KEY}_loop_video"),
|
||||
SwitchPreference("${KEY}_ambient_mode"),
|
||||
SwitchPreference("${KEY}_report"),
|
||||
SwitchPreference("${KEY}_help"),
|
||||
SwitchPreference("${KEY}_speed"),
|
||||
SwitchPreference("${KEY}_more_info"),
|
||||
SwitchPreference("${KEY}_audio_track"),
|
||||
SwitchPreference("${KEY}_watch_in_vr"),
|
||||
),
|
||||
StringResource("${KEY}_summary", "Manage the visibility of player flyout menu items")
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+7
-10
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.hide.rollingnumber
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
@@ -9,17 +8,18 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.shared.fingerprints.RollingNumberTextViewAnimationUpdateFingerprint
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Disable rolling number animations",
|
||||
description = "Adds an option to disable rolling number animations of video view count, user likes, and upload time.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -45,13 +45,10 @@ object DisableRollingNumberAnimationPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/DisableRollingNumberAnimationsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_rolling_number_animations",
|
||||
StringResource("revanced_disable_rolling_number_animations_title", "Disable rolling number animations"),
|
||||
StringResource("revanced_disable_rolling_number_animations_summary_on", "Rolling numbers are not animated"),
|
||||
StringResource("revanced_disable_rolling_number_animations_summary_off", "Rolling numbers are animated")
|
||||
)
|
||||
SwitchPreference("revanced_disable_rolling_number_animations")
|
||||
)
|
||||
|
||||
// Animations are disabled by preventing an Image from being applied to the text span,
|
||||
|
||||
+8
-15
@@ -5,8 +5,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWith
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.SeekbarColorBytecodePatch
|
||||
import app.revanced.patches.youtube.layout.seekbar.SeekbarPreferencesPatch
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
@@ -21,7 +21,8 @@ import app.revanced.patches.youtube.shared.fingerprints.SeekbarOnDrawFingerprint
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
SeekbarColorBytecodePatch::class,
|
||||
SeekbarPreferencesPatch::class
|
||||
SeekbarPreferencesPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -46,19 +47,11 @@ object HideSeekbarPatch : BytecodePatch(
|
||||
setOf(SeekbarFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SeekbarPreferencesPatch.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_seekbar",
|
||||
StringResource("revanced_hide_seekbar_title", "Hide seekbar in video player"),
|
||||
StringResource("revanced_hide_seekbar_summary_on", "Video player seekbar is hidden"),
|
||||
StringResource("revanced_hide_seekbar_summary_off", "Video player seekbar is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_seekbar_thumbnail",
|
||||
StringResource("revanced_hide_seekbar_thumbnail_title", "Hide seekbar in video thumbnails"),
|
||||
StringResource("revanced_hide_seekbar_thumbnail_summary_on", "Thumbnail seekbar is hidden"),
|
||||
StringResource("revanced_hide_seekbar_thumbnail_summary_off", "Thumbnail seekbar is shown")
|
||||
)
|
||||
SwitchPreference("revanced_hide_seekbar"),
|
||||
SwitchPreference("revanced_hide_seekbar_thumbnail")
|
||||
)
|
||||
|
||||
SeekbarFingerprint.result!!.let {
|
||||
|
||||
+1
-1
@@ -10,7 +10,7 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.layout.hide.shorts.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
|
||||
+21
-81
@@ -3,97 +3,37 @@ package app.revanced.patches.youtube.layout.hide.shorts
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class])
|
||||
object HideShortsComponentsResourcePatch : ResourcePatch() {
|
||||
internal var reelMultipleItemShelfId = -1L
|
||||
internal var reelPlayerRightCellButtonHeight = -1L
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_shorts_preference_screen",
|
||||
StringResource("revanced_shorts_preference_screen_title", "Shorts components"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts",
|
||||
StringResource("revanced_hide_shorts_title", "Hide Shorts in feed"),
|
||||
StringResource("revanced_hide_shorts_on", "Shorts are hidden"),
|
||||
StringResource("revanced_hide_shorts_off", "Shorts are shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_join_button",
|
||||
StringResource("revanced_hide_shorts_join_button_title", "Hide join button"),
|
||||
StringResource("revanced_hide_shorts_join_button_on", "Join button is hidden"),
|
||||
StringResource("revanced_hide_shorts_join_button_off", "Join button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_subscribe_button",
|
||||
StringResource("revanced_hide_shorts_subscribe_button_title", "Hide subscribe button"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_on", "Subscribe button is hidden"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_off", "Subscribe button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_subscribe_button_paused",
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_title", "Hide subscribe button when paused"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_on", "Subscribe button is hidden"),
|
||||
StringResource("revanced_hide_shorts_subscribe_button_paused_off", "Subscribe button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_thanks_button",
|
||||
StringResource("revanced_hide_shorts_thanks_button_title", "Hide thanks button"),
|
||||
StringResource("revanced_hide_shorts_thanks_button_on", "Thanks button is hidden"),
|
||||
StringResource("revanced_hide_shorts_thanks_button_off", "Thanks button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_comments_button",
|
||||
StringResource("revanced_hide_shorts_comments_button_title", "Hide comments button"),
|
||||
StringResource("revanced_hide_shorts_comments_button_on", "Comments button is hidden"),
|
||||
StringResource("revanced_hide_shorts_comments_button_off", "Comments button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_remix_button",
|
||||
StringResource("revanced_hide_shorts_remix_button_title", "Hide remix button"),
|
||||
StringResource("revanced_hide_shorts_remix_button_on", "Remix button is hidden"),
|
||||
StringResource("revanced_hide_shorts_remix_button_off", "Remix button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_share_button",
|
||||
StringResource("revanced_hide_shorts_share_button_title", "Hide share button"),
|
||||
StringResource("revanced_hide_shorts_share_button_on", "Share button is hidden"),
|
||||
StringResource("revanced_hide_shorts_share_button_off", "Share button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_info_panel",
|
||||
StringResource("revanced_hide_shorts_info_panel_title", "Hide info panel"),
|
||||
StringResource("revanced_hide_shorts_info_panel_on", "Info panel is hidden"),
|
||||
StringResource("revanced_hide_shorts_info_panel_off", "Info panel is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_channel_bar",
|
||||
StringResource("revanced_hide_shorts_channel_bar_title", "Hide channel bar"),
|
||||
StringResource("revanced_hide_shorts_channel_bar_on", "Channel bar is hidden"),
|
||||
StringResource("revanced_hide_shorts_channel_bar_off", "Channel bar is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_sound_button",
|
||||
StringResource("revanced_hide_shorts_sound_button_title", "Hide sound button"),
|
||||
StringResource("revanced_hide_shorts_sound_button_on", "Sound button is hidden"),
|
||||
StringResource("revanced_hide_shorts_sound_button_off", "Sound button is shown")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_hide_shorts_navigation_bar",
|
||||
StringResource("revanced_hide_shorts_navigation_bar_title", "Hide navigation bar"),
|
||||
StringResource("revanced_hide_shorts_navigation_bar_on", "Navigation bar is hidden"),
|
||||
StringResource("revanced_hide_shorts_navigation_bar_off", "Navigation bar is shown")
|
||||
)
|
||||
),
|
||||
StringResource("revanced_shorts_preference_screen_summary", "Manage the visibility of Shorts components")
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_hide_shorts"),
|
||||
SwitchPreference("revanced_hide_shorts_join_button"),
|
||||
SwitchPreference("revanced_hide_shorts_subscribe_button"),
|
||||
SwitchPreference("revanced_hide_shorts_subscribe_button_paused"),
|
||||
SwitchPreference("revanced_hide_shorts_thanks_button"),
|
||||
SwitchPreference("revanced_hide_shorts_comments_button"),
|
||||
SwitchPreference("revanced_hide_shorts_remix_button"),
|
||||
SwitchPreference("revanced_hide_shorts_share_button"),
|
||||
SwitchPreference("revanced_hide_shorts_info_panel"),
|
||||
SwitchPreference("revanced_hide_shorts_channel_bar"),
|
||||
SwitchPreference("revanced_hide_shorts_sound_button"),
|
||||
SwitchPreference("revanced_hide_shorts_navigation_bar")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+8
-19
@@ -3,37 +3,26 @@ package app.revanced.patches.youtube.layout.hide.suggestedvideoendscreen
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
)
|
||||
internal object DisableSuggestedVideoEndScreenResourcePatch : ResourcePatch() {
|
||||
internal var sizeAdjustableLiteAutoNavOverlay: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_suggested_video_end_screen",
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_title",
|
||||
"Disable suggested video end screen"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_on",
|
||||
"Suggested videos will be disabled"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_disable_suggested_video_end_screen_summary_off",
|
||||
"Suggested videos will be shown"
|
||||
),
|
||||
)
|
||||
SwitchPreference("revanced_disable_suggested_video_end_screen")
|
||||
)
|
||||
|
||||
sizeAdjustableLiteAutoNavOverlay = ResourceMappingPatch.resourceMappings.single {
|
||||
|
||||
+7
-12
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.layout.hide.time
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.hide.time.fingerprints.TimeCounterFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Hide timestamp",
|
||||
description = "Adds an option to hide the timestamp in the bottom left of the video player.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -38,14 +38,9 @@ object HideTimestampPatch : BytecodePatch(
|
||||
setOf(TimeCounterFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_timestamp",
|
||||
StringResource("revanced_hide_timestamp_title", "Hide video timestamp"),
|
||||
StringResource("revanced_hide_timestamp_summary_on", "Timestamp is hidden"),
|
||||
StringResource("revanced_hide_timestamp_summary_off", "Timestamp is shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_timestamp"))
|
||||
|
||||
TimeCounterFingerprint.result?.apply {
|
||||
mutableMethod.addInstructionsWithLabels(
|
||||
|
||||
+7
-12
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.layout.panels.popup
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.panels.popup.fingerprints.EngagementPanelControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Disable player popup panels",
|
||||
description = "Adds an option to disable panels (such as live chat) from opening automatically.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -39,14 +39,9 @@ object PlayerPopupPanelsPatch : BytecodePatch(
|
||||
setOf(EngagementPanelControllerFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hide_player_popup_panels",
|
||||
StringResource("revanced_hide_player_popup_panels_title", "Hide player popup panels"),
|
||||
StringResource("revanced_hide_player_popup_panels_summary_on", "Player popup panels are hidden"),
|
||||
StringResource("revanced_hide_player_popup_panels_summary_off", "Player popup panels are shown")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_hide_player_popup_panels"))
|
||||
|
||||
val engagementPanelControllerMethod = EngagementPanelControllerFingerprint
|
||||
.result?.mutableMethod ?: throw EngagementPanelControllerFingerprint.exception
|
||||
|
||||
+8
-17
@@ -3,32 +3,23 @@ package app.revanced.patches.youtube.layout.player.overlay
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class]
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class]
|
||||
)
|
||||
internal object CustomPlayerOverlayOpacityResourcePatch : ResourcePatch() {
|
||||
internal var scrimOverlayId = -1L
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
TextPreference(
|
||||
"revanced_player_overlay_opacity",
|
||||
StringResource(
|
||||
"revanced_player_overlay_opacity_title",
|
||||
"Player overlay opacity"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_player_overlay_opacity_summary",
|
||||
"Opacity value between 0-100, where 0 is transparent"
|
||||
),
|
||||
InputType.NUMBER
|
||||
)
|
||||
TextPreference("revanced_player_overlay_opacity", inputType = InputType.NUMBER)
|
||||
)
|
||||
|
||||
scrimOverlayId = ResourceMappingPatch.resourceMappings.single {
|
||||
|
||||
+15
-12
@@ -3,28 +3,31 @@ package app.revanced.patches.youtube.layout.returnyoutubedislike
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class]
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object ReturnYouTubeDislikeResourcePatch : ResourcePatch() {
|
||||
internal var oldUIDislikeId: Long = -1
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.addPreference(
|
||||
Preference(
|
||||
StringResource("revanced_ryd_settings_title", "Return YouTube Dislike"),
|
||||
StringResource("revanced_ryd_settings_summary", "Settings for Return YouTube Dislike"),
|
||||
SettingsPatch.createReVancedSettingsIntent("ryd_settings")
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
IntentPreference(
|
||||
"revanced_ryd_settings",
|
||||
intent = SettingsPatch.newIntent("revanced_ryd_settings_intent")
|
||||
)
|
||||
)
|
||||
// merge strings
|
||||
context.mergeStrings("returnyoutubedislike/host/values/strings.xml")
|
||||
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
oldUIDislikeId = ResourceMappingPatch.resourceMappings.single {
|
||||
it.type == "id" && it.name == "dislike_button"
|
||||
|
||||
+7
-12
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.searchbar
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
@@ -8,17 +7,18 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.searchbar.fingerprints.CreateSearchSuggestionsFingerprint
|
||||
import app.revanced.patches.youtube.layout.searchbar.fingerprints.SetWordmarkHeaderFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Wide searchbar",
|
||||
description = "Adds an option to replace the search icon with a wide search bar. This will hide the YouTube logo when active.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -44,14 +44,9 @@ object WideSearchbarPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_wide_searchbar",
|
||||
StringResource("revanced_wide_searchbar_enabled_title", "Enable wide search bar"),
|
||||
StringResource("revanced_wide_searchbar_summary_on", "Wide search bar is enabled"),
|
||||
StringResource("revanced_wide_searchbar_summary_off", "Wide search bar is disabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_wide_searchbar"))
|
||||
|
||||
val result = CreateSearchSuggestionsFingerprint.result ?: throw CreateSearchSuggestionsFingerprint.exception
|
||||
|
||||
|
||||
+7
-21
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.layout.seekbar
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.fingerprints.FullscreenSeekbarThumbnailsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Restore old seekbar thumbnails",
|
||||
description = "Adds an option to restore the old seekbar thumbnails that appear above the seekbar while seeking instead of fullscreen thumbnails.",
|
||||
dependencies = [IntegrationsPatch::class, SeekbarPreferencesPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SeekbarPreferencesPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -41,23 +41,9 @@ object RestoreOldSeekbarThumbnailsPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/RestoreOldSeekbarThumbnailsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SeekbarPreferencesPatch.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_restore_old_seekbar_thumbnails",
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_title",
|
||||
"Restore old seekbar thumbnails"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_summary_on",
|
||||
"Seekbar thumbnails will appear above the seekbar"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_restore_old_seekbar_thumbnails_summary_off",
|
||||
"Seekbar thumbnails will appear in fullscreen"
|
||||
),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SeekbarPreferencesPatch.addPreferences(SwitchPreference("revanced_restore_old_seekbar_thumbnails"))
|
||||
|
||||
FullscreenSeekbarThumbnailsFingerprint.result?.mutableMethod?.apply {
|
||||
val moveResultIndex = getInstructions().lastIndex - 1
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import org.w3c.dom.Element
|
||||
|
||||
|
||||
+9
-12
@@ -3,31 +3,28 @@ package app.revanced.patches.youtube.layout.seekbar
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.BasePreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.BasePreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import java.io.Closeable
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class])
|
||||
internal object SeekbarPreferencesPatch : ResourcePatch(), Closeable {
|
||||
private val seekbarPreferences = mutableListOf<BasePreference>()
|
||||
private val seekbarPreferences = mutableSetOf<BasePreference>()
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
// Nothing to do here. All work is done in close method.
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_seekbar_preference_screen",
|
||||
StringResource("revanced_seekbar_preference_screen_title", "Seekbar"),
|
||||
seekbarPreferences,
|
||||
StringResource(
|
||||
"revanced_seekbar_preference_screen_summary",
|
||||
"Settings for the seekbar"
|
||||
)
|
||||
preferences = seekbarPreferences,
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.fingerprints.AppendTimeFingerprint
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.fingerprints.ControlsOverlayFingerprint
|
||||
import app.revanced.patches.youtube.layout.sponsorblock.fingerprints.RectangleFieldInvalidatorFingerprint
|
||||
|
||||
+38
-38
@@ -1,55 +1,52 @@
|
||||
package app.revanced.patches.youtube.layout.sponsorblock
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.copyXmlNode
|
||||
import app.revanced.util.mergeStrings
|
||||
import app.revanced.util.inputStreamFromBundledResource
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
@Patch(
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object SponsorBlockResourcePatch : ResourcePatch() {
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.addPreference(
|
||||
Preference(
|
||||
StringResource("revanced_sponsorblock_settings_title", "SponsorBlock"),
|
||||
StringResource("revanced_sponsorblock_settings_summary", "SponsorBlock related settings"),
|
||||
SettingsPatch.createReVancedSettingsIntent("sponsorblock_settings")
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
IntentPreference(
|
||||
"revanced_sb_settings",
|
||||
intent = SettingsPatch.newIntent("revanced_sb_settings_intent")
|
||||
)
|
||||
)
|
||||
val classLoader = this.javaClass.classLoader
|
||||
|
||||
/*
|
||||
merge SponsorBlock strings to main strings
|
||||
*/
|
||||
context.mergeStrings("sponsorblock/host/values/strings.xml")
|
||||
|
||||
/*
|
||||
merge SponsorBlock drawables to main drawables
|
||||
*/
|
||||
|
||||
arrayOf(
|
||||
ResourceGroup(
|
||||
"layout",
|
||||
"inline_sponsor_overlay.xml",
|
||||
"new_segment.xml",
|
||||
"skip_sponsor_button.xml"
|
||||
"revanced_sb_inline_sponsor_overlay.xml",
|
||||
"revanced_sb_new_segment.xml",
|
||||
"revanced_sb_skip_sponsor_button.xml"
|
||||
),
|
||||
ResourceGroup(
|
||||
// required resource for back button, because when the base APK is used, this resource will not exist
|
||||
"drawable",
|
||||
"ic_sb_adjust.xml",
|
||||
"ic_sb_compare.xml",
|
||||
"ic_sb_edit.xml",
|
||||
"ic_sb_logo.xml",
|
||||
"ic_sb_publish.xml",
|
||||
"ic_sb_voting.xml"
|
||||
"revanced_sb_adjust.xml",
|
||||
"revanced_sb_compare.xml",
|
||||
"revanced_sb_edit.xml",
|
||||
"revanced_sb_logo.xml",
|
||||
"revanced_sb_publish.xml",
|
||||
"revanced_sb_voting.xml"
|
||||
),
|
||||
ResourceGroup(
|
||||
// required resource for back button, because when the base APK is used, this resource will not exist
|
||||
@@ -59,14 +56,14 @@ internal object SponsorBlockResourcePatch : ResourcePatch() {
|
||||
context.copyResources("sponsorblock", resourceGroup)
|
||||
}
|
||||
|
||||
/*
|
||||
merge xml nodes from the host to their real xml files
|
||||
*/
|
||||
|
||||
// copy nodes from host resources to their real xml files
|
||||
val hostingResourceStream =
|
||||
classLoader.getResourceAsStream("sponsorblock/host/layout/youtube_controls_layout.xml")!!
|
||||
|
||||
val hostingResourceStream = inputStreamFromBundledResource(
|
||||
"sponsorblock",
|
||||
"host/layout/youtube_controls_layout.xml"
|
||||
)!!
|
||||
|
||||
var modifiedControlsLayout = false
|
||||
val targetXmlEditor = context.xmlEditor["res/layout/youtube_controls_layout.xml"]
|
||||
"RelativeLayout".copyXmlNode(
|
||||
context.xmlEditor[hostingResourceStream],
|
||||
@@ -82,12 +79,15 @@ internal object SponsorBlockResourcePatch : ResourcePatch() {
|
||||
if (!(view.hasAttributes() && view.attributes.getNamedItem("android:id").nodeValue.endsWith("live_chat_overlay_button"))) continue
|
||||
|
||||
// voting button id from the voting button view from the youtube_controls_layout.xml host file
|
||||
val votingButtonId = "@+id/sb_voting_button"
|
||||
val votingButtonId = "@+id/revanced_sb_voting_button"
|
||||
|
||||
view.attributes.getNamedItem("android:layout_toStartOf").nodeValue = votingButtonId
|
||||
|
||||
modifiedControlsLayout = true
|
||||
break
|
||||
}
|
||||
}.close() // close afterwards
|
||||
}.close()
|
||||
|
||||
if (!modifiedControlsLayout) throw PatchException("Could not modify controls layout")
|
||||
}
|
||||
}
|
||||
+12
-42
@@ -1,25 +1,24 @@
|
||||
package app.revanced.patches.youtube.layout.spoofappversion
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.ListPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.ListPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.spoofappversion.fingerprints.SpoofAppVersionFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Spoof app version",
|
||||
description = "Adds an option to trick YouTube into thinking you are running an older version of the app. " +
|
||||
"This can be used to restore old UI elements and features.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -42,46 +41,17 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
object SpoofAppVersionPatch : BytecodePatch(
|
||||
setOf(SpoofAppVersionFingerprint)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/spoof/SpoofAppVersionPatch;"
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/youtube/patches/spoof/SpoofAppVersionPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_spoof_app_version",
|
||||
StringResource("revanced_spoof_app_version_title", "Spoof app version"),
|
||||
StringResource("revanced_spoof_app_version_summary_on", "Version spoofed"),
|
||||
StringResource("revanced_spoof_app_version_summary_off", "Version not spoofed"),
|
||||
StringResource("revanced_spoof_app_version_user_dialog_message",
|
||||
"App version will be spoofed to an older version of YouTube."
|
||||
+ "\\n\\nThis will change the appearance and features of the app, but unknown side effects may occur."
|
||||
+ "\\n\\nIf later turned off, it is recommended to clear the app data to prevent UI bugs.")
|
||||
),
|
||||
SwitchPreference("revanced_spoof_app_version"),
|
||||
ListPreference(
|
||||
"revanced_spoof_app_version_target",
|
||||
StringResource(
|
||||
"revanced_spoof_app_version_target_title",
|
||||
"Spoof app version target"
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_spoof_app_version_target_entries",
|
||||
listOf(
|
||||
StringResource("revanced_spoof_app_version_target_entry_1", "18.33.40 - Restore RYD Shorts incognito mode"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_2", "18.20.39 - Restore wide video speed & quality menu"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_3", "17.08.35 - Restore old UI layout"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_4", "16.08.35 - Restore explore tab"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_5", "16.01.35 - Restore fewer video player action buttons"),
|
||||
)
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_spoof_app_version_target_entry_values",
|
||||
listOf(
|
||||
StringResource("revanced_spoof_app_version_target_entry_value_1", "18.33.40"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_value_2", "18.20.39"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_value_3", "17.08.35"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_value_4", "16.08.35"),
|
||||
StringResource("revanced_spoof_app_version_target_entry_value_5", "16.01.35"),
|
||||
)
|
||||
)
|
||||
key = "revanced_spoof_app_version_target",
|
||||
summaryKey = null,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+8
-32
@@ -5,19 +5,18 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.fingerprints.HomeActivityFingerprint
|
||||
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.ListPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.ListPreference
|
||||
import app.revanced.patches.youtube.layout.startpage.fingerprints.StartActivityFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.shared.fingerprints.HomeActivityFingerprint
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Change start page",
|
||||
description = "Adds an option to set which page the app opens in instead of the homepage.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube"
|
||||
@@ -32,35 +31,12 @@ object ChangeStartPagePatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/ChangeStartPagePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
ListPreference(
|
||||
"revanced_start_page",
|
||||
StringResource(
|
||||
"revanced_start_page_title",
|
||||
"Set start page"
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_start_page_entries",
|
||||
listOf(
|
||||
StringResource("revanced_start_page_home_entry_0", "Default"),
|
||||
StringResource("revanced_start_page_home_entry_1", "Home"),
|
||||
StringResource("revanced_start_page_search_entry_2", "Search"),
|
||||
StringResource("revanced_start_page_subscriptions_entry_3", "Subscriptions"),
|
||||
StringResource("revanced_start_page_explore_entry_4", "Explore"),
|
||||
StringResource("revanced_start_page_shorts_entry_5", "Shorts"),
|
||||
)
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_start_page_values",
|
||||
listOf(
|
||||
StringResource("revanced_start_page_home_value_0", ""),
|
||||
StringResource("revanced_start_page_home_value_1", "MAIN"),
|
||||
StringResource("revanced_start_page_search_value_2", "open.search"),
|
||||
StringResource("revanced_start_page_subscriptions_value_3", "open.subscriptions"),
|
||||
StringResource("revanced_start_page_explore_value_4", "open.explore"),
|
||||
StringResource("revanced_start_page_shorts_value_5", "open.shorts"),
|
||||
)
|
||||
)
|
||||
key = "revanced_start_page",
|
||||
summaryKey = null,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+7
-10
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.layout.startupshortsreset
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.startupshortsreset.fingerprints.UserWasInShortsFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Disable resuming Shorts on startup",
|
||||
description = "Adds an option to disable the Shorts player from resuming on app startup when Shorts were last being watched.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -43,13 +43,10 @@ object DisableResumingShortsOnStartupPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/DisableResumingStartupShortsPlayerPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_resuming_shorts_player",
|
||||
StringResource("revanced_disable_resuming_shorts_player_title", "Disable resuming Shorts player"),
|
||||
StringResource("revanced_disable_resuming_shorts_player_summary_on", "Shorts player will not resume on app startup"),
|
||||
StringResource("revanced_disable_resuming_shorts_player_summary_off", "Shorts player will resume on app startup")
|
||||
)
|
||||
SwitchPreference("revanced_disable_resuming_shorts_player")
|
||||
)
|
||||
|
||||
UserWasInShortsFingerprint.result?.apply {
|
||||
|
||||
+7
-13
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.tablet
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -9,16 +8,17 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.tablet.fingerprints.GetFormFactorFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Enable tablet layout",
|
||||
description = "Adds an option to spoof the device form factor to a tablet which enables the tablet layout.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
@@ -26,15 +26,9 @@ object EnableTabletLayoutPatch : BytecodePatch(
|
||||
setOf(GetFormFactorFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_tablet_layout",
|
||||
StringResource("revanced_tablet_layout_enabled_title", "Enable tablet layout"),
|
||||
StringResource("revanced_tablet_layout_summary_on", "Tablet layout is enabled"),
|
||||
StringResource("revanced_tablet_layout_summary_off", "Tablet layout is disabled"),
|
||||
StringResource("revanced_tablet_layout_user_dialog_message", "Community posts do not show up on tablet layouts")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_tablet_layout"))
|
||||
|
||||
GetFormFactorFingerprint.result?.let {
|
||||
it.mutableMethod.apply {
|
||||
|
||||
+7
-12
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.tabletminiplayer
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
@@ -9,21 +8,22 @@ import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerDimensionsCalculatorParentFingerprint
|
||||
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerOverrideFingerprint
|
||||
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerOverrideNoContextFingerprint
|
||||
import app.revanced.patches.youtube.layout.tabletminiplayer.fingerprints.MiniPlayerResponseModelSizeCheckFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Tablet mini player",
|
||||
description = "Adds an option to enable the tablet mini player layout.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", arrayOf(
|
||||
@@ -51,14 +51,9 @@ object TabletMiniPlayerPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_tablet_miniplayer",
|
||||
StringResource("revanced_tablet_miniplayer_title", "Enable tablet mini player"),
|
||||
StringResource("revanced_tablet_miniplayer_summary_on", "Mini player is enabled"),
|
||||
StringResource("revanced_tablet_miniplayer_summary_off", "Mini player is disabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_tablet_miniplayer"))
|
||||
|
||||
// First resolve the fingerprints via the parent fingerprint.
|
||||
MiniPlayerDimensionsCalculatorParentFingerprint.result
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package app.revanced.patches.youtube.layout.theme
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.indexOfFirstWideLiteralInstructionValue
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -9,12 +7,14 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.patch.options.PatchOption.PatchExtensions.stringPatchOption
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.SeekbarColorBytecodePatch
|
||||
import app.revanced.patches.youtube.layout.theme.fingerprints.UseGradientLoadingScreenFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.util.indexOfFirstWideLiteralInstructionValue
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
@@ -25,7 +25,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
SeekbarColorBytecodePatch::class,
|
||||
ThemeResourcePatch::class,
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -95,20 +96,9 @@ object ThemeBytecodePatch : BytecodePatch(
|
||||
)
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_gradient_loading_screen",
|
||||
StringResource("revanced_gradient_loading_screen_title", "Enable gradient loading screen"),
|
||||
StringResource(
|
||||
"revanced_gradient_loading_screen_summary_on",
|
||||
"Loading screen will have a gradient background"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_gradient_loading_screen_summary_off",
|
||||
"Loading screen will have a solid background"
|
||||
),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(SwitchPreference("revanced_gradient_loading_screen"))
|
||||
|
||||
UseGradientLoadingScreenFingerprint.result?.mutableMethod?.apply {
|
||||
val isEnabledIndex = indexOfFirstWideLiteralInstructionValue(GRADIENT_LOADING_SCREEN_AB_CONSTANT) + 3
|
||||
|
||||
@@ -4,11 +4,11 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.layout.seekbar.SeekbarPreferencesPatch
|
||||
import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.darkThemeBackgroundColor
|
||||
import app.revanced.patches.youtube.layout.theme.ThemeBytecodePatch.lightThemeBackgroundColor
|
||||
@@ -16,25 +16,22 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class, SeekbarPreferencesPatch::class]
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
ResourceMappingPatch::class,
|
||||
SeekbarPreferencesPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object ThemeResourcePatch : ResourcePatch() {
|
||||
private const val SPLASH_BACKGROUND_COLOR = "revanced_splash_background_color"
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SeekbarPreferencesPatch.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_seekbar_custom_color",
|
||||
StringResource("revanced_seekbar_custom_color_title", "Enable custom seekbar color"),
|
||||
StringResource("revanced_seekbar_custom_color_summary_on", "Custom seekbar color is shown"),
|
||||
StringResource("revanced_seekbar_custom_color_summary_off", "Original seekbar color is shown")
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_seekbar_custom_color_value",
|
||||
StringResource("revanced_seekbar_custom_color_value_title", "Custom seekbar color"),
|
||||
StringResource("revanced_seekbar_custom_color_value_summary", "The color of the seekbar"),
|
||||
InputType.TEXT_CAP_CHARACTERS
|
||||
)
|
||||
SwitchPreference("revanced_seekbar_custom_color"),
|
||||
TextPreference("revanced_seekbar_custom_color_value", inputType = InputType.TEXT_CAP_CHARACTERS)
|
||||
)
|
||||
|
||||
// Edit theme colors via resources.
|
||||
@@ -73,9 +70,10 @@ internal object ThemeResourcePatch : ResourcePatch() {
|
||||
if (darkThemeBackgroundColor != null && lightThemeBackgroundColor != null) {
|
||||
val splashScreenResourceFiles = listOf(
|
||||
"res/drawable/quantum_launchscreen_youtube.xml",
|
||||
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml")
|
||||
"res/drawable-sw600dp/quantum_launchscreen_youtube.xml"
|
||||
)
|
||||
|
||||
splashScreenResourceFiles.forEach editSplashScreen@ { resourceFile ->
|
||||
splashScreenResourceFiles.forEach editSplashScreen@{ resourceFile ->
|
||||
context.xmlEditor[resourceFile].use {
|
||||
val layerList = it.file.getElementsByTagName("layer-list").item(0) as Element
|
||||
|
||||
|
||||
+21
-91
@@ -10,7 +10,8 @@ import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod.Companion.toMutable
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.*
|
||||
import app.revanced.patches.youtube.layout.thumbnails.fingerprints.MessageDigestImageUrlFingerprint
|
||||
import app.revanced.patches.youtube.layout.thumbnails.fingerprints.MessageDigestImageUrlParentFingerprint
|
||||
import app.revanced.patches.youtube.layout.thumbnails.fingerprints.cronet.RequestFingerprint
|
||||
@@ -30,7 +31,12 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
|
||||
@Patch(
|
||||
name = "Alternative thumbnails",
|
||||
description = "Adds options to replace video thumbnails using the DeArrow API or image captures from the video.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AlternativeThumbnailsResourcePatch::class],
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
AlternativeThumbnailsResourcePatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -111,114 +117,38 @@ object AlternativeThumbnailsPatch : BytecodePatch(
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.LAYOUT.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_alt_thumbnail_preference_screen",
|
||||
StringResource("revanced_alt_thumbnail_preference_screen_title", "Alternative thumbnails"),
|
||||
listOf(
|
||||
preferences = setOf(
|
||||
NonInteractivePreference(
|
||||
StringResource("revanced_alt_thumbnail_about_title", "Thumbnails in use"),
|
||||
"revanced_alt_thumbnail_about",
|
||||
null, // Summary is dynamically updated based on the current settings.
|
||||
tag = "app.revanced.integrations.youtube.settings.preference.AlternativeThumbnailsStatusPreference"
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_alt_thumbnail_dearrow",
|
||||
StringResource("revanced_alt_thumbnail_dearrow_title", "Enable DeArrow thumbnails"),
|
||||
StringResource("revanced_alt_thumbnail_dearrow_summary_on", "Using DeArrow thumbnails"),
|
||||
StringResource("revanced_alt_thumbnail_dearrow_summary_off", "Not using DeArrow thumbnails")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_alt_thumbnail_dearrow_connection_toast",
|
||||
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_title", "Show a toast if API is not available"),
|
||||
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_on", "Toast is shown if DeArrow is not available"),
|
||||
StringResource("revanced_alt_thumbnail_dearrow_connection_toast_summary_off", "Toast is not shown if DeArrow is not available")
|
||||
),
|
||||
TextPreference(
|
||||
"revanced_alt_thumbnail_dearrow_api_url",
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_dearrow_api_url_title",
|
||||
"DeArrow API endpoint"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_dearrow_api_url_summary",
|
||||
"The URL of the DeArrow thumbnail cache endpoint. " +
|
||||
"Do not change this unless you know what you\\\'re doing"
|
||||
),
|
||||
),
|
||||
SwitchPreference("revanced_alt_thumbnail_dearrow"),
|
||||
SwitchPreference("revanced_alt_thumbnail_dearrow_connection_toast"),
|
||||
TextPreference("revanced_alt_thumbnail_dearrow_api_url"),
|
||||
NonInteractivePreference(
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_dearrow_about_title",
|
||||
"About DeArrow"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_dearrow_about_summary",
|
||||
"DeArrow provides crowd-sourced thumbnails for YouTube videos. " +
|
||||
"These thumbnails are often more relevant than those provided by YouTube. " +
|
||||
"If enabled, video URLs will be sent to the API server and no other data is sent"
|
||||
+ "\\n\\nTap here to learn more about DeArrow"
|
||||
),
|
||||
"revanced_alt_thumbnail_dearrow_about",
|
||||
// Custom about preference with link to the DeArrow website.
|
||||
tag = "app.revanced.integrations.youtube.settings.preference.AlternativeThumbnailsAboutDeArrowPreference",
|
||||
selectable = true
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_alt_thumbnail_stills",
|
||||
StringResource("revanced_alt_thumbnail_stills_title", "Enable still video captures"),
|
||||
StringResource("revanced_alt_thumbnail_stills_summary_on", "Using YouTube still video captures"),
|
||||
StringResource("revanced_alt_thumbnail_stills_summary_off", "Not using YouTube still video captures")
|
||||
),
|
||||
SwitchPreference("revanced_alt_thumbnail_stills"),
|
||||
ListPreference(
|
||||
"revanced_alt_thumbnail_stills_time",
|
||||
StringResource("revanced_alt_thumbnail_stills_time_title", "Video time to take the still from"),
|
||||
ArrayResource(
|
||||
"revanced_alt_thumbnail_type_entries",
|
||||
listOf(
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_1", "Beginning of video"),
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_2", "Middle of video"),
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_3", "End of video"),
|
||||
)
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_alt_thumbnail_stills_time_entry_values",
|
||||
listOf(
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_value_1", "1"),
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_value_2", "2"),
|
||||
StringResource("revanced_alt_thumbnail_stills_time_entry_value_3", "3"),
|
||||
)
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_alt_thumbnail_stills_fast",
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_stills_fast_title",
|
||||
"Use fast still captures"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_stills_fast_summary_on",
|
||||
"Using medium quality still captures. " +
|
||||
"Thumbnails will load faster, but live streams, unreleased, " +
|
||||
"or very old videos may show blank thumbnails"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_stills_fast_summary_off",
|
||||
"Using high quality still captures"
|
||||
)
|
||||
summaryKey = null,
|
||||
),
|
||||
SwitchPreference("revanced_alt_thumbnail_stills_fast"),
|
||||
NonInteractivePreference(
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_stills_about_title",
|
||||
"About still video captures"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_alt_thumbnail_stills_about_summary",
|
||||
"Still captures are taken from the beginning/middle/end of each video. " +
|
||||
"These images are built into YouTube and no external API is used"
|
||||
),
|
||||
"revanced_alt_thumbnail_stills_about",
|
||||
// Restore the preference dividers to keep it from looking weird.
|
||||
selectable = true
|
||||
)
|
||||
),
|
||||
StringResource("revanced_alt_thumbnail_preference_screen_summary", "Video thumbnail settings")
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+7
-4
@@ -3,14 +3,17 @@ package app.revanced.patches.youtube.layout.thumbnails
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.mergeStrings
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class]
|
||||
dependencies = [
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
internal object AlternativeThumbnailsResourcePatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
context.mergeStrings("alternativethumbnails/host/values/strings.xml")
|
||||
AddResourcesPatch(this::class)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+8
-25
@@ -1,23 +1,23 @@
|
||||
package app.revanced.patches.youtube.misc.announcements
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.shared.fingerprints.MainActivityFingerprint
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.Opcode
|
||||
|
||||
@Patch(
|
||||
name = "Announcements",
|
||||
description = "Adds an option to show announcements from ReVanced on app startup.",
|
||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube")],
|
||||
dependencies = [SettingsPatch::class]
|
||||
dependencies = [SettingsPatch::class,AddResourcesPatch::class]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object AnnouncementsPatch : BytecodePatch(
|
||||
@@ -27,6 +27,10 @@ object AnnouncementsPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/announcements/AnnouncementsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_announcements"))
|
||||
|
||||
val onCreateMethod = MainActivityFingerprint.result?.let {
|
||||
it.mutableClass.methods.find { method -> method.name == "onCreate" }
|
||||
} ?: throw MainActivityFingerprint.exception
|
||||
@@ -38,26 +42,5 @@ object AnnouncementsPatch : BytecodePatch(
|
||||
"invoke-static { v1 }, $INTEGRATIONS_CLASS_DESCRIPTOR->showAnnouncement(Landroid/app/Activity;)V"
|
||||
)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_announcements",
|
||||
StringResource(
|
||||
"revanced_announcements_title",
|
||||
"Show ReVanced announcements"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_announcements_summary_on",
|
||||
"Announcements are shown on startup"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_announcements_summary_off",
|
||||
"Announcements are not shown on startup"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_announcements_enabled_summary",
|
||||
"Show announcements on startup"
|
||||
),
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,8 +7,8 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
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.IntegrationsPatch
|
||||
@@ -18,7 +18,7 @@ import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
@Patch(
|
||||
name = "Always repeat",
|
||||
description = "Adds an option to always repeat videos when they end.",
|
||||
dependencies = [IntegrationsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class,AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -43,14 +43,9 @@ object AutoRepeatPatch : BytecodePatch(
|
||||
setOf(AutoRepeatParentFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_auto_repeat",
|
||||
StringResource("revanced_auto_repeat_title", "Enable auto-repeat"),
|
||||
StringResource("revanced_auto_repeat_summary_on", "Auto-repeat is enabled"),
|
||||
StringResource("revanced_auto_repeat_summary_off", "Auto-repeat is disabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_auto_repeat"))
|
||||
|
||||
//Get Result from the ParentFingerprint which is the playMethod we need to get.
|
||||
val parentResult = AutoRepeatParentFingerprint.result
|
||||
|
||||
@@ -4,64 +4,32 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
name = "Enable debugging",
|
||||
description = "Adds options for debugging.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object DebuggingPatch : ResourcePatch() {
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
app.revanced.patches.shared.settings.preference.impl.PreferenceScreen(
|
||||
PreferenceScreen(
|
||||
"revanced_debug_preference_screen",
|
||||
StringResource("revanced_debug_preference_screen_title", "Debugging"),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_debug",
|
||||
StringResource("revanced_debug_title", "Debug logging"),
|
||||
StringResource("revanced_debug_summary_on", "Debug logs are enabled"),
|
||||
StringResource("revanced_debug_summary_off", "Debug logs are disabled")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_debug_protobuffer",
|
||||
StringResource(
|
||||
"revanced_debug_protobuffer_title",
|
||||
"Log protocol buffer"
|
||||
),
|
||||
StringResource("revanced_debug_protobuffer_summary_on", "Debug logs include proto buffer"),
|
||||
StringResource("revanced_debug_protobuffer_summary_off", "Debug logs do not include proto buffer")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_debug_stacktrace",
|
||||
StringResource(
|
||||
"revanced_debug_stacktrace_title",
|
||||
"Log stack traces"
|
||||
),
|
||||
StringResource("revanced_debug_stacktrace_summary_on", "Debug logs include stack trace"),
|
||||
StringResource("revanced_debug_stacktrace_summary_off", "Debug logs do not include stack trace")
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_debug_toast_on_error",
|
||||
StringResource(
|
||||
"revanced_debug_toast_on_error_title",
|
||||
"Show toast on ReVanced error"
|
||||
),
|
||||
StringResource("revanced_debug_toast_on_error_summary_on", "Toast shown if error occurs"),
|
||||
StringResource("revanced_debug_toast_on_error_summary_off", "Toast not shown if error occurs"),
|
||||
StringResource("revanced_debug_toast_on_error_user_dialog_message",
|
||||
"Turning off error toasts hides all ReVanced error notifications."
|
||||
+ "\\n\\nYou will not be notified of any unexpected events."
|
||||
)
|
||||
),
|
||||
),
|
||||
StringResource("revanced_debug_preference_screen_summary", "Enable or disable debugging options")
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_debug"),
|
||||
SwitchPreference("revanced_debug_protobuffer"),
|
||||
SwitchPreference("revanced_debug_stacktrace"),
|
||||
SwitchPreference("revanced_debug_toast_on_error")
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
+7
-16
@@ -1,21 +1,21 @@
|
||||
package app.revanced.patches.youtube.misc.dimensions.spoof
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.dimensions.spoof.fingerprints.DeviceDimensionsModelToStringFingerprint
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
|
||||
@Patch(
|
||||
name = "Spoof device dimensions",
|
||||
description = "Adds an option to spoof the device dimensions which unlocks higher video qualities if they aren't available on the device.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -41,18 +41,9 @@ object SpoofDeviceDimensionsPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/spoof/SpoofDeviceDimensionsPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_spoof_device_dimensions",
|
||||
StringResource("revanced_spoof_device_dimensions_title", "Spoof device dimensions"),
|
||||
StringResource("revanced_spoof_device_dimensions_summary_on", "Device dimensions spoofed"),
|
||||
StringResource(
|
||||
"revanced_spoof_device_dimensions_summary_off",
|
||||
"Device dimensions not spoofed\\n\\n"
|
||||
+ "Spoofing the device dimensions can unlock higher video qualities but unknown side effects may occur"
|
||||
),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_spoof_device_dimensions",))
|
||||
|
||||
DeviceDimensionsModelToStringFingerprint.result
|
||||
?.mutableClass?.methods?.find { method -> method.name == "<init>" }
|
||||
|
||||
+12
-62
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.fix.playback
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
@@ -9,14 +8,15 @@ import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.PreferenceScreen
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.PreferenceScreen
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.fix.playback.fingerprints.*
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
import app.revanced.patches.youtube.video.playerresponse.PlayerResponseMethodHookPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
@@ -27,7 +27,8 @@ import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
PlayerTypeHookPatch::class,
|
||||
PlayerResponseMethodHookPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
SpoofSignatureResourcePatch::class
|
||||
SpoofSignatureResourcePatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
object SpoofSignaturePatch : BytecodePatch(
|
||||
@@ -46,67 +47,16 @@ object SpoofSignaturePatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/spoof/SpoofSignaturePatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
PreferenceScreen(
|
||||
"revanced_spoof_signature_verification",
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_title",
|
||||
"Spoof app signature"
|
||||
preferences = setOf(
|
||||
SwitchPreference("revanced_spoof_signature_verification_enabled"),
|
||||
SwitchPreference("revanced_spoof_signature_in_feed_enabled"),
|
||||
SwitchPreference("revanced_spoof_storyboard")
|
||||
),
|
||||
listOf(
|
||||
SwitchPreference(
|
||||
"revanced_spoof_signature_verification_enabled",
|
||||
StringResource("revanced_spoof_signature_verification_enabled_title", "Spoof app signature"),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_enabled_summary_on",
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• Enhanced bitrate is not available\\n"
|
||||
+ "• Videos cannot be downloaded\\n"
|
||||
+ "• No seekbar thumbnails for paid videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_enabled_summary_off",
|
||||
"App signature not spoofed\\n\\nVideo playback may not work"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_enabled_user_dialog_message",
|
||||
"Turning off this setting will cause video playback issues."
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_spoof_signature_in_feed_enabled",
|
||||
StringResource("revanced_spoof_signature_in_feed_enabled_title", "Spoof app signature in feed"),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_in_feed_enabled_summary_on",
|
||||
"App signature spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• Feed videos are missing subtitles\\n"
|
||||
+ "• Automatically played feed videos will show up in your watch history"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_in_feed_enabled_summary_off",
|
||||
"App signature not spoofed for feed videos\\n\\n"
|
||||
+ "Feed videos will play for less than 1 minute before encountering playback issues"
|
||||
)
|
||||
),
|
||||
SwitchPreference(
|
||||
"revanced_spoof_storyboard",
|
||||
StringResource("revanced_spoof_storyboard_title", "Spoof storyboard"),
|
||||
StringResource("revanced_spoof_storyboard_summary_on", "Storyboard spoofed"),
|
||||
StringResource(
|
||||
"revanced_spoof_storyboard_summary_off",
|
||||
"Storyboard not spoofed\\n\\n"
|
||||
+ "Side effects include:\\n"
|
||||
+ "• No ambient mode\\n"
|
||||
+ "• Seekbar thumbnails are hidden"
|
||||
)
|
||||
)
|
||||
),
|
||||
StringResource(
|
||||
"revanced_spoof_signature_verification_summary",
|
||||
"Spoof the app signature to prevent playback issues"
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ package app.revanced.patches.youtube.misc.fix.playback
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(dependencies = [SettingsPatch::class, ResourceMappingPatch::class])
|
||||
|
||||
@@ -1,20 +1,19 @@
|
||||
package app.revanced.patches.youtube.misc.gms
|
||||
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patches.shared.fingerprints.HomeActivityFingerprint
|
||||
import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportPatch
|
||||
import app.revanced.patches.shared.fingerprints.CastContextFetchFingerprint
|
||||
import app.revanced.patches.shared.misc.gms.BaseGmsCoreSupportPatch
|
||||
import app.revanced.patches.youtube.layout.buttons.cast.HideCastButtonPatch
|
||||
import app.revanced.patches.youtube.misc.fix.playback.ClientSpoofPatch
|
||||
import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.gms.GmsCoreSupportResourcePatch.gmsCoreVendorOption
|
||||
import app.revanced.patches.youtube.misc.gms.fingerprints.*
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.shared.fingerprints.HomeActivityFingerprint
|
||||
|
||||
|
||||
@Suppress("unused")
|
||||
object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
|
||||
object GmsCoreSupportPatch : BaseGmsCoreSupportPatch(
|
||||
fromPackageName = YOUTUBE_PACKAGE_NAME,
|
||||
toPackageName = REVANCED_YOUTUBE_PACKAGE_NAME,
|
||||
primeMethodFingerprint = PrimeMethodFingerprint,
|
||||
@@ -25,11 +24,13 @@ object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
|
||||
CastDynamiteModuleV2Fingerprint,
|
||||
CastContextFetchFingerprint
|
||||
),
|
||||
mainActivityOnCreateFingerprint = HomeActivityFingerprint,
|
||||
integrationsPatchDependency = IntegrationsPatch::class,
|
||||
dependencies = setOf(
|
||||
HideCastButtonPatch::class,
|
||||
ClientSpoofPatch::class
|
||||
),
|
||||
abstractGmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch,
|
||||
gmsCoreSupportResourcePatch = GmsCoreSupportResourcePatch,
|
||||
compatiblePackages = setOf(
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", setOf(
|
||||
@@ -48,18 +49,7 @@ object GmsCoreSupportPatch : AbstractGmsCoreSupportPatch(
|
||||
CastDynamiteModuleV2Fingerprint,
|
||||
CastContextFetchFingerprint,
|
||||
PrimeMethodFingerprint,
|
||||
HomeActivityFingerprint,
|
||||
)
|
||||
) {
|
||||
override val gmsCoreVendor by gmsCoreVendorOption
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// Check the availability of GmsCore.
|
||||
HomeActivityFingerprint.result?.mutableMethod?.addInstruction(
|
||||
0,
|
||||
"invoke-static {}, Lapp/revanced/integrations/youtube/patches/GmsCoreSupport;->checkAvailability()V"
|
||||
) ?: throw HomeActivityFingerprint.exception
|
||||
|
||||
super.execute(context)
|
||||
}
|
||||
}
|
||||
|
||||
+14
-15
@@ -1,33 +1,32 @@
|
||||
package app.revanced.patches.youtube.misc.gms
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patches.all.misc.packagename.ChangePackageNamePatch
|
||||
import app.revanced.patches.shared.misc.gms.AbstractGmsCoreSupportResourcePatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.gms.BaseGmsCoreSupportResourcePatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.patches.youtube.misc.gms.Constants.REVANCED_YOUTUBE_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.gms.Constants.YOUTUBE_PACKAGE_NAME
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
|
||||
object GmsCoreSupportResourcePatch : AbstractGmsCoreSupportResourcePatch(
|
||||
object GmsCoreSupportResourcePatch : BaseGmsCoreSupportResourcePatch(
|
||||
fromPackageName = YOUTUBE_PACKAGE_NAME,
|
||||
toPackageName = REVANCED_YOUTUBE_PACKAGE_NAME,
|
||||
spoofedPackageSignature = "24bb24c05e47e0aefa68a58a766179d9b613a600",
|
||||
dependencies = setOf(SettingsPatch::class)
|
||||
dependencies = setOf(SettingsPatch::class, AddResourcesPatch::class)
|
||||
) {
|
||||
override fun execute(context: ResourceContext) {
|
||||
SettingsPatch.addPreference(
|
||||
Preference(
|
||||
StringResource("microg_settings", "GmsCore Settings"),
|
||||
StringResource("microg_settings_summary", "Settings for GmsCore"),
|
||||
Preference.Intent("$gmsCoreVendor.android.gms", "", "org.microg.gms.ui.SettingsActivity")
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
IntentPreference(
|
||||
"microg_settings",
|
||||
intent = IntentPreference.Intent("", "org.microg.gms.ui.SettingsActivity") {
|
||||
"$gmsCoreVendor.android.gms"
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
val packageName = ChangePackageNamePatch.setOrGetFallbackPackageName(REVANCED_YOUTUBE_PACKAGE_NAME)
|
||||
SettingsPatch.renameIntentsTargetPackage(packageName)
|
||||
|
||||
super.execute(context)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
package app.revanced.patches.youtube.misc.gms.fingerprints
|
||||
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object CastContextFetchFingerprint : MethodFingerprint(
|
||||
strings = listOf("Error fetching CastContext.")
|
||||
)
|
||||
@@ -1,11 +1,11 @@
|
||||
package app.revanced.patches.youtube.misc.integrations
|
||||
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.integrations.fingerprints.*
|
||||
|
||||
@Patch(requiresIntegrations = true)
|
||||
object IntegrationsPatch : AbstractIntegrationsPatch(
|
||||
object IntegrationsPatch : BaseIntegrationsPatch(
|
||||
setOf(
|
||||
ApplicationInitFingerprint,
|
||||
StandalonePlayerActivityFingerprint,
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
|
||||
/**
|
||||
* Hooks the context when the app is launched as a regular application (and is not an embedded video playback).
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
package app.revanced.patches.youtube.misc.integrations.fingerprints
|
||||
|
||||
import app.revanced.patcher.extensions.or
|
||||
import app.revanced.patches.shared.integrations.AbstractIntegrationsPatch.IntegrationsFingerprint
|
||||
import app.revanced.patches.shared.misc.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
package app.revanced.patches.youtube.misc.links
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.links.fingerprints.ABUriParserFingerprint
|
||||
import app.revanced.patches.youtube.misc.links.fingerprints.HTTPUriParserFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.FiveRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Bypass URL redirects",
|
||||
description = "Adds an option to bypass URL redirects and open the original URL directly.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -40,14 +40,9 @@ object BypassURLRedirectsPatch : BytecodePatch(
|
||||
setOf(ABUriParserFingerprint, HTTPUriParserFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_bypass_url_redirects",
|
||||
StringResource("revanced_bypass_url_redirects_title", "Bypass URL redirects"),
|
||||
StringResource("revanced_bypass_url_redirects_summary_on", "URL redirects are bypassed"),
|
||||
StringResource("revanced_bypass_url_redirects_summary_off", "URL redirects are not bypassed"),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_bypass_url_redirects" ))
|
||||
|
||||
mapOf(
|
||||
ABUriParserFingerprint to 7, // Offset to Uri.parse.
|
||||
|
||||
+8
-12
@@ -5,10 +5,10 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.all.misc.transformation.BaseTransformInstructionsPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.all.misc.transformation.AbstractTransformInstructionsPatch
|
||||
import com.android.tools.smali.dexlib2.iface.ClassDef
|
||||
import com.android.tools.smali.dexlib2.iface.Method
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.Instruction
|
||||
@@ -19,6 +19,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
||||
@Patch(
|
||||
name = "Open links externally",
|
||||
description = "Adds an option to always open links in your browser instead of in the in-app-browser.",
|
||||
dependencies = [SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -39,7 +40,7 @@ import com.android.tools.smali.dexlib2.iface.reference.StringReference
|
||||
]
|
||||
)
|
||||
@Suppress("unused")
|
||||
object OpenLinksExternallyPatch : AbstractTransformInstructionsPatch<Pair<Int, Int>>(
|
||||
object OpenLinksExternallyPatch : BaseTransformInstructionsPatch<Pair<Int, Int>>(
|
||||
) {
|
||||
override fun filterMap(
|
||||
classDef: ClassDef, method: Method, instruction: Instruction, instructionIndex: Int
|
||||
@@ -66,14 +67,9 @@ object OpenLinksExternallyPatch : AbstractTransformInstructionsPatch<Pair<Int, I
|
||||
}
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_external_browser",
|
||||
StringResource("revanced_external_browser_title", "Open links in browser"),
|
||||
StringResource("revanced_external_browser_summary_on", "Opening links externally"),
|
||||
StringResource("revanced_external_browser_summary_off", "Opening links in app")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_external_browser"))
|
||||
|
||||
super.execute(context)
|
||||
}
|
||||
|
||||
+14
-11
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.minimizedplayback
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
@@ -8,8 +7,8 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.NonInteractivePreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.NonInteractivePreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.KidsMinimizedPlaybackPolicyControllerFingerprint
|
||||
import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.MinimizedPlaybackManagerFingerprint
|
||||
@@ -18,6 +17,7 @@ import app.revanced.patches.youtube.misc.minimizedplayback.fingerprints.Minimize
|
||||
import app.revanced.patches.youtube.misc.playertype.PlayerTypeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
|
||||
@@ -28,7 +28,8 @@ import com.android.tools.smali.dexlib2.iface.reference.MethodReference
|
||||
IntegrationsPatch::class,
|
||||
PlayerTypeHookPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
SettingsPatch::class
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
@@ -51,17 +52,19 @@ object MinimizedPlaybackPatch : BytecodePatch(
|
||||
KidsMinimizedPlaybackPolicyControllerFingerprint
|
||||
)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/MinimizedPlaybackPatch;"
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/youtube/patches/MinimizedPlaybackPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// TODO: remove this empty preference sometime after mid 2023
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
NonInteractivePreference(
|
||||
StringResource("revanced_minimized_playback_enabled_title", "Minimized playback"),
|
||||
StringResource(
|
||||
"revanced_minimized_playback_summary_on",
|
||||
"This setting can be found in Settings -> Background"
|
||||
)
|
||||
"revanced_minimized_playback_enabled",
|
||||
"revanced_minimized_playback_summary_on",
|
||||
// Use horizontal dividers to keep the settings from looking weird.
|
||||
// If PreferenceCategories are added, then this should be removed.
|
||||
selectable = true
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.DomFileEditor
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import java.io.Closeable
|
||||
|
||||
@Patch(dependencies = [ResourceMappingPatch::class])
|
||||
|
||||
+7
-21
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.misc.privacy
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
@@ -10,20 +9,21 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableMethod
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.CopyTextFingerprint
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.SystemShareSheetFingerprint
|
||||
import app.revanced.patches.youtube.misc.privacy.fingerprints.YouTubeShareSheetFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
|
||||
@Patch(
|
||||
name = "Remove tracking query parameter",
|
||||
description = "Adds an option to remove the tracking info from links you share.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube",
|
||||
@@ -47,23 +47,9 @@ object RemoveTrackingQueryParameterPatch : BytecodePatch(
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR = "Lapp/revanced/integrations/youtube/patches/RemoveTrackingQueryParameterPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_remove_tracking_query_parameter",
|
||||
StringResource(
|
||||
"revanced_remove_tracking_query_parameter_title",
|
||||
"Remove tracking query parameter"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remove_tracking_query_parameter_summary_on",
|
||||
"Tracking query parameter is removed from links"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remove_tracking_query_parameter_summary_off",
|
||||
"Tracking query parameter is not removed from links"
|
||||
),
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_remove_tracking_query_parameter"))
|
||||
|
||||
fun MethodFingerprint.hook(
|
||||
getInsertIndex: PatternScanResult.() -> Int,
|
||||
|
||||
@@ -7,8 +7,12 @@ import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.replaceInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.Preference
|
||||
import app.revanced.patches.shared.settings.util.AbstractPreferenceScreen
|
||||
import app.revanced.patches.all.misc.packagename.ChangePackageNamePatch
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.BasePreferenceScreen
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.fingerprints.LicenseActivityOnCreateFingerprint
|
||||
import app.revanced.patches.youtube.misc.settings.fingerprints.SetThemeFingerprint
|
||||
@@ -20,7 +24,12 @@ import java.io.Closeable
|
||||
|
||||
@Patch(
|
||||
description = "Adds settings for ReVanced to YouTube.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsResourcePatch::class]
|
||||
dependencies = [
|
||||
ChangePackageNamePatch::class,
|
||||
IntegrationsPatch::class,
|
||||
SettingsResourcePatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
object SettingsPatch : BytecodePatch(
|
||||
setOf(LicenseActivityOnCreateFingerprint, SetThemeFingerprint)
|
||||
@@ -32,6 +41,18 @@ object SettingsPatch : BytecodePatch(
|
||||
private const val SET_THEME_METHOD_NAME: String = "setTheme"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
PreferenceScreen.MISC.addPreferences(
|
||||
TextPreference(
|
||||
key = null,
|
||||
titleKey = "revanced_pref_import_export_title",
|
||||
summaryKey = "revanced_pref_import_export_summary",
|
||||
inputType = InputType.TEXT_MULTI_LINE,
|
||||
tag = "app.revanced.integrations.shared.settings.preference.ImportExportPreference"
|
||||
)
|
||||
)
|
||||
|
||||
SetThemeFingerprint.result?.mutableMethod?.let { setThemeMethod ->
|
||||
setThemeMethod.implementation!!.instructions.mapIndexedNotNull { i, instruction ->
|
||||
if (instruction.opcode == Opcode.RETURN_OBJECT) i else null
|
||||
@@ -72,39 +93,26 @@ object SettingsPatch : BytecodePatch(
|
||||
} ?: throw LicenseActivityOnCreateFingerprint.exception
|
||||
}
|
||||
|
||||
fun addString(identifier: String, value: String, formatted: Boolean = true) =
|
||||
SettingsResourcePatch.addString(identifier, value, formatted)
|
||||
|
||||
fun addPreferenceScreen(preferenceScreen: app.revanced.patches.shared.settings.preference.impl.PreferenceScreen) =
|
||||
SettingsResourcePatch.addPreferenceScreen(preferenceScreen)
|
||||
|
||||
fun addPreference(preference: Preference) = SettingsResourcePatch.addPreference(preference)
|
||||
|
||||
fun renameIntentsTargetPackage(newPackage: String) {
|
||||
SettingsResourcePatch.overrideIntentsTargetPackage = newPackage
|
||||
/**
|
||||
* Creates an intent to open ReVanced settings.
|
||||
*/
|
||||
fun newIntent(settingsName: String) = IntentPreference.Intent(
|
||||
data = settingsName,
|
||||
targetClass = "com.google.android.libraries.social.licenses.LicenseActivity"
|
||||
) {
|
||||
// The package name change has to be reflected in the intent.
|
||||
ChangePackageNamePatch.setOrGetFallbackPackageName("com.google.android.apps.youtube")
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates an intent to open ReVanced settings of the given name
|
||||
*/
|
||||
fun createReVancedSettingsIntent(settingsName: String) = Preference.Intent(
|
||||
"com.google.android.youtube",
|
||||
settingsName,
|
||||
"com.google.android.libraries.social.licenses.LicenseActivity"
|
||||
)
|
||||
object PreferenceScreen : BasePreferenceScreen() {
|
||||
val ADS = Screen("revanced_ads_screen")
|
||||
val INTERACTIONS = Screen("revanced_interactions_screen")
|
||||
val LAYOUT = Screen("revanced_layout_screen")
|
||||
val VIDEO = Screen("revanced_video_screen")
|
||||
val MISC = Screen("revanced_misc_screen")
|
||||
|
||||
/**
|
||||
* Preference screens patches should add their settings to.
|
||||
*/
|
||||
object PreferenceScreen : AbstractPreferenceScreen() {
|
||||
val ADS = Screen("ads", "Ads", "Ad related settings")
|
||||
val INTERACTIONS = Screen("interactions", "Interaction", "Settings related to interactions")
|
||||
val LAYOUT = Screen("layout", "Layout", "Settings related to the layout")
|
||||
val VIDEO = Screen("video", "Video", "Settings related to the video player")
|
||||
val MISC = Screen("misc", "Misc", "Miscellaneous patches")
|
||||
|
||||
override fun commit(screen: app.revanced.patches.shared.settings.preference.impl.PreferenceScreen) {
|
||||
addPreferenceScreen(screen)
|
||||
override fun commit(screen: app.revanced.patches.shared.misc.settings.preference.PreferenceScreen) {
|
||||
SettingsResourcePatch += screen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+17
-115
@@ -1,63 +1,48 @@
|
||||
package app.revanced.patches.youtube.misc.settings
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.DomFileEditor
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.AbstractSettingsResourcePatch
|
||||
import app.revanced.patches.shared.settings.preference.addPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.*
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.BaseSettingsResourcePatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.IntentPreference
|
||||
import app.revanced.util.ResourceGroup
|
||||
import app.revanced.util.copyResources
|
||||
import app.revanced.util.mergeStrings
|
||||
import org.w3c.dom.Element
|
||||
import org.w3c.dom.Node
|
||||
|
||||
@Patch(
|
||||
dependencies = [ResourceMappingPatch::class]
|
||||
)
|
||||
object SettingsResourcePatch : AbstractSettingsResourcePatch(
|
||||
"revanced_prefs",
|
||||
"settings"
|
||||
object SettingsResourcePatch : BaseSettingsResourcePatch(
|
||||
IntentPreference(
|
||||
"revanced_settings",
|
||||
intent = SettingsPatch.newIntent("revanced_settings_intent")
|
||||
) to "settings_fragment",
|
||||
dependencies = setOf(
|
||||
ResourceMappingPatch::class,
|
||||
AddResourcesPatch::class,
|
||||
)
|
||||
) {
|
||||
// Used for a fingerprint from SettingsPatch.
|
||||
internal var appearanceStringId = -1L
|
||||
|
||||
// if this is not null, all intents will be renamed to this
|
||||
internal var overrideIntentsTargetPackage: String? = null
|
||||
|
||||
private var preferencesNode: Node? = null
|
||||
|
||||
private var preferencesEditor: DomFileEditor? = null
|
||||
set(value) {
|
||||
field = value
|
||||
preferencesNode = value.getNode("PreferenceScreen")
|
||||
}
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
super.execute(context)
|
||||
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
// Used for a fingerprint from SettingsPatch.
|
||||
appearanceStringId = ResourceMappingPatch.resourceMappings.find {
|
||||
it.type == "string" && it.name == "app_theme_appearance_dark"
|
||||
}!!.id
|
||||
|
||||
/*
|
||||
* copy layout resources
|
||||
*/
|
||||
arrayOf(
|
||||
ResourceGroup("layout", "revanced_settings_with_toolbar.xml")
|
||||
).forEach { resourceGroup ->
|
||||
context.copyResources("settings", resourceGroup)
|
||||
}
|
||||
|
||||
preferencesEditor = context.xmlEditor["res/xml/settings_fragment.xml"]
|
||||
|
||||
// Modify the manifest and add an data intent filter to the LicenseActivity.
|
||||
// Modify the manifest and add a data intent filter to the LicenseActivity.
|
||||
// Some devices freak out if undeclared data is passed to an intent,
|
||||
// and this change appears to fix the issue.
|
||||
context.xmlEditor["AndroidManifest.xml"].use { editor ->
|
||||
// An xml regular expression would probably work better than this manual searching.
|
||||
// A xml regular-expression would probably work better than this manual searching.
|
||||
val manifestNodes = editor.file.getElementsByTagName("manifest").item(0).childNodes
|
||||
for (i in 0..manifestNodes.length) {
|
||||
val node = manifestNodes.item(i)
|
||||
@@ -79,88 +64,5 @@ object SettingsResourcePatch : AbstractSettingsResourcePatch(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Add the ReVanced settings to the YouTube settings
|
||||
SettingsPatch.addPreference(
|
||||
Preference(
|
||||
StringResource("revanced_settings", "ReVanced"),
|
||||
StringResource("revanced_settings_summary", "ReVanced specific settings"),
|
||||
SettingsPatch.createReVancedSettingsIntent("revanced_settings")
|
||||
)
|
||||
)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
TextPreference(
|
||||
key = null,
|
||||
title = StringResource("revanced_pref_import_export_title", "Import / Export"),
|
||||
summary = StringResource("revanced_pref_import_export_summary", "Import / Export ReVanced settings"),
|
||||
inputType = InputType.TEXT_MULTI_LINE,
|
||||
tag = "app.revanced.integrations.shared.settings.preference.ImportExportPreference"
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
override fun close() {
|
||||
super.close()
|
||||
|
||||
// rename the intent package names if it was set
|
||||
overrideIntentsTargetPackage?.let { packageName ->
|
||||
val preferences = preferencesEditor!!.getNode("PreferenceScreen").childNodes
|
||||
for (i in 1 until preferences.length) {
|
||||
val preferenceNode = preferences.item(i)
|
||||
// preferences have a child node with the intent tag, skip over every other node
|
||||
if (preferenceNode.childNodes.length == 0) continue
|
||||
|
||||
val intentNode = preferenceNode.firstChild
|
||||
|
||||
// if the node doesn't have a target package attribute, skip it
|
||||
val targetPackageAttribute = intentNode.attributes.getNamedItem("android:targetPackage") ?: continue
|
||||
|
||||
// do not replace intent target package if the package name is not from YouTube
|
||||
val youtubePackage = "com.google.android.youtube"
|
||||
if (targetPackageAttribute.nodeValue != youtubePackage) continue
|
||||
|
||||
// replace the target package name
|
||||
intentNode.attributes.setNamedItem(preferenceNode.ownerDocument.createAttribute("android:targetPackage")
|
||||
.also { attribute ->
|
||||
attribute.value = packageName
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
preferencesEditor?.close()
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a preference fragment to the main preferences.
|
||||
*
|
||||
* @param preference The preference to add.
|
||||
*/
|
||||
internal fun addPreference(preference: Preference) =
|
||||
preferencesNode!!.addPreference(preference) { it.include() }
|
||||
|
||||
/**
|
||||
* Add a new string to the resources.
|
||||
*
|
||||
* @param identifier The key of the string.
|
||||
* @param value The value of the string.
|
||||
* @throws IllegalArgumentException if the string already exists.
|
||||
*/
|
||||
internal fun addString(identifier: String, value: String, formatted: Boolean) =
|
||||
AbstractSettingsResourcePatch.addString(identifier, value, formatted)
|
||||
|
||||
/**
|
||||
* Add an array to the resources.
|
||||
*
|
||||
* @param arrayResource The array resource to add.
|
||||
*/
|
||||
internal fun addArray(arrayResource: ArrayResource) = AbstractSettingsResourcePatch.addArray(arrayResource)
|
||||
|
||||
/**
|
||||
* Add a preference to the settings.
|
||||
*
|
||||
* @param preferenceScreen The name of the preference screen.
|
||||
*/
|
||||
internal fun addPreferenceScreen(preferenceScreen: PreferenceScreen) = addPreference(preferenceScreen)
|
||||
}
|
||||
+1
-1
@@ -12,4 +12,4 @@ internal object SetThemeFingerprint : LiteralValueFingerprint(
|
||||
parameters = listOf(),
|
||||
opcodes = listOf(Opcode.RETURN_OBJECT),
|
||||
literalSupplier = { SettingsResourcePatch.appearanceStringId }
|
||||
)
|
||||
)
|
||||
|
||||
@@ -7,15 +7,15 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.misc.zoomhaptics.fingerprints.ZoomHapticsFingerprint
|
||||
|
||||
@Patch(
|
||||
name = "Disable zoom haptics",
|
||||
description = "Adds an option to disable haptics when zooming.",
|
||||
dependencies = [SettingsPatch::class],
|
||||
dependencies = [SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [CompatiblePackage("com.google.android.youtube")]
|
||||
)
|
||||
@Suppress("unused")
|
||||
@@ -23,14 +23,9 @@ object ZoomHapticsPatch : BytecodePatch(
|
||||
setOf(ZoomHapticsFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_disable_zoom_haptics",
|
||||
StringResource("revanced_disable_zoom_haptics_title", "Disable zoom haptics"),
|
||||
StringResource("revanced_disable_zoom_haptics_summary_on", "Haptics are disabled"),
|
||||
StringResource("revanced_disable_zoom_haptics_summary_off", "Haptics are enabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.MISC.addPreferences(SwitchPreference("revanced_disable_zoom_haptics"))
|
||||
|
||||
val zoomHapticsFingerprintMethod = ZoomHapticsFingerprint.result!!.mutableMethod
|
||||
|
||||
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
package app.revanced.patches.youtube.shared.fingerprints
|
||||
|
||||
import app.revanced.patcher.fingerprint.MethodFingerprint
|
||||
|
||||
internal object HomeActivityFingerprint : MethodFingerprint(
|
||||
customFingerprint = { methodDef, classDef ->
|
||||
methodDef.name == "onCreate" && classDef.type.endsWith("Shell_HomeActivity;")
|
||||
},
|
||||
)
|
||||
+6
-11
@@ -5,8 +5,8 @@ import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.hdrbrightness.fingerprints.HDRBrightnessFingerprint
|
||||
@@ -17,7 +17,7 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
@Patch(
|
||||
name = "HDR auto brightness",
|
||||
description = "Adds an option to make the brightness of HDR videos follow the system default.",
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class],
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, AddResourcesPatch::class],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -41,14 +41,9 @@ object HDRBrightnessPatch : BytecodePatch(
|
||||
setOf(HDRBrightnessFingerprint)
|
||||
) {
|
||||
override fun execute(context: BytecodeContext) {
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_hdr_auto_brightness",
|
||||
StringResource("revanced_hdr_auto_brightness_title", "Enable auto HDR brightness"),
|
||||
StringResource("revanced_hdr_auto_brightness_summary_on", "Auto HDR brightness is enabled"),
|
||||
StringResource("revanced_hdr_auto_brightness_summary_off", "Auto HDR brightness is disabled")
|
||||
)
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(SwitchPreference("revanced_hdr_auto_brightness"))
|
||||
|
||||
val method = HDRBrightnessFingerprint.result!!.mutableMethod
|
||||
|
||||
|
||||
+22
-62
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.video.quality
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
@@ -9,10 +8,9 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.CompatiblePackage
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.ListPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.ListPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
@@ -20,6 +18,7 @@ import app.revanced.patches.youtube.video.quality.fingerprints.NewVideoQualityCh
|
||||
import app.revanced.patches.youtube.video.quality.fingerprints.SetQualityByIndexMethodClassFieldReferenceFingerprint
|
||||
import app.revanced.patches.youtube.video.quality.fingerprints.VideoQualityItemOnClickParentFingerprint
|
||||
import app.revanced.patches.youtube.video.quality.fingerprints.VideoQualitySetterFingerprint
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.TwoRegisterInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
@@ -27,7 +26,12 @@ import com.android.tools.smali.dexlib2.iface.reference.FieldReference
|
||||
@Patch(
|
||||
name = "Remember video quality",
|
||||
description = "Adds an option to remember the last video quality selected.",
|
||||
dependencies = [IntegrationsPatch::class, VideoInformationPatch::class, SettingsPatch::class],
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
SettingsPatch::class,
|
||||
AddResourcesPatch::class
|
||||
],
|
||||
compatiblePackages = [
|
||||
CompatiblePackage(
|
||||
"com.google.android.youtube", [
|
||||
@@ -49,68 +53,24 @@ object RememberVideoQualityPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/youtube/patches/playback/quality/RememberVideoQualityPatch;"
|
||||
"Lapp/revanced/integrations/youtube/patches/playback/quality/RememberVideoQualityPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
// This is bloated as each value has it's own String key/value
|
||||
// ideally the entries would be raw values (and not a key to a String resource)
|
||||
val entries = listOf(
|
||||
StringResource("revanced_video_quality_default_entry_1", "Automatic quality"),
|
||||
StringResource("revanced_video_quality_default_entry_2", "2160p"),
|
||||
StringResource("revanced_video_quality_default_entry_3", "1440p"),
|
||||
StringResource("revanced_video_quality_default_entry_4", "1080p"),
|
||||
StringResource("revanced_video_quality_default_entry_5", "720p"),
|
||||
StringResource("revanced_video_quality_default_entry_6", "480p"),
|
||||
StringResource("revanced_video_quality_default_entry_7", "360p"),
|
||||
StringResource("revanced_video_quality_default_entry_8", "240p"),
|
||||
StringResource("revanced_video_quality_default_entry_9", "144p"),
|
||||
)
|
||||
val entryValues = listOf(
|
||||
StringResource("revanced_video_quality_default_entry_value_1", "-2"),
|
||||
StringResource("revanced_video_quality_default_entry_value_2", "2160"),
|
||||
StringResource("revanced_video_quality_default_entry_value_3", "1440"),
|
||||
StringResource("revanced_video_quality_default_entry_value_4", "1080"),
|
||||
StringResource("revanced_video_quality_default_entry_value_5", "720"),
|
||||
StringResource("revanced_video_quality_default_entry_value_6", "480"),
|
||||
StringResource("revanced_video_quality_default_entry_value_7", "360"),
|
||||
StringResource("revanced_video_quality_default_entry_value_8", "240"),
|
||||
StringResource("revanced_video_quality_default_entry_value_9", "144"),
|
||||
)
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_remember_video_quality_last_selected",
|
||||
StringResource(
|
||||
"revanced_remember_video_quality_last_selected_title",
|
||||
"Remember video quality changes"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remember_video_quality_last_selected_summary_on",
|
||||
"Quality changes apply to all videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remember_video_quality_last_selected_summary_off",
|
||||
"Quality changes only apply to the current video"
|
||||
)
|
||||
SwitchPreference("revanced_remember_video_quality_last_selected"),
|
||||
ListPreference(
|
||||
key = "revanced_video_quality_default_wifi",
|
||||
summaryKey = null,
|
||||
entriesKey = "revanced_video_quality_default_entries",
|
||||
entryValuesKey = "revanced_video_quality_default_entry_values"
|
||||
),
|
||||
ListPreference(
|
||||
"revanced_video_quality_default_wifi",
|
||||
StringResource(
|
||||
"revanced_video_quality_default_wifi_title",
|
||||
"Default video quality on Wi-Fi network"
|
||||
),
|
||||
ArrayResource("revanced_video_quality_default_wifi_entry", entries),
|
||||
ArrayResource("revanced_video_quality_default_wifi_entry_values", entryValues)
|
||||
// default value and summary are set by integrations after loading
|
||||
),
|
||||
ListPreference(
|
||||
"revanced_video_quality_default_mobile",
|
||||
StringResource(
|
||||
"revanced_video_quality_default_mobile_title",
|
||||
"Default video quality on mobile network"
|
||||
),
|
||||
ArrayResource("revanced_video_quality_default_mobile_entries", entries),
|
||||
ArrayResource("revanced_video_quality_default_mobile_values", entryValues)
|
||||
key = "revanced_video_quality_default_mobile",
|
||||
summaryKey = null,
|
||||
entriesKey = "revanced_video_quality_default_entries",
|
||||
entryValuesKey = "revanced_video_quality_default_entry_values"
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
+10
-18
@@ -1,6 +1,5 @@
|
||||
package app.revanced.patches.youtube.video.speed.custom
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstruction
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructions
|
||||
@@ -11,14 +10,15 @@ import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.proxy.mutableTypes.MutableField.Companion.toMutable
|
||||
import app.revanced.patches.shared.settings.preference.impl.InputType
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.TextPreference
|
||||
import app.revanced.patches.youtube.misc.recyclerviewtree.hook.RecyclerViewTreeHookPatch
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.InputType
|
||||
import app.revanced.patches.shared.misc.settings.preference.TextPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.litho.filter.LithoFilterPatch
|
||||
import app.revanced.patches.youtube.misc.recyclerviewtree.hook.RecyclerViewTreeHookPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.speed.custom.fingerprints.*
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.AccessFlags
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.NarrowLiteralInstruction
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.OneRegisterInstruction
|
||||
@@ -34,7 +34,8 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableField
|
||||
LithoFilterPatch::class,
|
||||
SettingsPatch::class,
|
||||
RecyclerViewTreeHookPatch::class,
|
||||
CustomPlaybackSpeedResourcePatch::class
|
||||
CustomPlaybackSpeedResourcePatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
object CustomPlaybackSpeedPatch : BytecodePatch(
|
||||
@@ -52,19 +53,10 @@ object CustomPlaybackSpeedPatch : BytecodePatch(
|
||||
"Lapp/revanced/integrations/youtube/patches/playback/speed/CustomPlaybackSpeedPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
TextPreference(
|
||||
key = "revanced_custom_playback_speeds",
|
||||
title = StringResource(
|
||||
"revanced_custom_playback_speeds_title",
|
||||
"Custom playback speeds"
|
||||
),
|
||||
inputType = InputType.TEXT_MULTI_LINE,
|
||||
summary = StringResource(
|
||||
"revanced_custom_playback_speeds_summary",
|
||||
"Add or change the available playback speeds"
|
||||
)
|
||||
)
|
||||
TextPreference("revanced_custom_playback_speeds", inputType = InputType.TEXT_MULTI_LINE)
|
||||
)
|
||||
|
||||
val arrayGenMethod = SpeedArrayGeneratorFingerprint.result?.mutableMethod!!
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@ package app.revanced.patches.youtube.video.speed.custom
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
|
||||
internal object CustomPlaybackSpeedResourcePatch : ResourcePatch() {
|
||||
var speedUnavailableId: Long = -1
|
||||
|
||||
+22
-39
@@ -1,72 +1,55 @@
|
||||
package app.revanced.patches.youtube.video.speed.remember
|
||||
|
||||
import app.revanced.util.exception
|
||||
import app.revanced.patcher.data.BytecodeContext
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.addInstructionsWithLabels
|
||||
import app.revanced.patcher.extensions.InstructionExtensions.getInstruction
|
||||
import app.revanced.patcher.patch.BytecodePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patcher.util.smali.ExternalLabel
|
||||
import app.revanced.patches.shared.settings.preference.impl.ArrayResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.ListPreference
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.ListPreference
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.integrations.IntegrationsPatch
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
import app.revanced.patches.youtube.video.information.VideoInformationPatch
|
||||
import app.revanced.patches.youtube.video.speed.custom.CustomPlaybackSpeedPatch
|
||||
import app.revanced.patches.youtube.video.speed.remember.fingerprint.InitializePlaybackSpeedValuesFingerprint
|
||||
import app.revanced.util.exception
|
||||
import com.android.tools.smali.dexlib2.iface.instruction.ReferenceInstruction
|
||||
|
||||
@Patch(
|
||||
dependencies = [IntegrationsPatch::class, SettingsPatch::class, VideoInformationPatch::class, CustomPlaybackSpeedPatch::class]
|
||||
dependencies = [
|
||||
IntegrationsPatch::class,
|
||||
SettingsPatch::class,
|
||||
VideoInformationPatch::class,
|
||||
CustomPlaybackSpeedPatch::class,
|
||||
AddResourcesPatch::class
|
||||
]
|
||||
)
|
||||
object RememberPlaybackSpeedPatch : BytecodePatch(
|
||||
setOf(InitializePlaybackSpeedValuesFingerprint)
|
||||
){
|
||||
) {
|
||||
private const val INTEGRATIONS_CLASS_DESCRIPTOR =
|
||||
"Lapp/revanced/integrations/youtube/patches/playback/speed/RememberPlaybackSpeedPatch;"
|
||||
|
||||
override fun execute(context: BytecodeContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_remember_playback_speed_last_selected",
|
||||
StringResource(
|
||||
"revanced_remember_playback_speed_last_selected_title",
|
||||
"Remember playback speed changes"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remember_playback_speed_last_selected_summary_on",
|
||||
"Playback speed changes apply to all videos"
|
||||
),
|
||||
StringResource(
|
||||
"revanced_remember_playback_speed_last_selected_summary_off",
|
||||
"Playback speed changes only apply to the current video"
|
||||
)
|
||||
),
|
||||
SwitchPreference("revanced_remember_playback_speed_last_selected"),
|
||||
ListPreference(
|
||||
"revanced_playback_speed_default",
|
||||
StringResource(
|
||||
"revanced_playback_speed_default_title",
|
||||
"Default playback speed"
|
||||
),
|
||||
// Dummy data:
|
||||
// Entries and values are set by Integrations code based on the actual speeds available,
|
||||
// and the values set here are ignored and do nothing.
|
||||
ArrayResource(
|
||||
"revanced_playback_speed_default_entries",
|
||||
listOf(StringResource("revanced_playback_speed_default_entries", "1.0x"))
|
||||
),
|
||||
ArrayResource(
|
||||
"revanced_playback_speed_default_entry_values",
|
||||
listOf(StringResource("revanced_playback_speed_default_entry_value", "1.0"))
|
||||
)
|
||||
key = "revanced_playback_speed_default",
|
||||
summaryKey = null,
|
||||
// Entries and values are set by Integrations code based on the actual speeds available.
|
||||
entriesKey = null,
|
||||
entryValuesKey = null
|
||||
)
|
||||
)
|
||||
|
||||
VideoInformationPatch.onCreateHook(INTEGRATIONS_CLASS_DESCRIPTOR, "newVideoStarted")
|
||||
VideoInformationPatch.userSelectedPlaybackSpeedHook(
|
||||
INTEGRATIONS_CLASS_DESCRIPTOR, "userSelectedPlaybackSpeed")
|
||||
INTEGRATIONS_CLASS_DESCRIPTOR, "userSelectedPlaybackSpeed"
|
||||
)
|
||||
|
||||
/*
|
||||
* Hook the code that is called when the playback speeds are initialized, and sets the playback speed
|
||||
|
||||
+7
-10
@@ -4,25 +4,22 @@ import app.revanced.patcher.data.ResourceContext
|
||||
import app.revanced.patcher.patch.PatchException
|
||||
import app.revanced.patcher.patch.ResourcePatch
|
||||
import app.revanced.patcher.patch.annotation.Patch
|
||||
import app.revanced.patches.shared.mapping.misc.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.settings.preference.impl.StringResource
|
||||
import app.revanced.patches.shared.settings.preference.impl.SwitchPreference
|
||||
import app.revanced.patches.all.misc.resources.AddResourcesPatch
|
||||
import app.revanced.patches.shared.misc.mapping.ResourceMappingPatch
|
||||
import app.revanced.patches.shared.misc.settings.preference.SwitchPreference
|
||||
import app.revanced.patches.youtube.misc.settings.SettingsPatch
|
||||
|
||||
@Patch(
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class]
|
||||
dependencies = [SettingsPatch::class, ResourceMappingPatch::class, AddResourcesPatch::class]
|
||||
)
|
||||
object RestoreOldVideoQualityMenuResourcePatch : ResourcePatch() {
|
||||
internal var videoQualityBottomSheetListFragmentTitle = -1L
|
||||
|
||||
override fun execute(context: ResourceContext) {
|
||||
AddResourcesPatch(this::class)
|
||||
|
||||
SettingsPatch.PreferenceScreen.VIDEO.addPreferences(
|
||||
SwitchPreference(
|
||||
"revanced_restore_old_video_quality_menu",
|
||||
StringResource("revanced_restore_old_video_quality_menu_title", "Restore old video quality menu"),
|
||||
StringResource("revanced_restore_old_video_quality_menu_summary_on", "Old video quality menu is shown"),
|
||||
StringResource("revanced_restore_old_video_quality_menu_summary_off", "Old video quality menu is not shown")
|
||||
)
|
||||
SwitchPreference("revanced_restore_old_video_quality_menu")
|
||||
)
|
||||
|
||||
fun findResource(name: String) = ResourceMappingPatch.resourceMappings.find { it.name == name }?.id
|
||||
|
||||
Reference in New Issue
Block a user