feat(YouTube Music): add support version 7.05.52

This commit is contained in:
inotia00 2024-06-13 00:33:41 +09:00
parent a4c50493f7
commit 58e93da4f8
3 changed files with 28 additions and 23 deletions

View File

@ -75,8 +75,18 @@ object BackgroundPlaybackPatch : BaseBytecodePatch(
}
// don't play podcast videos
PodCastConfigFingerprint.resultOrThrow().let {
it.mutableMethod.apply {
// enable by default from YouTube Music 7.05.52+
val podCastConfigFingerprintResult = PodCastConfigFingerprint.result
val dataSavingSettingsFragmentFingerprintResult =
DataSavingSettingsFragmentFingerprint.result
val isPatchingOldVersion =
podCastConfigFingerprintResult != null
&& dataSavingSettingsFragmentFingerprintResult != null
if (isPatchingOldVersion) {
podCastConfigFingerprintResult!!.mutableMethod.apply {
val insertIndex = implementation!!.instructions.size - 1
val targetRegister = getInstruction<OneRegisterInstruction>(insertIndex).registerA
@ -85,11 +95,8 @@ object BackgroundPlaybackPatch : BaseBytecodePatch(
"const/4 v$targetRegister, 0x1"
)
}
}
// don't play podcast videos
DataSavingSettingsFragmentFingerprint.resultOrThrow().let {
it.mutableMethod.apply {
dataSavingSettingsFragmentFingerprintResult!!.mutableMethod.apply {
val insertIndex = getStringInstructionIndex("pref_key_dont_play_nma_video") + 4
val targetRegister = getInstruction<FiveRegisterInstruction>(insertIndex).registerD

View File

@ -7,11 +7,12 @@ object Constants {
Patch.CompatiblePackage(
"com.google.android.apps.youtube.music",
setOf(
"6.29.58", // Latest version that supports the 'Restore old player layout' setting.
"6.33.52", // Latest version with the legacy code of YouTube Music.
"6.42.55", // Latest version that supports Android 7.0
"6.51.53", // Latest version of YouTube Music 6.xx.xx
"7.04.51", // Latest version supported by the RVX patch.
"6.29.58", // This is the latest version that supports the 'Restore old player layout' setting.
"6.33.52", // This is the latest version with the legacy code of YouTube Music.
"6.42.55", // This is the latest version that supports Android 7.0
"6.51.53", // This is the latest version of YouTube Music 6.xx.xx
"7.04.51", // This was the latest version that was supported by the previous patch.
"7.05.52", // This is the latest version supported by the RVX patch.
)
)
)

View File

@ -1,25 +1,22 @@
package app.revanced.patches.music.utils.integrations.fingerprints
import app.revanced.patches.music.utils.integrations.fingerprints.InitFingerprint.indexOfGetProcessNameInstruction
import app.revanced.patches.shared.integrations.BaseIntegrationsPatch.IntegrationsFingerprint
import app.revanced.util.getReference
import app.revanced.util.indexOfFirstInstruction
import com.android.tools.smali.dexlib2.Opcode
import com.android.tools.smali.dexlib2.iface.Method
import com.android.tools.smali.dexlib2.iface.reference.MethodReference
internal object InitFingerprint : IntegrationsFingerprint(
returnType = "V",
parameters = emptyList(),
strings = listOf("activity"),
customFingerprint = { methodDef, _ ->
methodDef.name == "onCreate"
&& indexOfGetProcessNameInstruction(methodDef) >= 0
}
) {
fun indexOfGetProcessNameInstruction(methodDef: Method) =
customFingerprint = handler@{ methodDef, _ ->
if (methodDef.name != "onCreate")
return@handler false
methodDef.indexOfFirstInstruction {
opcode == Opcode.INVOKE_STATIC
&& getReference<MethodReference>()?.name == "getProcessName"
}
}
opcode == Opcode.INVOKE_VIRTUAL
&& getReference<MethodReference>()?.name == "getRunningAppProcesses"
} >= 0
}
)