mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2026-02-03 18:07:57 +01:00
Sign MacOS Server JAR for Notarization (#15)
* Initial test to sign a server jar for noterization * Update README and Build.yml * Remove no Tachidesk jar error
This commit is contained in:
@@ -45,12 +45,12 @@ class ServerService @Inject constructor(
|
||||
}
|
||||
|
||||
@Throws(IOException::class)
|
||||
private fun copyJar(jarFile: File): Boolean {
|
||||
return javaClass.getResourceAsStream("/Tachidesk.jar")?.buffered()?.use { input ->
|
||||
private fun copyJar(jarFile: File) {
|
||||
javaClass.getResourceAsStream("/Tachidesk.jar")?.buffered()?.use { input ->
|
||||
jarFile.outputStream().use { output ->
|
||||
input.copyTo(output)
|
||||
}
|
||||
}?.let { true } ?: false
|
||||
}
|
||||
}
|
||||
|
||||
private fun getJavaFromPath(javaPath: File): String? {
|
||||
@@ -108,9 +108,7 @@ class ServerService @Inject constructor(
|
||||
val jarFile = File(userDataDir, "Tachidesk.jar")
|
||||
if (!jarFile.exists()) {
|
||||
info { "Copying server to resources" }
|
||||
if (withIOContext { !copyJar(jarFile) }) {
|
||||
initialized.value = ServerResult.NO_TACHIDESK_JAR
|
||||
}
|
||||
withIOContext { copyJar(jarFile) }
|
||||
} else {
|
||||
try {
|
||||
val jarVersion = withIOContext {
|
||||
@@ -121,9 +119,7 @@ class ServerService @Inject constructor(
|
||||
|
||||
if (jarVersion != BuildConfig.TACHIDESK_SP_VERSION) {
|
||||
info { "Updating server file from resources" }
|
||||
if (withIOContext { !copyJar(jarFile) }) {
|
||||
initialized.value = ServerResult.NO_TACHIDESK_JAR
|
||||
}
|
||||
withIOContext { copyJar(jarFile) }
|
||||
}
|
||||
} catch (e: IOException) {
|
||||
error(e) {
|
||||
|
||||
@@ -139,16 +139,10 @@ fun main() {
|
||||
ServerResult.STARTED, ServerResult.UNUSED -> {
|
||||
MainMenu(rootBundle)
|
||||
}
|
||||
ServerResult.STARTING, ServerResult.FAILED, ServerResult.NO_TACHIDESK_JAR -> {
|
||||
ServerResult.STARTING, ServerResult.FAILED -> {
|
||||
LoadingScreen(
|
||||
initialized == ServerResult.STARTING,
|
||||
errorMessage = stringResource(
|
||||
if (initialized == ServerResult.NO_TACHIDESK_JAR) {
|
||||
"tachidesk_doesnt_exist"
|
||||
} else {
|
||||
"unable_to_start_server"
|
||||
}
|
||||
),
|
||||
errorMessage = stringResource("unable_to_start_server"),
|
||||
retryMessage = stringResource("action_start_anyway"),
|
||||
retry = serverService::startAnyway
|
||||
)
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
<string name="app_name">TachideskJUI</string>
|
||||
|
||||
<!-- Main Menu -->
|
||||
<string name="tachidesk_doesnt_exist">Tachidesk JAR does not exist, run Tachidesk yourself</string>
|
||||
<string name="unable_to_start_server">Cannot start server</string>
|
||||
|
||||
<!-- Actions -->
|
||||
|
||||
Reference in New Issue
Block a user