mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-03 16:14:28 +02:00
cleanup
This commit is contained in:
parent
4ee2f85b27
commit
4c0d11cf76
@ -44,7 +44,8 @@ class HideCastButtonPatch : BytecodePatch(
|
|||||||
* Hide cast button
|
* Hide cast button
|
||||||
*/
|
*/
|
||||||
MediaRouteButtonFingerprint.result?.let {
|
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 {
|
setVisibilityMethod?.apply {
|
||||||
addInstructions(
|
addInstructions(
|
||||||
|
@ -29,12 +29,14 @@ class OverrideQualityHookPatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
VideoQualityListFingerprint.result?.let {
|
VideoQualityListFingerprint.result?.let {
|
||||||
val constructorMethod = it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
|
val constructorMethod =
|
||||||
val overrideMethod = it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
|
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_CLASS = it.method.definingClass
|
||||||
QUALITY_METHOD = overrideMethod?.name
|
QUALITY_METHOD = overrideMethod?.name
|
||||||
?:throw PatchException("Failed to find hook method")
|
?: throw PatchException("Failed to find hook method")
|
||||||
|
|
||||||
constructorMethod.apply {
|
constructorMethod.apply {
|
||||||
addInstruction(
|
addInstruction(
|
||||||
|
@ -10,7 +10,6 @@ object SettingsHeadersFragmentFingerprint : MethodFingerprint(
|
|||||||
Opcode.IGET_OBJECT,
|
Opcode.IGET_OBJECT,
|
||||||
Opcode.INVOKE_VIRTUAL,
|
Opcode.INVOKE_VIRTUAL,
|
||||||
Opcode.MOVE_RESULT_OBJECT
|
Opcode.MOVE_RESULT_OBJECT
|
||||||
|
|
||||||
),
|
),
|
||||||
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("/SettingsHeadersFragment;") && methodDef.name == "onCreate" }
|
customFingerprint = { methodDef, _ -> methodDef.definingClass.endsWith("/SettingsHeadersFragment;") && methodDef.name == "onCreate" }
|
||||||
)
|
)
|
@ -50,7 +50,8 @@ class AppendTimeStampInformationPatch : BytecodePatch(
|
|||||||
) {
|
) {
|
||||||
setTextIndex = textViewIndex + 2
|
setTextIndex = textViewIndex + 2
|
||||||
val setTextRegister = getInstruction<Instruction35c>(setTextIndex).registerC
|
val setTextRegister = getInstruction<Instruction35c>(setTextIndex).registerC
|
||||||
val textViewRegister = getInstruction<Instruction35c>(textViewIndex).registerC
|
val textViewRegister =
|
||||||
|
getInstruction<Instruction35c>(textViewIndex).registerC
|
||||||
|
|
||||||
addInstructions(
|
addInstructions(
|
||||||
setTextIndex, """
|
setTextIndex, """
|
||||||
|
@ -33,12 +33,14 @@ class OverrideQualityHookPatch : BytecodePatch(
|
|||||||
override fun execute(context: BytecodeContext) {
|
override fun execute(context: BytecodeContext) {
|
||||||
|
|
||||||
VideoQualityListFingerprint.result?.let {
|
VideoQualityListFingerprint.result?.let {
|
||||||
val constructorMethod = it.mutableClass.methods.first { method -> MethodUtil.isConstructor(method) }
|
val constructorMethod =
|
||||||
val overrideMethod = it.mutableClass.methods.find { method -> method.parameterTypes.first() == "I" }
|
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_CLASS = it.method.definingClass
|
||||||
QUALITY_METHOD = overrideMethod?.name
|
QUALITY_METHOD = overrideMethod?.name
|
||||||
?:throw PatchException("Failed to find hook method")
|
?: throw PatchException("Failed to find hook method")
|
||||||
|
|
||||||
constructorMethod.apply {
|
constructorMethod.apply {
|
||||||
addInstruction(
|
addInstruction(
|
||||||
|
@ -64,7 +64,8 @@ class VideoQualityPatch : BytecodePatch(
|
|||||||
} ?: throw NewFlyoutPanelOnClickListenerFingerprint.exception
|
} ?: throw NewFlyoutPanelOnClickListenerFingerprint.exception
|
||||||
|
|
||||||
VideoQualitySetterFingerprint.result?.let {
|
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 {
|
onItemClickMethod?.apply {
|
||||||
val listItemIndexParameter = 3
|
val listItemIndexParameter = 3
|
||||||
|
Loading…
x
Reference in New Issue
Block a user