Skip to content

Commit

Permalink
适配抖音25.3.0、25.4.0
Browse files Browse the repository at this point in the history
适配抖音25.3.0、25.4.0;增加首页清爽模式
  • Loading branch information
GangJust committed May 17, 2023
1 parent 515edab commit f977c2e
Show file tree
Hide file tree
Showing 31 changed files with 1,035 additions and 330 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
applicationId "com.freegang.fplus"
minSdk 24
targetSdk 33
versionCode 14
versionCode 19
versionName "1.1.1"

testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand Down
30 changes: 30 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,36 @@
# 关闭警告信息
-dontwarn android.content.res.*
-dontwarn de.robv.android.xposed.**

# 抖音
-dontwarn com.ss.android.ugc.aweme.app.host.AwemeHostApplication
-dontwarn com.ss.android.ugc.aweme.base.model.UrlModel
-dontwarn com.ss.android.ugc.aweme.comment.ui.GifEmojiDetailActivity
-dontwarn com.ss.android.ugc.aweme.detail.ui.DetailActivity
-dontwarn com.ss.android.ugc.aweme.emoji.model.Emoji
-dontwarn com.ss.android.ugc.aweme.emoji.similaremoji.EmojiDetailDialogNew
-dontwarn com.ss.android.ugc.aweme.emoji.store.view.EmojiBottomSheetDialog
-dontwarn com.ss.android.ugc.aweme.emoji.views.EmojiDetailDialog
-dontwarn com.ss.android.ugc.aweme.feed.model.Aweme
-dontwarn com.ss.android.ugc.aweme.feed.model.Video
-dontwarn com.ss.android.ugc.aweme.feed.model.VideoUrlModel
-dontwarn com.ss.android.ugc.aweme.homepage.ui.view.MainFlippableViewPager
-dontwarn com.ss.android.ugc.aweme.homepage.ui.view.MainTabStripScrollView
-dontwarn com.ss.android.ugc.aweme.kiwi.model.QModel
-dontwarn com.ss.android.ugc.aweme.main.MainActivity
-dontwarn com.ss.android.ugc.aweme.music.model.Music
-dontwarn com.ss.android.ugc.aweme.profile.model.User
-dontwarn com.ss.ugc.aweme.ImageUrlStruct
-dontwarn org.bouncycastle.jsse.BCSSLParameters
-dontwarn org.bouncycastle.jsse.BCSSLSocket
-dontwarn org.bouncycastle.jsse.provider.BouncyCastleJsseProvider
-dontwarn org.conscrypt.Conscrypt$Version
-dontwarn org.conscrypt.Conscrypt
-dontwarn org.conscrypt.ConscryptHostnameVerifier
-dontwarn org.openjsse.javax.net.ssl.SSLParameters
-dontwarn org.openjsse.javax.net.ssl.SSLSocket
-dontwarn org.openjsse.net.ssl.OpenJSSE

