Skip to content

Commit

Permalink
remove Invalid import
Browse files Browse the repository at this point in the history
  • Loading branch information
chinosk6 committed Jun 29, 2024
1 parent d84ba3d commit c28e05e
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package io.github.chinosk.gakumas.localify

import android.app.Activity
import android.content.Intent
import android.widget.Toast
import androidx.core.content.FileProvider
import io.github.chinosk.gakumas.localify.GakumasHookMain.Companion.showToast
import io.github.chinosk.gakumas.localify.mainUtils.json
import io.github.chinosk.gakumas.localify.models.GakumasConfig
import io.github.chinosk.gakumas.localify.models.ProgramConfig
Expand All @@ -27,7 +27,8 @@ fun <T> T.getConfigContent(): String where T : Activity {
return if (configFile.exists()) {
configFile.readText()
} else {
showToast("检测到第一次启动,初始化配置文件...")
Toast.makeText(this, "检测到第一次启动,初始化配置文件...", Toast.LENGTH_SHORT).show()
configFile.writeText("{}")
"{}"
}
}
Expand Down Expand Up @@ -62,7 +63,7 @@ fun <T> T.loadConfig() where T : Activity, T : IHasConfigItems {
config = try {
json.decodeFromString<GakumasConfig>(configStr)
} catch (e: SerializationException) {
showToast("配置文件异常,已重置: $e")
Toast.makeText(this, "配置文件异常: $e", Toast.LENGTH_SHORT).show()
GakumasConfig()
}
saveConfig()
Expand Down

0 comments on commit c28e05e

Please sign in to comment.