From 49d0deb256c88c3bd77cc40aa78976245411c9cb Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 30 Jan 2023 21:45:14 +0800 Subject: [PATCH] downgrade minsdk --- .gitignore | 1 + app/build.gradle | 2 +- .../com/xtaolabs/fuck_huaya/hook/HookEntry.kt | 77 ++------------- .../fuck_huaya/hook/apps/CimocHooker.kt | 49 ++++++++++ .../fuck_huaya/hook/apps/HuayaHooker.kt | 97 +++++++++++++++++++ app/src/main/res/values/array.xml | 1 + build.gradle | 2 +- 7 files changed, 157 insertions(+), 72 deletions(-) create mode 100644 app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/CimocHooker.kt create mode 100644 app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/HuayaHooker.kt diff --git a/.gitignore b/.gitignore index aa724b7..5c915a5 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ .externalNativeBuild .cxx local.properties +.idea/ diff --git a/app/build.gradle b/app/build.gradle index bd10dca..d31acfd 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,7 +9,7 @@ android { defaultConfig { applicationId "com.xtaolabs.fuck_huaya" - minSdk 31 + minSdk 23 targetSdk 33 versionCode rootProject.ext.appVersionCode versionName rootProject.ext.appVersionName diff --git a/app/src/main/java/com/xtaolabs/fuck_huaya/hook/HookEntry.kt b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/HookEntry.kt index 02285fd..27e8bb9 100644 --- a/app/src/main/java/com/xtaolabs/fuck_huaya/hook/HookEntry.kt +++ b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/HookEntry.kt @@ -1,11 +1,10 @@ package com.xtaolabs.fuck_huaya.hook -import android.content.Context import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed import com.highcapable.yukihookapi.hook.factory.encase -import com.highcapable.yukihookapi.hook.type.java.BooleanType -import com.highcapable.yukihookapi.hook.type.java.UnitType import com.highcapable.yukihookapi.hook.xposed.proxy.IYukiHookXposedInit +import com.xtaolabs.fuck_huaya.hook.apps.CimocHooker +import com.xtaolabs.fuck_huaya.hook.apps.HuayaHooker @InjectYukiHookWithXposed(isUsingResourcesHook = false) @@ -13,72 +12,10 @@ class HookEntry : IYukiHookXposedInit { override fun onHook() = encase { loadApp("cn.fzhuayantcoltd.huayaapp") { - "com.stub.StubApp".hook { - injectMember { - method { - name = "attachBaseContext" - } - afterHook { - appClassLoader = args().first().cast()!!.classLoader - // 去除开屏广告 - findClass("cn.fzhuayantcoltd.huayaapp.dto.ConfigDto", appClassLoader).hook { - injectMember { - method { - name = "isNoSplash" - } - replaceToTrue() - } - } - // 去除阅读广告 - findClass("cn.fzhuayantcoltd.huayaapp.ui.activity.longcartoon.LongBookDetailActivity", appClassLoader).hook { - injectMember { - method { - name = "a" - param("cn.fzhuayantcoltd.huayaapp.dto.event.WatchVideoEvent") - returnType = UnitType - } - replaceUnit { } - } - } - // 去除签到、feedbannerAd 广告 - findClass("cn.fzhuayantcoltd.huayaapp.a.a", appClassLoader).hook { - injectMember { - method { - name = "e" - paramCount = 0 - returnType = BooleanType - } - replaceToTrue() - } - } - // 去除签到双倍奖励广告 - findClass("cn.fzhuayantcoltd.huayaapp.ui.activity.task.TasksCenterActivity", appClassLoader).hook { - injectMember { - method { - name = "j" - paramCount = 0 - } - replaceUnit { - method { - name = "h" - paramCount = 0 - }.get(instance).call() - } - } - } - // 取消更新弹窗 - findClass("cn.fzhuayantcoltd.huayaapp.util.f", appClassLoader).hook { - injectMember { - method { - name = "b" - paramCount = 2 - } - replaceUnit { } - } - } - } - } - } + loadHooker(HuayaHooker) + } + loadApp("com.cimoc.haleydu") { + loadHooker(CimocHooker) } } -} \ No newline at end of file +} diff --git a/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/CimocHooker.kt b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/CimocHooker.kt new file mode 100644 index 0000000..5dbeaaa --- /dev/null +++ b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/CimocHooker.kt @@ -0,0 +1,49 @@ +package com.xtaolabs.fuck_huaya.hook.apps + +import android.content.Context +import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker + +object CimocHooker : YukiBaseHooker() { + + private fun fuckAd() { + findClass("com.haleydu.cimoc.manager.PreferenceManager", appClassLoader).hook { + injectMember { + method { + name = "getBoolean" + paramCount = 2 + } + afterHook { + if (args().first().cast().equals("pref_global_shutdown_ad")) { + result = true + } + } + } + } + } + + private fun fuckPermissionCheck() { + findClass("com.haleydu.cimoc.ui.activity.MainActivity", appClassLoader).hook { + injectMember { + method { + name = "showPermission" + } + replaceUnit { } + } + } + } + + override fun onHook() { + "com.stub.StubApp".hook { + injectMember { + method { + name = "attachBaseContext" + } + afterHook { + appClassLoader = args().first().cast()!!.classLoader + fuckAd() + fuckPermissionCheck() + } + } + } + } +} diff --git a/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/HuayaHooker.kt b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/HuayaHooker.kt new file mode 100644 index 0000000..52a7a0f --- /dev/null +++ b/app/src/main/java/com/xtaolabs/fuck_huaya/hook/apps/HuayaHooker.kt @@ -0,0 +1,97 @@ +package com.xtaolabs.fuck_huaya.hook.apps + +import android.content.Context +import com.highcapable.yukihookapi.hook.entity.YukiBaseHooker +import com.highcapable.yukihookapi.hook.type.java.BooleanType +import com.highcapable.yukihookapi.hook.type.java.UnitType + +object HuayaHooker : YukiBaseHooker() { + private fun fuckSplashAd() { + findClass("cn.fzhuayantcoltd.huayaapp.dto.ConfigDto", appClassLoader).hook { + injectMember { + method { + name = "isNoSplash" + } + replaceToTrue() + } + } + } + + private fun fuckReadAd() { + findClass("cn.fzhuayantcoltd.huayaapp.ui.activity.longcartoon.LongBookDetailActivity", appClassLoader).hook { + injectMember { + method { + name = "a" + param("cn.fzhuayantcoltd.huayaapp.dto.event.WatchVideoEvent") + returnType = UnitType + } + replaceUnit { } + } + } + } + + private fun fuckSignInAd() { + findClass("cn.fzhuayantcoltd.huayaapp.a.a", appClassLoader).hook { + injectMember { + method { + name = "e" + paramCount = 0 + returnType = BooleanType + } + replaceToTrue() + } + } + } + + private fun fuckSignInRewardAd() { + findClass("cn.fzhuayantcoltd.huayaapp.ui.activity.task.TasksCenterActivity", appClassLoader).hook { + injectMember { + method { + name = "j" + paramCount = 0 + } + replaceUnit { + method { + name = "h" + paramCount = 0 + }.get(instance).call() + } + } + } + } + + private fun fuckUpdate() { + findClass("cn.fzhuayantcoltd.huayaapp.util.f", appClassLoader).hook { + injectMember { + method { + name = "b" + paramCount = 2 + } + replaceUnit { } + } + } + } + + override fun onHook() { + "com.stub.StubApp".hook { + injectMember { + method { + name = "attachBaseContext" + } + afterHook { + appClassLoader = args().first().cast()!!.classLoader + // 去除开屏广告 + fuckSplashAd() + // 去除阅读广告 + fuckReadAd() + // 去除签到、feedbannerAd 广告 + fuckSignInAd() + // 去除签到双倍奖励广告 + fuckSignInRewardAd() + // 取消更新弹窗 + fuckUpdate() + } + } + } + } +} diff --git a/app/src/main/res/values/array.xml b/app/src/main/res/values/array.xml index 19e97cb..41c0886 100644 --- a/app/src/main/res/values/array.xml +++ b/app/src/main/res/values/array.xml @@ -2,5 +2,6 @@ cn.fzhuayantcoltd.huayaapp + com.cimoc.haleydu \ No newline at end of file diff --git a/build.gradle b/build.gradle index b4b1904..9a822e7 100644 --- a/build.gradle +++ b/build.gradle @@ -6,6 +6,6 @@ plugins { ext { appVersionName = "1.1.2" - appVersionCode = 2 + appVersionCode = 3 enableR8 = false } \ No newline at end of file