From a7c1cbba51630def769864b040db6da21509dad4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A7=92=E7=A0=82=E7=B3=96?= <90336521+lings03@users.noreply.github.com> Date: Sat, 21 Dec 2024 04:58:45 +0800 Subject: [PATCH] Update dependency * Update softprops/action-gh-release action to v2.2.0 (#103) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update all non-major dependencies (#104) Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> * Update dependency * Update dependency * Update dependency gradle to v8.12 * Update dependency * Update dependency * Update dependency * Update dependency * Update dependency * Update dependency * Update dependency --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- app/build.gradle.kts | 14 +++-------- .../ui/viewmodel/ConsoleViewModel.kt | 2 -- .../modmanager/ui/viewmodel/ModViewModel.kt | 23 ++++-------------- build.gradle.kts | 24 ++++++++++++------- gradle/libs.versions.toml | 19 ++++++++------- gradle/wrapper/gradle-wrapper.properties | 2 +- gradlew | 3 +-- settings.gradle.kts | 18 +------------- 9 files changed, 37 insertions(+), 70 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e2a37ea..12ef982 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,7 +56,7 @@ jobs: run: ls -R app/build/outputs/apk/release/ - name: Create Release - uses: softprops/action-gh-release@v2.1.0 + uses: softprops/action-gh-release@v2.2.0 if: startsWith(github.ref, 'refs/tags/') with: tag_name: ${{ github.ref_name }} diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 04400df..7cbbcb0 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -34,6 +34,8 @@ android { namespace = "top.laoxin.modmanager" compileSdk = 35 + ndkVersion = "28.0.12433566 rc1" + defaultConfig { applicationId = "com.mod.manager" minSdk = 28 @@ -51,16 +53,6 @@ android { abiFilters.addAll(supportedAbis) debugSymbolLevel = "FULL" } - - externalNativeBuild { - ndkBuild { - arguments += arrayOf( - "-DANDROID_STL=none", - "-DCMAKE_CXX_STANDARD=23", - "-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON", - ) - } - } } buildTypes { @@ -91,6 +83,7 @@ android { buildConfig = true compose = true aidl = true + viewBinding = true } composeOptions { @@ -119,7 +112,6 @@ kotlin { "-Xjvm-default=all", "-Xcontext-receivers", "-Xwhen-guards", - "-opt-in=androidx.compose.foundation.layout.ExperimentalLayoutApi", "-opt-in=androidx.compose.material3.ExperimentalMaterial3Api", "-opt-in=androidx.compose.ui.ExperimentalComposeUiApi", diff --git a/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ConsoleViewModel.kt b/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ConsoleViewModel.kt index 11e4d6c..3fd5fbb 100644 --- a/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ConsoleViewModel.kt +++ b/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ConsoleViewModel.kt @@ -12,7 +12,6 @@ import android.os.Build import android.os.Bundle import android.os.FileObserver import android.util.Log -import androidx.annotation.RequiresApi import androidx.compose.runtime.getValue import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.setValue @@ -59,7 +58,6 @@ import top.laoxin.modmanager.userservice.gamestart.ProjectSnowStartService import top.lings.updater.Updater import java.io.File - class ConsoleViewModel( private val userPreferencesRepository: UserPreferencesRepository, private val modRepository: ModRepository, diff --git a/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ModViewModel.kt b/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ModViewModel.kt index f46888b..1e70c45 100644 --- a/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ModViewModel.kt +++ b/app/src/main/kotlin/top/laoxin/modmanager/ui/viewmodel/ModViewModel.kt @@ -56,10 +56,10 @@ class ModViewModel( private val backupRepository: BackupRepository ) : ViewModel(), ProgressUpdateListener, FlashObserverInterface { private val _uiState = MutableStateFlow(ModUiState()) -// val uiState: StateFlow = _uiState.asStateFlow() + // val uiState: StateFlow = _uiState.asStateFlow() // 搜索框内容 - //private val _searchText = mutableStateOf("") + // private val _searchText = mutableStateOf("") private var _requestPermissionPath by mutableStateOf("") val requestPermissionPath: String @@ -76,13 +76,11 @@ class ModViewModel( // 当前的虚拟路径 private var _currentPath by mutableStateOf("") - //当前研所包的文件列表 + // 当前研所包的文件列表 private var _currentFiles by mutableStateOf(emptyList()) - // mod列表 - // 扫描mod目录列表 // 从用户配置中读取mod目录 companion object { @@ -120,8 +118,7 @@ class ModViewModel( // 用户提示 private val userTips = userPreferencesRepository.getPreferenceFlow("USER_TIPS", true) - - // 选择游戏` + // 选择游戏 private val selectedGame = userPreferencesRepository.getPreferenceFlow("SELECTED_GAME", 0) // 扫描文件夹中的Mods @@ -158,7 +155,6 @@ class ModViewModel( viewModelScope, SharingStarted.WhileSubscribed(5000), UserPreferencesState() ) - val uiState: StateFlow = combine( userTips, _uiState ) { userTips, uiState -> @@ -167,7 +163,6 @@ class ModViewModel( viewModelScope, SharingStarted.WhileSubscribed(5000), ModUiState() ) - init { Log.d("ModViewModel", "init: 初始化${userPreferences.value}") //checkPermission() @@ -184,10 +179,7 @@ class ModViewModel( // 设置当前的视图 upDateCurrentModsView(it) } - } - - } private fun upDateCurrentModsView(it: UserPreferencesState) { @@ -1026,7 +1018,6 @@ class ModViewModel( private fun getArchiveFiles(path: String) { _currentZipPath = path // 读取压缩包文件 - val fileHeaders = ArchiveUtil.listInArchiveFiles(path) // 拼接路径 val files = fileHeaders.map { @@ -1056,10 +1047,8 @@ class ModViewModel( _uiState.update { it -> it.copy(currentFiles = _currentFiles.filter { it.parent == currentPath }) } } } - ///storage/emulated/0/Download/Mods/com.megagame.crosscore/圣歌.7z/圣歌 桃色乐境透 } - fun getModsByVirtualPathsStrict(path: String): List { return _uiState.value.modList.filter { it.virtualPaths == path } } @@ -1073,8 +1062,4 @@ class ModViewModel( it.copy(currentMods = mods) } } - - } - - diff --git a/build.gradle.kts b/build.gradle.kts index 23b23f8..f816839 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -2,25 +2,33 @@ plugins { alias(libs.plugins.androidApplication) apply false alias(libs.plugins.jetbrainsKotlinAndroid) apply false - // id("com.android.library") version "8.1.4" apply false + // id("com.android.library") version "8.1.4" apply false } buildscript { - extra.apply { set("room_version", "2.6.0") } - /* dependencies { - val kotlin_version - classpath ("org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version") + /* dependencies { + val kotlin_version + classpath ("org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version") }*/ dependencies { classpath(libs.okhttp3.okhttp) } - repositories{ + repositories { + google() + mavenCentral() + gradlePluginPortal() maven { url = uri("https://jitpack.io") } } - } - +allprojects { + repositories { + google() + mavenCentral() + gradlePluginPortal() + maven { url = uri("https://jitpack.io") } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6f6a321..60322b7 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,6 +1,7 @@ [versions] accompanistPager = "0.36.0" -accompanistPermissions = "0.36.0" +accompanistPermissions = "0.37.0" +accompanistSystemuicontroller = "0.36.0" agp = "8.7.3" shizuku = "13.1.5" coilCompose = "2.7.0" @@ -16,8 +17,8 @@ junit = "4.13.2" kotlinxSerializationJson = "1.7.3" activityCompose = "1.9.3" lifecycleViewmodelCompose = "2.8.7" -navigationCompose = "2.8.4" -navigationRuntimeKtx = "2.8.4" +navigationCompose = "2.8.5" +navigationRuntimeKtx = "2.8.5" okhttpVersion = "4.12.0" provider = "13.1.5" retrofit = "2.11.0" @@ -29,18 +30,18 @@ xz = "1.10" xZipJbindingXandroid = "Release-16.02-2.02" zip4j = "2.11.5" roomVersion = "2.6.1" -desugar = "2.1.3" +desugar = "2.1.4" serialization = "2.1.0" ksp = "2.1.0-1.0.29" -androidxRuntimeLivedata = "1.7.5" -androidxRuntimeRxjava2 = "1.7.5" -composeBom = "2024.11.00" -uiTestManifest = "1.7.5" +androidxRuntimeLivedata = "1.7.6" +androidxRuntimeRxjava2 = "1.7.6" +composeBom = "2024.12.01" +uiTestManifest = "1.7.6" [libraries] accompanist-pager = { module = "com.google.accompanist:accompanist-pager", version.ref = "accompanistPager" } accompanist-permissions = { module = "com.google.accompanist:accompanist-permissions", version.ref = "accompanistPermissions" } -accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanistPermissions" } +accompanist-systemuicontroller = { module = "com.google.accompanist:accompanist-systemuicontroller", version.ref = "accompanistSystemuicontroller" } androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" } androidx-navigation-runtime-ktx = { group = "androidx.navigation", name = "navigation-runtime-ktx", version.ref = "navigationRuntimeKtx" } androidx-rules = { group = "androidx.test", name = "rules", version.ref = "rules" } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index e2847c8..cea7a79 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index f5feea6..f3b75f3 100644 --- a/gradlew +++ b/gradlew @@ -86,8 +86,7 @@ done # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} # Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) -APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s -' "$PWD" ) || exit +APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/settings.gradle.kts b/settings.gradle.kts index 5b04252..2b8d4d8 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,27 +1,11 @@ pluginManagement { - repositories { - // maven { url = uri("https://jitpack.io") } - google { - content { - includeGroupByRegex("com\\.android.*") - includeGroupByRegex("com\\.google.*") - includeGroupByRegex("androidx.*") - } - } - mavenCentral() - gradlePluginPortal() - - } -} -dependencyResolutionManagement { - repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() + gradlePluginPortal() maven { url = uri("https://jitpack.io") } } } rootProject.name = "Mod Manager" include(":app") - \ No newline at end of file