mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-01 16:55:18 +08:00
Added CPU ABI shower in AppErrorsDetailActivity
This commit is contained in:
@@ -214,4 +214,10 @@ object LocaleString {
|
|||||||
|
|
||||||
/** @string Automatic generated */
|
/** @string Automatic generated */
|
||||||
fun exportAllErrorsFail(vararg objArrs: Any) = R.string.export_all_errors_fail.bind(*objArrs)
|
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)
|
||||||
}
|
}
|
@@ -79,6 +79,7 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
binding.appIcon.setImageDrawable(appIcon(appErrorsInfo.packageName))
|
binding.appIcon.setImageDrawable(appIcon(appErrorsInfo.packageName))
|
||||||
binding.appNameText.text = appName(appErrorsInfo.packageName)
|
binding.appNameText.text = appName(appErrorsInfo.packageName)
|
||||||
binding.appVersionText.text = appVersion(appErrorsInfo.packageName)
|
binding.appVersionText.text = appVersion(appErrorsInfo.packageName)
|
||||||
|
binding.appAbiText.text = appCpuAbi(appErrorsInfo.packageName).ifBlank { LocaleString.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
|
||||||
|
@@ -36,6 +36,8 @@ import androidx.core.content.res.ResourcesCompat
|
|||||||
import com.fankes.apperrorstracking.BuildConfig
|
import com.fankes.apperrorstracking.BuildConfig
|
||||||
import com.fankes.apperrorstracking.R
|
import com.fankes.apperrorstracking.R
|
||||||
import com.fankes.apperrorstracking.locale.LocaleString
|
import com.fankes.apperrorstracking.locale.LocaleString
|
||||||
|
import com.highcapable.yukihookapi.hook.factory.field
|
||||||
|
import com.highcapable.yukihookapi.hook.type.android.ApplicationInfoClass
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统深色模式是否开启
|
* 系统深色模式是否开启
|
||||||
@@ -84,6 +86,17 @@ fun Context.appVersion(packageName: String) =
|
|||||||
packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA)?.let { "${it.versionName} (${it.versionCode})" }
|
packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA)?.let { "${it.versionName} (${it.versionCode})" }
|
||||||
}.getOrNull() ?: "<unknown>"
|
}.getOrNull() ?: "<unknown>"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取 APP CPU ABI 名称
|
||||||
|
* @param packageName 包名
|
||||||
|
* @return [String]
|
||||||
|
*/
|
||||||
|
fun Context.appCpuAbi(packageName: String) =
|
||||||
|
runCatching {
|
||||||
|
ApplicationInfoClass.field { name = "primaryCpuAbi" }
|
||||||
|
.get(packageManager.getPackageInfo(packageName, PackageManager.GET_META_DATA)?.applicationInfo).string()
|
||||||
|
}.getOrNull() ?: ""
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取 APP 图标
|
* 获取 APP 图标
|
||||||
* @param packageName 包名
|
* @param packageName 包名
|
||||||
|
6
app/src/main/res/drawable/bg_black_round.xml
Normal file
6
app/src/main/res/drawable/bg_black_round.xml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<shape xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
android:shape="rectangle">
|
||||||
|
<solid android:color="#292929" />
|
||||||
|
<corners android:radius="5dp" />
|
||||||
|
</shape>
|
@@ -7,7 +7,7 @@
|
|||||||
android:background="@color/colorThemeBackground"
|
android:background="@color/colorThemeBackground"
|
||||||
android:orientation="vertical"
|
android:orientation="vertical"
|
||||||
tools:context=".ui.activity.AppErrorsDetailActivity"
|
tools:context=".ui.activity.AppErrorsDetailActivity"
|
||||||
tools:ignore="ContentDescription,UseCompoundDrawables">
|
tools:ignore="ContentDescription,UseCompoundDrawables,SmallSp">
|
||||||
|
|
||||||
<LinearLayout
|
<LinearLayout
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
@@ -146,14 +146,37 @@
|
|||||||
app:tint="#FFEF5350" />
|
app:tint="#FFEF5350" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<TextView
|
<LinearLayout
|
||||||
android:id="@+id/app_version_text"
|
android:layout_width="match_parent"
|
||||||
android:layout_width="wrap_content"
|
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:ellipsize="end"
|
android:gravity="center|start"
|
||||||
android:singleLine="true"
|
android:orientation="horizontal">
|
||||||
android:textColor="@color/colorTextDark"
|
|
||||||
android:textSize="12sp" />
|
<TextView
|
||||||
|
android:id="@+id/app_abi_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginEnd="5dp"
|
||||||
|
android:background="@drawable/bg_black_round"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:paddingLeft="3dp"
|
||||||
|
android:paddingTop="0.5dp"
|
||||||
|
android:paddingRight="3dp"
|
||||||
|
android:paddingBottom="0.5dp"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:text="@string/no_cpu_abi"
|
||||||
|
android:textColor="@color/white"
|
||||||
|
android:textSize="9sp" />
|
||||||
|
|
||||||
|
<TextView
|
||||||
|
android:id="@+id/app_version_text"
|
||||||
|
android:layout_width="wrap_content"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:ellipsize="end"
|
||||||
|
android:singleLine="true"
|
||||||
|
android:textColor="@color/colorTextDark"
|
||||||
|
android:textSize="11sp" />
|
||||||
|
</LinearLayout>
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<ImageView
|
<ImageView
|
||||||
|
@@ -42,4 +42,5 @@
|
|||||||
<string name="view_detail">詳細を見る</string>
|
<string name="view_detail">詳細を見る</string>
|
||||||
<string name="export_all_errors_success">すべてのエラーレコードがエクスポートされました</string>
|
<string name="export_all_errors_success">すべてのエラーレコードがエクスポートされました</string>
|
||||||
<string name="export_all_errors_fail">すべてのエラーレコードのエクスポートに失敗しました</string>
|
<string name="export_all_errors_fail">すべてのエラーレコードのエクスポートに失敗しました</string>
|
||||||
|
<string name="no_cpu_abi">アビなし</string>
|
||||||
</resources>
|
</resources>
|
@@ -42,4 +42,5 @@
|
|||||||
<string name="view_detail">查看详情</string>
|
<string name="view_detail">查看详情</string>
|
||||||
<string name="export_all_errors_success">已导出全部异常记录</string>
|
<string name="export_all_errors_success">已导出全部异常记录</string>
|
||||||
<string name="export_all_errors_fail">导出全部异常记录失败</string>
|
<string name="export_all_errors_fail">导出全部异常记录失败</string>
|
||||||
|
<string name="no_cpu_abi">无原生库</string>
|
||||||
</resources>
|
</resources>
|
@@ -42,4 +42,5 @@
|
|||||||
<string name="view_detail">查看詳情</string>
|
<string name="view_detail">查看詳情</string>
|
||||||
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
||||||
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
||||||
|
<string name="no_cpu_abi">無原生庫</string>
|
||||||
</resources>
|
</resources>
|
@@ -42,4 +42,5 @@
|
|||||||
<string name="view_detail">查看詳情</string>
|
<string name="view_detail">查看詳情</string>
|
||||||
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
||||||
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
||||||
|
<string name="no_cpu_abi">無原生庫</string>
|
||||||
</resources>
|
</resources>
|
@@ -42,4 +42,5 @@
|
|||||||
<string name="view_detail">查看詳情</string>
|
<string name="view_detail">查看詳情</string>
|
||||||
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
<string name="export_all_errors_success">已導出全部異常紀錄</string>
|
||||||
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
<string name="export_all_errors_fail">導出全部異常紀錄失敗</string>
|
||||||
|
<string name="no_cpu_abi">無原生庫</string>
|
||||||
</resources>
|
</resources>
|
@@ -41,4 +41,5 @@
|
|||||||
<string name="view_detail">View detail</string>
|
<string name="view_detail">View detail</string>
|
||||||
<string name="export_all_errors_success">All errors record exported</string>
|
<string name="export_all_errors_success">All errors record exported</string>
|
||||||
<string name="export_all_errors_fail">Failed to exported all errors record</string>
|
<string name="export_all_errors_fail">Failed to exported all errors record</string>
|
||||||
|
<string name="no_cpu_abi">No ABI</string>
|
||||||
</resources>
|
</resources>
|
Reference in New Issue
Block a user