add spoof-version patch: for YT Music users living in Canada.

This commit is contained in:
inotia00
2023-03-28 21:47:25 +09:00
parent 2be738b75c
commit e5cceb6876
2 changed files with 41 additions and 2 deletions

View File

@ -0,0 +1,37 @@
package app.revanced.patches.music.misc.versionspoof.patch
import app.revanced.patcher.annotation.Description
import app.revanced.patcher.annotation.Name
import app.revanced.patcher.annotation.Version
import app.revanced.patcher.data.BytecodeContext
import app.revanced.patcher.patch.BytecodePatch
import app.revanced.patcher.patch.PatchResult
import app.revanced.patcher.patch.PatchResultSuccess
import app.revanced.patcher.patch.annotations.DependsOn
import app.revanced.patcher.patch.annotations.Patch
import app.revanced.patches.music.misc.settings.patch.MusicSettingsPatch
import app.revanced.patches.shared.annotation.YouTubeMusicCompatibility
import app.revanced.patches.shared.patch.versionspoof.GeneralVersionSpoofPatch
import app.revanced.util.integrations.Constants.MUSIC_SETTINGS_PATH
@Patch
@Name("spoof-version")
@Description("Spoof the YouTube Music client version.")
@DependsOn(
[
GeneralVersionSpoofPatch::class,
MusicSettingsPatch::class
]
)
@YouTubeMusicCompatibility
@Version("0.0.1")
class SpoofAppVersionPatch : BytecodePatch() {
override fun execute(context: BytecodeContext): PatchResult {
GeneralVersionSpoofPatch.injectSpoof("$MUSIC_SETTINGS_PATH->spoofVersion(Ljava/lang/String;)Ljava/lang/String;")
MusicSettingsPatch.addMusicPreference("navigation", "revanced_enable_spoof_version", "false")
return PatchResultSuccess()
}
}

View File

@ -12,12 +12,14 @@
<string name="revanced_enable_color_match_player_title">Enable color match Players</string>
<string name="revanced_enable_force_minimized_player_summary">Keep player permanently minimized even if another track is played.</string>
<string name="revanced_enable_force_minimized_player_title">Enable force minimized player</string>
<string name="revanced_enable_force_shuffle_summary">"Enable force shuffle even if another track is played.
(Not available in Canada)"</string>
<string name="revanced_enable_force_shuffle_summary">Enable force shuffle even if another track is played.</string>
<string name="revanced_enable_force_shuffle_title">Enable force shuffle</string>
<string name="revanced_enable_opus_codec_summary">"Enable 250/251 opus codec when playing audio.
(requires an app restart)"</string>
<string name="revanced_enable_opus_codec_title">Enable opus codec</string>
<string name="revanced_enable_spoof_version_summary">"Trick the YouTube Music version to v4.27.53 for Canadian users.
(requires an app restart)"</string>
<string name="revanced_enable_spoof_version_title">Enable version spoof</string>
<string name="revanced_enable_tablet_mode_summary">"Enable landscape mode on phone.
(requires an app restart)"</string>
<string name="revanced_enable_tablet_mode_title">Enable tablet mode</string>