Init commit

This commit is contained in:
世界
2022-12-02 14:17:47 +08:00
commit 7736e1e644
121 changed files with 6295 additions and 0 deletions

View File

@@ -0,0 +1,6 @@
package io.nekohasekai.sfa.constant
object Action {
const val SERVICE = "io.nekohasekai.sfa.SERVICE"
const val SERVICE_CLOSE = "io.nekohasekai.sfa.SERVICE_CLOSE"
}

View File

@@ -0,0 +1,10 @@
package io.nekohasekai.sfa.constant
enum class Alert {
RequestVPNPermission,
RequestNotificationPermission,
EmptyConfiguration,
StartCommandServer,
CreateService,
StartService
}

View File

@@ -0,0 +1,11 @@
package io.nekohasekai.sfa.constant
enum class EnabledType(val boolValue: Boolean) {
Enabled(true), Disabled(false);
companion object {
fun from(value: Boolean): EnabledType {
return if (value) Enabled else Disabled
}
}
}

View File

@@ -0,0 +1,6 @@
package io.nekohasekai.sfa.constant
object Path {
const val SETTINGS_DATABASE_PATH = "settings.db"
const val PROFILES_DATABASE_PATH = "profiles.db"
}

View File

@@ -0,0 +1,6 @@
package io.nekohasekai.sfa.constant
object ServiceMode {
const val NORMAL = "normal"
const val VPN = "vpn"
}

View File

@@ -0,0 +1,14 @@
package io.nekohasekai.sfa.constant
object SettingsKey {
const val SELECTED_PROFILE = "selected_profile"
const val SERVICE_MODE = "service_mode"
const val ANALYTICS_ALLOWED = "analytics_allowed"
const val CHECK_UPDATE_ENABLED = "check_update_enabled"
// cache
const val STARTED_BY_USER = "started_by_user"
}

View File

@@ -0,0 +1,8 @@
package io.nekohasekai.sfa.constant
enum class Status {
Stopped,
Starting,
Started,
Stopping,
}