diff --git a/README.md b/README.md index cc21c0a..d8aa210 100644 --- a/README.md +++ b/README.md @@ -56,8 +56,6 @@ Added more features to app's crash dialog, fixed custom rom deleted dialog, the 此项目依然在开发中,正在开发的功能如下 -- 是否始终允许错误对话框显示“重新打开”按钮 (计划中) - ## License - [AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.html) diff --git a/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt b/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt index 6ed50c8..610ed1b 100644 --- a/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt +++ b/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt @@ -28,5 +28,6 @@ object DataConst { val ENABLE_HIDE_ICON = PrefsData("_hide_icon", false) val ENABLE_ONLY_SHOW_ERRORS_IN_FRONT = PrefsData("_enable_only_show_errors_in_front", false) val ENABLE_ONLY_SHOW_ERRORS_IN_MAIN = PrefsData("_enable_only_show_errors_in_main", false) + val ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS = PrefsData("_enable_always_shows_reopen_app_options", false) val ENABLE_APP_CONFIG_TEMPLATE = PrefsData("_enable_app_config_template", false) } \ No newline at end of file diff --git a/app/src/main/java/com/fankes/apperrorstracking/hook/entity/FrameworkHooker.kt b/app/src/main/java/com/fankes/apperrorstracking/hook/entity/FrameworkHooker.kt index b5f1d57..65ae943 100644 --- a/app/src/main/java/com/fankes/apperrorstracking/hook/entity/FrameworkHooker.kt +++ b/app/src/main/java/com/fankes/apperrorstracking/hook/entity/FrameworkHooker.kt @@ -211,6 +211,9 @@ object FrameworkHooker : YukiBaseHooker() { /** 崩溃标题 */ val errorTitle = if (isRepeating) LocaleString.aerrRepeatedTitle(appName) else LocaleString.aerrTitle(appName) + + /** 是否始终显示重新打开按钮 */ + val isAlwaysShowsReopenApp = prefs.get(DataConst.ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS) /** 打印错误日志 */ if (isApp) loggerE( msg = "App \"$packageName\"${if (packageName != processName) " --process \"$processName\"" else ""}" + @@ -257,7 +260,8 @@ object FrameworkHooker : YukiBaseHooker() { appName = appName, title = errorTitle, isShowAppInfoButton = isApp, - isShowReopenButton = isApp && isRepeating.not() && context.isAppCanOpened(packageName) && isMainProcess, + isShowReopenButton = isApp && (isRepeating.not() || isAlwaysShowsReopenApp) + && context.isAppCanOpened(packageName) && isMainProcess, isShowCloseAppButton = isApp ) ) diff --git a/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/MainActivity.kt b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/MainActivity.kt index 5f6da22..6023136 100644 --- a/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/MainActivity.kt +++ b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/MainActivity.kt @@ -56,6 +56,7 @@ class MainActivity : BaseActivity() { LocaleString.systemVersion("${Build.VERSION.RELEASE} (API ${Build.VERSION.SDK_INT}) ${Build.DISPLAY}") binding.onlyShowErrorsInFrontSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_ONLY_SHOW_ERRORS_IN_FRONT) binding.onlyShowErrorsInMainProcessSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN) + binding.alwaysShowsReopenAppOptionsSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS) binding.enableAppsConfigsTemplateSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_APP_CONFIG_TEMPLATE) binding.hideIconInLauncherSwitch.isChecked = modulePrefs.get(DataConst.ENABLE_HIDE_ICON) binding.mgrAppsConfigsTemplateButton.isVisible = modulePrefs.get(DataConst.ENABLE_APP_CONFIG_TEMPLATE) @@ -76,6 +77,10 @@ class MainActivity : BaseActivity() { if (btn.isPressed.not()) return@setOnCheckedChangeListener modulePrefs.put(DataConst.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN, b) } + binding.alwaysShowsReopenAppOptionsSwitch.setOnCheckedChangeListener { btn, b -> + if (btn.isPressed.not()) return@setOnCheckedChangeListener + modulePrefs.put(DataConst.ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS, b) + } binding.enableAppsConfigsTemplateSwitch.setOnCheckedChangeListener { btn, b -> if (btn.isPressed.not()) return@setOnCheckedChangeListener binding.mgrAppsConfigsTemplateButton.isVisible = b diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml index 527f219..816978a 100644 --- a/app/src/main/res/layout/activity_main.xml +++ b/app/src/main/res/layout/activity_main.xml @@ -251,6 +251,30 @@ android:textColor="@color/colorTextDark" android:textSize="12sp" /> + + + + アプリは未処理のエラーで崩壊しました。クリックして、アプリ開発者への詳細またはフィードバックを表示します。 一括操作 一度に %1$s 個のアプリに設定を適用してもよろしいですか + エラーダイアログには常にリスタートが表示 + 有効にした後、アプリが最初のエラーでない場合にも「アプリをリスタート」オプションが表示されます。現在のエラーがメインプロセスでない場合、またはアプリを開くことができない場合でも、このオプションは表示されません。 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rCN/strings.xml b/app/src/main/res/values-zh-rCN/strings.xml index 8065cec..b9a04f5 100644 --- a/app/src/main/res/values-zh-rCN/strings.xml +++ b/app/src/main/res/values-zh-rCN/strings.xml @@ -113,4 +113,6 @@ 应用发生了未处理的异常而崩溃,点击查看详情或反馈给应用开发者。 批量操作 你确定要一次性应用设置给 %1$s 个应用吗? + 错误对话框始终显示“重新打开”选项 + 启用后,在应用非首次异常时也将显示“重新打开”选项,若当前异常非主进程或应用无法打开则依然不会显示此选项。 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 33507bf..41f5c3e 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -113,4 +113,6 @@ 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 批量操作 你確認要一次性應用設置給 %1$s 個程式嗎? + 錯誤對話框始終顯示“重新開啟”選項 + 啟用後,在程式非首次異常時也將顯示“重新開啟”選項,若當前異常非主進程或程式無法打開則依然不會顯示此選項。 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rMO/strings.xml b/app/src/main/res/values-zh-rMO/strings.xml index 99c9f8f..85ad077 100644 --- a/app/src/main/res/values-zh-rMO/strings.xml +++ b/app/src/main/res/values-zh-rMO/strings.xml @@ -113,4 +113,6 @@ 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 批量操作 你確認要一次性應用設置給 %1$s 個程式嗎? + 錯誤對話框始終顯示“重新開啟”選項 + 啟用後,在程式非首次異常時也將顯示“重新開啟”選項,若當前異常非主進程或程式無法打開則依然不會顯示此選項。 \ No newline at end of file diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index fcce2c5..343964c 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -113,4 +113,6 @@ 程式發生了未處理的異常而崩潰,點擊查看詳情或反饋給程式開發者。 批量操作 你確認要一次性應用設置給 %1$s 個程式嗎? + 錯誤對話框始終顯示“重新開啟”選項 + 啟用後,在程式非首次異常時也將顯示“重新開啟”選項,若當前異常非主進程或程式無法打開則依然不會顯示此選項。 \ No newline at end of file diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 966a16f..c949117 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -72,8 +72,8 @@ Share error stack Preference Settings Function Management - Show error dialogs only for foreground apps - Show error dialogs only for main process apps + Show error dialogs only foreground apps + Show error dialogs only main process apps Enable apps config template Management apps config template View app errors record @@ -113,4 +113,6 @@ App collapses an unprocessed abnormality. Click to view details or feedback to the App developer. Batch operations Are you sure you want to apply settings to %1$s apps at once? + Error dialog always shows \"Reopen App\" + After enabling, the \"Reopen App\" option will also be shows when the app is not errors for the first time. If the current errors is not the main process or the app cannot be opened, this option will still not be showing. \ No newline at end of file