mirror of
https://github.com/pppscn/SmsForwarder
synced 2025-08-04 01:47:40 +08:00
优化:记录crash日志
This commit is contained in:
parent
1ce9f33a65
commit
c7166ae3ba
6
.github/workflows/Release.yml
vendored
6
.github/workflows/Release.yml
vendored
@ -23,9 +23,11 @@ jobs:
|
|||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
# 设置jdk环境为11
|
# 设置jdk环境为11
|
||||||
- name: set up JDK 11
|
- name: set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
distribution: 'zulu'
|
||||||
|
java-version: '11'
|
||||||
|
java-package: jdk
|
||||||
# 获取打包秘钥
|
# 获取打包秘钥
|
||||||
- name: Checkout Android Keystore
|
- name: Checkout Android Keystore
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
6
.github/workflows/Weekly_Build.yml
vendored
6
.github/workflows/Weekly_Build.yml
vendored
@ -30,9 +30,11 @@ jobs:
|
|||||||
delete_workflow_pattern: 'Weekly Build'
|
delete_workflow_pattern: 'Weekly Build'
|
||||||
# 设置jdk环境为11
|
# 设置jdk环境为11
|
||||||
- name: set up JDK 11
|
- name: set up JDK 11
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v2
|
||||||
with:
|
with:
|
||||||
java-version: 11
|
distribution: 'zulu'
|
||||||
|
java-version: '11'
|
||||||
|
java-package: jdk
|
||||||
# 获取打包秘钥
|
# 获取打包秘钥
|
||||||
- name: Checkout Android Keystore
|
- name: Checkout Android Keystore
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
@ -100,6 +100,11 @@ class App : Application(), CactusCallback, Configuration.Provider by Core {
|
|||||||
|
|
||||||
override fun onCreate() {
|
override fun onCreate() {
|
||||||
super.onCreate()
|
super.onCreate()
|
||||||
|
Thread.setDefaultUncaughtExceptionHandler { _, e ->
|
||||||
|
isDebug = true
|
||||||
|
e.printStackTrace()
|
||||||
|
Log.e(TAG, "onCreate: $e")
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
context = applicationContext
|
context = applicationContext
|
||||||
initLibs()
|
initLibs()
|
||||||
|
@ -46,8 +46,9 @@ object Log {
|
|||||||
|
|
||||||
if (!App.isDebug) return
|
if (!App.isDebug) return
|
||||||
|
|
||||||
|
Thread {
|
||||||
|
try {
|
||||||
createLogFile()
|
createLogFile()
|
||||||
|
|
||||||
logFile?.let { file ->
|
logFile?.let { file ->
|
||||||
try {
|
try {
|
||||||
val logTimeStamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault()).format(Date())
|
val logTimeStamp = SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS", Locale.getDefault()).format(Date())
|
||||||
@ -58,6 +59,10 @@ object Log {
|
|||||||
AndroidLog.e(TAG, "Error writing to file: ${e.message}")
|
AndroidLog.e(TAG, "Error writing to file: ${e.message}")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} catch (e: Exception) {
|
||||||
|
AndroidLog.e(TAG, "Error writing to file: ${e.message}")
|
||||||
|
}
|
||||||
|
}.start()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun v(tag: String, message: String) {
|
fun v(tag: String, message: String) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user