From c28e05e271a14c8c739dd4a38f071f3c502ccfee Mon Sep 17 00:00:00 2001 From: chinosk <2248589280@qq.com> Date: Sat, 29 Jun 2024 22:53:06 +0800 Subject: [PATCH] remove Invalid import --- .../io/github/chinosk/gakumas/localify/ActivityExtends.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt b/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt index 8bbc440..55c5c37 100644 --- a/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt +++ b/app/src/main/java/io/github/chinosk/gakumas/localify/ActivityExtends.kt @@ -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 @@ -27,7 +27,8 @@ fun T.getConfigContent(): String where T : Activity { return if (configFile.exists()) { configFile.readText() } else { - showToast("检测到第一次启动,初始化配置文件...") + Toast.makeText(this, "检测到第一次启动,初始化配置文件...", Toast.LENGTH_SHORT).show() + configFile.writeText("{}") "{}" } } @@ -62,7 +63,7 @@ fun T.loadConfig() where T : Activity, T : IHasConfigItems { config = try { json.decodeFromString(configStr) } catch (e: SerializationException) { - showToast("配置文件异常,已重置: $e") + Toast.makeText(this, "配置文件异常: $e", Toast.LENGTH_SHORT).show() GakumasConfig() } saveConfig()