1
0

fix(MainActivity.kt): update resVersionText
Some checks failed
Android CI / build (push) Has been cancelled

This commit is contained in:
Natsu 2024-07-02 16:48:52 +07:00
parent 265d8dc9ca
commit 95b78be2eb
Signed by: NatsumeLS
GPG Key ID: 6DB67FB460CF46C6

View File

@ -14,6 +14,7 @@ import androidx.compose.runtime.State
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.lifecycle.ViewModelProvider import androidx.lifecycle.ViewModelProvider
import io.github.chinosk.gakumas.localify.hookUtils.FileHotUpdater import io.github.chinosk.gakumas.localify.hookUtils.FileHotUpdater
import io.github.chinosk.gakumas.localify.hookUtils.FilesChecker
import io.github.chinosk.gakumas.localify.hookUtils.MainKeyEventDispatcher import io.github.chinosk.gakumas.localify.hookUtils.MainKeyEventDispatcher
import io.github.chinosk.gakumas.localify.mainUtils.json import io.github.chinosk.gakumas.localify.mainUtils.json
import io.github.chinosk.gakumas.localify.models.GakumasConfig import io.github.chinosk.gakumas.localify.models.GakumasConfig
@ -72,7 +73,8 @@ class MainActivity : ComponentActivity(), ConfigUpdateListener, IConfigurableAct
var resVersionText = "unknown" var resVersionText = "unknown"
try { try {
resVersionText = programConfigViewModel.localResourceVersion.value val stream = assets.open("${FilesChecker.localizationFilesDir}/version.txt")
resVersionText = FilesChecker.convertToString(stream)
val packInfo = packageManager.getPackageInfo(packageName, 0) val packInfo = packageManager.getPackageInfo(packageName, 0)
val version = packInfo.versionName val version = packInfo.versionName