update logutil;前台服务

This commit is contained in:
gallonyin
2023-06-29 18:52:44 +08:00
parent 7bec4055f3
commit 7eb7be4972
2 changed files with 11 additions and 0 deletions

View File

@@ -90,6 +90,7 @@
android:enabled="true"
android:exported="true"
android:label="@string/app_name"
android:foregroundServiceType="dataSync"
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
<intent-filter>
<action android:name="android.accessibilityservice.AccessibilityService" />

View File

@@ -1,7 +1,10 @@
package org.yameida.worktool.utils
import com.blankj.utilcode.util.AppUtils
import com.blankj.utilcode.util.LogUtils
import org.yameida.worktool.Constant
import java.lang.Exception
import java.util.*
object LogUtilsInit {
@@ -30,9 +33,16 @@ object LogUtilsInit {
*
*/
fun init() {
val prefix = try {
AppUtils.getAppSignaturesMD5().firstOrNull()?.replace(":", "")
?.substring(0, 2)?.toLowerCase(Locale.ROOT)
} catch (e: Exception) {
null
}
LogUtils.getConfig().apply {
isLog2FileSwitch = true
saveDays = 7
filePrefix = prefix
}
if (FlowPermissionHelper.isBlueCloud()) {
Constant.customLink = true