diff --git a/app/build.gradle b/app/build.gradle index bb1caaa..61c63fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -11,8 +11,8 @@ android { applicationId "io.github.fplus" minSdk 24 targetSdk 33 - versionCode 126 - versionName "1.3.0" + versionCode 128 + versionName "1.3.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" vectorDrawables { diff --git a/app/src/main/assets/update.txt b/app/src/main/assets/update.txt index 36a4c4d..f183a19 100644 --- a/app/src/main/assets/update.txt +++ b/app/src/main/assets/update.txt @@ -1,3 +1,12 @@ +v1.3.1 +增加横屏播放单独的状态栏沉浸逻辑 +增加根据内容自动匹配下载文件的格式 (表情包无法发送微信问题) +调整不再需要手动勾选崩溃容错处理 (默认给你们开了) +调整改回下载链接取为取第一项 (格式不统一问题) +修复部分情况下复制链接为前一个视频问题 +修复新版本下清爽模式偶尔不隐藏顶、底部控件问题 +修复其它已知问题 + v1.3.0 增加官方自动连播默认开启选项 修复定时、空闲退出计时冲突问题 diff --git a/app/src/main/assets/version b/app/src/main/assets/version index e3e5306..1259ac4 100644 --- a/app/src/main/assets/version +++ b/app/src/main/assets/version @@ -1 +1 @@ -1.3.0-126 \ No newline at end of file +1.3.1-128 \ No newline at end of file diff --git a/app/src/main/java/io/github/fplus/activity/HomeActivity.kt b/app/src/main/java/io/github/fplus/activity/HomeActivity.kt index a381ff4..5ae154b 100644 --- a/app/src/main/java/io/github/fplus/activity/HomeActivity.kt +++ b/app/src/main/java/io/github/fplus/activity/HomeActivity.kt @@ -21,7 +21,6 @@ import androidx.compose.foundation.clickable import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.interaction.MutableInteractionSource import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -419,7 +418,7 @@ class HomeActivity : ComponentActivity() { text = buildAnnotatedString { append("该操作将清空") withStyle(SpanStyle(Color.Red)) { - append("数据目录") + append("下载目录") } append("包括下载的") withStyle(SpanStyle(Color.Red)) { @@ -454,17 +453,17 @@ class HomeActivity : ComponentActivity() { Icon( modifier = Modifier.size(24.dp), painter = painterResource(id = R.drawable.ic_find_file), - contentDescription = "数据目录", + contentDescription = "下载目录", tint = Themes.nowColors.icon, ) Spacer(modifier = Modifier.padding(horizontal = 8.dp)) Column { Text( - text = "数据目录: `外置存储器/Download/Freedom`", + text = "下载目录: `外置存储器/Download/Freedom`", style = Themes.nowTypography.body1, ) Text( - text = "长按清空数据目录", + text = "长按清空下载目录", style = Themes.nowTypography.overline, ) } diff --git a/core/src/main/java/io/github/fplus/core/helper/DexkitBuilder.kt b/core/src/main/java/io/github/fplus/core/helper/DexkitBuilder.kt index fea4d47..3544f7f 100644 --- a/core/src/main/java/io/github/fplus/core/helper/DexkitBuilder.kt +++ b/core/src/main/java/io/github/fplus/core/helper/DexkitBuilder.kt @@ -1,10 +1,12 @@ package io.github.fplus.core.helper import android.app.Application +import com.freegang.extension.appLastUpdateTime import com.freegang.extension.appVersionCode import com.freegang.extension.appVersionName import com.freegang.extension.getIntOrDefault import com.freegang.extension.getJSONArrayOrDefault +import com.freegang.extension.getLongOrDefault import com.freegang.extension.getStringOrDefault import com.freegang.ktutils.log.KLogCat import com.freegang.ktutils.text.KTextUtils @@ -607,16 +609,13 @@ object DexkitBuilder { add { type = "com.ss.android.ugc.aweme.feed.model.VideoItemParams" } - - add { - type = "com.ss.android.ugc.aweme.feed.plato.business.mainarchitecture.tablandguide.TabId" - } } methods { add { paramTypes = listOf("com.ss.android.ugc.aweme.feed.model.VideoItemParams") } } + usingStrings = listOf("TabLandGuidePresenter", "tabLandingActionBtn") } } tabLandingClazz = tabLanding.instance("tabLanding") @@ -661,9 +660,19 @@ object DexkitBuilder { // version val version = cache.getIntOrDefault("version") - val appVersion = cache.getStringOrDefault("appVersion") + val appVersionName = cache.getStringOrDefault("appVersionName") + val appVersionCode = cache.getLongOrDefault("appVersionCode", 0) + val appLastUpdateTime = cache.getLongOrDefault("appLastUpdateTime") + + if (appVersionName != app!!.appVersionName) { + return false + } + + if (appVersionCode != app!!.appVersionCode) { + return false + } - if (appVersion.compareTo("${app!!.appVersionName}_${app!!.appVersionCode}") != 0) { + if (appLastUpdateTime != app!!.appLastUpdateTime) { return false } @@ -727,7 +736,9 @@ object DexkitBuilder { private fun saveCache() { // version cacheJson.put("version", "$cacheVersion") - cacheJson.put("appVersion", "${app!!.appVersionName}_${app!!.appVersionCode}") + cacheJson.put("appVersionName", app!!.appVersionName) + cacheJson.put("appVersionCode", app!!.appVersionCode) + cacheJson.put("appLastUpdateTime", app!!.appLastUpdateTime) // cache cacheJson.put("class", classCacheJson) diff --git a/core/src/main/java/io/github/fplus/core/hook/DouYinMain.kt b/core/src/main/java/io/github/fplus/core/hook/DouYinMain.kt index 5eb751e..19a0ed9 100644 --- a/core/src/main/java/io/github/fplus/core/hook/DouYinMain.kt +++ b/core/src/main/java/io/github/fplus/core/hook/DouYinMain.kt @@ -53,7 +53,7 @@ class DouYinMain(private val app: Application) { // search and hook DexkitBuilder.running( app = app, - version = 23, + version = 24, searchBefore = { HActivity() HMainActivity() diff --git a/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt b/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt index fe43011..68e840e 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HAbstractFeedAdapter.kt @@ -7,8 +7,8 @@ import android.view.ViewGroup import android.widget.FrameLayout import android.widget.LinearLayout import androidx.core.view.children +import androidx.core.view.isVisible import androidx.core.view.updatePadding -import com.freegang.extension.asOrNull import com.freegang.extension.dip2px import com.freegang.extension.firstOrNull import com.freegang.extension.firstParentOrNull @@ -43,14 +43,16 @@ class HAbstractFeedAdapter : BaseHook() { i: Int, ) { hookBlockRunning(params) { - if (!config.isImmersive) return + if (!config.isImmersive) + return + // KLogCat.d("view: $view") if (view is FrameLayout && view !is VideoViewHolderRootView) { // 垫高 view.forEachChild { if (it.background is GradientDrawable) it.background = null } val bottomPadding = view.context.dip2px(58f) // BottomTabBarHeight - val viewGroup = view.children.lastOrNull()?.asOrNull() ?: return + val viewGroup = view.children.lastOrNull { it is ViewGroup && it.isVisible } ?: return viewGroup.updatePadding(bottom = bottomPadding) singleLaunchMain { diff --git a/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt b/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt index 37aaa41..a71d0e3 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HCrashTolerance.kt @@ -27,8 +27,8 @@ class HCrashTolerance : BaseHook() { } override fun onInit() { - if (!config.isCrashTolerance) - return + // if (!config.isCrashTolerance) + // return HPoiFeed() HLivePhoto() diff --git a/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt index 09f2b27..0fb3b43 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HDetailActivity.kt @@ -55,10 +55,8 @@ class HDetailActivity : BaseHook() { return val method = activity.method(returnType = Aweme::class.java) - val aweme = method?.invoke(activity)?.asOrNull() - ?: HVideoViewHolder.aweme - clipboardLogic.addClipboardListener(activity) { _, _ -> + val aweme = method?.invoke(activity)?.asOrNull() DownloadLogic( this@HDetailActivity, diff --git a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt index 82c9cf0..a3b6605 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HEmojiDetailDialogNew.kt @@ -32,7 +32,7 @@ class HEmojiDetailDialogNew : BaseHook() { override fun onInit() { lpparam.hookClass(EmojiDetailDialogNew::class.java) - .constructorsAll { + .constructorAll { onBefore { if (argsOrEmpty.isEmpty()) return@onBefore diff --git a/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt b/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt index b732c40..7dc0d19 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HEmojiPopupWindow.kt @@ -36,11 +36,9 @@ class HEmojiPopupWindow : BaseHook() { if (!config.isEmojiDownload) return - popUrlList = popUrlList.ifEmpty { - emoji?.detailEmoji?.animateUrl?.urlList - ?: emoji?.detailEmoji?.staticUrl?.urlList - ?: emptyList() - } + popUrlList = emoji?.detailEmoji?.animateUrl?.urlList + ?: emoji?.detailEmoji?.staticUrl?.urlList + ?: emptyList() }.onFailure { XplerLog.e(it) } diff --git a/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt index de71092..6e87894 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HLandscapeFeedActivity.kt @@ -8,6 +8,7 @@ import com.ss.android.ugc.aweme.longervideo.landscape.home.activity.LandscapeFee import de.robv.android.xposed.XC_MethodHook import io.github.fplus.core.base.BaseHook import io.github.fplus.core.config.ConfigV1 +import io.github.fplus.core.helper.ImmersiveHelper import io.github.fplus.core.hook.logic.ClipboardLogic import io.github.fplus.core.hook.logic.DownloadLogic import io.github.xpler.core.entity.OnAfter @@ -33,6 +34,11 @@ class HLandscapeFeedActivity : BaseHook() { fun onResumeAfter(params: XC_MethodHook.MethodHookParam) { hookBlockRunning(params) { addClipboardListener(thisActivity) + ImmersiveHelper.immersive( + thisActivity, + hideStatusBar = true, + hideNavigationBars = true, + ) }.onFailure { XplerLog.e(it) } @@ -47,6 +53,20 @@ class HLandscapeFeedActivity : BaseHook() { } } + @OnBefore("onWindowFocusChanged") + @OnAfter("onWindowFocusChanged") + fun onWindowFocusChangedAfter(params: XC_MethodHook.MethodHookParam, boolean: Boolean) { + hookBlockRunning(params) { + ImmersiveHelper.immersive( + thisActivity, + hideStatusBar = true, + hideNavigationBars = true, + ) + }.onFailure { + XplerLog.e(it) + } + } + private fun addClipboardListener(activity: Activity) { if (!config.isDownload) return diff --git a/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt b/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt index 628db5e..ca0ea95 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HMainActivity.kt @@ -98,16 +98,6 @@ class HMainActivity : BaseHook() { XplerLog.d("version: ${KtXposedHelpers.moduleVersionName(activity)} - ${activity.appVersionName}(${activity.appVersionCode})") DouYinMain.timerExitHelper?.restart() - // test - /* runCatching { - val helper = findClass("X.0Suh").newInstance().methodInvoke("LIZ", args = arrayOf(activity)) - KLogCat.d("helper: $helper") - helper?.method("LIZ", paramTypes = arrayOf(helper::class.java, String::class.java, Int::class.java, Any::class.java)) - ?.invoke(helper, helper, null, 1, null) - }.onFailure { - KLogCat.d("调用失败: $it") - } */ - openAutoPlay(activity) }.onFailure { XplerLog.e(it) diff --git a/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt b/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt index 6cf9c35..37225e2 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HPlayerController.kt @@ -1,6 +1,5 @@ package io.github.fplus.core.hook -import android.view.View import androidx.core.view.isVisible import com.freegang.extension.asOrNull import com.freegang.extension.fields @@ -10,6 +9,7 @@ import com.ss.android.ugc.aweme.feed.ui.PenetrateTouchRelativeLayout import de.robv.android.xposed.XC_MethodHook import io.github.fplus.core.base.BaseHook import io.github.fplus.core.config.ConfigV1 +import io.github.xpler.core.entity.OnAfter import io.github.xpler.core.entity.OnBefore import io.github.xpler.core.hookBlockRunning import io.github.xpler.core.log.XplerLog @@ -46,6 +46,7 @@ class HPlayerController : BaseHook() { @OnBefore("onResumePlay") fun onResumePlayBefore(params: XC_MethodHook.MethodHookParam, aid: String?) { hookBlockRunning(params) { + // XplerLog.d("onResumePlay: $aid") playingAid = aid isPlaying = true callOpenCleanMode(params, true) @@ -55,40 +56,52 @@ class HPlayerController : BaseHook() { } @OnBefore("onPausePlay") - fun onPausePlayAfter(params: XC_MethodHook.MethodHookParam, aid: String?) { + fun onPausePlayBefore(params: XC_MethodHook.MethodHookParam, aid: String?) { hookBlockRunning(params) { // XplerLog.d("onPausePlay: $aid") if (playingAid == aid) { isPlaying = false + callOpenCleanMode(params, false) } - callOpenCleanMode(params, false) }.onFailure { XplerLog.e(it) } } + // @OnBefore("onPlayStop") + fun onPlayStopBefore(params: XC_MethodHook.MethodHookParam, aid: String?) { + hookBlockRunning(params) { + // XplerLog.d("onPlayStop: $aid") + if (playingAid == aid) { + isPlaying = false + callOpenCleanMode(params, false) + } + }.onFailure { + XplerLog.tagE(TAG, it) + } + } + // @OnBefore("onPlayCompleted") fun onPlayCompletedAfter(params: XC_MethodHook.MethodHookParam, aid: String?) { hookBlockRunning(params) { - // isPlaying = false - // callOpenCleanMode(params, false) + // XplerLog.d("onPlayCompleted: $aid") + isPlaying = false }.onFailure { XplerLog.e(it) } } - @OnBefore("onPlayCompletedFirstTime") + // @OnAfter("onPlayCompletedFirstTime") fun onPlayCompletedFirstTimeAfter(params: XC_MethodHook.MethodHookParam, aid: String?) { hookBlockRunning(params) { - // isPlaying = false - // callOpenCleanMode(params, false) - // onSwipeUp(params) + // XplerLog.d("onPlayCompletedFirstTime: $aid") + isPlaying = false }.onFailure { XplerLog.e(it) } } - @OnBefore("onPlayProgressChange") + @OnAfter("onPlayProgressChange") fun onPlayProgressChangeBefore( params: XC_MethodHook.MethodHookParam, aid: String?, current: Long, @@ -97,7 +110,6 @@ class HPlayerController : BaseHook() { hookBlockRunning(params) { playingAid = aid isPlaying = true - // callOpenCleanMode(params, false) }.onFailure { XplerLog.e(it) } @@ -126,19 +138,4 @@ class HPlayerController : BaseHook() { view?.isVisible = !bool HMainActivity.toggleView(!bool) } - - private fun onSwipeUp(params: XC_MethodHook.MethodHookParam) { - val method = params.thisObject - .methods(returnType = VideoViewHolder::class.java) - .firstOrNull { it.parameterTypes.isEmpty() } - val videoViewHolder = method?.invoke(params.thisObject) - - val fields = videoViewHolder - ?.fields(type = View::class.java) - - fields?.map { "\nfield: ${it}\nvalue: ${it.get(videoViewHolder)}" } - ?.let { - XplerLog.d(*it.toTypedArray()) - } - } } \ No newline at end of file diff --git a/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt b/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt index 69295bf..bc302cb 100644 --- a/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt +++ b/core/src/main/java/io/github/fplus/core/hook/HSideBarNestedScrollView.kt @@ -5,14 +5,11 @@ import android.content.Intent import android.graphics.Color import android.view.MotionEvent import android.view.ViewGroup -import android.widget.TextView import androidx.core.view.children -import com.freegang.extension.firstOrNull import com.freegang.extension.isDarkMode import com.freegang.extension.postRunning import com.freegang.ktutils.app.KAppUtils import com.freegang.ktutils.app.KToastUtils -import com.freegang.ktutils.color.KColorUtils import de.robv.android.xposed.XC_MethodHook import io.github.fplus.Constant import io.github.fplus.core.R @@ -69,8 +66,6 @@ class HSideBarNestedScrollView : BaseHook() { viewGroup.postRunning { val onlyChild = it.getChildAt(0) as ViewGroup if (onlyChild.children.lastOrNull()?.contentDescription == "扩展功能") return@postRunning - val text = onlyChild.firstOrNull(TextView::class.java) ?: return@postRunning - val isDark = KColorUtils.isDarkColor(text.currentTextColor) val setting = KtXposedHelpers.inflateView(onlyChild.context, R.layout.side_freedom_setting) setting.contentDescription = "扩展功能" @@ -79,7 +74,7 @@ class HSideBarNestedScrollView : BaseHook() { val backgroundRes: Int val iconColorRes: Int val textColorRes: Int - if (!isDark) { + if (viewGroup.context.isDarkMode) { backgroundRes = R.drawable.side_item_background_night iconColorRes = R.drawable.ic_freedom_night textColorRes = Color.parseColor("#E6FFFFFF") diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt index 63384cc..4c4a088 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/ClipboardLogic.kt @@ -14,12 +14,16 @@ class ClipboardLogic( fun addClipboardListener(context: Context, notify: (clipData: ClipData, firstText: String) -> Unit) { val clipboardManager = context.getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager primaryClipChangedListener = ClipboardManager.OnPrimaryClipChangedListener { - if (!clipboardManager.hasPrimaryClip()) return@OnPrimaryClipChangedListener + if (!clipboardManager.hasPrimaryClip()) + return@OnPrimaryClipChangedListener + clipboardManager.primaryClip?.runCatching { // 获取剪贴板内容 val clipDataItem = getItemAt(0) val shareText = "${clipDataItem.text}" - if (!shareText.contains("http")) return@OnPrimaryClipChangedListener + + if (!shareText.contains("http")) + return@OnPrimaryClipChangedListener // 跳过直播链接, 按文本检查 if (shareText.contains("【抖音】") && shareText.contains("正在直播") && shareText.contains("一起支持")) { diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt index 63e5b0e..9269554 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/DownloadLogic.kt @@ -220,7 +220,7 @@ class DownloadLogic( File(mImageParent.need(), mPureFileName.secureFilename("_${index + 1}.jpg")) val finished = download( - urlStruct.urlList.random(), + urlStruct.urlList.first(), downloadFile, it, "$index/${aweme.images.size} %s%%" @@ -292,7 +292,7 @@ class DownloadLogic( File(mImageParent.need(), mPureFileName.secureFilename("_${index + 1}.jpg")) val finished = download( - urlStruct.urlList.random(), + urlStruct.urlList.first(), downloadFile, notify, "$index/${aweme.images.size} %s%%" @@ -361,7 +361,7 @@ class DownloadLogic( // 下载逻辑 hook.singleLaunchIO(pureFileName) { val downloadFile = File(parentPath.need(), pureFileName) - val finished = download(urlList.random(), downloadFile, it, "下载中 %s%%") + val finished = download(urlList.first(), downloadFile, it, "下载中 %s%%") if (finished) { hook.refresh { val message = if (isWebDav) "下载成功, 正在上传WebDav!" else "下载成功!" @@ -404,7 +404,7 @@ class DownloadLogic( // 下载逻辑 hook.singleLaunchIO(pureFileName) { val downloadFile = File(parentPath.need(), pureFileName) - val finished = download(urlList.random(), downloadFile, notify, "%s%%") + val finished = download(urlList.first(), downloadFile, notify, "%s%%") if (finished) { hook.refresh { dialog.dismiss() @@ -441,7 +441,7 @@ class DownloadLogic( progressText: String, ): Boolean { return withContext(Dispatchers.IO) { - KHttpUtils.download(url, FileOutputStream(downloadFile)) { real, total, e -> + KHttpUtils.download(url, downloadFile) { real, total, e -> if (e != null) XplerLog.e(e) diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt index ec0104c..f646ff1 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveAudioLogic.kt @@ -8,7 +8,6 @@ import com.freegang.ktutils.net.KHttpUtils import io.github.fplus.core.base.BaseHook import io.github.fplus.core.config.ConfigV1 import java.io.File -import java.io.FileOutputStream class SaveAudioLogic( private val hook: BaseHook, @@ -29,7 +28,7 @@ class SaveAudioLogic( hook.showToast(context, "保存语音, 请稍后..") val file = File(parentPath, "${filename}.mp3") - val result = KHttpUtils.download(url, FileOutputStream(file)) + val result = KHttpUtils.download(url, file) if (result) { hook.showToast(context, "保存成功!") KMediaUtils.notifyMediaUpdate(context, file.absolutePath) diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt index 16587cf..9019e4b 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveCommentLogic.kt @@ -10,7 +10,6 @@ import io.github.fplus.core.base.BaseHook import io.github.fplus.core.config.ConfigV1 import io.github.xpler.core.log.XplerLog import java.io.File -import java.io.FileOutputStream // 保存评论区(图片/视频)逻辑 class SaveCommentLogic( @@ -64,7 +63,7 @@ class SaveCommentLogic( // 构建保存文件名 hook.showToast(context, "保存图片, 请稍后..") val file = File(parentPath, "${System.currentTimeMillis() / 1000}.png") - val result = KHttpUtils.download(urlList.random(), FileOutputStream(file)) + val result = KHttpUtils.download(urlList.first(), file) if (result) { hook.showToast(context, "保存成功!") KMediaUtils.notifyMediaUpdate(context, file.absolutePath) @@ -84,7 +83,7 @@ class SaveCommentLogic( // 构建保存文件名 hook.showToast(context, "保存视频, 请稍后..") val file = File(parentPath, "${System.currentTimeMillis() / 1000}.mp4") - val result = KHttpUtils.download(urlList.random(), FileOutputStream(file)) + val result = KHttpUtils.download(urlList.first(), file) if (result) { hook.showToast(context, "保存成功!") KMediaUtils.notifyMediaUpdate(context, file.absolutePath) diff --git a/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt b/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt index fe250bc..24ceba0 100644 --- a/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt +++ b/core/src/main/java/io/github/fplus/core/hook/logic/SaveEmojiLogic.kt @@ -3,6 +3,7 @@ package io.github.fplus.core.hook.logic import android.content.Context import com.freegang.extension.child import com.freegang.extension.need +import com.freegang.ktutils.log.KLogCat import com.freegang.ktutils.media.KMediaUtils import com.freegang.ktutils.net.KHttpUtils import io.github.fplus.core.base.BaseHook @@ -41,8 +42,8 @@ class SaveEmojiLogic( // 构建保存文件名 hook.showToast(context, "保存表情, 请稍后..") - val file = File(parentPath, "${System.currentTimeMillis() / 1000}.gif") - val result = KHttpUtils.download(urlList.random(), FileOutputStream(file)) + val file = File(parentPath, "${System.currentTimeMillis() / 1000}.webp") + val result = KHttpUtils.download(urlList.first(), file) if (result) { hook.showToast(context, "保存成功!") KMediaUtils.notifyMediaUpdate(context, file.absolutePath) diff --git a/core/src/main/java/io/github/fplus/core/ui/activity/FreedomSettingActivity.kt b/core/src/main/java/io/github/fplus/core/ui/activity/FreedomSettingActivity.kt index daa385f..457cb94 100644 --- a/core/src/main/java/io/github/fplus/core/ui/activity/FreedomSettingActivity.kt +++ b/core/src/main/java/io/github/fplus/core/ui/activity/FreedomSettingActivity.kt @@ -288,8 +288,8 @@ class FreedomSettingActivity : XplerActivity() { item { CommentColorModeItem() } item { WebDavItem() } item { TimedExitItem() } - item { CrashToleranceItem() } - /*item { DisablePluginItem() }*/ + /* item { CrashToleranceItem() } */ + /* item { DisablePluginItem() } */ } } @@ -1981,6 +1981,7 @@ class FreedomSettingActivity : XplerActivity() { } } + @Deprecated("暂存区") @Composable private fun CrashToleranceItem() { SwitchItem( diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index ac4e51d..779fa9b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ okhttp3 = "4.8.0" ss-ktx = "0.0.1" mmkv = "1.3.0" sardine-android = "v0.8" -dexkit = "2.0.0" +dexkit = "2.0.2" [libraries] diff --git a/readme.md b/readme.md index 6c50768..6e3190a 100644 --- a/readme.md +++ b/readme.md @@ -29,7 +29,7 @@ ## 支持版本 -- 理论上支持:23.5.0 ~ 至今 +- 理论上支持:28.0.0 ~ 至今 (28.0.0以下可能有兼容问题,请使用1.2.8之前的版本) - 版本号**参考**列表:[version.json](https://github.com/GangJust/FreedomPlus/blob/master/versions.json) diff --git a/versions.json b/versions.json index 98b4894..c0fee59 100644 --- a/versions.json +++ b/versions.json @@ -1 +1 @@ -["23.5.0","23.6.0","23.7.0","23.8.0","23.9.0","24.0.0","24.1.0","24.2.0","24.3.0","24.4.0","24.5.0","24.6.0","24.7.0","24.8.0","24.9.0","25.0.0","25.1.0","25.2.0","25.3.0","25.4.0","25.5.0","25.6.0","25.7.0","25.8.0","25.9.0","26.0.0","26.1.0","26.2.0","26.3.0","26.4.0","26.5.0","26.6.0","26.7.0","26.8.0","26.9.0","27.0.0","27.1.0","27.2.0","27.3.0","27.4.0","27.5.0","27.6.0","27.7.0","27.8.0","27.9.0","28.0.0","28.1.0","28.2.0","28.3.0","28.4.0","28.5.0","28.6.0","28.7.0","28.8.0","28.9.0","29.0.0","29.1.0","29.2.0","29.3.0","29.4.0","29.5.0","29.6.0","29.7.0"] \ No newline at end of file +["28.0.0","28.1.0","28.2.0","28.3.0","28.4.0","28.5.0","28.6.0","28.7.0","28.8.0","28.9.0","29.0.0","29.1.0","29.2.0","29.3.0","29.4.0","29.5.0","29.6.0","29.7.0","29.8.0","29.9.0","30.0.0","30.1.0","30.2.0","30.3.0"] \ No newline at end of file