downgrade minsdk

This commit is contained in:
xtaodada 2023-01-30 21:45:14 +08:00
parent 1396d50bae
commit 49d0deb256
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
7 changed files with 157 additions and 72 deletions

1
.gitignore vendored
View File

@ -13,3 +13,4 @@
.externalNativeBuild .externalNativeBuild
.cxx .cxx
local.properties local.properties
.idea/

View File

@ -9,7 +9,7 @@ android {
defaultConfig { defaultConfig {
applicationId "com.xtaolabs.fuck_huaya" applicationId "com.xtaolabs.fuck_huaya"
minSdk 31 minSdk 23
targetSdk 33 targetSdk 33
versionCode rootProject.ext.appVersionCode versionCode rootProject.ext.appVersionCode
versionName rootProject.ext.appVersionName versionName rootProject.ext.appVersionName

View File

@ -1,11 +1,10 @@
package com.xtaolabs.fuck_huaya.hook package com.xtaolabs.fuck_huaya.hook
import android.content.Context
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
import com.highcapable.yukihookapi.hook.factory.encase 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.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) @InjectYukiHookWithXposed(isUsingResourcesHook = false)
@ -13,72 +12,10 @@ class HookEntry : IYukiHookXposedInit {
override fun onHook() = encase { override fun onHook() = encase {
loadApp("cn.fzhuayantcoltd.huayaapp") { loadApp("cn.fzhuayantcoltd.huayaapp") {
"com.stub.StubApp".hook { loadHooker(HuayaHooker)
injectMember {
method {
name = "attachBaseContext"
}
afterHook {
appClassLoader = args().first().cast<Context>()!!.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 { }
}
}
}
}
} }
loadApp("com.cimoc.haleydu") {
loadHooker(CimocHooker)
} }
} }
} }

View File

@ -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<String>().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<Context>()!!.classLoader
fuckAd()
fuckPermissionCheck()
}
}
}
}
}

View File

@ -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<Context>()!!.classLoader
// 去除开屏广告
fuckSplashAd()
// 去除阅读广告
fuckReadAd()
// 去除签到、feedbannerAd 广告
fuckSignInAd()
// 去除签到双倍奖励广告
fuckSignInRewardAd()
// 取消更新弹窗
fuckUpdate()
}
}
}
}
}

View File

@ -2,5 +2,6 @@
<resources> <resources>
<string-array name="module_scope"> <string-array name="module_scope">
<item>cn.fzhuayantcoltd.huayaapp</item> <item>cn.fzhuayantcoltd.huayaapp</item>
<item>com.cimoc.haleydu</item>
</string-array> </string-array>
</resources> </resources>

View File

@ -6,6 +6,6 @@ plugins {
ext { ext {
appVersionName = "1.1.2" appVersionName = "1.1.2"
appVersionCode = 2 appVersionCode = 3
enableR8 = false enableR8 = false
} }