Skip to content

Commit

Permalink
Rename patch
Browse files Browse the repository at this point in the history
  • Loading branch information
LisoUseInAIKyrios committed Dec 15, 2024
1 parent aae7229 commit b9a02e6
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import app.revanced.extension.youtube.settings.Settings;

@SuppressWarnings("unused")
public class DisableAutoAudioTracksPatch {
public class ForceOriginalAudioPatch {

private static final String DEFAULT_AUDIO_TRACKS_IDENTIFIER = "original";

Expand All @@ -13,7 +13,7 @@ public class DisableAutoAudioTracksPatch {
*/
public static boolean isDefaultAudioStream(boolean isDefault, String audioTrackId, String audioTrackDisplayName) {
try {
if (!Settings.DISABLE_AUTO_AUDIO_TRACKS.get()) {
if (!Settings.FORCE_ORIGINAL_AUDIO.get()) {
return isDefault;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class Settings extends BaseSettings {
public static final StringSetting CUSTOM_PLAYBACK_SPEEDS = new StringSetting("revanced_custom_playback_speeds",
"0.25\n0.5\n0.75\n0.9\n0.95\n1.0\n1.05\n1.1\n1.25\n1.5\n1.75\n2.0\n3.0\n4.0\n5.0", true);
// Audio
public static final BooleanSetting DISABLE_AUTO_AUDIO_TRACKS = new BooleanSetting("revanced_disable_auto_audio_tracks", FALSE);
public static final BooleanSetting FORCE_ORIGINAL_AUDIO = new BooleanSetting("revanced_force_original_audio", FALSE);

// Ads
public static final BooleanSetting HIDE_BUTTONED_ADS = new BooleanSetting("revanced_hide_buttoned_ads", TRUE);
Expand Down
4 changes: 2 additions & 2 deletions patches/api/patches.api
Original file line number Diff line number Diff line change
Expand Up @@ -1392,8 +1392,8 @@ public final class app/revanced/patches/youtube/shared/FingerprintsKt {
public static final fun getRollingNumberTextViewAnimationUpdateFingerprint ()Lapp/revanced/patcher/Fingerprint;
}

public final class app/revanced/patches/youtube/video/audio/DisableAutoAudioTracksPatchKt {
public static final fun getDisableAutoAudioTracksPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
public final class app/revanced/patches/youtube/video/audio/ForceOriginalAudioPatchKt {
public static final fun getForceOriginalAudioPatch ()Lapp/revanced/patcher/patch/BytecodePatch;
}

public final class app/revanced/patches/youtube/video/information/VideoInformationPatchKt {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ import com.android.tools.smali.dexlib2.immutable.ImmutableMethod
import com.android.tools.smali.dexlib2.immutable.ImmutableMethodParameter

private const val EXTENSION_CLASS_DESCRIPTOR =
"Lapp/revanced/extension/youtube/patches/DisableAutoAudioTracksPatch;"
"Lapp/revanced/extension/youtube/patches/ForceOriginalAudioPatch;"

@Suppress("unused")
val disableAutoAudioTracksPatch = bytecodePatch(
name = "Disable auto audio tracks",
description = "Adds an option to disable audio tracks from being automatically enabled.",
val forceOriginalAudioPatch = bytecodePatch(
name = "Force original audio",
description = "Adds an option to always use the original audio track.",
) {
dependsOn(
sharedExtensionPatch,
Expand All @@ -53,10 +53,10 @@ val disableAutoAudioTracksPatch = bytecodePatch(
)

execute {
addResources("youtube", "video.audio.disableAutoAudioTracksPatch")
addResources("youtube", "video.audio.forceOriginalAudioPatch")

PreferenceScreen.VIDEO.addPreferences(
SwitchPreference("revanced_disable_auto_audio_tracks")
SwitchPreference("revanced_force_original_audio")
)

fun Method.firstFormatStreamingModelCall(
Expand Down
8 changes: 4 additions & 4 deletions patches/src/main/resources/addresources/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1226,10 +1226,10 @@ Enabling this can unlock higher video qualities"</string>
<string name="revanced_disable_zoom_haptics_summary_on">Haptics are disabled</string>
<string name="revanced_disable_zoom_haptics_summary_off">Haptics are enabled</string>
</patch>
<patch id="video.audio.disableAutoAudioTracksPatch">
<string name="revanced_disable_auto_audio_tracks_title">Disable forced auto audio tracks</string>
<string name="revanced_disable_auto_audio_tracks_summary_on">Forced auto audio track are disabled</string>
<string name="revanced_disable_auto_audio_tracks_summary_off">Forced auto audio tracks are not disabled</string>
<patch id="video.audio.forceOriginalAudioPatch">
<string name="revanced_force_original_audio_title">Forced original audio</string>
<string name="revanced_force_original_audio_summary_on">Using original audio</string>
<string name="revanced_force_original_audio_summary_off">Using default audio</string>
</patch>
<patch id="video.quality.rememberVideoQualityPatch">
<!-- Translations should use the same text as revanced_custom_playback_speeds_auto -->
Expand Down

0 comments on commit b9a02e6

Please sign in to comment.