# 模块核心
-keepclassmembers class com.freegang.xpler.core.** { *; }
-keepclassmembers class * {
Expand Down
6 changes: 4 additions & 2 deletions app/src/main/assets/update.log
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,7 @@ v1.1.0
适配列表仅作为参考,请自行测试各项功能

v1.1.1
修复私信页顶部被重构
长按表情保存时只震动一次
增加视频/图文下载时自定义文件名
增加首页视频清爽模式
增加震动反馈开关
修复部分页面顶部仍被重构
55 changes: 49 additions & 6 deletions app/src/main/java/com/freegang/fplus/activity/HomeActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,39 @@ import androidx.activity.compose.setContent
import androidx.activity.viewModels
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.*
import androidx.compose.foundation.ExperimentalFoundationApi
import androidx.compose.foundation.clickable
import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.layout.*
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
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.wrapContentSize
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.rememberScrollState
import androidx.compose.foundation.text.BasicTextField
import androidx.compose.material.*
import androidx.compose.runtime.*
import androidx.compose.foundation.verticalScroll
import androidx.compose.material.CircularProgressIndicator
import androidx.compose.material.Icon
import androidx.compose.material.Scaffold
import androidx.compose.material.Switch
import androidx.compose.material.SwitchDefaults
import androidx.compose.material.Text
import androidx.compose.material.TopAppBar
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.State
import androidx.compose.runtime.getValue
import androidx.compose.runtime.livedata.observeAsState
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.rotate
Expand All @@ -28,7 +53,9 @@ import com.freegang.fplus.FreedomTheme
import com.freegang.fplus.R
import com.freegang.fplus.Themes
import com.freegang.fplus.asDp
import com.freegang.fplus.component.*
import com.freegang.fplus.component.FCard
import com.freegang.fplus.component.FCardBorder
import com.freegang.fplus.component.FMessageDialog
import com.freegang.fplus.resource.StringRes
import com.freegang.fplus.viewmodel.HomeVM
import com.freegang.xpler.HookStatus
Expand Down Expand Up @@ -135,7 +162,7 @@ class HomeActivity : ComponentActivity() {
var rotate by remember { mutableStateOf(0f) }
val rotateAnimate by animateFloatAsState(
targetValue = rotate,
animationSpec = tween(durationMillis = Random.nextInt(500, 1500))
animationSpec = tween(durationMillis = Random.nextInt(500, 1500)),
)

//更新日志弹窗
Expand Down Expand Up @@ -276,6 +303,7 @@ class HomeActivity : ComponentActivity() {
if (version != null) {
val version = version!!
if (version.name.compareTo("v${application.appVersionName}") >= 1 && showNewVersionDialog) {

FMessageDialog(
title = "发现新版本 ${version.name}!",
confirm = "确定",
Expand Down Expand Up @@ -509,13 +537,28 @@ class HomeActivity : ComponentActivity() {
model.changeIsEmoji(it)
}
)
SwitchItem(
text = "震动反馈",
checked = model.isVibrate.observeAsState(false),
onCheckedChange = {
model.changeIsVibrate(it)
}
)
SwitchItem(
text = "首页控件半透明",
checked = model.isTranslucent.observeAsState(false),
onCheckedChange = {
model.changeIsTranslucent(it)
}
)
SwitchItem(
text = "清爽模式",
subtext = "开启后首页长按视频进入清爽模式",
checked = model.isNeat.observeAsState(false),
onCheckedChange = {
model.changeIsNeat(it)
}
)
SwitchItem(
text = "通知栏下载",
subtext = "开启通知栏下载, 否则将显示下载弹窗",
Expand Down
28 changes: 24 additions & 4 deletions app/src/main/java/com/freegang/fplus/viewmodel/HomeVM.kt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import com.freegang.config.VersionConfig
import com.freegang.webdav.WebDav
import com.freegang.xpler.utils.app.appVersionCode
import com.freegang.xpler.utils.app.appVersionName
import com.freegang.xpler.utils.io.KFileUtils.child
import com.freegang.xpler.utils.io.child
import com.freegang.xpler.utils.io.storageRootFile
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
Expand All @@ -36,9 +36,15 @@ class HomeVM(application: Application) : AppVM(application) {
private var _isEmoji = MutableLiveData(false)
val isEmoji: LiveData<Boolean> = _isEmoji

private var _isVibrate = MutableLiveData(false)
val isVibrate: LiveData<Boolean> = _isVibrate

private var _isTranslucent = MutableLiveData(false)
val isTranslucent: LiveData<Boolean> = _isTranslucent

private var _isNeat = MutableLiveData(false)
val isNeat: LiveData<Boolean> = _isNeat

private var _isNotification = MutableLiveData(false)
val isNotification: LiveData<Boolean> = _isNotification

Expand Down Expand Up @@ -88,7 +94,9 @@ class HomeVM(application: Application) : AppVM(application) {
changeIsOwnerDir(config.isOwnerDir)
changeIsDownload(config.isDownload)
changeIsEmoji(config.isEmoji)
changeIsVibrate(config.isVibrate)
changeIsTranslucent(config.isTranslucent)
changeIsNeat(config.isNeat)
changeIsNotification(config.isNotification)
changeIsWebDav(config.isWebDav)
setWebDavConfig(config.webDavHost, config.webDavUsername, config.webDavPassword)
Expand All @@ -115,12 +123,24 @@ class HomeVM(application: Application) : AppVM(application) {
config.isEmoji = value
}

// 震动反馈保存
fun changeIsVibrate(value: Boolean) {
_isVibrate.value = value
config.isVibrate = value
}

// 首页控件半透明
fun changeIsTranslucent(value: Boolean) {
_isTranslucent.value = value
config.isTranslucent = value
}

// 清爽模式
fun changeIsNeat(value: Boolean) {
_isNeat.value = value
config.isNeat = value
}

// 是否通知栏下载
fun changeIsNotification(value: Boolean) {
_isNotification.value = value
Expand Down Expand Up @@ -160,9 +180,7 @@ class HomeVM(application: Application) : AppVM(application) {
val username = webDavUsername.value ?: return false
val password = webDavPassword.value ?: return false

if (host.isBlank() or username.isBlank() or password.isBlank()) return false

return true
return !(host.isBlank() or username.isBlank() or password.isBlank())
}

// 保存WebDav配置
Expand Down Expand Up @@ -194,7 +212,9 @@ class HomeVM(application: Application) : AppVM(application) {
config.isOwnerDir = isOwnerDir.value ?: false
config.isDownload = isDownload.value ?: false
config.isEmoji = isEmoji.value ?: false
config.isVibrate = isVibrate.value ?: false
config.isTranslucent = isTranslucent.value ?: false
config.isNeat = isNeat.value ?: false
config.isNotification = isNotification.value ?: false
config.isWebDav = isWebDav.value ?: false
config.webDavHost = webDavHost.value ?: ""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import java.util.List;

public class Aweme {
public abstract class Aweme {
public String aid;

public User author;
Expand Down Expand Up @@ -36,4 +36,63 @@ public class Aweme {
public Aweme() {
throw new RuntimeException("sub!");
}

// sub methods

// this.externalType == 1 || this.awemeType == 107
public abstract boolean isAwemeFromXiGua();

// this.awemeType == 122
public abstract boolean isCloseMoment();

// this.awemeType != 127 && this.awemeType != 128
public abstract boolean isCopyRightLongVideo();

// this.awemeType == 115
public abstract boolean isExplainReplay();

// this.awemeType == 13
public abstract boolean isForwardAweme();

// this.awemeType == 104
public abstract boolean isHotSpotRankCard();

// this.awemeType == 2
public abstract boolean isImage();

// this.awemeType == 101
public abstract boolean isLive();

// this.awemeType == 68
public abstract boolean isMultiImage();

// this.awemeType == 117
public abstract boolean isMusicVideo();

// this.awemeType == 3002
public abstract boolean isPoiOperate();

// this.awemeType == 112
public abstract boolean isProductCard();

// this.awemeType == 33 || this.adAwemeSource == 1
public abstract boolean isUserPost();

// this.awemeType == 105
public abstract boolean isVS();

// this.awemeType == 1 || this.awemeType == 29 || this.awemeType == 30 || this.awemeType == 32 || this.awemeType == 33 || this.awemeType == 201
public abstract boolean commerceVideoTypeAllowDuetReact();

// this.awemeType == 140
public abstract boolean isLifeSpuCard();

// this.awemeType != 0 && this.awemeType != 51 && this.awemeType != 52 && this.awemeType != 58 && this.awemeType != 54 && this.awemeType != 53 && this.awemeType != 61 && this.awemeType != 109 && this.awemeType != 55 && this.awemeType != 56 && this.awemeType != 62 && this.awemeType != 66 && this.awemeType != 67 && !commerceVideoTypeAllowDuetReact() && this.awemeType != 110 && this.awemeType != 117 && this.awemeType != 118 && this.awemeType != 68 && this.awemeType != 122
public abstract boolean canDuetVideoType();

// this.awemeType != 52 && this.awemeType != 0 && this.awemeType != 51 && this.awemeType != 58 && this.awemeType != 54 && this.awemeType != 53 && this.awemeType != 61 && this.awemeType != 109 && this.awemeType != 55 && this.awemeType != 56 && this.awemeType != 62 && this.awemeType != 66 && this.awemeType != 67 && !commerceVideoTypeAllowDuetReact() && this.awemeType != 110 && this.awemeType != 118
public abstract boolean canReactVideoType();

// this.awemeType != 0 && this.awemeType != 51 && this.awemeType != 52 && this.awemeType != 54 && this.awemeType != 53 && this.awemeType != 61 && this.awemeType != 109 && this.awemeType != 55 && this.awemeType != 56 && this.awemeType != 62 && this.awemeType != 66 && this.awemeType != 67 && !commerceVideoTypeAllowDuetReact() && this.awemeType != 110
public abstract boolean canStitchVideoType();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
package com.ss.android.ugc.aweme.kiwi.model;

public class QModel {
}
2 changes: 1 addition & 1 deletion core/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ dependencies {
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.4'

implementation project(":webdav")
implementation 'org.luckypray:DexKit:1.1.4'
implementation 'org.luckypray:DexKit:1.1.6'
}
Loading

0 comments on commit f977c2e

Please sign in to comment.