Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
fix: updating message
Browse files Browse the repository at this point in the history
  • Loading branch information
MalitsPlus committed Jan 23, 2024
1 parent 9ae978f commit c6fc9d4
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
}

Expand Down Expand Up @@ -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)
Expand All @@ -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.")
Expand Down Expand Up @@ -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 ->
Expand All @@ -471,6 +475,7 @@ class UpdateManager private constructor(
fun dbUpdateError()
fun dbDownloadCompleted(success: Boolean, errorMsg: CharSequence?)
fun dbUpdateCompleted()
fun dbUnhashing()
}

interface IActivityCallBack {
Expand Down
9 changes: 9 additions & 0 deletions release_log.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit c6fc9d4

Please sign in to comment.