From ad43b15b2e8545d44a380deb3c7a338259e3933d Mon Sep 17 00:00:00 2001
From: tj <1378534974@qq.com>
Date: 星期三, 09 四月 2025 10:27:39 +0800
Subject: [PATCH] 1.1
---
app/src/main/java/com/example/firstapp/App.kt | 35 ++++++++++++++---------------------
1 files changed, 14 insertions(+), 21 deletions(-)
diff --git a/app/src/main/java/com/example/firstapp/App.kt b/app/src/main/java/com/example/firstapp/App.kt
index 7c60e3a..c8fc2c4 100644
--- a/app/src/main/java/com/example/firstapp/App.kt
+++ b/app/src/main/java/com/example/firstapp/App.kt
@@ -3,24 +3,16 @@
import android.annotation.SuppressLint
import android.app.Application
import android.app.PendingIntent
-import android.bluetooth.BluetoothAdapter
-import android.bluetooth.BluetoothDevice
import android.content.Context
import android.content.Intent
import android.content.IntentFilter
import android.location.Geocoder
-import android.net.ConnectivityManager
-import android.net.wifi.WifiManager
import android.os.Build
+import androidx.annotation.NonNull
import androidx.lifecycle.MutableLiveData
import androidx.multidex.MultiDex
import androidx.work.Configuration
import androidx.work.WorkManager
-import com.gyf.cactus.Cactus
-import com.gyf.cactus.callback.CactusCallback
-import com.gyf.cactus.ext.cactus
-import com.hjq.language.MultiLanguages
-import com.hjq.language.OnLanguageListener
import com.example.firstapp.core.Core
import com.example.firstapp.database.repository.CodeRepository
import com.example.firstapp.database.repository.KeywordRepository
@@ -28,28 +20,23 @@
import com.example.firstapp.database.repository.ReminderRepository
import com.example.firstapp.database.service.RetrofitClient
import com.example.firstapp.receiver.CactusReceiver
-import com.example.firstapp.service.BluetoothScanService
-import com.example.firstapp.service.HttpServerService
-import com.example.firstapp.utils.ACTION_START
import com.example.firstapp.utils.AppInfo
-import com.example.firstapp.utils.CactusSave
import com.example.firstapp.utils.FRONT_CHANNEL_ID
import com.example.firstapp.utils.FRONT_CHANNEL_NAME
import com.example.firstapp.utils.FRONT_NOTIFY_ID
import com.example.firstapp.utils.FRPC_LIB_VERSION
-import com.example.firstapp.utils.HistoryUtils
import com.example.firstapp.utils.Log
import com.example.firstapp.utils.PreferencesManager
import com.example.firstapp.utils.SettingUtils
-import com.example.firstapp.utils.SharedPreference
-
import com.example.firstapp.utils.tinker.TinkerLoadLibrary
+import com.gyf.cactus.Cactus
+import com.gyf.cactus.callback.CactusCallback
+import com.gyf.cactus.ext.cactus
+import com.hjq.language.MultiLanguages
import com.king.location.LocationClient
import com.xuexiang.xutil.file.FileUtils
import frpclib.Frpclib
-import io.reactivex.Observable
import io.reactivex.disposables.Disposable
-import io.reactivex.schedulers.Schedulers
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
import java.io.BufferedWriter
@@ -59,8 +46,6 @@
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
-import java.util.TimeZone
-import java.util.concurrent.TimeUnit
@Suppress("DEPRECATION")
class App : Application(), CactusCallback, Configuration.Provider by Core {
@@ -160,7 +145,8 @@
if (SettingUtils.enablePureClientMode) return
//初始化WorkManager
- WorkManager.initialize(this, Configuration.Builder().build())
+// WorkManager.initialize(this, Configuration.Builder().build())
+ WorkManager.initialize(this, getWorkManagerConfiguration())
//动态加载FrpcLib
val libPath = filesDir.absolutePath + "/libs"
@@ -296,6 +282,13 @@
}
}
+ @NonNull
+ override fun getWorkManagerConfiguration(): Configuration {
+ return Configuration.Builder()
+ .setMinimumLoggingLevel(android.util.Log.DEBUG) // 设置日志级别
+ .build()
+ }
+
/**
* 初始化基础库
*/
--
Gitblit v1.9.3