From f1669f9e4184278aa62d2892729d762d9b29a466 Mon Sep 17 00:00:00 2001 From: ZhanGSKen Date: Tue, 15 Apr 2025 16:00:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=BA=94=E7=94=A8=E5=AE=9E?= =?UTF-8?q?=E4=BE=8B=E5=8F=82=E6=95=B0=E4=B8=8A=E4=B8=8B=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- autoinstaller/build.properties | 4 ++-- .../autoinstaller/models/AppConfigs.java | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/autoinstaller/build.properties b/autoinstaller/build.properties index 1bda88a..4b2c98f 100644 --- a/autoinstaller/build.properties +++ b/autoinstaller/build.properties @@ -1,8 +1,8 @@ #Created by .winboll/winboll_app_build.gradle -#Tue Apr 15 02:52:13 GMT 2025 +#Tue Apr 15 07:58:36 GMT 2025 stageCount=1 libraryProject= baseVersion=15.2 publishVersion=15.2.0 -buildCount=12 +buildCount=17 baseBetaVersion=15.2.1 diff --git a/autoinstaller/src/main/java/cc/winboll/studio/autoinstaller/models/AppConfigs.java b/autoinstaller/src/main/java/cc/winboll/studio/autoinstaller/models/AppConfigs.java index ccacfd1..6d65adb 100644 --- a/autoinstaller/src/main/java/cc/winboll/studio/autoinstaller/models/AppConfigs.java +++ b/autoinstaller/src/main/java/cc/winboll/studio/autoinstaller/models/AppConfigs.java @@ -11,12 +11,11 @@ import android.util.JsonWriter; import cc.winboll.studio.autoinstaller.models.AppConfigs; import cc.winboll.studio.autoinstaller.utils.FileUtil; import cc.winboll.studio.libappbase.LogUtils; +import com.hjq.toast.ToastUtils; import java.io.IOException; import java.io.Serializable; import java.io.StringReader; import java.io.StringWriter; -import android.drm.DrmConvertedStatus; -import com.hjq.toast.ToastUtils; public class AppConfigs implements Serializable { @@ -32,12 +31,13 @@ public class AppConfigs implements Serializable { Context mContext; AppConfigs(Context context) { - mContext = context; + mContext = context.getApplicationContext(); } public static synchronized AppConfigs getInstance(Context context) { if (_AppConfigs == null) { _AppConfigs = new AppConfigs(context); + _AppConfigs.loadAppConfigs(_AppConfigs.mContext); } return _AppConfigs; } @@ -137,11 +137,22 @@ public class AppConfigs implements Serializable { static String getDataPath(Context context) { return context.getExternalFilesDir(TAG) + "/" + TAG + ".json"; } + + public AppConfigs loadAppConfigs() { + AppConfigs appConfigs = null; + try { + String szJson = FileUtil.readFile(getDataPath(mContext)); + appConfigs = AppConfigs.getInstance(mContext).parseAppConfigs(szJson); + } catch (IOException e) { + LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace()); + } + return appConfigs; + } public AppConfigs loadAppConfigs(Context context) { AppConfigs appConfigs = null; try { - String szJson = FileUtil.readFile(getDataPath(context)); + String szJson = FileUtil.readFile(getDataPath(context.getApplicationContext())); appConfigs = AppConfigs.getInstance(mContext).parseAppConfigs(szJson); } catch (IOException e) { LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace()); @@ -159,7 +170,7 @@ public class AppConfigs implements Serializable { LogUtils.d(TAG, e.getMessage(), Thread.currentThread().getStackTrace()); } } - + public void saveAppConfigs() { saveAppConfigs(mContext, this); }