mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
refactor: migrate i18ns generation to FlexiLocale plugin
This commit is contained in:
@@ -26,6 +26,9 @@ plugins:
|
|||||||
org.jetbrains.kotlin.android:
|
org.jetbrains.kotlin.android:
|
||||||
alias: kotlin-android
|
alias: kotlin-android
|
||||||
version: 1.9.10
|
version: 1.9.10
|
||||||
|
com.highcapable.flexilocale:
|
||||||
|
alias: flexi-locale
|
||||||
|
version: 1.0.0
|
||||||
com.google.devtools.ksp:
|
com.google.devtools.ksp:
|
||||||
alias: kotlin-ksp
|
alias: kotlin-ksp
|
||||||
version: 1.9.10-1.0.13
|
version: 1.9.10-1.0.13
|
||||||
|
@@ -2,6 +2,7 @@ plugins {
|
|||||||
autowire(libs.plugins.android.application)
|
autowire(libs.plugins.android.application)
|
||||||
autowire(libs.plugins.kotlin.android)
|
autowire(libs.plugins.kotlin.android)
|
||||||
autowire(libs.plugins.kotlin.ksp)
|
autowire(libs.plugins.kotlin.ksp)
|
||||||
|
autowire(libs.plugins.flexi.locale)
|
||||||
}
|
}
|
||||||
|
|
||||||
android {
|
android {
|
||||||
|
@@ -23,7 +23,8 @@ package com.fankes.apperrorstracking.application
|
|||||||
|
|
||||||
import androidx.appcompat.app.AppCompatDelegate
|
import androidx.appcompat.app.AppCompatDelegate
|
||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.generated.locale.ModuleAppLocale
|
||||||
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.utils.tool.AppAnalyticsTool
|
import com.fankes.apperrorstracking.utils.tool.AppAnalyticsTool
|
||||||
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication
|
import com.highcapable.yukihookapi.hook.xposed.application.ModuleApplication
|
||||||
|
|
||||||
@@ -31,13 +32,13 @@ class AppErrorsApplication : ModuleApplication() {
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
/** 绑定 I18n */
|
||||||
|
locale = ModuleAppLocale.attach(this)
|
||||||
/** 跟随系统夜间模式 */
|
/** 跟随系统夜间模式 */
|
||||||
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM)
|
||||||
/** 绑定 I18n */
|
|
||||||
LocaleString.bind(instance = this)
|
|
||||||
/** 装载存储控制类 */
|
/** 装载存储控制类 */
|
||||||
ConfigData.init(instance = this)
|
ConfigData.init(this)
|
||||||
/** 装载 App Center */
|
/** 装载 App Center */
|
||||||
AppAnalyticsTool.init(instance = this)
|
AppAnalyticsTool.init(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -24,7 +24,7 @@ package com.fankes.apperrorstracking.bean
|
|||||||
import android.app.ApplicationErrorReport
|
import android.app.ApplicationErrorReport
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.utils.factory.appCpuAbiOf
|
import com.fankes.apperrorstracking.utils.factory.appCpuAbiOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.appVersionCodeOf
|
import com.fankes.apperrorstracking.utils.factory.appVersionCodeOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.appVersionNameOf
|
import com.fankes.apperrorstracking.utils.factory.appVersionNameOf
|
||||||
@@ -155,13 +155,13 @@ data class AppErrorsInfoBean(
|
|||||||
*/
|
*/
|
||||||
val crossTime
|
val crossTime
|
||||||
get() = timestamp.difference(
|
get() = timestamp.difference(
|
||||||
now = LocaleString.momentAgo,
|
now = locale.momentAgo,
|
||||||
second = LocaleString.secondAgo,
|
second = locale.secondAgo,
|
||||||
minute = LocaleString.minuteAgo,
|
minute = locale.minuteAgo,
|
||||||
hour = LocaleString.hourAgo,
|
hour = locale.hourAgo,
|
||||||
day = LocaleString.dayAgo,
|
day = locale.dayAgo,
|
||||||
month = LocaleString.monthAgo,
|
month = locale.monthAgo,
|
||||||
year = LocaleString.yearAgo
|
year = locale.yearAgo
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -22,8 +22,9 @@
|
|||||||
package com.fankes.apperrorstracking.hook
|
package com.fankes.apperrorstracking.hook
|
||||||
|
|
||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
|
import com.fankes.apperrorstracking.generated.locale.ModuleAppLocale
|
||||||
import com.fankes.apperrorstracking.hook.entity.FrameworkHooker
|
import com.fankes.apperrorstracking.hook.entity.FrameworkHooker
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
|
import com.highcapable.yukihookapi.annotation.xposed.InjectYukiHookWithXposed
|
||||||
import com.highcapable.yukihookapi.hook.factory.configs
|
import com.highcapable.yukihookapi.hook.factory.configs
|
||||||
import com.highcapable.yukihookapi.hook.factory.encase
|
import com.highcapable.yukihookapi.hook.factory.encase
|
||||||
@@ -42,8 +43,8 @@ object HookEntry : IYukiHookXposedInit {
|
|||||||
|
|
||||||
override fun onHook() = encase {
|
override fun onHook() = encase {
|
||||||
loadSystem {
|
loadSystem {
|
||||||
LocaleString.bind(instance = this)
|
locale = ModuleAppLocale.attach { moduleAppResources }
|
||||||
ConfigData.init(instance = this)
|
ConfigData.init(this)
|
||||||
loadHooker(FrameworkHooker)
|
loadHooker(FrameworkHooker)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,7 @@ import com.fankes.apperrorstracking.data.AppErrorsConfigData
|
|||||||
import com.fankes.apperrorstracking.data.AppErrorsRecordData
|
import com.fankes.apperrorstracking.data.AppErrorsRecordData
|
||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
import com.fankes.apperrorstracking.data.enum.AppErrorsConfigType
|
import com.fankes.apperrorstracking.data.enum.AppErrorsConfigType
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsDisplayActivity
|
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsDisplayActivity
|
||||||
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsRecordActivity
|
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsRecordActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
||||||
@@ -288,18 +288,18 @@ object FrameworkHooker : YukiBaseHooker() {
|
|||||||
val appName = appInfo?.let { context.appNameOf(it.packageName).ifBlank { it.packageName } } ?: packageName
|
val appName = appInfo?.let { context.appNameOf(it.packageName).ifBlank { it.packageName } } ?: packageName
|
||||||
|
|
||||||
/** 当前 APP 名称 (包含用户 ID) */
|
/** 当前 APP 名称 (包含用户 ID) */
|
||||||
val appNameWithUserId = if (userId != 0) "$appName (${LocaleString.userId(userId)})" else appName
|
val appNameWithUserId = if (userId != 0) "$appName (${locale.userId(userId)})" else appName
|
||||||
|
|
||||||
/** 崩溃标题 */
|
/** 崩溃标题 */
|
||||||
val errorTitle = if (isRepeatingCrash) LocaleString.aerrRepeatedTitle(appNameWithUserId) else LocaleString.aerrTitle(appNameWithUserId)
|
val errorTitle = if (isRepeatingCrash) locale.aerrRepeatedTitle(appNameWithUserId) else locale.aerrTitle(appNameWithUserId)
|
||||||
|
|
||||||
/** 使用通知推送异常信息 */
|
/** 使用通知推送异常信息 */
|
||||||
fun showAppErrorsWithNotify() =
|
fun showAppErrorsWithNotify() =
|
||||||
context.pushNotify(
|
context.pushNotify(
|
||||||
channelId = "APPS_ERRORS",
|
channelId = "APPS_ERRORS",
|
||||||
channelName = LocaleString.appName,
|
channelName = locale.appName,
|
||||||
title = errorTitle,
|
title = errorTitle,
|
||||||
content = LocaleString.appErrorsTip,
|
content = locale.appErrorsTip,
|
||||||
icon = IconCompat.createWithBitmap(moduleAppResources.drawableOf(R.drawable.ic_notify).toBitmap()),
|
icon = IconCompat.createWithBitmap(moduleAppResources.drawableOf(R.drawable.ic_notify).toBitmap()),
|
||||||
color = 0xFFFF6200.toInt(),
|
color = 0xFFFF6200.toInt(),
|
||||||
intent = AppErrorsRecordActivity.intent()
|
intent = AppErrorsRecordActivity.intent()
|
||||||
|
@@ -0,0 +1,29 @@
|
|||||||
|
/*
|
||||||
|
* AppErrorsTracking - Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.
|
||||||
|
* Copyright (C) 2017-2023 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
|
||||||
|
* <https://www.gnu.org/licenses/>
|
||||||
|
*
|
||||||
|
* This file is created by fankes on 2023/10/13.
|
||||||
|
*/
|
||||||
|
@file:Suppress("StaticFieldLeak")
|
||||||
|
|
||||||
|
package com.fankes.apperrorstracking.locale
|
||||||
|
|
||||||
|
import com.fankes.apperrorstracking.generated.locale.ModuleAppLocale
|
||||||
|
|
||||||
|
/** I18ns 实例 */
|
||||||
|
lateinit var locale: ModuleAppLocale
|
@@ -1,577 +0,0 @@
|
|||||||
/*
|
|
||||||
* AppErrorsTracking - Added more features to app's crash dialog, fixed custom rom deleted dialog, the best experience to Android developer.
|
|
||||||
* Copyright (C) 2017-2023 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
|
|
||||||
* <https://www.gnu.org/licenses/>
|
|
||||||
*
|
|
||||||
* This file is created by fankes on 2022/5/11.
|
|
||||||
*/
|
|
||||||
@file:Suppress("MemberVisibilityCanBePrivate", "StaticFieldLeak", "unused")
|
|
||||||
|
|
||||||
package com.fankes.apperrorstracking.locale
|
|
||||||
|
|
||||||
import android.content.Context
|
|
||||||
import android.content.res.Resources
|
|
||||||
import com.fankes.apperrorstracking.R
|
|
||||||
import com.highcapable.yukihookapi.hook.param.PackageParam
|
|
||||||
|
|
||||||
/**
|
|
||||||
* I18n 字符串实例
|
|
||||||
*/
|
|
||||||
object LocaleString {
|
|
||||||
|
|
||||||
/** 当前的 [Context] */
|
|
||||||
private var baseContext: Context? = null
|
|
||||||
|
|
||||||
/** 当前的 [PackageParam] */
|
|
||||||
private var basePackageParam: PackageParam? = null
|
|
||||||
|
|
||||||
/** 当前的 [Resources] */
|
|
||||||
private var baseResources: Resources? = null
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 当前的 [Resources]
|
|
||||||
* @return [Resources]
|
|
||||||
* @throws IllegalStateException 如果 [LocaleString] 没有被绑定
|
|
||||||
*/
|
|
||||||
private val resources
|
|
||||||
get() = baseContext?.resources ?: basePackageParam?.moduleAppResources ?: baseResources
|
|
||||||
?: error("LocaleString must bind an instance first")
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 绑定并初始化
|
|
||||||
* @param instance 可以是 [Context]、[PackageParam]、[Resources]
|
|
||||||
*/
|
|
||||||
fun bind(instance: Any) {
|
|
||||||
when (instance) {
|
|
||||||
is Context -> baseContext = instance
|
|
||||||
is PackageParam -> basePackageParam = instance
|
|
||||||
is Resources -> baseResources = instance
|
|
||||||
else -> error("LocaleString bind an unknown instance")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据资源 Id 获取字符串
|
|
||||||
* @param objArrs 格式化实例
|
|
||||||
* @return [String]
|
|
||||||
*/
|
|
||||||
private fun Int.bind(vararg objArrs: Any) = resources.getString(this, *objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val appName get() = appName()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun appName(vararg objArrs: Any) = R.string.app_name.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val copied get() = copied()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun copied(vararg objArrs: Any) = R.string.copied.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val copyFail get() = copyFail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun copyFail(vararg objArrs: Any) = R.string.copy_fail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val printToLogcatSuccess get() = printToLogcatSuccess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun printToLogcatSuccess(vararg objArrs: Any) = R.string.print_to_logcat_success.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val outputStackSuccess get() = outputStackSuccess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun outputStackSuccess(vararg objArrs: Any) = R.string.output_stack_success.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val outputStackFail get() = outputStackFail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun outputStackFail(vararg objArrs: Any) = R.string.output_stack_fail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val aerrTitle get() = aerrTitle()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun aerrTitle(vararg objArrs: Any) = R.string.aerr_title.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val aerrRepeatedTitle get() = aerrRepeatedTitle()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun aerrRepeatedTitle(vararg objArrs: Any) = R.string.aerr_repeated_title.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val appInfo get() = appInfo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun appInfo(vararg objArrs: Any) = R.string.app_info.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val closeApp get() = closeApp()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun closeApp(vararg objArrs: Any) = R.string.close_app.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val reopenApp get() = reopenApp()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun reopenApp(vararg objArrs: Any) = R.string.reopen_app.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val errorDetail get() = errorDetail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun errorDetail(vararg objArrs: Any) = R.string.error_detail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val muteIfUnlock get() = muteIfUnlock()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun muteIfUnlock(vararg objArrs: Any) = R.string.mute_if_unlock.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val muteIfRestart get() = muteIfRestart()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun muteIfRestart(vararg objArrs: Any) = R.string.mute_if_restart.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val muteIfUnlockTip get() = muteIfUnlockTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun muteIfUnlockTip(vararg objArrs: Any) = R.string.mute_if_unlock_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val muteIfRestartTip get() = muteIfRestartTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun muteIfRestartTip(vararg objArrs: Any) = R.string.mute_if_restart_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val noListData get() = noListData()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun noListData(vararg objArrs: Any) = R.string.no_list_data.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val confirm get() = confirm()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun confirm(vararg objArrs: Any) = R.string.confirm.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val cancel get() = cancel()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun cancel(vararg objArrs: Any) = R.string.cancel.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val more get() = more()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun more(vararg objArrs: Any) = R.string.more.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val notice get() = notice()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun notice(vararg objArrs: Any) = R.string.notice.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val warning get() = warning()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun warning(vararg objArrs: Any) = R.string.warning.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureClearErrors get() = areYouSureClearErrors()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureClearErrors(vararg objArrs: Any) = R.string.are_you_sure_clear_errors.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val allErrorsClearSuccess get() = allErrorsClearSuccess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun allErrorsClearSuccess(vararg objArrs: Any) = R.string.all_errors_clear_success.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureExportAllErrors get() = areYouSureExportAllErrors()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureExportAllErrors(vararg objArrs: Any) = R.string.are_you_sure_export_all_errors.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val exportAllErrorsSuccess get() = exportAllErrorsSuccess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun exportAllErrorsSuccess(vararg objArrs: Any) = R.string.export_all_errors_success.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val exportAllErrorsFail get() = exportAllErrorsFail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun exportAllErrorsFail(vararg objArrs: Any) = R.string.export_all_errors_fail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val noCpuAbi get() = noCpuAbi()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun noCpuAbi(vararg objArrs: Any) = R.string.no_cpu_abi.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureRemoveRecord get() = areYouSureRemoveRecord()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureRemoveRecord(vararg objArrs: Any) = R.string.are_you_sure_remove_record.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val gotIt get() = gotIt()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun gotIt(vararg objArrs: Any) = R.string.got_it.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val moduleVersion get() = moduleVersion()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun moduleVersion(vararg objArrs: Any) = R.string.module_version.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val systemVersion get() = systemVersion()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun systemVersion(vararg objArrs: Any) = R.string.system_version.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureRestartSystem get() = areYouSureRestartSystem()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureRestartSystem(vararg objArrs: Any) = R.string.are_your_sure_restart_system.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val fastRestart get() = fastRestart()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun fastRestart(vararg objArrs: Any) = R.string.fast_restart.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val accessRootFail get() = accessRootFail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun accessRootFail(vararg objArrs: Any) = R.string.access_root_fail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val moduleNotActivated get() = moduleNotActivated()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun moduleNotActivated(vararg objArrs: Any) = R.string.module_not_activated.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val moduleIsActivated get() = moduleIsActivated()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun moduleIsActivated(vararg objArrs: Any) = R.string.module_is_activated.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val moduleNotFullyActivated get() = moduleNotFullyActivated()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun moduleNotFullyActivated(vararg objArrs: Any) = R.string.module_not_fully_activated.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val momentAgo get() = momentAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun momentAgo(vararg objArrs: Any) = R.string.moment_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val secondAgo get() = secondAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun secondAgo(vararg objArrs: Any) = R.string.second_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val minuteAgo get() = minuteAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun minuteAgo(vararg objArrs: Any) = R.string.minute_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val hourAgo get() = hourAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun hourAgo(vararg objArrs: Any) = R.string.hour_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val dayAgo get() = dayAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun dayAgo(vararg objArrs: Any) = R.string.day_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val monthAgo get() = monthAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun monthAgo(vararg objArrs: Any) = R.string.month_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val yearAgo get() = yearAgo()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun yearAgo(vararg objArrs: Any) = R.string.year_ago.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val crashProcess get() = crashProcess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun crashProcess(vararg objArrs: Any) = R.string.crash_process.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val shareErrorStack get() = shareErrorStack()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun shareErrorStack(vararg objArrs: Any) = R.string.share_error_stack.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureUnmuteAll get() = areYouSureUnmuteAll()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureUnmuteAll(vararg objArrs: Any) = R.string.are_you_sure_unmute_all.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val noListResult get() = noListResult()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun noListResult(vararg objArrs: Any) = R.string.no_list_result.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)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val appErrorsStatistics get() = appErrorsStatistics()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun appErrorsStatistics(vararg objArrs: Any) = R.string.app_errors_statistics.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val totalErrorsUnit get() = totalErrorsUnit()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun totalErrorsUnit(vararg objArrs: Any) = R.string.total_errors_unit.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val totalAppsUnit get() = totalAppsUnit()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun totalAppsUnit(vararg objArrs: Any) = R.string.total_apps_unit.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val generatingStatistics get() = generatingStatistics()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun generatingStatistics(vararg objArrs: Any) = R.string.generating_statistics.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val moduleNotFullyActivatedTip get() = moduleNotFullyActivatedTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun moduleNotFullyActivatedTip(vararg objArrs: Any) = R.string.module_not_fully_activated_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val showErrorsNotify get() = showErrorsNotify()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun showErrorsNotify(vararg objArrs: Any) = R.string.show_errors_notify.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val appErrorsTip get() = appErrorsTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun appErrorsTip(vararg objArrs: Any) = R.string.app_errors_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val batchOperations get() = batchOperations()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun batchOperations(vararg objArrs: Any) = R.string.batch_operations.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val areYouSureApplySiteApps get() = areYouSureApplySiteApps()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun areYouSureApplySiteApps(vararg objArrs: Any) = R.string.are_you_sure_apply_site_apps.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val developerNoticeTip get() = developerNoticeTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun developerNoticeTip(vararg objArrs: Any) = R.string.developer_notice_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val developerNotice get() = developerNotice()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun developerNotice(vararg objArrs: Any) = R.string.developer_notice.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val fastRestartProblem get() = fastRestartProblem()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun fastRestartProblem(vararg objArrs: Any) = R.string.fast_restart_problem.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val userId get() = userId()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun userId(vararg objArrs: Any) = R.string.user_id.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val unableGetAppErrorsRecordTip get() = unableGetAppErrorsRecordTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun unableGetAppErrorsRecordTip(vararg objArrs: Any) = R.string.unable_get_app_errors_record_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val exportAllLogsSuccess get() = exportAllLogsSuccess()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun exportAllLogsSuccess(vararg objArrs: Any) = R.string.export_all_logs_success.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val exportAllLogsFail get() = exportAllLogsFail()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun exportAllLogsFail(vararg objArrs: Any) = R.string.export_all_logs_fail.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val goItNow get() = goItNow()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun goItNow(vararg objArrs: Any) = R.string.go_it_now.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val accessRootFailTip get() = accessRootFailTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun accessRootFailTip(vararg objArrs: Any) = R.string.access_root_fail_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val globalConfig get() = globalConfig()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun globalConfig(vararg objArrs: Any) = R.string.global_config.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val followGlobalConfig get() = followGlobalConfig()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun followGlobalConfig(vararg objArrs: Any) = R.string.follow_global_config.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val batchOperationsNumber get() = batchOperationsNumber()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun batchOperationsNumber(vararg objArrs: Any) = R.string.batch_operations_number.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val clickToUpdate get() = clickToUpdate()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun clickToUpdate(vararg objArrs: Any) = R.string.click_to_update.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val latestVersion get() = latestVersion()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun latestVersion(vararg objArrs: Any) = R.string.latest_version.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val latestVersionTip get() = latestVersionTip()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun latestVersionTip(vararg objArrs: Any) = R.string.latest_version_tip.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val updateNow get() = updateNow()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun updateNow(vararg objArrs: Any) = R.string.update_now.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val recordCount get() = recordCount()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun recordCount(vararg objArrs: Any) = R.string.record_count.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val ciNoticeDialogTitle get() = ciNoticeDialogTitle()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun ciNoticeDialogTitle(vararg objArrs: Any) = R.string.ci_notice_dialog_title.bind(*objArrs)
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
val ciNoticeDialogContent get() = ciNoticeDialogContent()
|
|
||||||
|
|
||||||
/** @string Automatic generated */
|
|
||||||
fun ciNoticeDialogContent(vararg objArrs: Any) = R.string.ci_notice_dialog_content.bind(*objArrs)
|
|
||||||
}
|
|
@@ -35,7 +35,7 @@ import com.fankes.apperrorstracking.const.PackageName
|
|||||||
import com.fankes.apperrorstracking.databinding.ActivitiyLoggerBinding
|
import com.fankes.apperrorstracking.databinding.ActivitiyLoggerBinding
|
||||||
import com.fankes.apperrorstracking.databinding.AdapterLoggerBinding
|
import com.fankes.apperrorstracking.databinding.AdapterLoggerBinding
|
||||||
import com.fankes.apperrorstracking.databinding.DiaLoggerFilterBinding
|
import com.fankes.apperrorstracking.databinding.DiaLoggerFilterBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.bindAdapter
|
import com.fankes.apperrorstracking.utils.factory.bindAdapter
|
||||||
import com.fankes.apperrorstracking.utils.factory.copyToClipboard
|
import com.fankes.apperrorstracking.utils.factory.copyToClipboard
|
||||||
@@ -72,7 +72,7 @@ class LoggerActivity : BaseActivity<ActivitiyLoggerBinding>() {
|
|||||||
binding.refreshIcon.setOnClickListener { refreshData() }
|
binding.refreshIcon.setOnClickListener { refreshData() }
|
||||||
binding.filterIcon.setOnClickListener {
|
binding.filterIcon.setOnClickListener {
|
||||||
showDialog<DiaLoggerFilterBinding> {
|
showDialog<DiaLoggerFilterBinding> {
|
||||||
title = LocaleString.filterByCondition
|
title = locale.filterByCondition
|
||||||
binding.configCheck0.isChecked = filters.any { it == "D" }
|
binding.configCheck0.isChecked = filters.any { it == "D" }
|
||||||
binding.configCheck1.isChecked = filters.any { it == "I" }
|
binding.configCheck1.isChecked = filters.any { it == "I" }
|
||||||
binding.configCheck2.isChecked = filters.any { it == "W" }
|
binding.configCheck2.isChecked = filters.any { it == "W" }
|
||||||
@@ -136,7 +136,7 @@ class LoggerActivity : BaseActivity<ActivitiyLoggerBinding>() {
|
|||||||
binding.exportAllIcon.isVisible = listData.isNotEmpty()
|
binding.exportAllIcon.isVisible = listData.isNotEmpty()
|
||||||
binding.listView.isVisible = listData.isNotEmpty()
|
binding.listView.isVisible = listData.isNotEmpty()
|
||||||
binding.listNoDataView.isVisible = listData.isEmpty()
|
binding.listNoDataView.isVisible = listData.isEmpty()
|
||||||
binding.listNoDataView.text = if (filters.size < 4) LocaleString.noListResult else LocaleString.noListData
|
binding.listNoDataView.text = if (filters.size < 4) locale.noListResult else locale.noListData
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,9 +177,9 @@ class LoggerActivity : BaseActivity<ActivitiyLoggerBinding>() {
|
|||||||
if (requestCode == WRITE_REQUEST_CODE && resultCode == Activity.RESULT_OK) runCatching {
|
if (requestCode == WRITE_REQUEST_CODE && resultCode == Activity.RESULT_OK) runCatching {
|
||||||
data?.data?.let {
|
data?.data?.let {
|
||||||
contentResolver?.openOutputStream(it)?.apply { write(YLog.contents(listData).toByteArray()) }?.close()
|
contentResolver?.openOutputStream(it)?.apply { write(YLog.contents(listData).toByteArray()) }?.close()
|
||||||
toast(LocaleString.exportAllLogsSuccess)
|
toast(locale.exportAllLogsSuccess)
|
||||||
} ?: toast(LocaleString.exportAllLogsFail)
|
} ?: toast(locale.exportAllLogsFail)
|
||||||
}.onFailure { toast(LocaleString.exportAllLogsFail) }
|
}.onFailure { toast(locale.exportAllLogsFail) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@@ -34,7 +34,7 @@ import com.fankes.apperrorstracking.bean.AppErrorsInfoBean
|
|||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
import com.fankes.apperrorstracking.data.factory.bind
|
import com.fankes.apperrorstracking.data.factory.bind
|
||||||
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsDetailBinding
|
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsDetailBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
||||||
@@ -101,13 +101,13 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
if (appErrorsInfo.isEmpty) {
|
if (appErrorsInfo.isEmpty) {
|
||||||
binding.appPanelScrollView.isVisible = false
|
binding.appPanelScrollView.isVisible = false
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.unableGetAppErrorsRecordTip
|
msg = locale.unableGetAppErrorsRecordTip
|
||||||
confirmButton(LocaleString.gotIt) {
|
confirmButton(locale.gotIt) {
|
||||||
cancel()
|
cancel()
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
cancelButton(LocaleString.goItNow) {
|
cancelButton(locale.goItNow) {
|
||||||
cancel()
|
cancel()
|
||||||
finish()
|
finish()
|
||||||
navigate<AppErrorsRecordActivity>()
|
navigate<AppErrorsRecordActivity>()
|
||||||
@@ -119,7 +119,7 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
binding.appInfoItem.setOnClickListener { openSelfSetting(appErrorsInfo.packageName) }
|
binding.appInfoItem.setOnClickListener { openSelfSetting(appErrorsInfo.packageName) }
|
||||||
binding.printIcon.setOnClickListener {
|
binding.printIcon.setOnClickListener {
|
||||||
loggerE(msg = appErrorsInfo.stackTrace)
|
loggerE(msg = appErrorsInfo.stackTrace)
|
||||||
toast(LocaleString.printToLogcatSuccess)
|
toast(locale.printToLogcatSuccess)
|
||||||
}
|
}
|
||||||
binding.copyIcon.setOnClickListener { copyToClipboard(appErrorsInfo.stackOutputShareContent) }
|
binding.copyIcon.setOnClickListener { copyToClipboard(appErrorsInfo.stackOutputShareContent) }
|
||||||
binding.exportIcon.setOnClickListener {
|
binding.exportIcon.setOnClickListener {
|
||||||
@@ -136,14 +136,14 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
startActivity(Intent.createChooser(Intent(Intent.ACTION_SEND).apply {
|
startActivity(Intent.createChooser(Intent(Intent.ACTION_SEND).apply {
|
||||||
type = "text/plain"
|
type = "text/plain"
|
||||||
putExtra(Intent.EXTRA_TEXT, appErrorsInfo.stackOutputShareContent)
|
putExtra(Intent.EXTRA_TEXT, appErrorsInfo.stackOutputShareContent)
|
||||||
}, LocaleString.shareErrorStack))
|
}, locale.shareErrorStack))
|
||||||
}
|
}
|
||||||
binding.appIcon.setImageDrawable(appIconOf(appErrorsInfo.packageName))
|
binding.appIcon.setImageDrawable(appIconOf(appErrorsInfo.packageName))
|
||||||
binding.appNameText.text = appNameOf(appErrorsInfo.packageName).ifBlank { appErrorsInfo.packageName }
|
binding.appNameText.text = appNameOf(appErrorsInfo.packageName).ifBlank { appErrorsInfo.packageName }
|
||||||
binding.appVersionText.text = appErrorsInfo.versionBrand
|
binding.appVersionText.text = appErrorsInfo.versionBrand
|
||||||
binding.appUserIdText.isVisible = appErrorsInfo.userId > 0
|
binding.appUserIdText.isVisible = appErrorsInfo.userId > 0
|
||||||
binding.appUserIdText.text = LocaleString.userId(appErrorsInfo.userId)
|
binding.appUserIdText.text = locale.userId(appErrorsInfo.userId)
|
||||||
binding.appCpuAbiText.text = appErrorsInfo.cpuAbi.ifBlank { LocaleString.noCpuAbi }
|
binding.appCpuAbiText.text = appErrorsInfo.cpuAbi.ifBlank { locale.noCpuAbi }
|
||||||
binding.jvmErrorPanel.isGone = appErrorsInfo.isNativeCrash
|
binding.jvmErrorPanel.isGone = appErrorsInfo.isNativeCrash
|
||||||
binding.errorTypeIcon.setImageResource(if (appErrorsInfo.isNativeCrash) R.drawable.ic_cpp else R.drawable.ic_java)
|
binding.errorTypeIcon.setImageResource(if (appErrorsInfo.isNativeCrash) R.drawable.ic_cpp else R.drawable.ic_java)
|
||||||
binding.errorInfoText.text = appErrorsInfo.exceptionMessage
|
binding.errorInfoText.text = appErrorsInfo.exceptionMessage
|
||||||
@@ -158,7 +158,7 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
binding.appPanelScrollView.setOnScrollChangeListener { _, _, y, _, _ ->
|
binding.appPanelScrollView.setOnScrollChangeListener { _, _, y, _, _ ->
|
||||||
binding.detailTitleText.text = if (y >= 30.dp(context = this@AppErrorsDetailActivity))
|
binding.detailTitleText.text = if (y >= 30.dp(context = this@AppErrorsDetailActivity))
|
||||||
appNameOf(appErrorsInfo.packageName).ifBlank { appErrorsInfo.packageName }
|
appNameOf(appErrorsInfo.packageName).ifBlank { appErrorsInfo.packageName }
|
||||||
else LocaleString.appName
|
else locale.appName
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -176,9 +176,9 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
if (requestCode == WRITE_REQUEST_CODE && resultCode == Activity.RESULT_OK) runCatching {
|
if (requestCode == WRITE_REQUEST_CODE && resultCode == Activity.RESULT_OK) runCatching {
|
||||||
data?.data?.let {
|
data?.data?.let {
|
||||||
contentResolver?.openOutputStream(it)?.apply { write(stackTrace.toByteArray()) }?.close()
|
contentResolver?.openOutputStream(it)?.apply { write(stackTrace.toByteArray()) }?.close()
|
||||||
toast(LocaleString.outputStackSuccess)
|
toast(locale.outputStackSuccess)
|
||||||
} ?: toast(LocaleString.outputStackFail)
|
} ?: toast(locale.outputStackFail)
|
||||||
}.onFailure { toast(LocaleString.outputStackFail) }
|
}.onFailure { toast(locale.outputStackFail) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onBackPressed() {
|
override fun onBackPressed() {
|
||||||
|
@@ -29,7 +29,7 @@ import com.fankes.apperrorstracking.bean.AppErrorsDisplayBean
|
|||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsDisplayBinding
|
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsDisplayBinding
|
||||||
import com.fankes.apperrorstracking.databinding.DiaAppErrorsDisplayBinding
|
import com.fankes.apperrorstracking.databinding.DiaAppErrorsDisplayBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.colorOf
|
import com.fankes.apperrorstracking.utils.factory.colorOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.getSerializableExtraCompat
|
import com.fankes.apperrorstracking.utils.factory.getSerializableExtraCompat
|
||||||
@@ -78,7 +78,7 @@ class AppErrorsDisplayActivity : BaseActivity<ActivityAppErrorsDisplayBinding>()
|
|||||||
binding.appInfoItem.isVisible = appErrorsDisplay.isShowAppInfoButton
|
binding.appInfoItem.isVisible = appErrorsDisplay.isShowAppInfoButton
|
||||||
binding.closeAppItem.isVisible = appErrorsDisplay.isShowReopenButton.not() && appErrorsDisplay.isShowCloseAppButton
|
binding.closeAppItem.isVisible = appErrorsDisplay.isShowReopenButton.not() && appErrorsDisplay.isShowCloseAppButton
|
||||||
binding.reopenAppItem.isVisible = appErrorsDisplay.isShowReopenButton
|
binding.reopenAppItem.isVisible = appErrorsDisplay.isShowReopenButton
|
||||||
binding.processNameText.text = LocaleString.crashProcess(appErrorsDisplay.processName)
|
binding.processNameText.text = locale.crashProcess(appErrorsDisplay.processName)
|
||||||
binding.appInfoItem.setOnClickListener {
|
binding.appInfoItem.setOnClickListener {
|
||||||
cancel()
|
cancel()
|
||||||
openSelfSetting(appErrorsDisplay.packageName)
|
openSelfSetting(appErrorsDisplay.packageName)
|
||||||
@@ -96,13 +96,13 @@ class AppErrorsDisplayActivity : BaseActivity<ActivityAppErrorsDisplayBinding>()
|
|||||||
}
|
}
|
||||||
binding.mutedIfUnlockItem.setOnClickListener {
|
binding.mutedIfUnlockItem.setOnClickListener {
|
||||||
FrameworkTool.mutedErrorsIfUnlock(context, appErrorsDisplay.packageName) {
|
FrameworkTool.mutedErrorsIfUnlock(context, appErrorsDisplay.packageName) {
|
||||||
toast(LocaleString.muteIfUnlockTip(appErrorsDisplay.appName))
|
toast(locale.muteIfUnlockTip(appErrorsDisplay.appName))
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.mutedIfRestartItem.setOnClickListener {
|
binding.mutedIfRestartItem.setOnClickListener {
|
||||||
FrameworkTool.mutedErrorsIfRestart(context, appErrorsDisplay.packageName) {
|
FrameworkTool.mutedErrorsIfRestart(context, appErrorsDisplay.packageName) {
|
||||||
toast(LocaleString.muteIfRestartTip(appErrorsDisplay.appName))
|
toast(locale.muteIfRestartTip(appErrorsDisplay.appName))
|
||||||
cancel()
|
cancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -25,7 +25,7 @@ import androidx.core.view.isVisible
|
|||||||
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
|
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
|
||||||
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsMutedBinding
|
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsMutedBinding
|
||||||
import com.fankes.apperrorstracking.databinding.AdapterAppErrorsMutedBinding
|
import com.fankes.apperrorstracking.databinding.AdapterAppErrorsMutedBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
||||||
@@ -45,8 +45,8 @@ class AppErrorsMutedActivity : BaseActivity<ActivityAppErrorsMutedBinding>() {
|
|||||||
binding.titleBackIcon.setOnClickListener { onBackPressed() }
|
binding.titleBackIcon.setOnClickListener { onBackPressed() }
|
||||||
binding.unmuteAllIcon.setOnClickListener {
|
binding.unmuteAllIcon.setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureUnmuteAll
|
msg = locale.areYouSureUnmuteAll
|
||||||
confirmButton { FrameworkTool.unmuteAllErrorsApps(context) { refreshData() } }
|
confirmButton { FrameworkTool.unmuteAllErrorsApps(context) { refreshData() } }
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
@@ -59,8 +59,8 @@ class AppErrorsMutedActivity : BaseActivity<ActivityAppErrorsMutedBinding>() {
|
|||||||
binding.appIcon.setImageDrawable(appIconOf(bean.packageName))
|
binding.appIcon.setImageDrawable(appIconOf(bean.packageName))
|
||||||
binding.appNameText.text = appNameOf(bean.packageName).ifBlank { bean.packageName }
|
binding.appNameText.text = appNameOf(bean.packageName).ifBlank { bean.packageName }
|
||||||
binding.muteTypeText.text = when (bean.type) {
|
binding.muteTypeText.text = when (bean.type) {
|
||||||
MutedErrorsAppBean.MuteType.UNTIL_UNLOCKS -> LocaleString.muteIfUnlock
|
MutedErrorsAppBean.MuteType.UNTIL_UNLOCKS -> locale.muteIfUnlock
|
||||||
MutedErrorsAppBean.MuteType.UNTIL_REBOOTS -> LocaleString.muteIfRestart
|
MutedErrorsAppBean.MuteType.UNTIL_REBOOTS -> locale.muteIfRestart
|
||||||
}
|
}
|
||||||
binding.unmuteButton.setOnClickListener { FrameworkTool.unmuteErrorsApp(context, bean) { refreshData() } }
|
binding.unmuteButton.setOnClickListener { FrameworkTool.unmuteErrorsApp(context, bean) { refreshData() } }
|
||||||
}
|
}
|
||||||
|
@@ -38,7 +38,7 @@ import com.fankes.apperrorstracking.bean.enum.AppFiltersType
|
|||||||
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsRecordBinding
|
import com.fankes.apperrorstracking.databinding.ActivityAppErrorsRecordBinding
|
||||||
import com.fankes.apperrorstracking.databinding.AdapterAppErrorsRecordBinding
|
import com.fankes.apperrorstracking.databinding.AdapterAppErrorsRecordBinding
|
||||||
import com.fankes.apperrorstracking.databinding.DiaAppErrorsStatisticsBinding
|
import com.fankes.apperrorstracking.databinding.DiaAppErrorsStatisticsBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
import com.fankes.apperrorstracking.utils.factory.appNameOf
|
||||||
@@ -82,8 +82,8 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
binding.titleBackIcon.setOnClickListener { onBackPressed() }
|
binding.titleBackIcon.setOnClickListener { onBackPressed() }
|
||||||
binding.appErrorSisIcon.setOnClickListener {
|
binding.appErrorSisIcon.setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
progressContent = LocaleString.generatingStatistics
|
progressContent = locale.generatingStatistics
|
||||||
noCancelable()
|
noCancelable()
|
||||||
FrameworkTool.fetchAppListData(context, AppFiltersBean(type = AppFiltersType.ALL)) {
|
FrameworkTool.fetchAppListData(context, AppFiltersBean(type = AppFiltersType.ALL)) {
|
||||||
newThread {
|
newThread {
|
||||||
@@ -100,14 +100,14 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
runOnUiThread {
|
runOnUiThread {
|
||||||
cancel()
|
cancel()
|
||||||
showDialog<DiaAppErrorsStatisticsBinding> {
|
showDialog<DiaAppErrorsStatisticsBinding> {
|
||||||
title = LocaleString.appErrorsStatistics
|
title = locale.appErrorsStatistics
|
||||||
binding.totalErrorsUnitText.text = LocaleString.totalErrorsUnit(listData.size)
|
binding.totalErrorsUnitText.text = locale.totalErrorsUnit(listData.size)
|
||||||
binding.totalAppsUnitText.text = LocaleString.totalAppsUnit(it.size)
|
binding.totalAppsUnitText.text = locale.totalAppsUnit(it.size)
|
||||||
binding.mostErrorsAppIcon.setImageDrawable(appIconOf(mostAppPackageName))
|
binding.mostErrorsAppIcon.setImageDrawable(appIconOf(mostAppPackageName))
|
||||||
binding.mostErrorsAppText.text = appNameOf(mostAppPackageName).ifBlank { mostAppPackageName }
|
binding.mostErrorsAppText.text = appNameOf(mostAppPackageName).ifBlank { mostAppPackageName }
|
||||||
binding.mostErrorsTypeText.text = mostErrorsType
|
binding.mostErrorsTypeText.text = mostErrorsType
|
||||||
binding.totalPptOfErrorsText.text = "$pptCount%"
|
binding.totalPptOfErrorsText.text = "$pptCount%"
|
||||||
confirmButton(LocaleString.gotIt)
|
confirmButton(locale.gotIt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -116,12 +116,12 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
}
|
}
|
||||||
binding.clearAllIcon.setOnClickListener {
|
binding.clearAllIcon.setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureClearErrors
|
msg = locale.areYouSureClearErrors
|
||||||
confirmButton {
|
confirmButton {
|
||||||
FrameworkTool.clearAppErrorsInfoData(context) {
|
FrameworkTool.clearAppErrorsInfoData(context) {
|
||||||
refreshData()
|
refreshData()
|
||||||
toast(LocaleString.allErrorsClearSuccess)
|
toast(locale.allErrorsClearSuccess)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
cancelButton()
|
cancelButton()
|
||||||
@@ -129,8 +129,8 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
}
|
}
|
||||||
binding.exportAllIcon.setOnClickListener {
|
binding.exportAllIcon.setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureExportAllErrors
|
msg = locale.areYouSureExportAllErrors
|
||||||
confirmButton { exportAll() }
|
confirmButton { exportAll() }
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
binding.appIcon.setImageDrawable(appIconOf(bean.packageName))
|
binding.appIcon.setImageDrawable(appIconOf(bean.packageName))
|
||||||
binding.appNameText.text = appNameOf(bean.packageName).ifBlank { bean.packageName }
|
binding.appNameText.text = appNameOf(bean.packageName).ifBlank { bean.packageName }
|
||||||
binding.appUserIdText.isVisible = bean.userId > 0
|
binding.appUserIdText.isVisible = bean.userId > 0
|
||||||
binding.appUserIdText.text = LocaleString.userId(bean.userId)
|
binding.appUserIdText.text = locale.userId(bean.userId)
|
||||||
binding.errorsTimeText.text = bean.crossTime
|
binding.errorsTimeText.text = bean.crossTime
|
||||||
binding.errorTypeIcon.setImageResource(if (bean.isNativeCrash) R.drawable.ic_cpp else R.drawable.ic_java)
|
binding.errorTypeIcon.setImageResource(if (bean.isNativeCrash) R.drawable.ic_cpp else R.drawable.ic_java)
|
||||||
binding.errorTypeText.text = if (bean.isNativeCrash) "Native crash" else bean.exceptionClassName.simpleThwName()
|
binding.errorTypeText.text = if (bean.isNativeCrash) "Native crash" else bean.exceptionClassName.simpleThwName()
|
||||||
@@ -160,7 +160,7 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
/** 更新列表数据 */
|
/** 更新列表数据 */
|
||||||
private fun refreshData() {
|
private fun refreshData() {
|
||||||
FrameworkTool.fetchAppErrorsInfoData(context = this) {
|
FrameworkTool.fetchAppErrorsInfoData(context = this) {
|
||||||
binding.titleCountText.text = LocaleString.recordCount(it.size)
|
binding.titleCountText.text = locale.recordCount(it.size)
|
||||||
binding.listProgressView.isVisible = false
|
binding.listProgressView.isVisible = false
|
||||||
binding.appErrorSisIcon.isVisible = it.size >= 5
|
binding.appErrorSisIcon.isVisible = it.size >= 5
|
||||||
binding.clearAllIcon.isVisible = it.isNotEmpty()
|
binding.clearAllIcon.isVisible = it.isNotEmpty()
|
||||||
@@ -219,8 +219,8 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
R.id.aerrors_app_info -> openSelfSetting(listData[it.position].packageName)
|
R.id.aerrors_app_info -> openSelfSetting(listData[it.position].packageName)
|
||||||
R.id.aerrors_remove_record ->
|
R.id.aerrors_remove_record ->
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureRemoveRecord
|
msg = locale.areYouSureRemoveRecord
|
||||||
confirmButton { FrameworkTool.removeAppErrorsInfoData(context, listData[it.position]) { refreshData() } }
|
confirmButton { FrameworkTool.removeAppErrorsInfoData(context, listData[it.position]) { refreshData() } }
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
@@ -235,9 +235,9 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
data?.data?.let {
|
data?.data?.let {
|
||||||
contentResolver?.openOutputStream(it)?.apply { write(FileInputStream(outPutFilePath).readBytes()) }?.close()
|
contentResolver?.openOutputStream(it)?.apply { write(FileInputStream(outPutFilePath).readBytes()) }?.close()
|
||||||
clearAllExportTemp()
|
clearAllExportTemp()
|
||||||
toast(LocaleString.exportAllErrorsSuccess)
|
toast(locale.exportAllErrorsSuccess)
|
||||||
} ?: toast(LocaleString.exportAllErrorsFail)
|
} ?: toast(locale.exportAllErrorsFail)
|
||||||
}.onFailure { toast(LocaleString.exportAllErrorsFail) }
|
}.onFailure { toast(locale.exportAllErrorsFail) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@@ -31,7 +31,7 @@ import com.fankes.apperrorstracking.databinding.ActivityConfigBinding
|
|||||||
import com.fankes.apperrorstracking.databinding.AdapterAppInfoBinding
|
import com.fankes.apperrorstracking.databinding.AdapterAppInfoBinding
|
||||||
import com.fankes.apperrorstracking.databinding.DiaAppConfigBinding
|
import com.fankes.apperrorstracking.databinding.DiaAppConfigBinding
|
||||||
import com.fankes.apperrorstracking.databinding.DiaAppsFilterBinding
|
import com.fankes.apperrorstracking.databinding.DiaAppsFilterBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
import com.fankes.apperrorstracking.utils.factory.appIconOf
|
||||||
import com.fankes.apperrorstracking.utils.factory.bindAdapter
|
import com.fankes.apperrorstracking.utils.factory.bindAdapter
|
||||||
@@ -53,16 +53,16 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
binding.titleBackIcon.setOnClickListener { finish() }
|
binding.titleBackIcon.setOnClickListener { finish() }
|
||||||
binding.globalIcon.setOnClickListener {
|
binding.globalIcon.setOnClickListener {
|
||||||
showAppConfigDialog(LocaleString.globalConfig, isShowGlobalConfig = false) { type ->
|
showAppConfigDialog(locale.globalConfig, isShowGlobalConfig = false) { type ->
|
||||||
AppErrorsConfigData.putAppShowingType(type)
|
AppErrorsConfigData.putAppShowingType(type)
|
||||||
onChanged?.invoke()
|
onChanged?.invoke()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.batchIcon.setOnClickListener {
|
binding.batchIcon.setOnClickListener {
|
||||||
showAppConfigDialog(LocaleString.batchOperationsNumber(listData.size), isNotSetDefaultValue = true) { type ->
|
showAppConfigDialog(locale.batchOperationsNumber(listData.size), isNotSetDefaultValue = true) { type ->
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureApplySiteApps(listData.size)
|
msg = locale.areYouSureApplySiteApps(listData.size)
|
||||||
confirmButton {
|
confirmButton {
|
||||||
listData.takeIf { it.isNotEmpty() }?.forEach { AppErrorsConfigData.putAppShowingType(type, it.packageName) }
|
listData.takeIf { it.isNotEmpty() }?.forEach { AppErrorsConfigData.putAppShowingType(type, it.packageName) }
|
||||||
onChanged?.invoke()
|
onChanged?.invoke()
|
||||||
@@ -73,7 +73,7 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
}
|
}
|
||||||
binding.filterIcon.setOnClickListener {
|
binding.filterIcon.setOnClickListener {
|
||||||
showDialog<DiaAppsFilterBinding> {
|
showDialog<DiaAppsFilterBinding> {
|
||||||
title = LocaleString.filterByCondition
|
title = locale.filterByCondition
|
||||||
binding.filtersRadioUser.isChecked = appFilters.type == AppFiltersType.USER
|
binding.filtersRadioUser.isChecked = appFilters.type == AppFiltersType.USER
|
||||||
binding.filtersRadioSystem.isChecked = appFilters.type == AppFiltersType.SYSTEM
|
binding.filtersRadioSystem.isChecked = appFilters.type == AppFiltersType.SYSTEM
|
||||||
binding.filtersRadioAll.isChecked = appFilters.type == AppFiltersType.ALL
|
binding.filtersRadioAll.isChecked = appFilters.type == AppFiltersType.ALL
|
||||||
@@ -101,7 +101,7 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
}
|
}
|
||||||
cancelButton()
|
cancelButton()
|
||||||
if (appFilters.name.isNotBlank())
|
if (appFilters.name.isNotBlank())
|
||||||
neutralButton(LocaleString.clearFilters) {
|
neutralButton(locale.clearFilters) {
|
||||||
setAppFiltersType()
|
setAppFiltersType()
|
||||||
appFilters.name = ""
|
appFilters.name = ""
|
||||||
refreshData()
|
refreshData()
|
||||||
@@ -116,11 +116,11 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
binding.appIcon.setImageDrawable(bean.icon)
|
binding.appIcon.setImageDrawable(bean.icon)
|
||||||
binding.appNameText.text = bean.name
|
binding.appNameText.text = bean.name
|
||||||
binding.configTypeText.text = when {
|
binding.configTypeText.text = when {
|
||||||
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.GLOBAL, bean.packageName) -> LocaleString.followGlobalConfig
|
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.GLOBAL, bean.packageName) -> locale.followGlobalConfig
|
||||||
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.DIALOG, bean.packageName) -> LocaleString.showErrorsDialog
|
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.DIALOG, bean.packageName) -> locale.showErrorsDialog
|
||||||
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.NOTIFY, bean.packageName) -> LocaleString.showErrorsNotify
|
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.NOTIFY, bean.packageName) -> locale.showErrorsNotify
|
||||||
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.TOAST, bean.packageName) -> LocaleString.showErrorsToast
|
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.TOAST, bean.packageName) -> locale.showErrorsToast
|
||||||
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.NOTHING, bean.packageName) -> LocaleString.showNothing
|
AppErrorsConfigData.isAppShowingType(AppErrorsConfigType.NOTHING, bean.packageName) -> locale.showNothing
|
||||||
else -> "Unknown type"
|
else -> "Unknown type"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -138,8 +138,8 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
/** 模块未完全激活将显示警告 */
|
/** 模块未完全激活将显示警告 */
|
||||||
if (MainActivity.isModuleValied.not())
|
if (MainActivity.isModuleValied.not())
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.moduleNotFullyActivatedTip
|
msg = locale.moduleNotFullyActivatedTip
|
||||||
confirmButton { FrameworkTool.restartSystem(context) }
|
confirmButton { FrameworkTool.restartSystem(context) }
|
||||||
cancelButton()
|
cancelButton()
|
||||||
noCancelable()
|
noCancelable()
|
||||||
@@ -199,7 +199,7 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
binding.filterIcon.isVisible = false
|
binding.filterIcon.isVisible = false
|
||||||
binding.listView.isVisible = false
|
binding.listView.isVisible = false
|
||||||
binding.listNoDataView.isVisible = false
|
binding.listNoDataView.isVisible = false
|
||||||
binding.titleCountText.text = LocaleString.loading
|
binding.titleCountText.text = locale.loading
|
||||||
FrameworkTool.fetchAppListData(context = this, appFilters) {
|
FrameworkTool.fetchAppListData(context = this, appFilters) {
|
||||||
/** 设置一个临时变量用于更新列表数据 */
|
/** 设置一个临时变量用于更新列表数据 */
|
||||||
val tempsData = ArrayList<AppInfoBean>()
|
val tempsData = ArrayList<AppInfoBean>()
|
||||||
@@ -221,7 +221,7 @@ class ConfigureActivity : BaseActivity<ActivityConfigBinding>() {
|
|||||||
binding.filterIcon.isVisible = true
|
binding.filterIcon.isVisible = true
|
||||||
binding.listView.isVisible = listData.isNotEmpty()
|
binding.listView.isVisible = listData.isNotEmpty()
|
||||||
binding.listNoDataView.isVisible = listData.isEmpty()
|
binding.listNoDataView.isVisible = listData.isEmpty()
|
||||||
binding.titleCountText.text = LocaleString.resultCount(listData.size)
|
binding.titleCountText.text = locale.resultCount(listData.size)
|
||||||
} else tempsData.clear()
|
} else tempsData.clear()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -30,7 +30,7 @@ import com.fankes.apperrorstracking.const.ModuleVersion
|
|||||||
import com.fankes.apperrorstracking.data.ConfigData
|
import com.fankes.apperrorstracking.data.ConfigData
|
||||||
import com.fankes.apperrorstracking.data.factory.bind
|
import com.fankes.apperrorstracking.data.factory.bind
|
||||||
import com.fankes.apperrorstracking.databinding.ActivityMainBinding
|
import com.fankes.apperrorstracking.databinding.ActivityMainBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
import com.fankes.apperrorstracking.ui.activity.base.BaseActivity
|
||||||
import com.fankes.apperrorstracking.ui.activity.debug.LoggerActivity
|
import com.fankes.apperrorstracking.ui.activity.debug.LoggerActivity
|
||||||
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsMutedActivity
|
import com.fankes.apperrorstracking.ui.activity.errors.AppErrorsMutedActivity
|
||||||
@@ -65,7 +65,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
/** 检查更新 */
|
/** 检查更新 */
|
||||||
GithubReleaseTool.checkingForUpdate(context = this, ModuleVersion.NAME) { version, function ->
|
GithubReleaseTool.checkingForUpdate(context = this, ModuleVersion.NAME) { version, function ->
|
||||||
binding.mainTextReleaseVersion.apply {
|
binding.mainTextReleaseVersion.apply {
|
||||||
text = LocaleString.clickToUpdate(version)
|
text = locale.clickToUpdate(version)
|
||||||
isVisible = true
|
isVisible = true
|
||||||
setOnClickListener { function() }
|
setOnClickListener { function() }
|
||||||
}
|
}
|
||||||
@@ -75,9 +75,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
/** 显示开发者提示 */
|
/** 显示开发者提示 */
|
||||||
if (ConfigData.isShowDeveloperNotice)
|
if (ConfigData.isShowDeveloperNotice)
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.developerNotice
|
title = locale.developerNotice
|
||||||
msg = LocaleString.developerNoticeTip
|
msg = locale.developerNoticeTip
|
||||||
confirmButton(LocaleString.gotIt) { ConfigData.isShowDeveloperNotice = false }
|
confirmButton(locale.gotIt) { ConfigData.isShowDeveloperNotice = false }
|
||||||
noCancelable()
|
noCancelable()
|
||||||
}
|
}
|
||||||
/** 设置 CI 自动构建标识 */
|
/** 设置 CI 自动构建标识 */
|
||||||
@@ -87,15 +87,15 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
isVisible = true
|
isVisible = true
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.ciNoticeDialogTitle
|
title = locale.ciNoticeDialogTitle
|
||||||
msg = LocaleString.ciNoticeDialogContent(ModuleVersion.GITHUB_COMMIT_ID)
|
msg = locale.ciNoticeDialogContent(ModuleVersion.GITHUB_COMMIT_ID)
|
||||||
confirmButton(LocaleString.gotIt)
|
confirmButton(locale.gotIt)
|
||||||
noCancelable()
|
noCancelable()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
binding.mainTextVersion.text = LocaleString.moduleVersion(ModuleVersion.NAME)
|
binding.mainTextVersion.text = locale.moduleVersion(ModuleVersion.NAME)
|
||||||
binding.mainTextSystemVersion.text = LocaleString.systemVersion(systemVersion)
|
binding.mainTextSystemVersion.text = locale.systemVersion(systemVersion)
|
||||||
binding.onlyShowErrorsInFrontSwitch.bind(ConfigData.ENABLE_ONLY_SHOW_ERRORS_IN_FRONT)
|
binding.onlyShowErrorsInFrontSwitch.bind(ConfigData.ENABLE_ONLY_SHOW_ERRORS_IN_FRONT)
|
||||||
binding.onlyShowErrorsInMainProcessSwitch.bind(ConfigData.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN)
|
binding.onlyShowErrorsInMainProcessSwitch.bind(ConfigData.ENABLE_ONLY_SHOW_ERRORS_IN_MAIN)
|
||||||
binding.alwaysShowsReopenAppOptionsSwitch.bind(ConfigData.ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS)
|
binding.alwaysShowsReopenAppOptionsSwitch.bind(ConfigData.ENABLE_ALWAYS_SHOWS_REOPEN_APP_OPTIONS)
|
||||||
@@ -110,9 +110,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
/** 系统版本点击事件 */
|
/** 系统版本点击事件 */
|
||||||
binding.mainTextSystemVersion.setOnClickListener {
|
binding.mainTextSystemVersion.setOnClickListener {
|
||||||
showDialog {
|
showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = systemVersion
|
msg = systemVersion
|
||||||
confirmButton(LocaleString.gotIt)
|
confirmButton(locale.gotIt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/** 管理应用配置模板按钮点击事件 */
|
/** 管理应用配置模板按钮点击事件 */
|
||||||
@@ -155,9 +155,9 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
}
|
}
|
||||||
)
|
)
|
||||||
binding.mainTextStatus.text = when {
|
binding.mainTextStatus.text = when {
|
||||||
YukiHookAPI.Status.isXposedModuleActive && isModuleValied.not() -> LocaleString.moduleNotFullyActivated
|
YukiHookAPI.Status.isXposedModuleActive && isModuleValied.not() -> locale.moduleNotFullyActivated
|
||||||
YukiHookAPI.Status.isXposedModuleActive -> LocaleString.moduleIsActivated
|
YukiHookAPI.Status.isXposedModuleActive -> locale.moduleIsActivated
|
||||||
else -> LocaleString.moduleNotActivated
|
else -> locale.moduleNotActivated
|
||||||
}
|
}
|
||||||
binding.mainTextApiWay.isVisible = YukiHookAPI.Status.isXposedModuleActive
|
binding.mainTextApiWay.isVisible = YukiHookAPI.Status.isXposedModuleActive
|
||||||
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.Executor.name} API ${YukiHookAPI.Status.Executor.apiLevel}"
|
binding.mainTextApiWay.text = "Activated by ${YukiHookAPI.Status.Executor.name} API ${YukiHookAPI.Status.Executor.apiLevel}"
|
||||||
@@ -168,7 +168,7 @@ class MainActivity : BaseActivity<ActivityMainBinding>() {
|
|||||||
* @param callback 激活后回调
|
* @param callback 激活后回调
|
||||||
*/
|
*/
|
||||||
private inline fun whenActivated(callback: () -> Unit) {
|
private inline fun whenActivated(callback: () -> Unit) {
|
||||||
if (YukiHookAPI.Status.isXposedModuleActive) callback() else toast(LocaleString.moduleNotActivated)
|
if (YukiHookAPI.Status.isXposedModuleActive) callback() else toast(locale.moduleNotActivated)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
|
@@ -33,7 +33,7 @@ import android.widget.LinearLayout
|
|||||||
import android.widget.TextView
|
import android.widget.TextView
|
||||||
import androidx.appcompat.app.AlertDialog
|
import androidx.appcompat.app.AlertDialog
|
||||||
import androidx.viewbinding.ViewBinding
|
import androidx.viewbinding.ViewBinding
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
import com.google.android.material.dialog.MaterialAlertDialogBuilder
|
||||||
import com.google.android.material.progressindicator.CircularProgressIndicator
|
import com.google.android.material.progressindicator.CircularProgressIndicator
|
||||||
import com.google.android.material.shape.MaterialShapeDrawable
|
import com.google.android.material.shape.MaterialShapeDrawable
|
||||||
@@ -149,7 +149,7 @@ class DialogBuilder<VB : ViewBinding>(
|
|||||||
* @param text 按钮文本内容
|
* @param text 按钮文本内容
|
||||||
* @param callback 点击事件
|
* @param callback 点击事件
|
||||||
*/
|
*/
|
||||||
fun confirmButton(text: String = LocaleString.confirm, callback: () -> Unit = {}) {
|
fun confirmButton(text: String = locale.confirm, callback: () -> Unit = {}) {
|
||||||
instance?.setPositiveButton(text) { _, _ -> callback() }
|
instance?.setPositiveButton(text) { _, _ -> callback() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -158,7 +158,7 @@ class DialogBuilder<VB : ViewBinding>(
|
|||||||
* @param text 按钮文本内容
|
* @param text 按钮文本内容
|
||||||
* @param callback 点击事件
|
* @param callback 点击事件
|
||||||
*/
|
*/
|
||||||
fun cancelButton(text: String = LocaleString.cancel, callback: () -> Unit = {}) {
|
fun cancelButton(text: String = locale.cancel, callback: () -> Unit = {}) {
|
||||||
instance?.setNegativeButton(text) { _, _ -> callback() }
|
instance?.setNegativeButton(text) { _, _ -> callback() }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -167,7 +167,7 @@ class DialogBuilder<VB : ViewBinding>(
|
|||||||
* @param text 按钮文本内容
|
* @param text 按钮文本内容
|
||||||
* @param callback 点击事件
|
* @param callback 点击事件
|
||||||
*/
|
*/
|
||||||
fun neutralButton(text: String = LocaleString.more, callback: () -> Unit = {}) {
|
fun neutralButton(text: String = locale.more, callback: () -> Unit = {}) {
|
||||||
instance?.setNeutralButton(text) { _, _ -> callback() }
|
instance?.setNeutralButton(text) { _, _ -> callback() }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -52,7 +52,7 @@ import androidx.core.content.pm.PackageInfoCompat
|
|||||||
import androidx.core.content.res.ResourcesCompat
|
import androidx.core.content.res.ResourcesCompat
|
||||||
import androidx.core.graphics.drawable.IconCompat
|
import androidx.core.graphics.drawable.IconCompat
|
||||||
import com.fankes.apperrorstracking.R
|
import com.fankes.apperrorstracking.R
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.wrapper.BuildConfigWrapper
|
import com.fankes.apperrorstracking.wrapper.BuildConfigWrapper
|
||||||
import com.google.android.material.snackbar.Snackbar
|
import com.google.android.material.snackbar.Snackbar
|
||||||
import com.highcapable.yukihookapi.hook.factory.field
|
import com.highcapable.yukihookapi.hook.factory.field
|
||||||
@@ -338,7 +338,7 @@ fun Context.copyToClipboard(content: String) = runCatching {
|
|||||||
(getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager).apply {
|
(getSystemService(Context.CLIPBOARD_SERVICE) as ClipboardManager).apply {
|
||||||
setPrimaryClip(ClipData.newPlainText(null, content))
|
setPrimaryClip(ClipData.newPlainText(null, content))
|
||||||
(primaryClip?.getItemAt(0)?.text ?: "").also {
|
(primaryClip?.getItemAt(0)?.text ?: "").also {
|
||||||
if (it != content) toast(LocaleString.copyFail) else toast(LocaleString.copied)
|
if (it != content) toast(locale.copyFail) else toast(locale.copied)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -27,7 +27,7 @@ import com.fankes.apperrorstracking.bean.AppFiltersBean
|
|||||||
import com.fankes.apperrorstracking.bean.AppInfoBean
|
import com.fankes.apperrorstracking.bean.AppInfoBean
|
||||||
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
|
import com.fankes.apperrorstracking.bean.MutedErrorsAppBean
|
||||||
import com.fankes.apperrorstracking.const.PackageName
|
import com.fankes.apperrorstracking.const.PackageName
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.utils.factory.execShell
|
import com.fankes.apperrorstracking.utils.factory.execShell
|
||||||
import com.fankes.apperrorstracking.utils.factory.isRootAccess
|
import com.fankes.apperrorstracking.utils.factory.isRootAccess
|
||||||
import com.fankes.apperrorstracking.utils.factory.showDialog
|
import com.fankes.apperrorstracking.utils.factory.showDialog
|
||||||
@@ -211,22 +211,22 @@ object FrameworkTool {
|
|||||||
/** 当 Root 权限获取失败时显示对话框 */
|
/** 当 Root 权限获取失败时显示对话框 */
|
||||||
fun showWhenAccessRootFail() =
|
fun showWhenAccessRootFail() =
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = LocaleString.accessRootFail
|
title = locale.accessRootFail
|
||||||
msg = LocaleString.accessRootFailTip
|
msg = locale.accessRootFailTip
|
||||||
confirmButton(LocaleString.gotIt)
|
confirmButton(locale.gotIt)
|
||||||
}
|
}
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = LocaleString.notice
|
title = locale.notice
|
||||||
msg = LocaleString.areYouSureRestartSystem
|
msg = locale.areYourSureRestartSystem
|
||||||
confirmButton {
|
confirmButton {
|
||||||
if (isRootAccess)
|
if (isRootAccess)
|
||||||
execShell(cmd = "reboot")
|
execShell(cmd = "reboot")
|
||||||
else showWhenAccessRootFail()
|
else showWhenAccessRootFail()
|
||||||
}
|
}
|
||||||
neutralButton(LocaleString.fastRestart) {
|
neutralButton(locale.fastRestart) {
|
||||||
context.showDialog {
|
context.showDialog {
|
||||||
title = LocaleString.warning
|
title = locale.warning
|
||||||
msg = LocaleString.fastRestartProblem
|
msg = locale.fastRestartProblem
|
||||||
confirmButton {
|
confirmButton {
|
||||||
if (isRootAccess)
|
if (isRootAccess)
|
||||||
execShell(cmd = "killall zygote")
|
execShell(cmd = "killall zygote")
|
||||||
|
@@ -26,7 +26,7 @@ import android.content.Context
|
|||||||
import android.icu.text.SimpleDateFormat
|
import android.icu.text.SimpleDateFormat
|
||||||
import android.icu.util.Calendar
|
import android.icu.util.Calendar
|
||||||
import android.icu.util.TimeZone
|
import android.icu.util.TimeZone
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.locale
|
||||||
import com.fankes.apperrorstracking.utils.factory.openBrowser
|
import com.fankes.apperrorstracking.utils.factory.openBrowser
|
||||||
import com.fankes.apperrorstracking.utils.factory.showDialog
|
import com.fankes.apperrorstracking.utils.factory.showDialog
|
||||||
import okhttp3.Call
|
import okhttp3.Call
|
||||||
@@ -74,9 +74,9 @@ object GithubReleaseTool {
|
|||||||
date = getString("published_at").localTime()
|
date = getString("published_at").localTime()
|
||||||
).apply {
|
).apply {
|
||||||
fun showUpdate() = context.showDialog {
|
fun showUpdate() = context.showDialog {
|
||||||
title = LocaleString.latestVersion(name)
|
title = locale.latestVersion(name)
|
||||||
msg = LocaleString.latestVersionTip(date, content)
|
msg = locale.latestVersionTip(date, content)
|
||||||
confirmButton(LocaleString.updateNow) { context.openBrowser(htmlUrl) }
|
confirmButton(locale.updateNow) { context.openBrowser(htmlUrl) }
|
||||||
cancelButton()
|
cancelButton()
|
||||||
}
|
}
|
||||||
if (name != version) (context as? Activity?)?.runOnUiThread {
|
if (name != version) (context as? Activity?)?.runOnUiThread {
|
||||||
|
Reference in New Issue
Block a user