diff --git a/README.md b/README.md
index 7fdf43d..ed8ec16 100644
--- a/README.md
+++ b/README.md
@@ -52,11 +52,9 @@ Added more features to app's crash dialog, fixed custom rom deleted dialog, the
## Future
-此项目依然在开发中,现在未解决的问题和包含的问题如下
+此项目依然在开发中,正在开发的功能如下
-- 应用配置模板功能
-
-- 更多功能 (计划内)
+- 应用异常统计信息功能
## License
diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml
index 497395d..244e3b2 100644
--- a/app/src/main/AndroidManifest.xml
+++ b/app/src/main/AndroidManifest.xml
@@ -54,6 +54,11 @@
+
+
+ *
+ * This file is Created by fankes on 2022/6/4.
+ */
+package com.fankes.apperrorstracking.bean
+
+import java.io.Serializable
+
+/**
+ * 应用过滤条件 bean
+ * @param name 名称或包名
+ * @param isContainsSystem 是否包含系统应用
+ */
+data class AppFiltersBean(var name: String = "", var isContainsSystem: Boolean = false) : Serializable
\ No newline at end of file
diff --git a/app/src/main/java/com/fankes/apperrorstracking/bean/AppInfoBean.kt b/app/src/main/java/com/fankes/apperrorstracking/bean/AppInfoBean.kt
new file mode 100644
index 0000000..6eb46e4
--- /dev/null
+++ b/app/src/main/java/com/fankes/apperrorstracking/bean/AppInfoBean.kt
@@ -0,0 +1,33 @@
+/*
+ * AppErrorsTracking - Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.
+ * Copyright (C) 2019-2022 Fankes Studio(qzmmcn@163.com)
+ * https://github.com/KitsunePie/AppErrorsTracking
+ *
+ * This software is non-free but opensource software: you can redistribute it
+ * and/or modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and eula along with this software. If not, see
+ *
+ *
+ * This file is Created by fankes on 2022/6/8.
+ */
+package com.fankes.apperrorstracking.bean
+
+import android.graphics.drawable.Drawable
+import java.io.Serializable
+
+/**
+ * 应用信息 bean
+ * @param icon 图标
+ * @param name APP 名称
+ * @param packageName APP 包名
+ */
+data class AppInfoBean(var icon: Drawable? = null, var name: String, var packageName: String) : Serializable
\ No newline at end of file
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 df1b1a7..6ed50c8 100644
--- a/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt
+++ b/app/src/main/java/com/fankes/apperrorstracking/data/DataConst.kt
@@ -28,4 +28,5 @@ 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_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 1f37795..e02ba28 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
@@ -26,12 +26,16 @@ package com.fankes.apperrorstracking.hook.entity
import android.content.Context
import android.content.Intent
import android.content.pm.ApplicationInfo
+import android.content.pm.PackageManager
import android.os.Message
import com.fankes.apperrorstracking.BuildConfig
import com.fankes.apperrorstracking.bean.AppErrorsDisplayBean
import com.fankes.apperrorstracking.bean.AppErrorsInfoBean
+import com.fankes.apperrorstracking.bean.AppInfoBean
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
import com.fankes.apperrorstracking.data.DataConst
+import com.fankes.apperrorstracking.hook.factory.isAppShowErrorsToast
+import com.fankes.apperrorstracking.hook.factory.isAppShowNothing
import com.fankes.apperrorstracking.locale.LocaleString
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsDisplayActivity
import com.fankes.apperrorstracking.utils.factory.appName
@@ -107,6 +111,21 @@ object FrameworkHooker : YukiBaseHooker() {
mutedErrorsIfUnlockApps.clear()
mutedErrorsIfRestartApps.clear()
}
+ onPushAppListData { filters ->
+ arrayListOf().apply {
+ appContext.packageManager.getInstalledPackages(PackageManager.GET_CONFIGURATIONS).also { info ->
+ (if (filters.name.isNotBlank())
+ info.filter { it.packageName.contains(filters.name) || appContext.appName(it.packageName).contains(filters.name) }
+ else info).let { result ->
+ if (filters.isContainsSystem.not()) result.filter { (it.applicationInfo.flags and ApplicationInfo.FLAG_SYSTEM) == 0 }
+ else result
+ }.sortedByDescending { it.lastUpdateTime }
+ .forEach { add(AppInfoBean(name = appContext.appName(it.packageName), packageName = it.packageName)) }
+ /** 移除模块自身 */
+ removeIf { it.packageName == BuildConfig.APPLICATION_ID }
+ }
+ }
+ }
}
}
@@ -187,6 +206,9 @@ object FrameworkHooker : YukiBaseHooker() {
/** 是否短时内重复错误 */
val isRepeating = AppErrorDialog_DataClass.clazz.field { name = "repeating" }.get(errData).boolean()
+
+ /** 崩溃标题 */
+ val errorTitle = if (isRepeating) LocaleString.aerrRepeatedTitle(appName) else LocaleString.aerrTitle(appName)
/** 打印错误日志 */
if (isApp) loggerE(
msg = "App \"$packageName\"${if (packageName != processName) " --process \"$processName\"" else ""}" +
@@ -205,13 +227,21 @@ object FrameworkHooker : YukiBaseHooker() {
) return@afterHook
/** 判断是否为主进程 */
if (isMainProcess.not() && prefs.get(DataConst.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN)) return@afterHook
+ /** 判断配置模块启用状态 */
+ if (prefs.get(DataConst.ENABLE_APP_CONFIG_TEMPLATE)) {
+ if (isAppShowNothing(packageName)) return@afterHook
+ if (isAppShowErrorsToast(packageName)) {
+ context.toast(errorTitle)
+ return@afterHook
+ }
+ }
/** 启动错误对话框显示窗口 */
AppErrorsDisplayActivity.start(
context, AppErrorsDisplayBean(
packageName = packageName,
processName = processName,
appName = appName,
- title = if (isRepeating) LocaleString.aerrRepeatedTitle(appName) else LocaleString.aerrTitle(appName),
+ title = errorTitle,
isShowAppInfoButton = isApp,
isShowReopenButton = isApp && isRepeating.not() && context.isAppCanOpened(packageName) && isMainProcess,
isShowCloseAppButton = isApp
diff --git a/app/src/main/java/com/fankes/apperrorstracking/hook/factory/DataFactory.kt b/app/src/main/java/com/fankes/apperrorstracking/hook/factory/DataFactory.kt
new file mode 100644
index 0000000..f45ba02
--- /dev/null
+++ b/app/src/main/java/com/fankes/apperrorstracking/hook/factory/DataFactory.kt
@@ -0,0 +1,85 @@
+/*
+ * AppErrorsTracking - Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.
+ * Copyright (C) 2019-2022 Fankes Studio(qzmmcn@163.com)
+ * https://github.com/KitsunePie/AppErrorsTracking
+ *
+ * This software is non-free but opensource software: you can redistribute it
+ * and/or modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and eula along with this software. If not, see
+ *
+ *
+ * This file is Created by fankes on 2022/6/8.
+ */
+@file:Suppress("unused")
+
+package com.fankes.apperrorstracking.hook.factory
+
+import android.content.Context
+import com.highcapable.yukihookapi.hook.factory.modulePrefs
+import com.highcapable.yukihookapi.hook.param.PackageParam
+
+/**
+ * 获取此 APP 是否配置显示错误对话框
+ * @param packageName APP 包名
+ */
+fun PackageParam.isAppShowErrorsDialog(packageName: String) = prefs.getBoolean("${packageName}_show_errors_dialog", true)
+
+/**
+ * 获取此 APP 是否配置显示错误 Toast 提示
+ * @param packageName APP 包名
+ */
+fun PackageParam.isAppShowErrorsToast(packageName: String) = prefs.getBoolean("${packageName}_show_errors_toast", false)
+
+/**
+ * 获取此 APP 是否配置不显示任何提示
+ * @param packageName APP 包名
+ */
+fun PackageParam.isAppShowNothing(packageName: String) = prefs.getBoolean("${packageName}_show_nothing", false)
+
+/**
+ * 获取此 APP 是否配置显示错误对话框
+ * @param packageName APP 包名
+ */
+fun Context.isAppShowErrorsDialog(packageName: String) = modulePrefs.getBoolean("${packageName}_show_errors_dialog", true)
+
+/**
+ * 获取此 APP 是否配置显示错误 Toast 提示
+ * @param packageName APP 包名
+ */
+fun Context.isAppShowErrorsToast(packageName: String) = modulePrefs.getBoolean("${packageName}_show_errors_toast", false)
+
+/**
+ * 获取此 APP 是否配置不显示任何提示
+ * @param packageName APP 包名
+ */
+fun Context.isAppShowNothing(packageName: String) = modulePrefs.getBoolean("${packageName}_show_nothing", false)
+
+/**
+ * 设置此 APP 是否配置显示错误对话框
+ * @param packageName APP 包名
+ * @param isApply 是否设置
+ */
+fun Context.putAppShowErrorsDialog(packageName: String, isApply: Boolean) = modulePrefs.putBoolean("${packageName}_show_errors_dialog", isApply)
+
+/**
+ * 设置此 APP 是否配置显示错误 Toast 提示
+ * @param packageName APP 包名
+ * @param isApply 是否设置
+ */
+fun Context.putAppShowErrorsToast(packageName: String, isApply: Boolean) = modulePrefs.putBoolean("${packageName}_show_errors_toast", isApply)
+
+/**
+ * 设置此 APP 是否配置不显示任何提示
+ * @param packageName APP 包名
+ * @param isApply 是否设置
+ */
+fun Context.putAppShowNothing(packageName: String, isApply: Boolean) = modulePrefs.putBoolean("${packageName}_show_nothing", isApply)
\ No newline at end of file
diff --git a/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt b/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt
index feab41a..addaf41 100644
--- a/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt
+++ b/app/src/main/java/com/fankes/apperrorstracking/locale/LocaleString.kt
@@ -346,4 +346,46 @@ object LocaleString {
/** @string Automatic generated */
fun areYouSureUnmuteAll(vararg objArrs: Any) = R.string.are_you_sure_unmute_all.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val filterByCondition get() = filterByCondition()
+
+ /** @string Automatic generated */
+ fun filterByCondition(vararg objArrs: Any) = R.string.filter_by_condition.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val clearFilters get() = clearFilters()
+
+ /** @string Automatic generated */
+ fun clearFilters(vararg objArrs: Any) = R.string.clear_filters.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val resultCount get() = resultCount()
+
+ /** @string Automatic generated */
+ fun resultCount(vararg objArrs: Any) = R.string.result_count.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val loading get() = loading()
+
+ /** @string Automatic generated */
+ fun loading(vararg objArrs: Any) = R.string.loading.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val showErrorsDialog get() = showErrorsDialog()
+
+ /** @string Automatic generated */
+ fun showErrorsDialog(vararg objArrs: Any) = R.string.show_errors_dialog.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val showErrorsToast get() = showErrorsToast()
+
+ /** @string Automatic generated */
+ fun showErrorsToast(vararg objArrs: Any) = R.string.show_errors_toast.bind(*objArrs)
+
+ /** @string Automatic generated */
+ val showNothing get() = showNothing()
+
+ /** @string Automatic generated */
+ fun showNothing(vararg objArrs: Any) = R.string.show_nothing.bind(*objArrs)
}
\ No newline at end of file
diff --git a/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt
new file mode 100644
index 0000000..539b599
--- /dev/null
+++ b/app/src/main/java/com/fankes/apperrorstracking/ui/activity/main/ConfigureActivity.kt
@@ -0,0 +1,142 @@
+/*
+ * AppErrorsTracking - Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.
+ * Copyright (C) 2019-2022 Fankes Studio(qzmmcn@163.com)
+ * https://github.com/KitsunePie/AppErrorsTracking
+ *
+ * This software is non-free but opensource software: you can redistribute it
+ * and/or modify it under the terms of the GNU Affero General Public License
+ * as published by the Free Software Foundation; either
+ * version 3 of the License, or any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * and eula along with this software. If not, see
+ *
+ *
+ * This file is Created by fankes on 2022/6/4.
+ */
+package com.fankes.apperrorstracking.ui.activity.main
+
+import androidx.core.view.isVisible
+import com.fankes.apperrorstracking.bean.AppFiltersBean
+import com.fankes.apperrorstracking.bean.AppInfoBean
+import com.fankes.apperrorstracking.databinding.ActivityConfigBinding
+import com.fankes.apperrorstracking.databinding.AdapterAppInfoBinding
+import com.fankes.apperrorstracking.databinding.DiaAppConfigBinding
+import com.fankes.apperrorstracking.databinding.DiaAppsFilterBinding
+import com.fankes.apperrorstracking.hook.factory.*
+import com.fankes.apperrorstracking.locale.LocaleString
+import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
+import com.fankes.apperrorstracking.utils.factory.appIcon
+import com.fankes.apperrorstracking.utils.factory.bindAdapter
+import com.fankes.apperrorstracking.utils.factory.showDialog
+import com.fankes.apperrorstracking.utils.tool.FrameworkTool
+
+class ConfigureActivity : BaseActivity() {
+
+ /** 过滤条件 */
+ private var appFilters = AppFiltersBean()
+
+ /** 回调适配器改变 */
+ private var onChanged: (() -> Unit)? = null
+
+ /** 全部的 APP 信息 */
+ private val listData = ArrayList()
+
+ override fun onCreate() {
+ binding.titleBackIcon.setOnClickListener { onBackPressed() }
+ binding.filterIcon.setOnClickListener {
+ showDialog {
+ title = LocaleString.filterByCondition
+ binding.containsSystemSwitch.isChecked = appFilters.isContainsSystem
+ binding.appFiltersEdit.apply {
+ requestFocus()
+ invalidate()
+ if (appFilters.name.isNotBlank()) {
+ setText(appFilters.name)
+ setSelection(appFilters.name.length)
+ }
+ }
+ confirmButton {
+ appFilters.isContainsSystem = binding.containsSystemSwitch.isChecked
+ appFilters.name = binding.appFiltersEdit.text.toString().trim()
+ refreshData()
+ }
+ cancelButton()
+ if (appFilters.name.isNotBlank())
+ neutralButton(LocaleString.clearFilters) {
+ appFilters.isContainsSystem = binding.containsSystemSwitch.isChecked
+ appFilters.name = ""
+ refreshData()
+ }
+ }
+ }
+ binding.listView.apply {
+ bindAdapter {
+ onBindDatas { listData }
+ onBindViews { binding, position ->
+ listData[position].also { bean ->
+ binding.appIcon.setImageDrawable(bean.icon)
+ binding.appNameText.text = bean.name
+ binding.configTypeText.text = when {
+ isAppShowErrorsDialog(bean.packageName) -> LocaleString.showErrorsDialog
+ isAppShowErrorsToast(bean.packageName) -> LocaleString.showErrorsToast
+ isAppShowNothing(bean.packageName) -> LocaleString.showNothing
+ else -> "Unknown type"
+ }
+ }
+ }
+ }.apply { onChanged = { notifyDataSetChanged() } }
+ setOnItemClickListener { _, _, p, _ ->
+ listData[p].also { bean ->
+ showDialog {
+ title = bean.name
+ binding.configRadio1.isChecked = isAppShowErrorsDialog(bean.packageName)
+ binding.configRadio2.isChecked = isAppShowErrorsToast(bean.packageName)
+ binding.configRadio3.isChecked = isAppShowNothing(bean.packageName)
+ confirmButton {
+ putAppShowErrorsDialog(bean.packageName, binding.configRadio1.isChecked)
+ putAppShowErrorsToast(bean.packageName, binding.configRadio2.isChecked)
+ putAppShowNothing(bean.packageName, binding.configRadio3.isChecked)
+ onChanged?.invoke()
+ }
+ cancelButton()
+ }
+ }
+ }
+ }
+ /** 开始刷新数据 */
+ refreshData()
+ }
+
+ /** 刷新列表数据 */
+ private fun refreshData() {
+ binding.listProgressView.isVisible = true
+ binding.filterIcon.isVisible = false
+ binding.listView.isVisible = false
+ binding.listNoDataView.isVisible = false
+ binding.titleCountText.text = LocaleString.loading
+ FrameworkTool.fetchAppListData(context = this, appFilters) {
+ listData.clear()
+ Thread {
+ it.takeIf { e -> e.isNotEmpty() }?.forEach { e ->
+ listData.add(e)
+ e.icon = appIcon(e.packageName)
+ }
+ runOnUiThread {
+ onChanged?.invoke()
+ binding.listView.post { binding.listView.setSelection(0) }
+ binding.listProgressView.isVisible = false
+ binding.filterIcon.isVisible = true
+ binding.listView.isVisible = listData.isNotEmpty()
+ binding.listNoDataView.isVisible = listData.isEmpty()
+ binding.titleCountText.text = LocaleString.resultCount(listData.size)
+ }
+ }.start()
+ }
+ }
+}
\ No newline at end of file
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 8cb5c93..f90b769 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
@@ -53,7 +53,9 @@ 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.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)
binding.hideIconInLauncherSwitch.setOnCheckedChangeListener { btn, b ->
if (btn.isPressed.not()) return@setOnCheckedChangeListener
modulePrefs.put(DataConst.ENABLE_HIDE_ICON, b)
@@ -72,14 +74,15 @@ class MainActivity : BaseActivity() {
modulePrefs.put(DataConst.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN, b)
}
binding.enableAppsConfigsTemplateSwitch.setOnCheckedChangeListener { btn, b ->
- if (b) btn.isChecked = false
- toastComingSoon()
+ if (btn.isPressed.not()) return@setOnCheckedChangeListener
+ binding.mgrAppsConfigsTemplateButton.isVisible = b
+ modulePrefs.put(DataConst.ENABLE_APP_CONFIG_TEMPLATE, b)
}
/** 管理应用配置模板按钮点击事件 */
- binding.mgrAppsConfigsTemplateButton.setOnClickListener { toastComingSoon() }
+ binding.mgrAppsConfigsTemplateButton.setOnClickListener { whenActivated { navigate() } }
/** 功能管理按钮点击事件 */
- binding.viewErrorsRecordButton.setOnClickListener { navigate() }
- binding.viewMutedErrorsAppsButton.setOnClickListener { navigate() }
+ binding.viewErrorsRecordButton.setOnClickListener { whenActivated { navigate() } }
+ binding.viewMutedErrorsAppsButton.setOnClickListener { whenActivated { navigate() } }
/** 重启按钮点击事件 */
binding.titleRestartIcon.setOnClickListener { FrameworkTool.restartSystem(context = this) }
/** 项目地址按钮点击事件 */
@@ -111,8 +114,13 @@ class MainActivity : BaseActivity() {
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.executorName} API ${YukiHookAPI.Status.executorVersion}"
}
- /** 敬请期待 */
- private fun toastComingSoon() = toast(msg = "Coming soon")
+ /**
+ * 当模块激活后才能执行相应功能
+ * @param callback 激活后回调
+ */
+ private inline fun whenActivated(callback: () -> Unit) {
+ if (YukiHookAPI.Status.isXposedModuleActive) callback() else toast(LocaleString.moduleNotActivated)
+ }
override fun onResume() {
super.onResume()
diff --git a/app/src/main/java/com/fankes/apperrorstracking/utils/tool/FrameworkTool.kt b/app/src/main/java/com/fankes/apperrorstracking/utils/tool/FrameworkTool.kt
index b917f29..a61edc3 100644
--- a/app/src/main/java/com/fankes/apperrorstracking/utils/tool/FrameworkTool.kt
+++ b/app/src/main/java/com/fankes/apperrorstracking/utils/tool/FrameworkTool.kt
@@ -25,6 +25,8 @@ package com.fankes.apperrorstracking.utils.tool
import android.content.Context
import com.fankes.apperrorstracking.bean.AppErrorsInfoBean
+import com.fankes.apperrorstracking.bean.AppFiltersBean
+import com.fankes.apperrorstracking.bean.AppInfoBean
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
import com.fankes.apperrorstracking.locale.LocaleString
import com.fankes.apperrorstracking.utils.factory.execShell
@@ -55,7 +57,9 @@ object FrameworkTool {
private const val CALL_UNMUTE_ALL_ERRORS_APPS_DATA_RESULT = "call_unmute_all_errors_apps_data_result"
private val CALL_OPEN_SPECIFY_APP = ChannelData("call_open_specify_app")
+ private val CALL_APP_LIST_DATA_GET = ChannelData("call_app_info_list_data_get")
private val CALL_APP_ERRORS_DATA_REMOVE = ChannelData("call_app_errors_data_remove")
+ private val CALL_APP_LIST_DATA_GET_RESULT = ChannelData>("call_app_info_list_data_get_result")
private val CALL_APP_ERRORS_DATA_GET_RESULT = ChannelData>("call_app_errors_data_get_result")
private val CALL_MUTED_ERRORS_APP_DATA_GET_RESULT = ChannelData>("call_muted_app_errors_data_get_result")
private val CALL_UNMUTE_ERRORS_APP_DATA = ChannelData("call_unmute_errors_app_data")
@@ -177,6 +181,14 @@ object FrameworkTool {
}
}
}
+
+ /**
+ * 监听发送已安装 APP 列表数组
+ * @param result 回调数据
+ */
+ fun onPushAppListData(result: (AppFiltersBean) -> ArrayList) {
+ instance?.dataChannel?.with { wait(CALL_APP_LIST_DATA_GET) { put(CALL_APP_LIST_DATA_GET_RESULT, result(it)) } }
+ }
}
/**
@@ -314,4 +326,17 @@ object FrameworkTool {
put(CALL_UNMUTE_ALL_ERRORS_APPS_DATA)
}
}
+
+ /**
+ * 获取已安装 APP 列表数组
+ * @param context 实例
+ * @param appFilters 过滤条件
+ * @param result 回调数据
+ */
+ fun fetchAppListData(context: Context, appFilters: AppFiltersBean, result: (ArrayList) -> Unit) {
+ context.dataChannel(SYSTEM_FRAMEWORK_NAME).with {
+ wait(CALL_APP_LIST_DATA_GET_RESULT) { result(it) }
+ put(CALL_APP_LIST_DATA_GET, appFilters)
+ }
+ }
}
\ No newline at end of file
diff --git a/app/src/main/res/drawable/ic_filter.xml b/app/src/main/res/drawable/ic_filter.xml
new file mode 100644
index 0000000..08cb3a8
--- /dev/null
+++ b/app/src/main/res/drawable/ic_filter.xml
@@ -0,0 +1,9 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_config.xml b/app/src/main/res/layout/activity_config.xml
new file mode 100644
index 0000000..e1c34ce
--- /dev/null
+++ b/app/src/main/res/layout/activity_config.xml
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/activity_main.xml b/app/src/main/res/layout/activity_main.xml
index 2d788c6..527f219 100644
--- a/app/src/main/res/layout/activity_main.xml
+++ b/app/src/main/res/layout/activity_main.xml
@@ -155,6 +155,7 @@
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/dia_app_config.xml b/app/src/main/res/layout/dia_app_config.xml
new file mode 100644
index 0000000..66e39a6
--- /dev/null
+++ b/app/src/main/res/layout/dia_app_config.xml
@@ -0,0 +1,46 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/layout/dia_apps_filter.xml b/app/src/main/res/layout/dia_apps_filter.xml
new file mode 100644
index 0000000..ab4539b
--- /dev/null
+++ b/app/src/main/res/layout/dia_apps_filter.xml
@@ -0,0 +1,31 @@
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-ja/strings.xml b/app/src/main/res/values-ja/strings.xml
index c895700..fa78209 100644
--- a/app/src/main/res/values-ja/strings.xml
+++ b/app/src/main/res/values-ja/strings.xml
@@ -52,7 +52,6 @@
モジュールバージョン: %1$s
システムバージョン: %1$s
モジュールが有効化でした
- 一部の設定を変更した後、リスタートシステムして有効にするには、右上隅をクリックする必要がある場合があります。
表示設定
デスクトップ上のアプリアイコンを非表示
モジュールアイコンを非表示にすると、インターフェイスが閉じてデスクトップに表示されなくなります。モジュール設定は、EdXposedまたはLSPosedで検索して開くことができます。
@@ -88,4 +87,16 @@
無視を解除
無視を全部解除
エラーを無視したすべてのアプリを解除してもよろしいですか
+ アプリ設定テンプレート
+ 条件でフィルタリング
+ 表示結果はありません
+ アプリ名とパッケージ名を入力できます
+ 結果にはシステムアプリが含まれます
+ 条件をクリア
+ %1$s の合計結果
+ ロード中
+ エラーが現在適用されているときにシステムがエラーを表示する方法を構成できます。
+ エラーダイアログを表示
+ エラー Toast を表示
+ 何も表示されません
\ 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 c5198c3..027f8a5 100644
--- a/app/src/main/res/values-zh-rCN/strings.xml
+++ b/app/src/main/res/values-zh-rCN/strings.xml
@@ -52,7 +52,6 @@
模块版本:%1$s
系统版本:%1$s
模块已激活
- 部分设置修改后可能需要点击右上角重启系统才能生效。
显示设置
在桌面隐藏模块图标
隐藏模块图标后界面可能会被关闭,将不会再在桌面显示,你可以在 EdXposed、LSPosed 中找到模块设置并打开。
@@ -73,19 +72,31 @@
分享异常堆栈
偏好设置
功能管理
- 仅对前台应用展示错误对话框
- 仅对应用主进程展示错误对话框
+ 仅对前台应用显示错误对话框
+ 仅对应用主进程显示错误对话框
启用应用配置模板
管理应用配置模板
查看异常历史记录
查看已忽略异常的应用
- 启用后,只有发生异常的应用处于前台(正在使用中)时才会展示错误对话框,发生异常的后台应用虽然不会展示错误对话框,但是它们都会被记录到异常历史记录中。
- 启用后,只有应用发生的异常位于主进程(第一个 Application 实例对象)时才会展示错误对话框。
- 你可以在这里对每个应用发生异常时,单独配置其在发生异常时是否展示错误对话框。
+ 启用后,只有发生异常的应用处于前台(正在使用中)时才会显示错误对话框,发生异常的后台应用虽然不会显示错误对话框,但是它们都会被记录到异常历史记录中。
+ 启用后,只有应用发生的异常位于主进程(第一个 Application 实例对象)时才会显示错误对话框。
+ 你可以在这里对每个应用发生异常时,单独配置其在发生异常时是否显示错误对话框。
在这里,你可以找到从系统开机以来到现在为止的全部应用异常记录,异常历史记录在重新启动后会自动清空,你可以对记录进行查看、导出和分享以及清空。
在这里,你可以找到已被你以不同形式手动忽略异常的应用,这个列表将会在重新启动后自动清空,你可以对这些已忽略的应用进行管理以及从忽略列表中移除它们。
已忽略异常的应用
取消忽略
取消全部忽略
你确定要取消全部已忽略异常的应用吗?
+ 应用配置模板
+ 按条件过滤
+ 没有结果可以显示
+ 可输入 APP 名称、包名
+ 结果包含系统应用
+ 清除条件
+ 共 %1$s 个结果
+ 加载中
+ 你可以配置当前应用崩溃时系统将如何向你显示错误提示信息。
+ 显示错误对话框
+ 显示错误 Toast 提示
+ 不显示任何提示
\ 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 28264b1..d1cbbc7 100644
--- a/app/src/main/res/values-zh-rHK/strings.xml
+++ b/app/src/main/res/values-zh-rHK/strings.xml
@@ -52,7 +52,6 @@
模組版本:%1$s
系統版本:%1$s
模組已激活
- 部分設置修改後可能需要點擊右上角重啟系統才能生效。
顯示設置
在桌面隱藏模組圖標
隱藏模組圖標後界面可能會被關閉,將不會再在桌面顯示,你可以在 EdXposed、LSPosed 中找到模組設置並打開。
@@ -88,4 +87,16 @@
取消忽略
取消全部忽略
你確認要取消全部已忽略異常的程式嗎?
+ 程式配置模板
+ 按條件過濾
+ 沒有結果可以展示
+ 可輸入 APP 名稱、包名
+ 結果包含系統程式
+ 清除條件
+ 共 %1$s 個結果
+ 加載中
+ 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。
+ 顯示錯誤對話框
+ 顯示錯誤 Toast 提示
+ 不顯示任何提示
\ 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 f063cb9..7df7e72 100644
--- a/app/src/main/res/values-zh-rMO/strings.xml
+++ b/app/src/main/res/values-zh-rMO/strings.xml
@@ -52,7 +52,6 @@
模組版本:%1$s
系統版本:%1$s
模組已激活
- 部分設置修改後可能需要點擊右上角重啟系統才能生效。
顯示設置
在桌面隱藏模組圖標
隱藏模組圖標後界面可能會被關閉,將不會再在桌面顯示,你可以在 EdXposed、LSPosed 中找到模組設置並打開。
@@ -88,4 +87,16 @@
取消忽略
取消全部忽略
你確認要取消全部已忽略異常的程式嗎?
+ 程式配置模板
+ 按條件過濾
+ 沒有結果可以展示
+ 可輸入 APP 名稱、包名
+ 結果包含系統程式
+ 清除條件
+ 共 %1$s 個結果
+ 加載中
+ 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。
+ 顯示錯誤對話框
+ 顯示錯誤 Toast 提示
+ 不顯示任何提示
\ 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 ce5960e..9e831bd 100644
--- a/app/src/main/res/values-zh-rTW/strings.xml
+++ b/app/src/main/res/values-zh-rTW/strings.xml
@@ -52,7 +52,6 @@
模組版本:%1$s
系統版本:%1$s
模組已激活
- 部分設置修改後可能需要點擊右上角重啟系統才能生效。
顯示設置
在桌面隱藏模組圖標
隱藏模組圖標後界面可能會被關閉,將不會再在桌面顯示,你可以在 EdXposed、LSPosed 中找到模組設置並打開。
@@ -88,4 +87,16 @@
取消忽略
取消全部忽略
你確認要取消全部已忽略異常的程式嗎?
+ 程式配置模板
+ 按條件過濾
+ 沒有結果可以展示
+ 可輸入 APP 名稱、包名
+ 結果包含系統程式
+ 清除條件
+ 共 %1$s 個結果
+ 加載中
+ 你可以配置當前程式崩潰時系統將如何向你展示錯誤提醒副案。
+ 顯示錯誤對話框
+ 顯示錯誤 Toast 提示
+ 不顯示任何提示
\ 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 60d578b..74e8e83 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -52,7 +52,6 @@
Module version: %1$s
System version: %1$s
Module is activated
- After some settings are modified, you may need to click the upper right corner to restart the system to take effect.
Display settings
Hide app icons on launcher
After hiding the app icon, the interface may be closed and will no longer be displayed on the launcher. You can find and open the module settings in EdXposed or LSPosed.
@@ -88,4 +87,16 @@
Unmute
Unmute all
Are you sure you want to unmute all apps?
+ Apps Config Template
+ Filter by condition
+ No result to display
+ Typo apps name or package name
+ Result contains system apps
+ Clear filters
+ %1$s results found
+ Loading
+ You can configure how the system will show you errors when the current app crashes.
+ Show errors dialog
+ Show errors Toast
+ Don\'t show anything
\ No newline at end of file