From 34e4b4613eb389ee35ef26e5f514291ab6476188 Mon Sep 17 00:00:00 2001 From: hd <1839732296@qq.com> Date: Thu, 28 Mar 2024 01:22:30 +0800 Subject: [PATCH] 01:21 add log return --- .../me/hd/hookgg/data/SetPagePrefsData.kt | 2 + .../me/hd/hookgg/hook/base/BaseGGHooker.kt | 8 + .../hookgg/hook/hooker/agg333/AGG333Hooker.kt | 128 +++----- .../hook/hooker/elgg114/ELGG114Hooker.kt | 128 +++----- .../hookgg/hook/hooker/gg1011/GG1011Hooker.kt | 128 +++----- .../hookgg/hook/hooker/gg960/GG960Hooker.kt | 128 +++----- .../hookgg/hook/hooker/gg961/GG961Hooker.kt | 128 +++----- .../hook/hooker/rlgg2092/RLGG2092Hooker.kt | 104 +++---- .../hookgg/ui/fragment/nav/SetPageFragment.kt | 21 +- app/src/main/res/layout/fragment_set_page.xml | 277 ++++++++++++------ app/src/main/res/values/strings.xml | 6 +- 11 files changed, 508 insertions(+), 550 deletions(-) diff --git a/app/src/main/java/me/hd/hookgg/data/SetPagePrefsData.kt b/app/src/main/java/me/hd/hookgg/data/SetPagePrefsData.kt index af2d7e7..1ea53a3 100644 --- a/app/src/main/java/me/hd/hookgg/data/SetPagePrefsData.kt +++ b/app/src/main/java/me/hd/hookgg/data/SetPagePrefsData.kt @@ -6,4 +6,6 @@ object SetPagePrefsData { val PACKAGE_NAME = PrefsData("package_name", "") val VERSION_NAME = PrefsData("version_name", "") val FUNCTION_LIST = PrefsData("function_list", setOf()) + val LOG_RETURN = PrefsData("log_return", false) + val FILTER_PARAM = PrefsData("filter_Param", false) } \ No newline at end of file diff --git a/app/src/main/java/me/hd/hookgg/hook/base/BaseGGHooker.kt b/app/src/main/java/me/hd/hookgg/hook/base/BaseGGHooker.kt index 36b1324..d4cb608 100644 --- a/app/src/main/java/me/hd/hookgg/hook/base/BaseGGHooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/base/BaseGGHooker.kt @@ -1,10 +1,18 @@ package me.hd.hookgg.hook.base import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker +import com.highcapable.yukihookapi.hook.factory.dataChannel +import me.hd.hookgg.BuildConfig import me.hd.hookgg.data.GG import me.hd.hookgg.data.SetPagePrefsData abstract class BaseGGHooker : YukiBaseHooker() { + protected fun sendLog(func: String, result: Any?) { + val logReturn = prefs.get(SetPagePrefsData.LOG_RETURN) + val log = if (!logReturn) "$func\n" else "$func\n--[[$result]]\n" + appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put("log", log) + } + override fun onHook() { val setFuncList = prefs.get(SetPagePrefsData.FUNCTION_LIST) if (GG.toast in setFuncList) toast() diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/agg333/AGG333Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/agg333/AGG333Hooker.kt index dc8f34a..dbaa8e3 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/agg333/AGG333Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/agg333/AGG333Hooker.kt @@ -1,8 +1,6 @@ package me.hd.hookgg.hook.hooker.agg333 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.agg333.AGG333VarArgs.arg import me.hd.hookgg.hook.hooker.agg333.AGG333VarArgs.checkint @@ -22,14 +20,12 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val fast = varArgs.optboolean(2, false) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.toast($text, $fast)" - ) + val func = "gg.toast($text, $fast)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -41,16 +37,14 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -62,15 +56,13 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -82,15 +74,13 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -102,15 +92,13 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -122,11 +110,9 @@ object AGG333Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -138,13 +124,11 @@ object AGG333Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -156,13 +140,11 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -174,7 +156,7 @@ object AGG333Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -182,10 +164,9 @@ object AGG333Hooker : BaseGGHooker() { val sign = varArgs.optint(4, 0x20000000) val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -197,11 +178,9 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -213,7 +192,7 @@ object AGG333Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -224,10 +203,9 @@ object AGG333Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -239,14 +217,12 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -258,13 +234,11 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getValues($values)" - ) + val func = "gg.getValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -276,13 +250,11 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setValues($values)" - ) + val func = "gg.setValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -294,13 +266,11 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.addListItems($items)" - ) + val func = "gg.addListItems($items)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -312,15 +282,13 @@ object AGG333Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/elgg114/ELGG114Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/elgg114/ELGG114Hooker.kt index a0cc5bb..4e237ff 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/elgg114/ELGG114Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/elgg114/ELGG114Hooker.kt @@ -1,8 +1,6 @@ package me.hd.hookgg.hook.hooker.elgg114 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.elgg114.ELGG114VarArgs.arg import me.hd.hookgg.hook.hooker.elgg114.ELGG114VarArgs.checkint @@ -22,14 +20,12 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val fast = varArgs.optboolean(2, false) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.toast($text, $fast)" - ) + val func = "gg.toast($text, $fast)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -41,16 +37,14 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -62,15 +56,13 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -82,15 +74,13 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -102,15 +92,13 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -122,11 +110,9 @@ object ELGG114Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -138,13 +124,11 @@ object ELGG114Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -156,13 +140,11 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -174,7 +156,7 @@ object ELGG114Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -183,10 +165,9 @@ object ELGG114Hooker : BaseGGHooker() { val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) val limit = varArgs.optlong(7, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo, $limit)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -198,11 +179,9 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -214,7 +193,7 @@ object ELGG114Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -225,10 +204,9 @@ object ELGG114Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -240,14 +218,12 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -259,13 +235,11 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getValues($values)" - ) + val func = "gg.getValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -277,13 +251,11 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setValues($values)" - ) + val func = "gg.setValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -295,13 +267,11 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.addListItems($items)" - ) + val func = "gg.addListItems($items)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -313,15 +283,13 @@ object ELGG114Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/gg1011/GG1011Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/gg1011/GG1011Hooker.kt index 1b97af4..86e83b5 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/gg1011/GG1011Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/gg1011/GG1011Hooker.kt @@ -1,8 +1,6 @@ package me.hd.hookgg.hook.hooker.gg1011 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.gg1011.GG1011VarArgs.arg import me.hd.hookgg.hook.hooker.gg1011.GG1011VarArgs.checkint @@ -22,14 +20,12 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val fast = varArgs.optboolean(2, false) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.toast($text, $fast)" - ) + val func = "gg.toast($text, $fast)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -41,16 +37,14 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -62,15 +56,13 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -82,15 +74,13 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -102,15 +92,13 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -122,11 +110,9 @@ object GG1011Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -138,13 +124,11 @@ object GG1011Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -156,13 +140,11 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -174,7 +156,7 @@ object GG1011Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -183,10 +165,9 @@ object GG1011Hooker : BaseGGHooker() { val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) val limit = varArgs.optlong(7, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo, $limit)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -198,11 +179,9 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -214,7 +193,7 @@ object GG1011Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -225,10 +204,9 @@ object GG1011Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -240,14 +218,12 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -259,13 +235,11 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getValues($values)" - ) + val func = "gg.getValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -277,13 +251,11 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setValues($values)" - ) + val func = "gg.setValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -295,13 +267,11 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.addListItems($items)" - ) + val func = "gg.addListItems($items)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -313,15 +283,13 @@ object GG1011Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/gg960/GG960Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/gg960/GG960Hooker.kt index 0444147..713a9e8 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/gg960/GG960Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/gg960/GG960Hooker.kt @@ -1,8 +1,6 @@ package me.hd.hookgg.hook.hooker.gg960 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.gg960.GG960VarArgs.arg import me.hd.hookgg.hook.hooker.gg960.GG960VarArgs.checkint @@ -22,14 +20,12 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val fast = varArgs.optboolean(2, false) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.toast($text, $fast)" - ) + val func = "gg.toast($text, $fast)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -41,16 +37,14 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -62,15 +56,13 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -82,15 +74,13 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -102,15 +92,13 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -122,11 +110,9 @@ object GG960Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -138,13 +124,11 @@ object GG960Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -156,13 +140,11 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -174,7 +156,7 @@ object GG960Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -182,10 +164,9 @@ object GG960Hooker : BaseGGHooker() { val sign = varArgs.optint(4, 0x20000000) val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -197,11 +178,9 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -213,7 +192,7 @@ object GG960Hooker : BaseGGHooker() { name = "invokeUi" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -224,10 +203,9 @@ object GG960Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -239,14 +217,12 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -258,13 +234,11 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getValues($values)" - ) + val func = "gg.getValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -276,13 +250,11 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setValues($values)" - ) + val func = "gg.setValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -294,13 +266,11 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.addListItems($items)" - ) + val func = "gg.addListItems($items)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -312,15 +282,13 @@ object GG960Hooker : BaseGGHooker() { name = "invoke2" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/gg961/GG961Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/gg961/GG961Hooker.kt index 3d79447..ce2c2fc 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/gg961/GG961Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/gg961/GG961Hooker.kt @@ -1,8 +1,6 @@ package me.hd.hookgg.hook.hooker.gg961 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.gg961.GG961VarArgs.arg import me.hd.hookgg.hook.hooker.gg961.GG961VarArgs.checkint @@ -22,14 +20,12 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val fast = varArgs.optboolean(2, false) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.toast($text, $fast)" - ) + val func = "gg.toast($text, $fast)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -41,16 +37,14 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -62,15 +56,13 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -82,15 +74,13 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -102,15 +92,13 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -122,11 +110,9 @@ object GG961Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -138,13 +124,11 @@ object GG961Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -156,13 +140,11 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -174,7 +156,7 @@ object GG961Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -182,10 +164,9 @@ object GG961Hooker : BaseGGHooker() { val sign = varArgs.optint(4, 0x20000000) val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -197,11 +178,9 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -213,7 +192,7 @@ object GG961Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -224,10 +203,9 @@ object GG961Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -239,14 +217,12 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -258,13 +234,11 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getValues($values)" - ) + val func = "gg.getValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -276,13 +250,11 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val values = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setValues($values)" - ) + val func = "gg.setValues($values)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -294,13 +266,11 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.addListItems($items)" - ) + val func = "gg.addListItems($items)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -312,15 +282,13 @@ object GG961Hooker : BaseGGHooker() { name = "b" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/hook/hooker/rlgg2092/RLGG2092Hooker.kt b/app/src/main/java/me/hd/hookgg/hook/hooker/rlgg2092/RLGG2092Hooker.kt index 9d7e706..32b9a28 100644 --- a/app/src/main/java/me/hd/hookgg/hook/hooker/rlgg2092/RLGG2092Hooker.kt +++ b/app/src/main/java/me/hd/hookgg/hook/hooker/rlgg2092/RLGG2092Hooker.kt @@ -1,9 +1,7 @@ package me.hd.hookgg.hook.hooker.rlgg2092 -import com.highcapable.yukihookapi.hook.factory.dataChannel import com.highcapable.yukihookapi.hook.factory.method import com.highcapable.yukihookapi.hook.log.YLog -import me.hd.hookgg.BuildConfig import me.hd.hookgg.hook.base.BaseGGHooker import me.hd.hookgg.hook.hooker.rlgg2092.RLGG2092VarArgs.arg import me.hd.hookgg.hook.hooker.rlgg2092.RLGG2092VarArgs.checkint @@ -27,16 +25,14 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val positive = varArgs.optjstring(2, "ok") val negative = varArgs.optjstring(3, "nil") val neutral = varArgs.optjstring(4, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.alert($text, $positive, $negative, $neutral)" - ) + val func = "gg.alert($text, $positive, $negative, $neutral)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -48,15 +44,13 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selected = varArgs.arg(2) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.choice($items, $selected, $message)" - ) + val func = "gg.choice($items, $selected, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -68,15 +62,13 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val selection = varArgs.opttable(2, null) val message = varArgs.optjstring(3, "nil") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.multiChoice($items, $selection, $message)" - ) + val func = "gg.multiChoice($items, $selection, $message)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -88,15 +80,13 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val items = varArgs.checktable(1) val defaults = varArgs.opttable(2, null) val types = varArgs.opttable(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.prompt($items, $defaults, $types)" - ) + val func = "gg.prompt($items, $defaults, $types)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -108,11 +98,9 @@ object RLGG2092Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.clearResults()" - ) + after { + val func = "gg.clearResults()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -124,13 +112,11 @@ object RLGG2092Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val ranges = varArgs.checkint(1) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.setRanges($ranges)" - ) + val func = "gg.setRanges($ranges)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -142,13 +128,11 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val filter = varArgs.optjstring(1, "") - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getRangesList($filter)" - ) + val func = "gg.getRangesList($filter)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -160,7 +144,7 @@ object RLGG2092Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val text = varArgs.checkjstring(1) val type = varArgs.optint(2, 127) @@ -169,10 +153,9 @@ object RLGG2092Hooker : BaseGGHooker() { val memoryFrom = varArgs.optlong(5, 0L) val memoryTo = varArgs.optlong(6, -1L) val limit = varArgs.optlong(7, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.searchNumber($text, $type, $encrypted, $sign, $memoryFrom, $memoryTo, $limit)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -184,11 +167,9 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.getResultsCount()" - ) + after { + val func = "gg.getResultsCount()" + sendLog(func, result) } }.ignoredAllFailure() } @@ -200,7 +181,8 @@ object RLGG2092Hooker : BaseGGHooker() { name = "d" paramCount = 1 }.ignored().hook { - before { + after { + YLog.error("getResults") val varArgs = args(0).any() val maxCount = varArgs.checkint(1) val skip = varArgs.optint(2, 0) @@ -211,10 +193,9 @@ object RLGG2092Hooker : BaseGGHooker() { val type = varArgs.optint(7, 0) val fractional = varArgs.optjstring(8, "nil") val pointer = varArgs.optint(9, 0) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", + val func = "gg.getResults($maxCount, $skip, $addressMin, $addressMax, $valueMin, $valueMax, $type, $fractional, $pointer)" - ) + sendLog(func, result) } }.ignoredAllFailure() } @@ -226,14 +207,13 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { + YLog.error("editAll") val varArgs = args(0).any() val value = varArgs.checkjstring(1) val type = varArgs.checkint(2) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.editAll($value, $type)" - ) + val func = "gg.editAll($value, $type)" + sendLog(func, result) } }.ignoredAllFailure() } @@ -245,7 +225,7 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { YLog.error("getValues") // val varArgs = args(0).any() // val values = varArgs.checktable(1) @@ -264,7 +244,7 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { YLog.error("setValues") // val varArgs = args(0).any() // val values = varArgs.checktable(1) @@ -283,7 +263,7 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { YLog.error("addListItems") // val varArgs = args(0).any() // val items = varArgs.checktable(1) @@ -302,15 +282,13 @@ object RLGG2092Hooker : BaseGGHooker() { name = "̢" paramCount = 1 }.ignored().hook { - before { + after { val varArgs = args(0).any() val url = varArgs.checkjstring(1) val headers = varArgs.opttable(2, null) val data = varArgs.optstring(3, null) - appContext?.dataChannel(BuildConfig.APPLICATION_ID)?.put( - "log", - "gg.makeRequest($url, $headers, $data)" - ) + val func = "gg.makeRequest($url, $headers, $data)" + sendLog(func, result) } }.ignoredAllFailure() } diff --git a/app/src/main/java/me/hd/hookgg/ui/fragment/nav/SetPageFragment.kt b/app/src/main/java/me/hd/hookgg/ui/fragment/nav/SetPageFragment.kt index f5afd15..9b08bf1 100644 --- a/app/src/main/java/me/hd/hookgg/ui/fragment/nav/SetPageFragment.kt +++ b/app/src/main/java/me/hd/hookgg/ui/fragment/nav/SetPageFragment.kt @@ -33,7 +33,10 @@ class SetPageFragment : BaseFragment( val prefs = MyApp.context.prefs() binding.setTvDefPackageName.text = prefs.get(SetPagePrefsData.PACKAGE_NAME) binding.setTvDefVersionName.text = prefs.get(SetPagePrefsData.VERSION_NAME) - binding.setTvDefFunctionList.text = prefs.get(SetPagePrefsData.FUNCTION_LIST).toString() + binding.setTvDefFunctionList.text = getString(R.string.prefs_def_function_num) + .format(prefs.get(SetPagePrefsData.FUNCTION_LIST).size) + binding.setSwitchLogReturn.isChecked = prefs.get(SetPagePrefsData.LOG_RETURN) + binding.setSwitchFilterParam.isChecked = prefs.get(SetPagePrefsData.FILTER_PARAM) } private fun initPrefsOnClick(binding: FragmentSetPageBinding) { @@ -101,5 +104,21 @@ class SetPageFragment : BaseFragment( .setNegativeButton(R.string.dialog_decline) { _, _ -> } .show() } + binding.setSwitchLogReturn.setOnClickListener { + val oldLogReturn = prefs.get(SetPagePrefsData.LOG_RETURN) + val newLogReturn = !oldLogReturn + prefs.edit { + put(SetPagePrefsData.LOG_RETURN, newLogReturn) + } + binding.setSwitchLogReturn.isChecked = newLogReturn + } + binding.setSwitchFilterParam.setOnClickListener { + val oldFilterParam = prefs.get(SetPagePrefsData.FILTER_PARAM) + val newFilterParam = !oldFilterParam + prefs.edit { + put(SetPagePrefsData.FILTER_PARAM, newFilterParam) + } + binding.setSwitchFilterParam.isChecked = newFilterParam + } } } \ No newline at end of file diff --git a/app/src/main/res/layout/fragment_set_page.xml b/app/src/main/res/layout/fragment_set_page.xml index 0bd7c21..bd56674 100644 --- a/app/src/main/res/layout/fragment_set_page.xml +++ b/app/src/main/res/layout/fragment_set_page.xml @@ -26,125 +26,232 @@ + android:orientation="vertical"> - - + android:orientation="vertical" + android:padding="20dp"> - + + - + android:orientation="horizontal"> + + + + + + + + + + + android:id="@+id/setLLVersionName" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> - + android:layout_margin="20dp" + android:src="@drawable/ic_nav_set_24dp" + tools:ignore="ContentDescription" /> - + + + + + + + + + + + android:layout_margin="20dp" + android:src="@drawable/ic_nav_set_24dp" + tools:ignore="ContentDescription" /> + + + + + + + + + - - + android:orientation="vertical"> - - + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="vertical" + android:padding="20dp"> - - - - + android:orientation="horizontal"> + + + + + + + + + + + + + android:id="@+id/setLLFilterParam" + android:layout_width="match_parent" + android:layout_height="wrap_content" + android:orientation="horizontal"> - + android:layout_margin="20dp" + android:src="@drawable/ic_nav_set_24dp" + tools:ignore="ContentDescription" /> + + + + + + + + - + + \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 8101b98..2a74d22 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -14,5 +14,9 @@ VersionName 96.0 FunctionList - [] + EnableNum [0] + EnableNum [%1$s] + More + LogReturn + FilterParam \ No newline at end of file