mirror of
https://github.com/revanced/revanced-patches
synced 2024-11-10 21:09:29 +01:00
feat: bump music patches to 5.17.51 (#307)
This commit is contained in:
parent
a8524e6020
commit
c303589bd8
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
@ -5,10 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class CodecsUnlockCompatibility
|
||||
|
||||
|
@ -12,17 +12,14 @@ import org.jf.dexlib2.Opcode
|
||||
|
||||
@Name("codec-lock-fingerprint")
|
||||
@MatchingMethod(
|
||||
"Labwj;",
|
||||
"Lacfr;",
|
||||
"a",
|
||||
)
|
||||
@FuzzyPatternScanMethod(2) // FIXME: Test this threshold and find the best value.
|
||||
@CodecsUnlockCompatibility
|
||||
@Version("0.0.1")
|
||||
object CodecsLockFingerprint : MethodFingerprint(
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, listOf("L", "L", "L", "L"), listOf(
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT_OBJECT,
|
||||
Opcode.CHECK_CAST,
|
||||
"L", AccessFlags.PUBLIC or AccessFlags.STATIC, null, listOf(
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.INVOKE_VIRTUAL,
|
||||
Opcode.MOVE_RESULT,
|
||||
@ -37,5 +34,6 @@ object CodecsLockFingerprint : MethodFingerprint(
|
||||
Opcode.INVOKE_INTERFACE,
|
||||
Opcode.INVOKE_DIRECT,
|
||||
Opcode.RETURN_OBJECT
|
||||
)
|
||||
)
|
||||
),
|
||||
listOf("eac3_supported")
|
||||
)
|
||||
|
@ -13,6 +13,7 @@ import app.revanced.patcher.util.smali.toInstruction
|
||||
import app.revanced.patches.music.audio.codecs.annotations.CodecsUnlockCompatibility
|
||||
import app.revanced.patches.music.audio.codecs.fingerprints.AllCodecsReferenceFingerprint
|
||||
import app.revanced.patches.music.audio.codecs.fingerprints.CodecsLockFingerprint
|
||||
import org.jf.dexlib2.Opcode
|
||||
|
||||
@Patch
|
||||
@Name("codecs-unlock")
|
||||
@ -25,19 +26,29 @@ class CodecsUnlockPatch : BytecodePatch(
|
||||
)
|
||||
) {
|
||||
override fun execute(data: BytecodeData): PatchResult {
|
||||
var result = CodecsLockFingerprint.result!!
|
||||
val codecsLockResult = CodecsLockFingerprint.result!!
|
||||
|
||||
val implementation = result.mutableMethod.implementation!!
|
||||
val implementation = codecsLockResult.mutableMethod.implementation!!
|
||||
|
||||
val instructionIndex = result.patternScanResult!!.startIndex
|
||||
val scanResultStartIndex = codecsLockResult.patternScanResult!!.startIndex
|
||||
val instructionIndex = scanResultStartIndex +
|
||||
if (implementation.instructions[scanResultStartIndex - 1].opcode == Opcode.CHECK_CAST) {
|
||||
// for 5.16.xx and lower
|
||||
-3
|
||||
} else {
|
||||
// since 5.17.xx
|
||||
-2
|
||||
}
|
||||
|
||||
result = AllCodecsReferenceFingerprint.result!!
|
||||
val codecMethod =
|
||||
data.toMethodWalker(result.method).nextMethod(result.patternScanResult!!.startIndex).getMethod()
|
||||
val allCodecsResult = AllCodecsReferenceFingerprint.result!!
|
||||
val allCodecsMethod =
|
||||
data.toMethodWalker(allCodecsResult.method)
|
||||
.nextMethod(allCodecsResult.patternScanResult!!.startIndex)
|
||||
.getMethod()
|
||||
|
||||
implementation.replaceInstruction(
|
||||
instructionIndex,
|
||||
"invoke-static {}, ${codecMethod.definingClass}->${codecMethod.name}()Ljava/util/Set;".toInstruction()
|
||||
"invoke-static {}, ${allCodecsMethod.definingClass}->${allCodecsMethod.name}()Ljava/util/Set;".toInstruction()
|
||||
)
|
||||
|
||||
return PatchResultSuccess()
|
||||
|
@ -5,10 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class ExclusiveAudioCompatibility
|
||||
|
||||
|
@ -5,7 +5,7 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
|
@ -5,10 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class HideGetPremiumCompatibility
|
||||
|
||||
|
@ -3,6 +3,11 @@ package app.revanced.patches.music.layout.tastebuilder.annotations
|
||||
import app.revanced.patcher.annotation.Compatibility
|
||||
import app.revanced.patcher.annotation.Package
|
||||
|
||||
/**
|
||||
* -- Note 2022-08-05 --
|
||||
* Since 5.17.xx the tastebuilder component is dismissible, so this patch is less useful
|
||||
* also it is partly litho now
|
||||
*/
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
@ -11,4 +16,3 @@ import app.revanced.patcher.annotation.Package
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class RemoveTasteBuilderCompatibility
|
||||
|
||||
|
@ -5,10 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class RemoveUpgradeButtonCompatibility
|
||||
|
||||
|
@ -5,9 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class MusicMicroGPatchCompatibility
|
||||
internal annotation class MusicMicroGPatchCompatibility
|
||||
|
@ -5,10 +5,9 @@ import app.revanced.patcher.annotation.Package
|
||||
|
||||
@Compatibility(
|
||||
[Package(
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51")
|
||||
"com.google.android.apps.youtube.music", arrayOf("5.14.53", "5.16.51", "5.17.51")
|
||||
)]
|
||||
)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
internal annotation class BackgroundPlayCompatibility
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user