update logutil;前台服务
This commit is contained in:
@@ -90,6 +90,7 @@
|
|||||||
android:enabled="true"
|
android:enabled="true"
|
||||||
android:exported="true"
|
android:exported="true"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
|
android:foregroundServiceType="dataSync"
|
||||||
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
android:permission="android.permission.BIND_ACCESSIBILITY_SERVICE">
|
||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="android.accessibilityservice.AccessibilityService" />
|
<action android:name="android.accessibilityservice.AccessibilityService" />
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
package org.yameida.worktool.utils
|
package org.yameida.worktool.utils
|
||||||
|
|
||||||
|
import com.blankj.utilcode.util.AppUtils
|
||||||
import com.blankj.utilcode.util.LogUtils
|
import com.blankj.utilcode.util.LogUtils
|
||||||
import org.yameida.worktool.Constant
|
import org.yameida.worktool.Constant
|
||||||
|
import java.lang.Exception
|
||||||
|
import java.util.*
|
||||||
|
|
||||||
object LogUtilsInit {
|
object LogUtilsInit {
|
||||||
|
|
||||||
@@ -30,9 +33,16 @@ object LogUtilsInit {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
fun init() {
|
fun init() {
|
||||||
|
val prefix = try {
|
||||||
|
AppUtils.getAppSignaturesMD5().firstOrNull()?.replace(":", "")
|
||||||
|
?.substring(0, 2)?.toLowerCase(Locale.ROOT)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
LogUtils.getConfig().apply {
|
LogUtils.getConfig().apply {
|
||||||
isLog2FileSwitch = true
|
isLog2FileSwitch = true
|
||||||
saveDays = 7
|
saveDays = 7
|
||||||
|
filePrefix = prefix
|
||||||
}
|
}
|
||||||
if (FlowPermissionHelper.isBlueCloud()) {
|
if (FlowPermissionHelper.isBlueCloud()) {
|
||||||
Constant.customLink = true
|
Constant.customLink = true
|
||||||
|
|||||||
Reference in New Issue
Block a user