Skip to content

Commit

Permalink
feat: 970 版本 自动领取阅读积分100~500ms随机延迟领取
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 16, 2023
1 parent 58810f1 commit 5bcecb6
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ jobs:
token: ${{ secrets.RELEASE_TOKEN }}
release-type: node
package-name: release-please-action
release-as: 2.2.6
release-as: 2.2.7
signoff: "xihan123<srxqzxs@vip.qq.com>"
changelog-types: '[{"type":"types","section":"Types","hidden":false},{"type":"revert","section":"Reverts","hidden":false},{"type":"feat","section":"Features","hidden":false},{"type":"fix","section":"Bug Fixes","hidden":false},{"type":"improvement","section":"Feature Improvements","hidden":false},{"type":"docs","section":"Docs","hidden":false},{"type":"ci","section":"CI","hidden":false},{"type":"chore","section":"Miscellaneous","hidden":false}]'
8 changes: 4 additions & 4 deletions app/src/main/kotlin/cn/xihan/qdds/HookEntry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1752,7 +1752,7 @@ fun PackageParam.receiveReadingCreditsAutomatically(versionCode: Int) {
instance.getParam<HashMap<*, *>>("bubbleViewMap")
bubbleViewMap?.forEach { (_, any2) ->
val readTimeBubbleView = any2 as? LinearLayout
readTimeBubbleView?.performClick()
readTimeBubbleView?.postRandomDelay { performClick() }
}
}
}
Expand Down Expand Up @@ -1792,7 +1792,7 @@ fun PackageParam.receiveReadingCreditsAutomatically(versionCode: Int) {
for (i in 0..<count) {
val child = it.getChildAt(i)
if (child is LinearLayout) {
child.performClick()
child.postRandomDelay { performClick() }
}
}
}
Expand Down Expand Up @@ -1820,7 +1820,7 @@ fun PackageParam.receiveReadingCreditsAutomatically(versionCode: Int) {
}.call()

if ("领取" == text) {
button.post { button.performClick() }
button.postRandomDelay { performClick() }
}
}
}
Expand Down Expand Up @@ -1855,7 +1855,7 @@ fun PackageParam.receiveReadingCreditsAutomatically(versionCode: Int) {
"开启新一周PK"
)
if (text in list) {
button.post { button.performClick() }
button.postRandomDelay { performClick() }
}
}
}
Expand Down
12 changes: 12 additions & 0 deletions app/src/main/kotlin/cn/xihan/qdds/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -911,3 +911,15 @@ fun ViewGroup.findViewsByType(viewClass: Class<*>): ArrayList<View> {
return result
}

/**
* 随机 100至500 之间的数
*/
val randomTime: Long = Random().nextInt(400) + 100L

/**
* 随机延迟运行
* @param [delayMillis] 延迟,毫秒
* @param [action] 动作
*/
fun View.postRandomDelay(delayMillis: Long = randomTime, action: View.() -> Unit) =
postDelayed({ this.action() }, delayMillis)
4 changes: 2 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ yukihook-ksp = { module = "com.highcapable.yukihookapi:ksp-xposed", version.ref
xposed-api = { module = "de.robv.android.xposed:api", version = "82" }
htmlunit = { module = "org.htmlunit:htmlunit3-android", version = "3.3.0" }
dexkit = { module = "org.luckypray:DexKit", version = "1.1.8" }
compose-bom = { module = "dev.chrisbanes.compose:compose-bom", version = "2023.07.00-alpha02" }
compose-bom = { module = "dev.chrisbanes.compose:compose-bom", version = "2023.09.00-alpha02" }
ui = { group = "androidx.compose.ui", name = "ui" }
ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
foundation = { group = "androidx.compose.foundation", name = "foundation" }
Expand All @@ -35,7 +35,7 @@ activity-ktx = { module = "androidx.activity:activity-ktx", version.ref = "activ
material3 = { group = "androidx.compose.material3", name = "material3" }
com-google-accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanist" }
com-google-accompanist-themeadapter-material3 = { module = "com.google.accompanist:accompanist-themeadapter-material3", version.ref = "accompanist" }
com-google-android-material = { module = "com.google.android.material:material", version = "1.10.0-alpha05" }
com-google-android-material = { module = "com.google.android.material:material", version = "1.10.0-alpha06" }

[plugins]
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
Expand Down

0 comments on commit 5bcecb6

Please sign in to comment.