Skip to content

Commit

Permalink
fix: RemoveAudioTransition use DexKit
Browse files Browse the repository at this point in the history
  • Loading branch information
HdShare committed Oct 20, 2024
1 parent 285e99c commit 087cf54
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
21 changes: 8 additions & 13 deletions app/src/main/java/io/github/leafmoes/RemoveAudioTransition.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,32 +22,27 @@

package io.github.leafmoes

import android.content.Context
import com.github.kyuubiran.ezxhelper.utils.findMethod
import com.github.kyuubiran.ezxhelper.utils.hookReplace
import io.github.qauxv.base.annotation.FunctionHookEntry
import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
import io.github.qauxv.hook.CommonSwitchFunctionHook
import io.github.qauxv.util.Initiator
import io.github.qauxv.util.dexkit.DexKit
import io.github.qauxv.util.dexkit.RemoveAudioTransitionMethod
import xyz.nextalone.util.throwOrTrue


@FunctionHookEntry
@UiItemAgentEntry
object RemoveAudioTransition : CommonSwitchFunctionHook("removeAudioTransition") {
object RemoveAudioTransition : CommonSwitchFunctionHook(
"removeAudioTransition",
targets = arrayOf(RemoveAudioTransitionMethod)
) {
override val name: String get() = "移除语音面板多余过渡动画"
override val description: String get() = "QQ语音面板左右滑动的时候因为这个动画导致UI重影\n故写此功能移除这个莫名其妙的动画"
override val uiItemLocation: Array<String> get() = FunctionEntryRouter.Locations.Simplify.CHAT_OTHER

override fun initOnce()= throwOrTrue {
Initiator.loadClass("com.tencent.mobileqq.activity.aio.audiopanel.AudioTransitionAnimManager")
.findMethod {
val paramsTypes = parameterTypes
parameterCount == 4
&& paramsTypes[0] == Int::class.javaPrimitiveType
&& paramsTypes[1] == String::class.java
&& paramsTypes[2] == Context::class.java
}.hookReplace { }
override fun initOnce() = throwOrTrue {
DexKit.requireMethodFromCache(RemoveAudioTransitionMethod).hookReplace { }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ data object Multiforward_Avatar_setListener_NT : DexKitTarget.UsingDexkit() {
}

data object AIOTextElementCtor : DexKitTarget.UsingStr() {
override val findMethod: Boolean = true;
override val findMethod: Boolean = true
override val declaringClass = "com.tencent.mobileqq.aio.msg.AIOMsgElement.AIOTextElementCtor"
override val traitString = arrayOf("textElement")
override val filter = DexKitFilter.strInClsName("com/tencent/mobileqq/aio/msg")
Expand Down Expand Up @@ -1023,3 +1023,10 @@ data object OriginalPhotoNT_onInitView : DexKitTarget.UsingDexkit() {
override val declaringClass = ""
override val filter: dexkitFilter = DexKitFilter.allowAll
}

data object RemoveAudioTransitionMethod : DexKitTarget.UsingStr() {
override val findMethod = true
override val traitString = arrayOf("getDrawable onCompositionLoaded lottieComposition is null or mIsDestroyed")
override val declaringClass = "Lcom/tencent/mobileqq/activity/aio/audiopanel/AudioTransitionAnimManager;"
override val filter = DexKitFilter.allowAll
}

0 comments on commit 087cf54

Please sign in to comment.