diff --git a/core/src/main/java/io/github/fplus/core/base/BaseHook.kt b/core/src/main/java/io/github/fplus/core/base/BaseHook.kt index ca8927a..1a01497 100644 --- a/core/src/main/java/io/github/fplus/core/base/BaseHook.kt +++ b/core/src/main/java/io/github/fplus/core/base/BaseHook.kt @@ -47,7 +47,7 @@ import kotlinx.coroutines.isActive import kotlinx.coroutines.launch import kotlin.coroutines.CoroutineContext -abstract class BaseHook : HookEntity() { +abstract class BaseHook : HookEntity() { protected val handler: Handler = Handler(Looper.getMainLooper()) private val mainScope: CoroutineScope = CoroutineScope(Dispatchers.Main) private var singleMainJob: MutableMap = mutableMapOf() diff --git a/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt b/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt index 7bebcf0..fe43011 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt @@ -24,7 +24,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import kotlinx.coroutines.delay -class HAbstractFeedAdapter : BaseHook() { +class HAbstractFeedAdapter : BaseHook() { companion object { const val TAG = "HAbstractFeedAdapter" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HActivity.kt index aa51580..2f9f7c6 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HActivity.kt @@ -18,13 +18,17 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisActivity -class HActivity : BaseHook() { +class HActivity : BaseHook() { companion object { const val TAG = "HActivity" } private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return Activity::class.java + } + @OnBefore("dispatchTouchEvent") fun dispatchTouchEventBefore(params: XC_MethodHook.MethodHookParam, event: MotionEvent) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HBottomCtrlBar.kt b/core/src/main/java/io/github/fplus/core/hook/HBottomCtrlBar.kt index 9dd3f07..8834934 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HBottomCtrlBar.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HBottomCtrlBar.kt @@ -13,7 +13,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup -class HBottomCtrlBar : BaseHook() { +class HBottomCtrlBar : BaseHook() { companion object { const val TAG = "HBottomCtrlBar" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HChatListRecalledHint.kt b/core/src/main/java/io/github/fplus/core/hook/HChatListRecalledHint.kt index edabfc1..8eb9a9c 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HChatListRecalledHint.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HChatListRecalledHint.kt @@ -16,7 +16,7 @@ import io.github.xpler.core.entity.Param import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HChatListRecalledHint : BaseHook() { +class HChatListRecalledHint : BaseHook() { companion object { const val TAG = "HChatListRecalledHint" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HChatListRecyclerViewAdapter.kt b/core/src/main/java/io/github/fplus/core/hook/HChatListRecyclerViewAdapter.kt index ddabce3..184ed35 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HChatListRecyclerViewAdapter.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HChatListRecyclerViewAdapter.kt @@ -24,7 +24,7 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HChatListRecyclerViewAdapter : BaseHook() { +class HChatListRecyclerViewAdapter : BaseHook() { companion object { const val TAG = "HChatListRecyclerViewAdapter" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HCommentAudioView.kt b/core/src/main/java/io/github/fplus/core/hook/HCommentAudioView.kt index 3116ae6..7147177 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HCommentAudioView.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HCommentAudioView.kt @@ -25,7 +25,7 @@ import io.github.xpler.core.thisView import io.github.xpler.core.wrapper.CallMethods @Deprecated("暂存区, 评论区语音保存") -class HCommentAudioView : BaseHook(), CallMethods { +class HCommentAudioView : BaseHook(), CallMethods { companion object { const val TAG = "HCommentAudioView" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HCommentListPageFragment.kt b/core/src/main/java/io/github/fplus/core/hook/HCommentListPageFragment.kt index f0e9db0..22fbb79 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HCommentListPageFragment.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HCommentListPageFragment.kt @@ -18,7 +18,7 @@ import io.github.xpler.core.entity.ReturnType import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HCommentListPageFragment : BaseHook() { +class HCommentListPageFragment : BaseHook() { companion object { const val TAG = "HCommentListPageFragment" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HConversationFragment.kt b/core/src/main/java/io/github/fplus/core/hook/HConversationFragment.kt index 21987c5..1571f01 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HConversationFragment.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HConversationFragment.kt @@ -15,7 +15,7 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HConversationFragment : BaseHook() { +class HConversationFragment : BaseHook() { companion object { const val TAG = "HConversationFragment" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HCornerExtensionsPopupWindow.kt b/core/src/main/java/io/github/fplus/core/hook/HCornerExtensionsPopupWindow.kt index 0a03301..9c6e4ac 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HCornerExtensionsPopupWindow.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HCornerExtensionsPopupWindow.kt @@ -24,7 +24,7 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HCornerExtensionsPopupWindow : BaseHook() { +class HCornerExtensionsPopupWindow : BaseHook() { companion object { const val TAG = "HCornerExtensionsPopupWindow" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt b/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt index 3901a86..37aaa41 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt @@ -15,13 +15,17 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.wrapper.CallMethods /// 崩溃容错,处理官方可能造成的系列崩溃问题 -class HCrashTolerance : BaseHook() { +class HCrashTolerance : BaseHook() { companion object { const val TAG = "HCrashTolerance" } val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return EmptyHook::class.java + } + override fun onInit() { if (!config.isCrashTolerance) return @@ -31,7 +35,7 @@ class HCrashTolerance : BaseHook() { HTabLanding() } - inner class HPoiFeed : BaseHook(), CallMethods { + inner class HPoiFeed : BaseHook(), CallMethods { override fun setTargetClass(): Class<*> { return findClass("com.ss.android.ugc.aweme.poi.anchor.poi.flavor.PoiFeedAnchor") } @@ -50,7 +54,7 @@ class HCrashTolerance : BaseHook() { } } - inner class HLivePhoto : BaseHook() { + inner class HLivePhoto : BaseHook() { override fun setTargetClass(): Class<*> { return DexkitBuilder.livePhotoClazz ?: NoneHook::class.java @@ -67,7 +71,7 @@ class HCrashTolerance : BaseHook() { } } - inner class HTabLanding : BaseHook() { + inner class HTabLanding : BaseHook() { override fun setTargetClass(): Class<*> { return DexkitBuilder.tabLandingClazz ?: NoneHook::class.java diff --git a/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt index 52f21b4..09f2b27 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt @@ -16,7 +16,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisActivity -class HDetailActivity : BaseHook() { +class HDetailActivity : BaseHook() { companion object { const val TAG = "HDetailActivity" } @@ -25,6 +25,10 @@ class HDetailActivity : BaseHook() { private val clipboardLogic = ClipboardLogic(this) + override fun setTargetClass(): Class<*> { + return DetailActivity::class.java + } + @OnAfter("onResume") fun onResumeAfter(params: XC_MethodHook.MethodHookParam) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HDetailPageFragment.kt b/core/src/main/java/io/github/fplus/core/hook/HDetailPageFragment.kt index 8332ebd..10512f8 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HDetailPageFragment.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HDetailPageFragment.kt @@ -26,7 +26,7 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HDetailPageFragment : BaseHook() { +class HDetailPageFragment : BaseHook() { companion object { const val TAG = "HDetailPageFragment" @@ -37,7 +37,9 @@ class HDetailPageFragment : BaseHook() { private val config get() = ConfigV1.get() - override fun setTargetClass(): Class<*> = DexkitBuilder.detailPageFragmentClazz ?: NoneHook::class.java + override fun setTargetClass(): Class<*> { + return DexkitBuilder.detailPageFragmentClazz ?: NoneHook::class.java + } @OnAfter("onViewCreated") fun onViewCreatedAfter(param: XC_MethodHook.MethodHookParam, view: View, bundle: Bundle?) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HDialog.kt b/core/src/main/java/io/github/fplus/core/hook/HDialog.kt index 035ae49..702393d 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HDialog.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HDialog.kt @@ -13,7 +13,7 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HDialog : BaseHook() { +class HDialog : BaseHook() { companion object { const val TAG = "HDialog" } @@ -30,6 +30,10 @@ class HDialog : BaseHook() { .toRegex() } + override fun setTargetClass(): Class<*> { + return Dialog::class.java + } + @OnAfter("show") fun showAfter(params: XC_MethodHook.MethodHookParam) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HDisallowInterceptRelativeLayout.kt b/core/src/main/java/io/github/fplus/core/hook/HDisallowInterceptRelativeLayout.kt index 56593a6..c1bb42d 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HDisallowInterceptRelativeLayout.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HDisallowInterceptRelativeLayout.kt @@ -13,7 +13,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup import io.github.xpler.core.wrapper.CallConstructors -class HDisallowInterceptRelativeLayout : BaseHook(), +class HDisallowInterceptRelativeLayout : BaseHook(), CallConstructors { companion object { const val TAG = "HDisallowInterceptRelativeLayout" diff --git a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialog.kt b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialog.kt index 907f4a6..4bec88f 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialog.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialog.kt @@ -19,7 +19,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.wrapper.CallMethods import kotlinx.coroutines.delay -class HEmojiDetailDialog : BaseHook(), CallMethods { +class HEmojiDetailDialog : BaseHook(), CallMethods { companion object { const val TAG = "HEmojiDetailDialog" } @@ -28,12 +28,16 @@ class HEmojiDetailDialog : BaseHook(), CallMethods { private var urlList: List = emptyList() + override fun setTargetClass(): Class<*> { + return EmojiDetailDialog::class.java + } + override fun onInit() { lpparam.hookClass(EmojiBottomSheetDialog::class.java) .method("onCreate", Bundle::class.java) { onAfter { if (!config.isEmojiDownload) return@onAfter - if (!targetClazz.isInstance(thisObject)) return@onAfter // 非 EmojiDetailDialog, 直接结束 + if (!targetClass.isInstance(thisObject)) return@onAfter // 非 EmojiDetailDialog, 直接结束 singleLaunchMain { delay(500L) diff --git a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt index 534fa6f..82c9cf0 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt @@ -16,7 +16,7 @@ import io.github.fplus.core.hook.logic.SaveEmojiLogic import io.github.xpler.core.argsOrEmpty import io.github.xpler.core.hookClass -class HEmojiDetailDialogNew : BaseHook() { +class HEmojiDetailDialogNew : BaseHook() { companion object { const val TAG = "HEmojiDetailDialogNew" } @@ -25,6 +25,10 @@ class HEmojiDetailDialogNew : BaseHook() { private var urlList: List = emptyList() + override fun setTargetClass(): Class<*> { + return EmojiDetailDialogNew::class.java + } + override fun onInit() { lpparam.hookClass(EmojiDetailDialogNew::class.java) @@ -44,7 +48,7 @@ class HEmojiDetailDialogNew : BaseHook() { if (!config.isEmojiDownload) return@onAfter // 非 EmojiDetailDialogNew, 直接结束 - if (!targetClazz.isInstance(thisObject)) { + if (!targetClass.isInstance(thisObject)) { return@onAfter } diff --git a/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt b/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt index c16cf9a..b732c40 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt @@ -14,7 +14,7 @@ import io.github.xpler.core.entity.ReturnType import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HEmojiPopupWindow : BaseHook() { +class HEmojiPopupWindow : BaseHook() { companion object { const val TAG = "HEmojiPopupWindow" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HFeedAvatarPresenter.kt b/core/src/main/java/io/github/fplus/core/hook/HFeedAvatarPresenter.kt index 1cca87a..1fe2408 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HFeedAvatarPresenter.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HFeedAvatarPresenter.kt @@ -16,7 +16,7 @@ import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HFeedAvatarPresenter : BaseHook() { +class HFeedAvatarPresenter : BaseHook() { companion object { const val TAG = "HFeedAvatarPresenter" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HFlippableViewPager.kt b/core/src/main/java/io/github/fplus/core/hook/HFlippableViewPager.kt index e5b64d7..24f8718 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HFlippableViewPager.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HFlippableViewPager.kt @@ -9,13 +9,17 @@ import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HFlippableViewPager : BaseHook() { +class HFlippableViewPager : BaseHook() { companion object { const val TAG = "HFlippableViewPager" } private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return FlippableViewPager::class.java + } + @OnBefore("onInterceptTouchEvent", "onTouchEvent", "dispatchTouchEvent") fun onTouchEventBefore(params: XC_MethodHook.MethodHookParam, event: MotionEvent) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HGifEmojiDetailActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HGifEmojiDetailActivity.kt index 001aa2b..a87e843 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HGifEmojiDetailActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HGifEmojiDetailActivity.kt @@ -20,7 +20,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisActivity import kotlinx.coroutines.delay -class HGifEmojiDetailActivity : BaseHook() { +class HGifEmojiDetailActivity : BaseHook() { companion object { const val TAG = "HGifEmojiDetailActivity" } @@ -29,6 +29,10 @@ class HGifEmojiDetailActivity : BaseHook() { private var urlList: List = emptyList() + override fun setTargetClass(): Class<*> { + return GifEmojiDetailActivity::class.java + } + @OnBefore("onCreate") fun onCreate(params: XC_MethodHook.MethodHookParam, bundle: Bundle?) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HHomeBottomTabServiceImpl.kt b/core/src/main/java/io/github/fplus/core/hook/HHomeBottomTabServiceImpl.kt index 94084c0..c45f53b 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HHomeBottomTabServiceImpl.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HHomeBottomTabServiceImpl.kt @@ -10,7 +10,7 @@ import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HHomeBottomTabServiceImpl : BaseHook() { +class HHomeBottomTabServiceImpl : BaseHook() { companion object { const val TAG = "HHomeBottomTabServiceImpl" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HInteractStickerParent.kt b/core/src/main/java/io/github/fplus/core/hook/HInteractStickerParent.kt index 91ebed5..ee417f3 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HInteractStickerParent.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HInteractStickerParent.kt @@ -11,13 +11,17 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup import io.github.xpler.core.wrapper.CallConstructors -class HInteractStickerParent : BaseHook(), CallConstructors { +class HInteractStickerParent : BaseHook(), CallConstructors { companion object { const val TAG = "HInteractStickerParent" } private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return InteractStickerParent::class.java + } + override fun callOnBeforeConstructors(params: XC_MethodHook.MethodHookParam) { } diff --git a/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt index 76544e0..de71092 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt @@ -16,7 +16,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisActivity -class HLandscapeFeedActivity : BaseHook() { +class HLandscapeFeedActivity : BaseHook() { companion object { const val TAG = "HLandscapeFeedActivity" } @@ -25,6 +25,10 @@ class HLandscapeFeedActivity : BaseHook() { private val clipboardLogic = ClipboardLogic(this) + override fun setTargetClass(): Class<*> { + return LandscapeFeedActivity::class.java + } + @OnAfter("onResume") fun onResumeAfter(params: XC_MethodHook.MethodHookParam) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HLivePlayActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HLivePlayActivity.kt index 7f0c3d2..d389675 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HLivePlayActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HLivePlayActivity.kt @@ -11,7 +11,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisActivity -class HLivePlayActivity : BaseHook() { +class HLivePlayActivity : BaseHook() { companion object { const val TAG = "HLivePlayActivity" @@ -19,6 +19,10 @@ class HLivePlayActivity : BaseHook() { private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return LivePlayActivity::class.java + } + @OnBefore("onWindowFocusChanged") @OnAfter("onWindowFocusChanged") fun onWindowFocusChangedAfter(params: XC_MethodHook.MethodHookParam, boolean: Boolean) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HLongPressLayout.kt b/core/src/main/java/io/github/fplus/core/hook/HLongPressLayout.kt index fc246de..6d10cc0 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HLongPressLayout.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HLongPressLayout.kt @@ -34,7 +34,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisView -class HLongPressLayout : BaseHook() { +class HLongPressLayout : BaseHook() { companion object { const val TAG = "HLongPressLayout" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt index ef5c3f0..628db5e 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt @@ -41,7 +41,7 @@ import io.github.xpler.core.thisActivity import io.github.xpler.core.thisContext import kotlinx.coroutines.delay -class HMainActivity : BaseHook() { +class HMainActivity : BaseHook() { companion object { const val TAG = "HMainActivity" @@ -64,6 +64,10 @@ class HMainActivity : BaseHook() { private val clipboardLogic = ClipboardLogic(this) private var disallowInterceptRelativeLayout: View? = null + override fun setTargetClass(): Class<*> { + return MainActivity::class.java + } + @OnBefore("onCreate") fun onCreateBefore(params: XC_MethodHook.MethodHookParam, savedInstanceState: Bundle?) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HMainBottomPhotoTab.kt b/core/src/main/java/io/github/fplus/core/hook/HMainBottomPhotoTab.kt index 2086a45..a6c2a5b 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMainBottomPhotoTab.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMainBottomPhotoTab.kt @@ -16,7 +16,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisView -class HMainBottomPhotoTab : BaseHook() { +class HMainBottomPhotoTab : BaseHook() { companion object { const val TAG = "HMainBottomPhotoTab" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HMainBottomTabView.kt b/core/src/main/java/io/github/fplus/core/hook/HMainBottomTabView.kt index 73defce..05fb452 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMainBottomTabView.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMainBottomTabView.kt @@ -14,7 +14,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup -class HMainBottomTabView : BaseHook() { +class HMainBottomTabView : BaseHook() { companion object { const val TAG = "HMainBottomTabView" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HMainTabStripScrollView.kt b/core/src/main/java/io/github/fplus/core/hook/HMainTabStripScrollView.kt index 2fc1439..884df60 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMainTabStripScrollView.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMainTabStripScrollView.kt @@ -11,7 +11,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup import io.github.xpler.core.wrapper.CallMethods -class HMainTabStripScrollView : BaseHook(), +class HMainTabStripScrollView : BaseHook(), CallMethods { companion object { @@ -20,6 +20,10 @@ class HMainTabStripScrollView : BaseHook(), private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return MainTabStripScrollView::class.java + } + override fun callOnBeforeMethods(params: XC_MethodHook.MethodHookParam) {} override fun callOnAfterMethods(params: XC_MethodHook.MethodHookParam) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HMessage.kt b/core/src/main/java/io/github/fplus/core/hook/HMessage.kt index e745cf1..7b18817 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMessage.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMessage.kt @@ -10,13 +10,17 @@ import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HMessage : BaseHook() { +class HMessage : BaseHook() { companion object { const val TAG = "HMessage" } private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return Message::class.java + } + @OnAfter("isRecalled") fun isRecalledAfter(params: XC_MethodHook.MethodHookParam) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HPenetrateTouchRelativeLayout.kt b/core/src/main/java/io/github/fplus/core/hook/HPenetrateTouchRelativeLayout.kt index ba70448..afbacaa 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HPenetrateTouchRelativeLayout.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HPenetrateTouchRelativeLayout.kt @@ -13,13 +13,17 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup import io.github.xpler.core.wrapper.CallMethods -class HPenetrateTouchRelativeLayout : BaseHook(), CallMethods { +class HPenetrateTouchRelativeLayout : BaseHook(), CallMethods { companion object { const val TAG = "HPenetrateTouchRelativeLayout" } private val config get() = ConfigV1.get() + override fun setTargetClass(): Class<*> { + return PenetrateTouchRelativeLayout::class.java + } + @OnBefore("setVisibility") fun setVisibilityBefore(params: XC_MethodHook.MethodHookParam, visibility: Int) { hookBlockRunning(params) { diff --git a/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt b/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt index a4a9a12..6cf9c35 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt @@ -14,7 +14,7 @@ import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog -class HPlayerController : BaseHook() { +class HPlayerController : BaseHook() { companion object { const val TAG = "HPlayerController" diff --git a/core/src/main/java/io/github/fplus/core/hook/HSeekBarSpeedModeBottomMask.kt b/core/src/main/java/io/github/fplus/core/hook/HSeekBarSpeedModeBottomMask.kt index f1f9c37..45c55e7 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HSeekBarSpeedModeBottomMask.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HSeekBarSpeedModeBottomMask.kt @@ -15,7 +15,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup import io.github.xpler.core.wrapper.CallMethods -class HSeekBarSpeedModeBottomMask : BaseHook(), +class HSeekBarSpeedModeBottomMask : BaseHook(), CallMethods { companion object { const val TAG = "HSeekBarSpeedModeBottomMask" diff --git a/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt b/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt index b2afd76..69295bf 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt @@ -28,7 +28,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.core.thisViewGroup -class HSideBarNestedScrollView : BaseHook() { +class HSideBarNestedScrollView : BaseHook() { companion object { const val TAG = "HSideBarNestedScrollView" } diff --git a/core/src/main/java/io/github/fplus/core/hook/HVerticalViewPager.kt b/core/src/main/java/io/github/fplus/core/hook/HVerticalViewPager.kt index 3d4a835..5e28d01 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HVerticalViewPager.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HVerticalViewPager.kt @@ -22,7 +22,7 @@ import io.github.xpler.core.log.XplerLog import io.github.xpler.core.lpparam import io.github.xpler.core.thisView -class HVerticalViewPager : BaseHook() { +class HVerticalViewPager : BaseHook() { companion object { const val TAG = "HVerticalViewPager" @@ -70,6 +70,10 @@ class HVerticalViewPager : BaseHook() { private var durationRunnable: Runnable? = null + override fun setTargetClass(): Class<*> { + return VerticalViewPager::class.java + } + @OnAfter("onInterceptTouchEvent") fun onInterceptTouchEvent(params: XC_MethodHook.MethodHookParam, event: MotionEvent) { longVideoJudge(params, event) diff --git a/core/src/main/java/io/github/fplus/core/hook/HVideoViewHolder.kt b/core/src/main/java/io/github/fplus/core/hook/HVideoViewHolder.kt index 5aa9de3..3877079 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HVideoViewHolder.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HVideoViewHolder.kt @@ -41,7 +41,7 @@ import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog import io.github.xpler.loader.hostClassloader -class HVideoViewHolder : BaseHook() { +class HVideoViewHolder : BaseHook() { companion object { const val TAG = "HVideoViewHolder" diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt index 7ea2be1..63384cc 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt @@ -6,7 +6,7 @@ import android.content.Context import io.github.fplus.core.base.BaseHook class ClipboardLogic( - private val hook: BaseHook<*>, + private val hook: BaseHook, ) { private var primaryClipChangedListener: ClipboardManager.OnPrimaryClipChangedListener? = null diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt index 9575012..63e5b0e 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt @@ -29,7 +29,7 @@ import java.io.FileOutputStream /// 下载(视频/图文/音乐)逻辑 class DownloadLogic( - val hook: BaseHook<*>, + val hook: BaseHook, val context: Context, val aweme: Aweme?, ) { diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt index fc50c3b..ec0104c 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt @@ -11,7 +11,7 @@ import java.io.File import java.io.FileOutputStream class SaveAudioLogic( - private val hook: BaseHook<*>, + private val hook: BaseHook, private val context: Context, private val url: String, private val filename: String, diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt index e1b19b3..16587cf 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt @@ -14,7 +14,7 @@ import java.io.FileOutputStream // 保存评论区(图片/视频)逻辑 class SaveCommentLogic( - private val hook: BaseHook<*>, + private val hook: BaseHook, private val context: Context, private val aweme: Aweme?, ) { diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt index ef87ca8..fe250bc 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt @@ -13,7 +13,7 @@ import java.io.FileOutputStream // 保存表情逻辑 class SaveEmojiLogic( - private val hook: BaseHook<*>, + private val hook: BaseHook, private val context: Context, private val urlList: List, ) {