fix(YouTube Music): fix app crashes

This commit is contained in:
inotia00 2024-12-08 15:54:00 +09:00
parent e5bbc036f4
commit 222636a4e0
2 changed files with 4 additions and 7 deletions

View File

@ -21,11 +21,8 @@ internal val removePreferenceFingerprint = legacyFingerprint(
accessFlags = AccessFlags.PUBLIC or AccessFlags.FINAL,
parameters = listOf("Landroidx/preference/Preference;"),
opcodes = listOf(Opcode.INVOKE_VIRTUAL),
customFingerprint = custom@{ method, _ ->
if (method.definingClass != "Landroidx/preference/PreferenceGroup;") {
return@custom false
}
val instructions = method.implementation?.instructions ?: return@custom false
instructions.elementAt(0).opcode == Opcode.INVOKE_DIRECT
customFingerprint = { method, classDef ->
classDef.type == "Landroidx/preference/PreferenceGroup;" &&
method.implementation?.instructions?.elementAt(0)?.opcode == Opcode.INVOKE_DIRECT
}
)

View File

@ -14,7 +14,7 @@ val settingsMenuPatch = bytecodePatch(
) {
execute {
val findPreferenceMethodCall = findPreferenceFingerprint.methodCall()
val removePreferenceMethodCall = findPreferenceFingerprint.methodCall()
val removePreferenceMethodCall = removePreferenceFingerprint.methodCall()
findMethodOrThrow(EXTENSION_CLASS_DESCRIPTOR) {
name == "removePreference"