From c6fc9d471a2d8bd92c0f67d78433cae529c06474 Mon Sep 17 00:00:00 2001 From: MalitsPlus <50281195+MalitsPlus@users.noreply.github.com> Date: Tue, 23 Jan 2024 21:23:13 +0900 Subject: [PATCH] fix: updating message --- app/build.gradle | 4 ++-- .../malitsplus/shizurunotes/common/UpdateManager.kt | 11 ++++++++--- release_log.json | 9 +++++++++ 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 5cb8b6e4..17468cab 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,8 +16,8 @@ android { applicationId "com.github.malitsplus.shizurunotes" minSdk 26 targetSdk 30 - versionCode 107 - versionName "2.0.0" + versionCode 108 + versionName "2.0.1" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } signingConfigs { diff --git a/app/src/main/java/com/github/malitsplus/shizurunotes/common/UpdateManager.kt b/app/src/main/java/com/github/malitsplus/shizurunotes/common/UpdateManager.kt index 876c2897..de4e6944 100644 --- a/app/src/main/java/com/github/malitsplus/shizurunotes/common/UpdateManager.kt +++ b/app/src/main/java/com/github/malitsplus/shizurunotes/common/UpdateManager.kt @@ -185,6 +185,10 @@ class UpdateManager private constructor( progressDialog?.cancel() iActivityCallBack?.showSnackBar(R.string.db_update_failed) } + + override fun dbUnhashing() { + progressDialog?.message(R.string.Unhashing_db, null, null) + } } } @@ -342,7 +346,7 @@ class UpdateManager private constructor( progress = totalDownload updateHandler.sendMessage(updateHandler.obtainMessage(UPDATE_DOWNLOADING)) if (numRead <= 0) { - updateHandler.sendEmptyMessage(UPDATE_DOWNLOAD_COMPLETED) + updateHandler.sendEmptyMessage(UPDATE_UNHASHING) break } fileOutputStream.write(buf, 0, numRead) @@ -368,7 +372,6 @@ class UpdateManager private constructor( updateHandler.sendEmptyMessage(UPDATE_COMPLETED) return } - progressDialog?.message(R.string.Unhashing_db, null, null) val rainbowJson = AssetUtils.readStringFromRaw(mContext, R.raw.rainbow) if (rainbowJson == null) { LogUtils.file(LogUtils.E, "Rainbow table not found, unhashing skipped.") @@ -452,7 +455,8 @@ class UpdateManager private constructor( callBack.dbUpdateError() UPDATE_DOWNLOAD_COMPLETED -> callBack.dbDownloadCompleted(true, "") - + UPDATE_UNHASHING -> + callBack.dbUnhashing() UPDATE_COMPLETED -> callBack.dbUpdateCompleted() UPDATE_DOWNLOAD_CANCELED -> @@ -471,6 +475,7 @@ class UpdateManager private constructor( fun dbUpdateError() fun dbDownloadCompleted(success: Boolean, errorMsg: CharSequence?) fun dbUpdateCompleted() + fun dbUnhashing() } interface IActivityCallBack { diff --git a/release_log.json b/release_log.json index a6de62c3..c6b73558 100644 --- a/release_log.json +++ b/release_log.json @@ -1,4 +1,13 @@ [ + { + "versionCode": "108", + "versionName": "2.0.1", + "recommend": "false", + "messageJa": "- 新データベースのサポート\n- データ更新後アプリがクラッシュする不具合の修正\n\n新バージョンのアプリデータは旧バージョンとの互換性がないため、予めアプリを削除してからアップデートするか、アップデート後にアプリデータをクリアするかをしてください。", + "messageZh": "- 适配新版数据库\n- 修复数据库更新后崩溃的 bug\n\n本次更新破坏了旧版本数据的兼容性,请在更新前先卸载 app,或在更新后完全清除 app 数据。", + "infoJa": "", + "infoZh": "" + }, { "versionCode": "107", "versionName": "2.0.0",