This commit is contained in:
inotia00 2023-09-25 11:22:38 +09:00
parent 4ee2f85b27
commit 4c0d11cf76
6 changed files with 16 additions and 10 deletions

View File

@ -44,7 +44,8 @@ class HideCastButtonPatch : BytecodePatch(
* Hide cast button
*/
MediaRouteButtonFingerprint.result?.let {
val setVisibilityMethod = it.mutableClass.methods.find { method -> method.name == "setVisibility" }
val setVisibilityMethod =
it.mutableClass.methods.find { method -> method.name == "setVisibility" }
setVisibilityMethod?.apply {
addInstructions(

View File

@ -29,12 +29,14 @@ class OverrideQualityHookPatch : BytecodePatch(
override fun execute(context: BytecodeContext) {
VideoQualityListFingerprint.result?.let {
val constructorMethod = it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
val overrideMethod = it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
val constructorMethod =
it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
val overrideMethod =
it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
QUALITY_CLASS = it.method.definingClass
QUALITY_METHOD = overrideMethod?.name
?:throw PatchException("Failed to find hook method")
?: throw PatchException("Failed to find hook method")
constructorMethod.apply {
addInstruction(

View File

@ -10,7 +10,6 @@ object SettingsHeadersFragmentFingerprint : MethodFingerprint(
Opcode.IGET_OBJECT,
Opcode.INVOKE_VIRTUAL,
Opcode.MOVE_RESULT_OBJECT
),
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("/SettingsHeadersFragment;") && methodDef.name == "onCreate" }
)

View File

@ -50,7 +50,8 @@ class AppendTimeStampInformationPatch : BytecodePatch(
) {
setTextIndex = textViewIndex + 2
val setTextRegister = getInstruction<Instruction35c>(setTextIndex).registerC
val textViewRegister = getInstruction<Instruction35c>(textViewIndex).registerC
val textViewRegister =
getInstruction<Instruction35c>(textViewIndex).registerC
addInstructions(
setTextIndex, """

View File

@ -33,12 +33,14 @@ class OverrideQualityHookPatch : BytecodePatch(
override fun execute(context: BytecodeContext) {
VideoQualityListFingerprint.result?.let {
val constructorMethod = it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
val overrideMethod = it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
val constructorMethod =
it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
val overrideMethod =
it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
QUALITY_CLASS = it.method.definingClass
QUALITY_METHOD = overrideMethod?.name
?:throw PatchException("Failed to find hook method")
?: throw PatchException("Failed to find hook method")
constructorMethod.apply {
addInstruction(

View File

@ -64,7 +64,8 @@ class VideoQualityPatch : BytecodePatch(
} ?: throw NewFlyoutPanelOnClickListenerFingerprint.exception
VideoQualitySetterFingerprint.result?.let {
val onItemClickMethod = it.mutableClass.methods.find { method -> method.name == "onItemClick" }
val onItemClickMethod =
it.mutableClass.methods.find { method -> method.name == "onItemClick" }
onItemClickMethod?.apply {
val listItemIndexParameter = 3