mirror of
https://github.com/mihonapp/mihon.git
synced 2025-06-26 19:17:51 +02:00
Add files for new action, should allow automatic updating when finished
This commit is contained in:
@ -26,4 +26,7 @@ interface GithubService {
|
||||
|
||||
@GET("/repos/jobobby04/tachiyomiSY/releases/latest")
|
||||
suspend fun getLatestVersion(): GithubRelease
|
||||
|
||||
@GET("/repos/jobobby04/TachiyomiSYPrieview/releases/latest")
|
||||
suspend fun getLatestDebugVersion(): GithubRelease
|
||||
}
|
||||
|
@ -3,17 +3,22 @@ package eu.kanade.tachiyomi.data.updater.github
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.data.updater.UpdateChecker
|
||||
import eu.kanade.tachiyomi.data.updater.UpdateResult
|
||||
import exh.syDebugVersion
|
||||
|
||||
class GithubUpdateChecker : UpdateChecker() {
|
||||
class GithubUpdateChecker(val debug: Boolean = false) : UpdateChecker() {
|
||||
|
||||
private val service: GithubService = GithubService.create()
|
||||
|
||||
override suspend fun checkForUpdate(): UpdateResult {
|
||||
val release = service.getLatestVersion()
|
||||
val release = if (syDebugVersion != "0") {
|
||||
service.getLatestDebugVersion()
|
||||
} else {
|
||||
service.getLatestVersion()
|
||||
}
|
||||
|
||||
val newVersion = release.version
|
||||
// Check if latest version is different from current version
|
||||
return if (newVersion != BuildConfig.VERSION_NAME) {
|
||||
return if ((newVersion != BuildConfig.VERSION_NAME && (syDebugVersion != "0")) || ((syDebugVersion != "0") && newVersion != syDebugVersion)) {
|
||||
GithubUpdateResult.NewUpdate(release)
|
||||
} else {
|
||||
GithubUpdateResult.NoNewUpdate()
|
||||
|
@ -9,6 +9,7 @@ import com.afollestad.materialdialogs.customview.customView
|
||||
import eu.kanade.tachiyomi.BuildConfig
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.ui.base.controller.DialogController
|
||||
import exh.syDebugVersion
|
||||
import it.gmariotti.changelibs.library.view.ChangeLogRecyclerView
|
||||
|
||||
class ChangelogDialogController : DialogController() {
|
||||
@ -17,7 +18,7 @@ class ChangelogDialogController : DialogController() {
|
||||
val activity = activity!!
|
||||
val view = WhatsNewRecyclerView(activity)
|
||||
return MaterialDialog(activity)
|
||||
.title(res = if (BuildConfig.DEBUG) R.string.notices else R.string.changelog)
|
||||
.title(res = if (BuildConfig.DEBUG || syDebugVersion != "0") R.string.notices else R.string.changelog)
|
||||
.customView(view = view)
|
||||
.positiveButton(R.string.action_close)
|
||||
}
|
||||
@ -26,7 +27,7 @@ class ChangelogDialogController : DialogController() {
|
||||
override fun initAttrs(attrs: AttributeSet?, defStyle: Int) {
|
||||
mRowLayoutId = R.layout.changelog_row_layout
|
||||
mRowHeaderLayoutId = R.layout.changelog_header_layout
|
||||
mChangeLogFileResourceId = if (BuildConfig.DEBUG) R.raw.changelog_debug else R.raw.changelog_release
|
||||
mChangeLogFileResourceId = if (BuildConfig.DEBUG || syDebugVersion != "0") R.raw.changelog_debug else R.raw.changelog_release
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,7 @@ import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
import eu.kanade.tachiyomi.util.system.copyToClipboard
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import exh.syDebugVersion
|
||||
import java.text.DateFormat
|
||||
import java.text.ParseException
|
||||
import java.text.SimpleDateFormat
|
||||
@ -52,8 +53,8 @@ class AboutController : SettingsController() {
|
||||
|
||||
preference {
|
||||
titleRes = R.string.version
|
||||
summary = if (BuildConfig.DEBUG) {
|
||||
"Preview r${BuildConfig.COMMIT_COUNT} (${BuildConfig.COMMIT_SHA})"
|
||||
summary = if (syDebugVersion != "0") {
|
||||
"Preview r${syDebugVersion} (${BuildConfig.COMMIT_SHA})"
|
||||
} else {
|
||||
"Stable ${BuildConfig.VERSION_NAME}"
|
||||
}
|
||||
|
@ -19,8 +19,6 @@ import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
import exh.ui.lock.FingerLockPreference
|
||||
import exh.ui.lock.LockPreference
|
||||
import kotlinx.coroutines.flow.launchIn
|
||||
|
||||
class SettingsGeneralController : SettingsController() {
|
||||
@ -206,7 +204,7 @@ class SettingsGeneralController : SettingsController() {
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
preferenceCategory {
|
||||
/*preferenceCategory {
|
||||
title = "Application lock"
|
||||
|
||||
LockPreference(context).apply {
|
||||
@ -244,7 +242,7 @@ class SettingsGeneralController : SettingsController() {
|
||||
titleRes = R.string.hide_notification_content
|
||||
defaultValue = false
|
||||
}
|
||||
}
|
||||
}*/
|
||||
// <-- EXH
|
||||
}
|
||||
}
|
||||
|
1
app/src/main/java/exh/Version.kt
Normal file
1
app/src/main/java/exh/Version.kt
Normal file
@ -0,0 +1 @@
|
||||
package exh const val syDebugVersion: String = "0"
|
Reference in New Issue
Block a user