0bf759ae64
- 新增 PhoneCallMonitor:通过轮询 getCallState() 感知来电/未接 (绕过 MIUI 对系统电话通知的限制,需 READ_PHONE_STATE 权限) - 短信仅收不发:过滤"发送中"/"已发送"等关键词 - 图标 URL 前缀默认值:GitHub raw 图床 - 从黑名单移除 com.android.phone/com.android.incallui - 默认黑名单新增三星剪贴板/GMS 等噪音包名 - 版本 1.2.0 → 1.3.0 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
1.1 KiB
Kotlin
39 lines
1.1 KiB
Kotlin
package com.a2i.forwarder
|
|
|
|
import android.app.Application
|
|
import com.a2i.forwarder.core.LogStore
|
|
import com.a2i.forwarder.core.PhoneCallMonitor
|
|
import com.a2i.forwarder.store.AppRulesStore
|
|
import com.a2i.forwarder.store.SettingsStore
|
|
import kotlinx.coroutines.CoroutineScope
|
|
import kotlinx.coroutines.Dispatchers
|
|
import kotlinx.coroutines.SupervisorJob
|
|
|
|
class A2iApp : Application() {
|
|
val appScope: CoroutineScope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
|
|
|
|
lateinit var settings: SettingsStore
|
|
private set
|
|
lateinit var appRules: AppRulesStore
|
|
private set
|
|
lateinit var logStore: LogStore
|
|
private set
|
|
lateinit var phoneCallMonitor: PhoneCallMonitor
|
|
private set
|
|
|
|
override fun onCreate() {
|
|
super.onCreate()
|
|
instance = this
|
|
settings = SettingsStore(this, appScope)
|
|
appRules = AppRulesStore(this, appScope)
|
|
logStore = LogStore(this, appScope)
|
|
phoneCallMonitor = PhoneCallMonitor(this)
|
|
phoneCallMonitor.start()
|
|
}
|
|
|
|
companion object {
|
|
lateinit var instance: A2iApp
|
|
private set
|
|
}
|
|
}
|