From 04409db12a51d6f989cba211627f9ff6be9c5825 Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Sun, 15 Dec 2024 00:27:07 +0400 Subject: [PATCH] refactor --- .../youtube/patches/ChangeDefaultAudioLanguagePatch.java | 2 +- .../youtube/video/audio/ChangeDefaultAudioLanguagePatch.kt | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeDefaultAudioLanguagePatch.java b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeDefaultAudioLanguagePatch.java index bb223dfeee..622e627421 100644 --- a/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeDefaultAudioLanguagePatch.java +++ b/extensions/youtube/src/main/java/app/revanced/extension/youtube/patches/ChangeDefaultAudioLanguagePatch.java @@ -25,7 +25,7 @@ public class ChangeDefaultAudioLanguagePatch { /** * Injection point. */ - public static boolean isAudioStreamAsDefault(boolean isDefault, String audioTrackId, String audioTrackDisplayName) { + public static boolean isDefaultAudioStream(boolean isDefault, String audioTrackId, String audioTrackDisplayName) { try { if (audioTrackId.isEmpty()) { // Older app targets can have empty audio tracks and these might be placeholders. diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ChangeDefaultAudioLanguagePatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ChangeDefaultAudioLanguagePatch.kt index 16e23eb400..57f7a2b7ff 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ChangeDefaultAudioLanguagePatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/video/audio/ChangeDefaultAudioLanguagePatch.kt @@ -30,8 +30,8 @@ private const val EXTENSION_CLASS_DESCRIPTOR = @Suppress("unused") val changeDefaultAudioLanguagePatch = bytecodePatch( - name = "Change default audio track", - description = "Adds an option to set a video default audio language .", + name = "Change default audio language", + description = "Adds an option to set a default audio language.", ) { dependsOn( sharedExtensionPatch, @@ -133,8 +133,9 @@ val changeDefaultAudioLanguagePatch = bytecodePatch( invoke-virtual { p0 }, $audioTrackDisplayNameMethod move-result-object v2 - invoke-static { p1, v1, v2 }, $EXTENSION_CLASS_DESCRIPTOR->isAudioStreamAsDefault(ZLjava/lang/String;Ljava/lang/String;)Z + invoke-static { p1, v1, v2 }, $EXTENSION_CLASS_DESCRIPTOR->isDefaultAudioStream(ZLjava/lang/String;Ljava/lang/String;)Z move-result v3 + invoke-static { v3 }, Ljava/lang/Boolean;->valueOf(Z)Ljava/lang/Boolean; move-result-object v0 iput-object v0, p0, $helperMethodClass->$helperFieldName:Ljava/lang/Boolean;