mirror of
https://github.com/fankes/TSBattery.git
synced 2025-09-04 17:55:30 +08:00
Modify merge to YukiHookAPI new usage
This commit is contained in:
@@ -334,7 +334,7 @@ object QQTIMHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "a"
|
name = "a"
|
||||||
param(StringType, LongType)
|
param(StringClass, LongType)
|
||||||
returnType = UnitType
|
returnType = UnitType
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
@@ -401,7 +401,7 @@ object QQTIMHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "onHook"
|
name = "onHook"
|
||||||
param(StringType, AnyType, AnyArrayClass, AnyType)
|
param(StringClass, AnyClass, AnyArrayClass, AnyClass)
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
}
|
}
|
||||||
@@ -504,14 +504,14 @@ object QQTIMHooker : YukiBaseHooker() {
|
|||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "onWriteLog"
|
name = "onWriteLog"
|
||||||
param(StringType, StringType)
|
param(StringClass, StringClass)
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
}
|
}
|
||||||
injectMember {
|
injectMember {
|
||||||
method {
|
method {
|
||||||
name = "onCmdRequest"
|
name = "onCmdRequest"
|
||||||
param(StringType)
|
param(StringClass)
|
||||||
}
|
}
|
||||||
intercept()
|
intercept()
|
||||||
}
|
}
|
||||||
@@ -540,21 +540,17 @@ object QQTIMHooker : YukiBaseHooker() {
|
|||||||
private fun hookQQSettingsUI(instance: Any?, instanceClass: Class<*>) {
|
private fun hookQQSettingsUI(instance: Any?, instanceClass: Class<*>) {
|
||||||
/** 当前的顶级 Item 实例 */
|
/** 当前的顶级 Item 实例 */
|
||||||
val formItemRefRoot = instanceClass.field {
|
val formItemRefRoot = instanceClass.field {
|
||||||
// TODO: 这里的 "type" 在之后换成新用法
|
type { it.name == FormSimpleItemClass || it.name == FormCommonSingleLineItemClass }.index(num = 1)
|
||||||
type(FormSimpleItemClass).index(num = 1)
|
}.get(instance).cast<View?>()
|
||||||
}.ignored().get(instance).cast() ?: instanceClass.field {
|
|
||||||
// TODO: 这里的 "type" 在之后换成新用法
|
|
||||||
type(FormCommonSingleLineItemClass).index(num = 1)
|
|
||||||
}.ignored().get(instance).cast<View?>()
|
|
||||||
/** 创建一个新的 Item */
|
/** 创建一个新的 Item */
|
||||||
FormSimpleItemClass.toClassOrNull()?.buildOf<View>(instance?.compatToActivity()) { param(ContextClass) }?.current {
|
FormSimpleItemClass.toClassOrNull()?.buildOf<View>(instance?.compatToActivity()) { param(ContextClass) }?.current {
|
||||||
method {
|
method {
|
||||||
name = "setLeftText"
|
name = "setLeftText"
|
||||||
param(CharSequenceType)
|
param(CharSequenceClass)
|
||||||
}.call("TSBattery")
|
}.call("TSBattery")
|
||||||
method {
|
method {
|
||||||
name = "setRightText"
|
name = "setRightText"
|
||||||
param(CharSequenceType)
|
param(CharSequenceClass)
|
||||||
}.call("${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})")
|
}.call("${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})")
|
||||||
method {
|
method {
|
||||||
name = "setBgType"
|
name = "setBgType"
|
||||||
|
@@ -167,12 +167,8 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
|
|
||||||
/** 刷新模块激活使用的方式 */
|
/** 刷新模块激活使用的方式 */
|
||||||
private fun refreshActivateExecutor() {
|
private fun refreshActivateExecutor() {
|
||||||
when {
|
if (YukiHookAPI.Status.Executor.apiLevel > 0)
|
||||||
YukiHookAPI.Status.executorVersion > 0 ->
|
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.Executor.name} API ${YukiHookAPI.Status.Executor.apiLevel}"
|
||||||
binding.mainTextApiWay.text =
|
else binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.Executor.name}"
|
||||||
"Activated by ${YukiHookAPI.Status.executorName} API ${YukiHookAPI.Status.executorVersion}"
|
|
||||||
YukiHookAPI.Status.isTaiChiModuleActive -> binding.mainTextApiWay.text = "Activated by TaiChi"
|
|
||||||
else -> binding.mainTextApiWay.text = "Activated by anonymous"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user