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

Commit

Permalink
fix: 版本为null
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Jan 11, 2024
1 parent 4f1953b commit 23ba5ec
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 28 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Release

on:
push:
branches:
- "master"
paths:
- "CHANGELOG.md"
workflow_dispatch:

jobs:
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
[自动同步AList] v3.30.0
修复:版本为null
新增:内置网页
7 changes: 4 additions & 3 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
}
Expand All @@ -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"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ class MainActivity : BaseComposeActivity() {
super.onCreate(savedInstanceState)

lifecycleScope.launch {
if (AppConfig.isFirstRun)
killBattery()
ShortCuts.buildShortCuts(this@MainActivity)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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)
Expand Down

0 comments on commit 23ba5ec

Please sign in to comment.