fix(YouTube/Default playback speed): change default value

This commit is contained in:
inotia00
2023-10-21 05:02:18 +09:00
parent a7043078b2
commit ccf5054b04
4 changed files with 26 additions and 12 deletions

View File

@ -40,18 +40,25 @@ internal object BytecodeHelper {
}
}
internal fun BytecodeContext.updatePatchStatus(patch: String) {
this.classes.forEach { classDef ->
classDef.methods.forEach { method ->
if (classDef.type.endsWith("/PatchStatus;") && method.name == patch) {
val patchStatusMethod =
this.proxy(classDef).mutableClass.methods.first { it.name == patch }
internal fun BytecodeContext.updatePatchStatus(
methodName: String,
isYouTube: Boolean
) {
val integrationPath =
if (isYouTube)
UTILS_PATH
else
MUSIC_UTILS_PATH
patchStatusMethod.replaceInstruction(
0,
"const/4 v0, 0x1"
)
}
this.classes.forEach { classDef ->
if (classDef.type.endsWith("$integrationPath/PatchStatus;")) {
val patchStatusMethod =
this.proxy(classDef).mutableClass.methods.first { it.name == methodName }
patchStatusMethod.replaceInstruction(
0,
"const/4 v0, 0x1"
)
}
}
}