Skip to content

Commit 5ca68f0

Browse files
authored
Merge pull request #1215 from ZalithLauncher/main
merge main
2 parents f92cb37 + ea5c0fe commit 5ca68f0

29 files changed

Lines changed: 1458 additions & 320 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,6 @@ This software uses the following open source libraries:
9393
| proxy-client-android | - | LGPL-3.0 License | [Link](https://github.com/TouchController/TouchController) |
9494
| Reorderable | Copyright © 2023 Calvin Liang | Apache 2.0 | [Link](https://github.com/Calvin-LL/Reorderable) |
9595
| skinview3d | Copyright © 2014-2018 Kent Rasmussen; Copyright © 2017-2022 Haowei Wen, Sean Boult and contributors | MIT License | [Link](https://github.com/bs-community/skinview3d) |
96+
| sora-editor | Copyright © 1991, 1999 Free Software Foundation, Inc. | LGPL-2.1 License | [Link](https://github.com/Rosemoe/sora-editor) |
9697
| StringFog | Copyright © 2016-2023, Megatron King | Apache 2.0 | [Link](https://github.com/MegatronKing/StringFog) |
9798
| XZ for Java | Copyright © The XZ for Java authors and contributors | 0BSD License | [Link](https://tukaani.org/xz/java.html) |

README_ZH_CN.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ git clone git@github.com:ZalithLauncher/ZalithLauncher2.git
9999
| Process Phoenix | Copyright © 2015 Jake Wharton | Apache 2.0 | [链接](https://github.com/JakeWharton/ProcessPhoenix) |
100100
| proxy-client-android | - | LGPL-3.0 License | [链接](https://github.com/TouchController/TouchController) |
101101
| Reorderable | Copyright © 2023 Calvin Liang | Apache 2.0 | [链接](https://github.com/Calvin-LL/Reorderable) |
102+
| sora-editor | Copyright © 1991, 1999 Free Software Foundation, Inc. | LGPL-2.1 License | [链接](https://github.com/Rosemoe/sora-editor) |
102103
| skinview3d | Copyright © 2014-2018 Kent Rasmussen; Copyright © 2017-2022 Haowei Wen, Sean Boult and contributors | MIT License | [链接](https://github.com/bs-community/skinview3d) |
103104
| StringFog | Copyright © 2016-2023, Megatron King | Apache 2.0 | [链接](https://github.com/MegatronKing/StringFog) |
104105
| XZ for Java | Copyright © The XZ for Java authors and contributors | 0BSD License | [链接](https://tukaani.org/xz/java.html) |

README_ZH_TW.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,6 @@ git clone git@github.com:ZalithLauncher/ZalithLauncher2.git
103103
| proxy-client-android | - | LGPL-3.0 License | [链接](https://github.com/TouchController/TouchController) |
104104
| Reorderable | Copyright © 2023 Calvin Liang | Apache 2.0 | [链接](https://github.com/Calvin-LL/Reorderable) |
105105
| skinview3d | Copyright © 2014-2018 Kent Rasmussen; Copyright © 2017-2022 Haowei Wen, Sean Boult and contributors | MIT License | [链接](https://github.com/bs-community/skinview3d) |
106+
| sora-editor | Copyright © 1991, 1999 Free Software Foundation, Inc. | LGPL-2.1 License | [链接](https://github.com/Rosemoe/sora-editor) |
106107
| StringFog | Copyright © 2016-2023, Megatron King | Apache 2.0 | [链接](https://github.com/MegatronKing/StringFog) |
107108
| XZ for Java | Copyright © The XZ for Java authors and contributors | 0BSD License | [链接](https://tukaani.org/xz/java.html) |

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/context/Contexts.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ import android.content.Intent
2323
import android.net.Uri
2424
import android.provider.DocumentsContract
2525
import android.provider.OpenableColumns
26+
import androidx.annotation.RawRes
2627
import com.movtery.zalithlauncher.path.PathManager
2728
import com.movtery.zalithlauncher.utils.file.ensureParentDirectory
2829
import com.movtery.zalithlauncher.utils.file.readString
@@ -143,4 +144,12 @@ fun Context.writeLocalFile(
143144
contentResolver.openOutputStream(newFileUri, "wt")?.use { out ->
144145
FileUtils.copyFile(inputFile, out)
145146
}
147+
}
148+
149+
fun Context.readRawContent(
150+
@RawRes raw: Int
151+
): String {
152+
return resources.openRawResource(raw)
153+
.bufferedReader()
154+
.readText()
146155
}

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/game/launch/GameLauncher.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import com.movtery.zalithlauncher.game.plugin.renderer.RendererPluginManager
4242
import com.movtery.zalithlauncher.game.renderer.Renderers
4343
import com.movtery.zalithlauncher.game.support.touch_controller.ControllerProxy
4444
import com.movtery.zalithlauncher.game.version.installed.Version
45+
import com.movtery.zalithlauncher.game.version.installed.VersionsManager
4546
import com.movtery.zalithlauncher.game.version.installed.getGameManifest
4647
import com.movtery.zalithlauncher.game.versioninfo.models.GameManifest
4748
import com.movtery.zalithlauncher.path.LibPath
@@ -137,7 +138,7 @@ class GameLauncher(
137138
return version.getGameDir().absolutePath
138139
}
139140

140-
override fun getLogName(): String = LogName.GAME.fileName
141+
override fun getLogFile(): File = VersionsManager.getLatestLog(version)
141142

142143
override fun initEnv(screenSize: IntSize): MutableMap<String, String> {
143144
val envMap = super.initEnv(screenSize)

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/game/launch/JvmLauncher.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ open class JvmLauncher(
7070
return getGameHome()
7171
}
7272

73-
override fun getLogName(): String = LogName.JVM.fileName
73+
override fun getLogFile(): File = File(
74+
PathManager.DIR_FILES_EXTERNAL, LogName.JVM.fileName
75+
)
7476

7577
private fun getStartupNeeded(
7678
screenSize: IntSize

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/game/launch/Launcher.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ abstract class Launcher(
6868

6969
abstract suspend fun launch(screenSize: IntSize): Int
7070
abstract fun chdir(): String
71-
abstract fun getLogName(): String
71+
abstract fun getLogFile(): File
7272
abstract fun exit()
7373

7474
protected suspend fun launchJvm(

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/game/launch/LogName.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@
1919
package com.movtery.zalithlauncher.game.launch
2020

2121
enum class LogName(val fileName: String) {
22-
GAME("latest_game"),
23-
JVM("latest_jvm")
22+
GAME("latest_game.log"),
23+
JVM("latest_jvm.log")
2424
}

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/game/version/installed/VersionsManager.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818

1919
package com.movtery.zalithlauncher.game.version.installed
2020

21+
import com.movtery.zalithlauncher.game.launch.LogName
2122
import com.movtery.zalithlauncher.game.path.getVersionsHome
2223
import com.movtery.zalithlauncher.game.version.installed.utils.parseJsonToVersionInfo
2324
import com.movtery.zalithlauncher.info.InfoDistributor
@@ -229,6 +230,11 @@ object VersionsManager {
229230
*/
230231
fun getZalithVersionPath(name: String) = File(getVersionPath(name), InfoDistributor.LAUNCHER_IDENTIFIER)
231232

233+
/**
234+
* @return 游戏的上一次运行日志
235+
*/
236+
fun getLatestLog(version: Version) = File(getZalithVersionPath(version), LogName.GAME.fileName)
237+
232238
/**
233239
* @return 获取当前版本设置的图标
234240
*/

ZalithLauncher/src/main/java/com/movtery/zalithlauncher/library/_Libraries.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ val libraryData = listOf(
5252
LibraryInfo("Coil Gifs", "Copyright © 2025 Coil Contributors", LICENSE_APACHE_2, "https://github.com/coil-kt/coil"),
5353
LibraryInfo("Coil SVG", "Copyright © 2025 Coil Contributors", LICENSE_APACHE_2, "https://github.com/coil-kt/coil"),
5454
LibraryInfo("Fishnet", "Copyright © 2025 Kyant", LICENSE_APACHE_2, "https://github.com/Kyant0/Fishnet"),
55-
LibraryInfo("gl4es_extra_extra", "Copyright (c) 2016-2018 Sebastien Chevalier; Copyright (c) 2013-2016 Ryan Hileman", License(LICENSE_MIT, R.raw.gl4es_license), "https://github.com/PojavLauncherTeam/gl4es_extra_extra"),
55+
LibraryInfo("gl4es_extra_extra", "Copyright © 2016-2018 Sebastien Chevalier; Copyright © 2013-2016 Ryan Hileman", License(LICENSE_MIT, R.raw.gl4es_license), "https://github.com/PojavLauncherTeam/gl4es_extra_extra"),
5656
LibraryInfo("Gson", "Copyright © 2008 Google Inc.", LICENSE_APACHE_2, "https://github.com/google/gson"),
5757
LibraryInfo("kotlinx.coroutines", "Copyright © 2000-2020 JetBrains s.r.o.", LICENSE_APACHE_2, "https://github.com/Kotlin/kotlinx.coroutines"),
5858
LibraryInfo("ktor-client-cio", COPYRIGHT_KTOR, LICENSE_APACHE_2, URL_KTOR),
@@ -67,14 +67,15 @@ val libraryData = listOf(
6767
LibraryInfo("Mesa", "Copyright © The Mesa Authors", License(LICENSE_MIT, R.raw.mesa_license), "https://mesa3d.org/"),
6868
LibraryInfo("MMKV", "Copyright © 2018 THL A29 Limited, a Tencent company.", License(LICENSE_BSD_3_CLAUSE, R.raw.mmkv_license), "https://github.com/Tencent/MMKV"),
6969
LibraryInfo("Navigation 3", COPYRIGHT_AOSP, LICENSE_APACHE_2, "https://developer.android.com/jetpack/androidx/releases/navigation3"),
70-
LibraryInfo("NG-GL4ES", "Copyright (c) 2016-2018 Sebastien Chevalier; Copyright (c) 2013-2016 Ryan Hileman; Copyright (c) 2025-2026 BZLZHH", License(LICENSE_MIT, R.raw.ng_gl4es_license), "https://github.com/BZLZHH/NG-GL4ES"),
70+
LibraryInfo("NG-GL4ES", "Copyright © 2016-2018 Sebastien Chevalier; Copyright © 2013-2016 Ryan Hileman; Copyright © 2025-2026 BZLZHH", License(LICENSE_MIT, R.raw.ng_gl4es_license), "https://github.com/BZLZHH/NG-GL4ES"),
7171
LibraryInfo("OkHttp", "Copyright © 2019 Square, Inc.", LICENSE_APACHE_2, "https://github.com/square/okhttp"),
7272
LibraryInfo("Okio", "Copyright © 2013 Square, Inc.", LICENSE_APACHE_2, "https://square.github.io/okio/"),
7373
LibraryInfo("OpenNBT", "Copyright © 2013-2021 Steveice10.", License(LICENSE_MIT, R.raw.opennbt_license), "https://github.com/GeyserMC/OpenNBT"),
7474
LibraryInfo("Process Phoenix", "Copyright © 2015 Jake Wharton", LICENSE_APACHE_2, "https://github.com/JakeWharton/ProcessPhoenix"),
7575
LibraryInfo("proxy-client-android", null, License(LICENSE_LGPL_3, R.raw.lgpl_3_license), "https://github.com/TouchController/TouchController"),
7676
LibraryInfo("Reorderable", "Copyright © 2023 Calvin Liang", LICENSE_APACHE_2, "https://github.com/Calvin-LL/Reorderable"),
7777
LibraryInfo("skinview3d", "Copyright © 2014-2018 Kent Rasmussen; Copyright © 2017-2022 Haowei Wen, Sean Boult and contributors", License(LICENSE_MIT, R.raw.skinview3d_license), "https://github.com/bs-community/skinview3d"),
78+
LibraryInfo("sora-editor", "Copyright © 1991, 1999 Free Software Foundation, Inc.", License("LGPL-2.1 License", R.raw.sora_editor_license), "https://github.com/Rosemoe/sora-editor"),
7879
LibraryInfo("StringFog", "Copyright © 2016-2023, Megatron King", LICENSE_APACHE_2, "https://github.com/MegatronKing/StringFog"),
7980
LibraryInfo("Terracotta", "Copyright © 2025 Burning_TNT", License(LICENSE_AGPL_3, net.burningtnt.terracotta.R.raw.terracotta_license), "https://github.com/burningtnt/Terracotta"),
8081
LibraryInfo("XZ for Java", "Copyright © The XZ for Java authors and contributors", License("0BSD License", R.raw.xz_java_license), "https://tukaani.org/xz/java.html")

0 commit comments

Comments
 (0)