mirror of
https://github.com/KitsunePie/AppErrorsTracking.git
synced 2025-09-04 02:05:16 +08:00
Modify change missing output log's timestamp file name to UTC time file name
This commit is contained in:
@@ -108,7 +108,7 @@ data class AppErrorsInfoBean(
|
|||||||
* 获取异常本地化 UTC 时间
|
* 获取异常本地化 UTC 时间
|
||||||
* @return [String]
|
* @return [String]
|
||||||
*/
|
*/
|
||||||
private val utcTime get() = timestamp.toUtcTime()
|
val utcTime get() = timestamp.toUtcTime()
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取异常本地化经过时间
|
* 获取异常本地化经过时间
|
||||||
|
@@ -74,7 +74,7 @@ class AppErrorsDetailActivity : BaseActivity<ActivityAppErrorsDetailBinding>() {
|
|||||||
startActivityForResult(Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
startActivityForResult(Intent(Intent.ACTION_CREATE_DOCUMENT).apply {
|
||||||
addCategory(Intent.CATEGORY_OPENABLE)
|
addCategory(Intent.CATEGORY_OPENABLE)
|
||||||
type = "*/application"
|
type = "*/application"
|
||||||
putExtra(Intent.EXTRA_TITLE, "${appErrorsInfo.packageName}_${appErrorsInfo.timestamp}.log")
|
putExtra(Intent.EXTRA_TITLE, "${appErrorsInfo.packageName}_${appErrorsInfo.utcTime}.log")
|
||||||
}, WRITE_REQUEST_CODE)
|
}, WRITE_REQUEST_CODE)
|
||||||
}.onFailure { toast(msg = "Start Android SAF failed") }
|
}.onFailure { toast(msg = "Start Android SAF failed") }
|
||||||
}
|
}
|
||||||
|
@@ -168,7 +168,7 @@ class AppErrorsRecordActivity : BaseActivity<ActivityAppErrorsRecordBinding>() {
|
|||||||
("${cacheDir.absolutePath}/temp").also { path ->
|
("${cacheDir.absolutePath}/temp").also { path ->
|
||||||
File(path).mkdirs()
|
File(path).mkdirs()
|
||||||
listData.takeIf { it.isNotEmpty() }?.forEach {
|
listData.takeIf { it.isNotEmpty() }?.forEach {
|
||||||
File("$path/${it.packageName}_${it.timestamp.toUtcTime()}.log").writeText(it.stackOutputFileContent)
|
File("$path/${it.packageName}_${it.utcTime}.log").writeText(it.stackOutputFileContent)
|
||||||
}
|
}
|
||||||
outPutFilePath = "${cacheDir.absolutePath}/temp_${System.currentTimeMillis()}.zip"
|
outPutFilePath = "${cacheDir.absolutePath}/temp_${System.currentTimeMillis()}.zip"
|
||||||
ZipFileTool.zipMultiFile(path, outPutFilePath)
|
ZipFileTool.zipMultiFile(path, outPutFilePath)
|
||||||
|
Reference in New Issue
Block a user