diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 98f08e7..986803e 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -1,6 +1,11 @@ name: Release on: + push: + branches: + - "master" + paths: + - "CHANGELOG.md" workflow_dispatch: jobs: diff --git a/CHANGELOG.md b/CHANGELOG.md index e7b6db2..8e4a87c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1 +1,2 @@ -[自动同步AList] v3.30.0 +修复:版本为null +新增:内置网页 diff --git a/app/build.gradle b/app/build.gradle index d7f0419..33018fc 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,11 +7,13 @@ plugins { id("com.mikepenz.aboutlibraries.plugin") } -Properties pro = new Properties() +def pro = new Properties() InputStream input = rootProject.file("local.properties").newDataInputStream() pro.load(input) input.close() +def alistVersion = rootProject.file("alist_version").newReader().readLine() + static def releaseTime() { return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+8")) } @@ -34,8 +36,7 @@ android { arg("room.expandProjection", "true") } - buildConfigField "String", "ALIST_VERSION", "\"" + pro["ALIST_VERSION"] + "\"" - buildConfigField "String", "ALIST_COMMIT_SHA", "\"" + pro["ALIST_COMMIT_SHA"] + "\"" + buildConfigField "String", "ALIST_VERSION", "\"" + alistVersion + "\"" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } diff --git a/app/src/main/java/com/github/jing332/alistandroid/ui/MainActivity.kt b/app/src/main/java/com/github/jing332/alistandroid/ui/MainActivity.kt index 5c2e919..2f0ed29 100644 --- a/app/src/main/java/com/github/jing332/alistandroid/ui/MainActivity.kt +++ b/app/src/main/java/com/github/jing332/alistandroid/ui/MainActivity.kt @@ -40,8 +40,6 @@ class MainActivity : BaseComposeActivity() { super.onCreate(savedInstanceState) lifecycleScope.launch { - if (AppConfig.isFirstRun) - killBattery() ShortCuts.buildShortCuts(this@MainActivity) } } diff --git a/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AListScreen.kt b/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AListScreen.kt index 56d58c9..a3dc841 100644 --- a/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AListScreen.kt +++ b/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AListScreen.kt @@ -129,18 +129,9 @@ fun AListScreen() { topBar = { TopAppBar( title = { - val miniSha = remember { - try { - BuildConfig.ALIST_COMMIT_SHA.slice(0..6) - } catch (_: Exception) { - "" - } - } Row { Text(stringResource(R.string.app_name)) - Text( - " - " + miniSha.ifEmpty { BuildConfig.ALIST_VERSION } - ) + Text(" - " + BuildConfig.ALIST_VERSION) } }, actions = { diff --git a/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AboutDialog.kt b/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AboutDialog.kt index 8ea8e32..3ca67fb 100644 --- a/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AboutDialog.kt +++ b/app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AboutDialog.kt @@ -58,17 +58,10 @@ fun AboutDialog(onDismissRequest: () -> Unit) { } Column { - val miniSha = remember { - try { - BuildConfig.ALIST_COMMIT_SHA.slice(0..6) - } catch (_: Exception) { - "" - } - } SelectionContainer { Column { Text("APP - ${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})") - Text("AList - ${miniSha.ifBlank { BuildConfig.ALIST_VERSION }}") + Text("AList - ${BuildConfig.ALIST_VERSION}") } } HorizontalDivider(Modifier.padding(vertical = 8.dp)) @@ -85,15 +78,13 @@ fun AboutDialog(onDismissRequest: () -> Unit) { ) Spacer(modifier = Modifier.height(4.dp)) Text( - "Github - AList (${miniSha.ifBlank { "Release" }})", + "Github - AList (Release)", color = MaterialTheme.colorScheme.primary, fontWeight = FontWeight.Bold, modifier = Modifier .clickable { openUrl( - if (BuildConfig.ALIST_COMMIT_SHA.isEmpty()) - "https://github.com/alist-org/alist/releases/tag/${BuildConfig.ALIST_VERSION}" - else "https://github.com/alist-org/alist/tree/${BuildConfig.ALIST_COMMIT_SHA}" + "https://github.com/alist-org/alist/releases/tag/${BuildConfig.ALIST_VERSION}" ) } .padding(vertical = 8.dp)