Skip to content
This repository has been archived by the owner on Oct 14, 2024. It is now read-only.

Commit

Permalink
更换评论区图片的判断逻辑
Browse files Browse the repository at this point in the history
  • Loading branch information
GangJust committed Mar 16, 2023
1 parent a652605 commit b2d205d
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 13 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ android {
applicationId "com.freegang.fplus"
minSdk 21
targetSdk 33
versionCode 2
versionName "1.0.1"
versionCode 3
versionName "1.0.2"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables {
Expand Down
7 changes: 5 additions & 2 deletions app/src/main/assets/update.log
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@ v1.0.0
适配抖音24.4.0、24.5.0

v1.0.1
文件名过长无法下载;
关注页未获取到基本信息
文件名过长无法下载
关注页未获取到基本信息

v1.0.2
更换评论区图片的判断逻辑
Original file line number Diff line number Diff line change
Expand Up @@ -567,6 +567,7 @@ class HomeActivity : ComponentActivity() {
// 保存配置
private fun saveConfig() {
lifecycleScope.launch {
config.isSupportHint = application.appVersionCode != config.versionCode
config.versionName = application.appVersionName
config.versionCode = application.appVersionCode
config.save(application)
Expand Down
10 changes: 3 additions & 7 deletions core/src/main/java/com/freegang/douyin/HAbsActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,9 @@ class HAbsActivity(
if (methods.isNotEmpty()) {
val aweme = methods.first().call(absActivity) ?: return@launch

//不处理评论区视频(如果是视频的话)
val video = aweme.getObjectField<Any>("video")
if (video != null) return@launch

//如果没有背景音乐, 代表是评论区图片(图文也可能没有背景音乐, 但是少, 就这么判断了)
val music = aweme.getObjectField<Any>("music")
if (music == null) {
//如果是评论区的评论, 则获取图片
val commentFeedOuterAweme = aweme.getObjectField<Any>("commentFeedOuterAweme")
if (commentFeedOuterAweme != null) {
val image = aweme.getObjectField<List<Any>>("images")?.first() ?: return@launch
urlList = image.getObjectField<List<String>>("urlList") ?: return@launch
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/main/java/com/freegang/douyin/HMainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class HMainActivity(
) : BaseHook(lpparam) {

//当前适配版本列表
private val supportVersions = listOf("24.4.0", "24.5.0")
private val supportVersions = listOf("24.4.0", "24.5.0", "24.6.0")

override fun onHook() {
val config = Config.get()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object KFileUtils {
* @param ellipsis 省略占位文本
* @return String
*/
fun String.subMax(max: Int = 10, ellipsis: String = ""): String {
fun String.subMax(max: Int = 35, ellipsis: String = ""): String {
if (this.length <= max) return this
return this.substring(0, max).plus(ellipsis)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,14 @@ object KResourceUtils {
fun getString(@StringRes id: Int): String {
return KtXposedHelpers.getModuleRes().getString(id)
}

/**
* 获取模块中的 String Array
*
* @param id id
* @return String Array
*/
fun getStringArray(@ArrayRes id: Int): Array<String> {
return KtXposedHelpers.getModuleRes().getStringArray(id)
}
}

0 comments on commit b2d205d

Please sign in to comment.