Skip to content

Commit

Permalink
feat(拦截设置): 980 + 新增拦截 自动跳转精选
Browse files Browse the repository at this point in the history
Signed-off-by: xihan123 <srxqzxs@vip.qq.com>
  • Loading branch information
xihan123 committed Aug 31, 2023
1 parent 3f0a604 commit 3429f08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
22 changes: 22 additions & 0 deletions app/src/main/kotlin/cn/xihan/qdds/Intercept.kt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cn.xihan.qdds


import com.highcapable.yukihookapi.hook.param.PackageParam
import com.highcapable.yukihookapi.hook.type.android.IntentClass
import com.highcapable.yukihookapi.hook.type.java.BooleanType
import com.highcapable.yukihookapi.hook.type.java.StringClass
import com.highcapable.yukihookapi.hook.type.java.UnitType
Expand Down Expand Up @@ -31,6 +32,7 @@ fun PackageParam.interceptOption(
"闪屏广告页面" -> interceptSplashAdActivity(versionCode)
"阅读页水印" -> interceptReadBookPageWaterMark(versionCode)
"发帖图片水印" -> interceptPostImageWatermark(versionCode)
"自动跳转精选" -> interceptAutoJumpSelected(versionCode)
else -> interceptList.add(selected.title)
}
}
Expand Down Expand Up @@ -247,6 +249,26 @@ fun PackageParam.interceptPostImageWatermark(versionCode: Int) {
}
}

/**
* 拦截自动跳转精选
*/
fun PackageParam.interceptAutoJumpSelected(versionCode: Int){
when(versionCode){
in 980..994 -> {
findClass("com.qidian.QDReader.ui.activity.MainGroupActivity").hook {
injectMember {
method {
name = "checkOpenView"
param(IntentClass)
returnType = UnitType
}
intercept()
}
}
}
}
}

/**
* 拦截异步初始化任务
* @param version 版本号
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/kotlin/cn/xihan/qdds/Option.kt
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,6 @@ data class OptionEntity(
*/
@Keep
@Serializable
@Immutable
data class InterceptOption(
@SerialName("configurations") var configurations: List<SelectedModel> = listOf(
SelectedModel("隐私政策更新弹框"),
Expand All @@ -288,6 +287,7 @@ data class OptionEntity(
SelectedModel("闪屏广告页面"),
SelectedModel("阅读页水印"),
SelectedModel("发帖图片水印"),
SelectedModel("自动跳转精选"),
SelectedModel("异步主GDT广告任务|com.qidian.QDReader.start.AsyncMainGDTTask"),
SelectedModel("异步主游戏广告SDK任务|com.qidian.QDReader.start.AsyncMainGameADSDKTask"),
SelectedModel("异步主游戏下载任务|com.qidian.QDReader.start.AsyncMainGameDownloadTask"),
Expand Down

0 comments on commit 3429f08

Please sign in to comment.