Skip to content

Commit

Permalink
fix: RemoveDiyCard
Browse files Browse the repository at this point in the history
  • Loading branch information
klxiaoniu committed Jul 25, 2023
1 parent f6f9045 commit 9d90091
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions app/src/main/java/cc/ioctl/hook/ui/profile/RemoveDiyCard.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ import android.content.Intent
import cc.ioctl.util.HookUtils
import cc.ioctl.util.HostInfo
import cc.ioctl.util.Reflex
import com.github.kyuubiran.ezxhelper.utils.field
import com.github.kyuubiran.ezxhelper.utils.hookAfter
import io.github.qauxv.base.annotation.FunctionHookEntry
import io.github.qauxv.base.annotation.UiItemAgentEntry
import io.github.qauxv.dsl.FunctionEntryRouter
Expand All @@ -39,6 +41,7 @@ import io.github.qauxv.util.isTim
import io.github.qauxv.util.requireMinQQVersion
import xyz.nextalone.util.get
import xyz.nextalone.util.hookBefore
import xyz.nextalone.util.method
import xyz.nextalone.util.set
import xyz.nextalone.util.throwOrTrue
import java.lang.reflect.Method
Expand All @@ -63,6 +66,7 @@ object RemoveDiyCard : CommonSwitchFunctionHook(
val card = it.args[0]
copeCard(card)
}

else -> {
if (requireMinQQVersion(QQVersion.QQ_8_6_0)) {
val card = it.args[1].get("card")
Expand Down Expand Up @@ -123,6 +127,16 @@ object RemoveDiyCard : CommonSwitchFunctionHook(
}
}
}

// 上面是旧的代码,不报错就不去动他
try {
"Lcom/tencent/mobileqq/profilecard/processor/TempProfileBusinessProcessor;->updateCardTemplate(Lcom/tencent/mobileqq/data/Card;Ljava/lang/String;LSummaryCardTaf/SSummaryCardRsp;)V".method.hookAfter { param ->
val card = param.args[0]
card.field("lCurrentStyleId", false, Long::class.java).set(card, 0L)
}
} catch (e: Exception) {
Log.e(e)
}
}

private fun copeCard(card: Any) {
Expand Down

0 comments on commit 9d90091

Please sign in to comment.