|
|
@ -2,9 +2,9 @@ package io.legado.app.help |
|
|
|
|
|
|
|
|
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.annotation.SuppressLint |
|
|
|
import android.content.Context |
|
|
|
import android.content.Context |
|
|
|
import android.content.pm.PackageManager |
|
|
|
|
|
|
|
import android.os.Build |
|
|
|
import android.os.Build |
|
|
|
import android.util.Log |
|
|
|
import android.util.Log |
|
|
|
|
|
|
|
import io.legado.app.constant.AppConst |
|
|
|
import io.legado.app.model.ReadAloud |
|
|
|
import io.legado.app.model.ReadAloud |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.FileUtils |
|
|
|
import io.legado.app.utils.longToastOnUi |
|
|
|
import io.legado.app.utils.longToastOnUi |
|
|
@ -70,26 +70,14 @@ class CrashHandler(val context: Context) : Thread.UncaughtExceptionHandler { |
|
|
|
* 收集设备参数信息 |
|
|
|
* 收集设备参数信息 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private fun collectDeviceInfo(ctx: Context) { |
|
|
|
private fun collectDeviceInfo(ctx: Context) { |
|
|
|
//获取versionName,versionCode |
|
|
|
|
|
|
|
kotlin.runCatching { |
|
|
|
kotlin.runCatching { |
|
|
|
val pm = ctx.packageManager |
|
|
|
//获取系统信息 |
|
|
|
val pi = pm.getPackageInfo(ctx.packageName, PackageManager.GET_ACTIVITIES) |
|
|
|
paramsMap["MANUFACTURER"] = Build.MANUFACTURER |
|
|
|
if (pi != null) { |
|
|
|
paramsMap["BRAND"] = Build.BRAND |
|
|
|
val versionName = if (pi.versionName == null) "null" else pi.versionName |
|
|
|
//获取app版本信息 |
|
|
|
val versionCode = pi.versionCode.toString() + "" |
|
|
|
AppConst.appInfo.let { |
|
|
|
paramsMap["versionName"] = versionName |
|
|
|
paramsMap["versionName"] = it.versionName |
|
|
|
paramsMap["versionCode"] = versionCode |
|
|
|
paramsMap["versionCode"] = it.versionCode.toString() |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取所有系统信息 |
|
|
|
|
|
|
|
val fields = Build::class.java.declaredFields |
|
|
|
|
|
|
|
kotlin.runCatching { |
|
|
|
|
|
|
|
for (field in fields) { |
|
|
|
|
|
|
|
field.isAccessible = true |
|
|
|
|
|
|
|
field.get(null)?.toString()?.let { |
|
|
|
|
|
|
|
paramsMap[field.name] = it |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|