Skip to content
This repository was archived by the owner on Jan 16, 2024. It is now read-only.

Commit 23ba5ec

Browse files
committed
fix: 版本为null
1 parent 4f1953b commit 23ba5ec

File tree

6 files changed

+15
-28
lines changed

6 files changed

+15
-28
lines changed

.github/workflows/release.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
name: Release
22

33
on:
4+
push:
5+
branches:
6+
- "master"
7+
paths:
8+
- "CHANGELOG.md"
49
workflow_dispatch:
510

611
jobs:

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
[自动同步AList] v3.30.0
1+
修复:版本为null
2+
新增:内置网页

app/build.gradle

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,13 @@ plugins {
77
id("com.mikepenz.aboutlibraries.plugin")
88
}
99

10-
Properties pro = new Properties()
10+
def pro = new Properties()
1111
InputStream input = rootProject.file("local.properties").newDataInputStream()
1212
pro.load(input)
1313
input.close()
1414

15+
def alistVersion = rootProject.file("alist_version").newReader().readLine()
16+
1517
static def releaseTime() {
1618
return new Date().format("yy.MMddHH", TimeZone.getTimeZone("GMT+8"))
1719
}
@@ -34,8 +36,7 @@ android {
3436
arg("room.expandProjection", "true")
3537
}
3638

37-
buildConfigField "String", "ALIST_VERSION", "\"" + pro["ALIST_VERSION"] + "\""
38-
buildConfigField "String", "ALIST_COMMIT_SHA", "\"" + pro["ALIST_COMMIT_SHA"] + "\""
39+
buildConfigField "String", "ALIST_VERSION", "\"" + alistVersion + "\""
3940

4041
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
4142
}

app/src/main/java/com/github/jing332/alistandroid/ui/MainActivity.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,6 @@ class MainActivity : BaseComposeActivity() {
4040
super.onCreate(savedInstanceState)
4141

4242
lifecycleScope.launch {
43-
if (AppConfig.isFirstRun)
44-
killBattery()
4543
ShortCuts.buildShortCuts(this@MainActivity)
4644
}
4745
}

app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AListScreen.kt

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -129,18 +129,9 @@ fun AListScreen() {
129129
topBar = {
130130
TopAppBar(
131131
title = {
132-
val miniSha = remember {
133-
try {
134-
BuildConfig.ALIST_COMMIT_SHA.slice(0..6)
135-
} catch (_: Exception) {
136-
""
137-
}
138-
}
139132
Row {
140133
Text(stringResource(R.string.app_name))
141-
Text(
142-
" - " + miniSha.ifEmpty { BuildConfig.ALIST_VERSION }
143-
)
134+
Text(" - " + BuildConfig.ALIST_VERSION)
144135
}
145136
},
146137
actions = {

app/src/main/java/com/github/jing332/alistandroid/ui/nav/alist/AboutDialog.kt

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,10 @@ fun AboutDialog(onDismissRequest: () -> Unit) {
5858
}
5959

6060
Column {
61-
val miniSha = remember {
62-
try {
63-
BuildConfig.ALIST_COMMIT_SHA.slice(0..6)
64-
} catch (_: Exception) {
65-
""
66-
}
67-
}
6861
SelectionContainer {
6962
Column {
7063
Text("APP - ${BuildConfig.VERSION_NAME}(${BuildConfig.VERSION_CODE})")
71-
Text("AList - ${miniSha.ifBlank { BuildConfig.ALIST_VERSION }}")
64+
Text("AList - ${BuildConfig.ALIST_VERSION}")
7265
}
7366
}
7467
HorizontalDivider(Modifier.padding(vertical = 8.dp))
@@ -85,15 +78,13 @@ fun AboutDialog(onDismissRequest: () -> Unit) {
8578
)
8679
Spacer(modifier = Modifier.height(4.dp))
8780
Text(
88-
"Github - AList (${miniSha.ifBlank { "Release" }})",
81+
"Github - AList (Release)",
8982
color = MaterialTheme.colorScheme.primary,
9083
fontWeight = FontWeight.Bold,
9184
modifier = Modifier
9285
.clickable {
9386
openUrl(
94-
if (BuildConfig.ALIST_COMMIT_SHA.isEmpty())
95-
"https://github.com/alist-org/alist/releases/tag/${BuildConfig.ALIST_VERSION}"
96-
else "https://github.com/alist-org/alist/tree/${BuildConfig.ALIST_COMMIT_SHA}"
87+
"https://github.com/alist-org/alist/releases/tag/${BuildConfig.ALIST_VERSION}"
9788
)
9889
}
9990
.padding(vertical = 8.dp)

0 commit comments

Comments
 (0)