Compare commits
1 Commits
v0.8.87-pr
...
v0.8.85-pr
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21b27a95aa |
11
.github/workflows/build.yaml
vendored
11
.github/workflows/build.yaml
vendored
@@ -63,19 +63,12 @@ jobs:
|
||||
cache-dependency-path: |
|
||||
core/go.sum
|
||||
|
||||
- name: Setup Flutter Master
|
||||
if: startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'master'
|
||||
cache: true
|
||||
- name: Setup Flutter
|
||||
if: ${{ !(startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) }}
|
||||
uses: subosito/flutter-action@v2
|
||||
with:
|
||||
channel: 'stable'
|
||||
channel: ${{ (startsWith(matrix.os, 'windows-11-arm') || startsWith(matrix.os, 'ubuntu-24.04-arm')) && 'master' || 'stable' }}
|
||||
cache: true
|
||||
# flutter-version: 3.29.3
|
||||
flutter-version: 3.29.3
|
||||
|
||||
- name: Get Flutter Dependency
|
||||
run: flutter pub get
|
||||
|
||||
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,19 +1,3 @@
|
||||
## v0.8.85
|
||||
|
||||
- Support override script
|
||||
|
||||
- Support proxies search
|
||||
|
||||
- Support svg display
|
||||
|
||||
- Optimize config persistence
|
||||
|
||||
- Add some scenes auto close connections
|
||||
|
||||
- Update core
|
||||
|
||||
- Optimize more details
|
||||
|
||||
## v0.8.84
|
||||
|
||||
- Fix windows service verify issues
|
||||
|
||||
@@ -1,8 +1 @@
|
||||
include: package:flutter_lints/flutter.yaml
|
||||
analyzer:
|
||||
exclude:
|
||||
- lib/l10n/intl/**
|
||||
|
||||
linter:
|
||||
rules:
|
||||
prefer_single_quotes: true
|
||||
@@ -7,9 +7,6 @@
|
||||
<uses-feature
|
||||
android:name="android.hardware.camera"
|
||||
android:required="false" />
|
||||
<uses-feature
|
||||
android:name="android.software.leanback"
|
||||
android:required="false" />
|
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
|
||||
@@ -25,7 +22,6 @@
|
||||
|
||||
<application
|
||||
android:name=".FlClashApplication"
|
||||
android:banner="@mipmap/ic_banner"
|
||||
android:hardwareAccelerated="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="FlClash">
|
||||
@@ -92,7 +88,7 @@
|
||||
<service
|
||||
android:name=".services.FlClashTileService"
|
||||
android:exported="true"
|
||||
android:icon="@drawable/ic"
|
||||
android:icon="@drawable/ic_stat_name"
|
||||
android:label="FlClash"
|
||||
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE"
|
||||
tools:targetApi="n">
|
||||
|
||||
@@ -104,7 +104,7 @@ fun ConnectivityManager.resolveDns(network: Network?): List<String> {
|
||||
fun InetAddress.asSocketAddressText(port: Int): String {
|
||||
return when (this) {
|
||||
is Inet6Address ->
|
||||
"[${numericToTextFormat(this)}]:$port"
|
||||
"[${numericToTextFormat(this.address)}]:$port"
|
||||
|
||||
is Inet4Address ->
|
||||
"${this.hostAddress}:$port"
|
||||
@@ -141,8 +141,7 @@ fun Context.getActionPendingIntent(action: String): PendingIntent {
|
||||
}
|
||||
}
|
||||
|
||||
private fun numericToTextFormat(address: Inet6Address): String {
|
||||
val src = address.address
|
||||
private fun numericToTextFormat(src: ByteArray): String {
|
||||
val sb = StringBuilder(39)
|
||||
for (i in 0 until 8) {
|
||||
sb.append(
|
||||
@@ -155,10 +154,6 @@ private fun numericToTextFormat(address: Inet6Address): String {
|
||||
sb.append(":")
|
||||
}
|
||||
}
|
||||
if (address.scopeId > 0) {
|
||||
sb.append("%")
|
||||
sb.append(address.scopeId)
|
||||
}
|
||||
return sb.toString()
|
||||
}
|
||||
|
||||
|
||||
@@ -100,7 +100,6 @@ data object VpnPlugin : FlutterPlugin, MethodChannel.MethodCallHandler {
|
||||
}
|
||||
|
||||
fun handleStart(options: VpnOptions): Boolean {
|
||||
onUpdateNetwork();
|
||||
if (options.enable != this.options?.enable) {
|
||||
this.flClashService = null
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import com.follow.clash.MainActivity
|
||||
import com.follow.clash.R
|
||||
import com.follow.clash.extensions.getActionPendingIntent
|
||||
import com.follow.clash.models.VpnOptions
|
||||
import io.flutter.Log
|
||||
import kotlinx.coroutines.CoroutineScope
|
||||
import kotlinx.coroutines.Deferred
|
||||
import kotlinx.coroutines.Dispatchers
|
||||
@@ -53,7 +54,7 @@ fun Service.createFlClashNotificationBuilder(): Deferred<NotificationCompat.Buil
|
||||
this@createFlClashNotificationBuilder, GlobalState.NOTIFICATION_CHANNEL
|
||||
)
|
||||
) {
|
||||
setSmallIcon(R.drawable.ic)
|
||||
setSmallIcon(R.drawable.ic_stat_name)
|
||||
setContentTitle("FlClash")
|
||||
setContentIntent(pendingIntent)
|
||||
setCategory(NotificationCompat.CATEGORY_SERVICE)
|
||||
@@ -75,8 +76,9 @@ fun Service.startForeground(notification: Notification) {
|
||||
val manager = getSystemService(NotificationManager::class.java)
|
||||
var channel = manager?.getNotificationChannel(GlobalState.NOTIFICATION_CHANNEL)
|
||||
if (channel == null) {
|
||||
Log.d("[FlClash]","createNotificationChannel===>")
|
||||
channel = NotificationChannel(
|
||||
GlobalState.NOTIFICATION_CHANNEL, "SERVICE_CHANNEL", NotificationManager.IMPORTANCE_LOW
|
||||
GlobalState.NOTIFICATION_CHANNEL, "FlClash", NotificationManager.IMPORTANCE_LOW
|
||||
)
|
||||
manager?.createNotificationChannel(channel)
|
||||
}
|
||||
|
||||
BIN
android/app/src/main/res/drawable-hdpi/ic_stat_name.png
Normal file
BIN
android/app/src/main/res/drawable-hdpi/ic_stat_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 618 B |
BIN
android/app/src/main/res/drawable-mdpi/ic_stat_name.png
Normal file
BIN
android/app/src/main/res/drawable-mdpi/ic_stat_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 423 B |
BIN
android/app/src/main/res/drawable-xhdpi/ic_stat_name.png
Normal file
BIN
android/app/src/main/res/drawable-xhdpi/ic_stat_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 803 B |
BIN
android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png
Normal file
BIN
android/app/src/main/res/drawable-xxhdpi/ic_stat_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png
Normal file
BIN
android/app/src/main/res/drawable-xxxhdpi/ic_stat_name.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.6 KiB |
@@ -1,17 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:width="240dp"
|
||||
android:height="240dp"
|
||||
android:viewportWidth="240"
|
||||
android:viewportHeight="240"
|
||||
tools:ignore="VectorRaster">
|
||||
<path
|
||||
android:pathData="M48.1,80.89L168.44,11.41c11.08,-6.4 25.24,-2.6 31.64,8.48 0,0 0,0 0,0h0c6.4,11.08 2.6,25.24 -8.48,31.64 0,0 0,0 0,0l-120.34,69.48c-11.08,6.4 -25.24,2.6 -31.64,-8.48 0,0 0,0 0,0h0c-6.4,-11.08 -2.6,-25.24 8.48,-31.64 0,0 0,0 0,0Z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
<path
|
||||
android:pathData="M78.98,134.37l60.18,-34.74c11.07,-6.39 25.23,-2.59 31.63,8.48h0c6.4,11.07 2.61,25.24 -8.47,31.64l-60.18,34.74c-11.08,6.4 -25.24,2.6 -31.64,-8.48 0,0 0,0 0,0h0c-6.4,-11.08 -2.6,-25.24 8.48,-31.64h0Z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
<path
|
||||
android:pathData="M109.86,187.86h0c11.08,-6.4 25.24,-2.6 31.64,8.48 0,0 0,0 0,0h0c6.4,11.08 2.6,25.24 -8.48,31.64 0,0 0,0 0,0h0c-11.08,6.4 -25.24,2.6 -31.64,-8.48 0,0 0,0 0,0h0c-6.4,-11.08 -2.6,-25.24 8.48,-31.64 0,0 0,0 0,0Z"
|
||||
android:fillColor="#FFFFFF"/>
|
||||
</vector>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 4.2 KiB |
@@ -402,24 +402,5 @@
|
||||
"redirPort": "Redir Port",
|
||||
"tproxyPort": "Tproxy Port",
|
||||
"portTip": "{label} must be between 1024 and 49151",
|
||||
"portConflictTip": "Please enter a different port",
|
||||
"import": "Import",
|
||||
"importFile": "Import from file",
|
||||
"importUrl": "Import from URL",
|
||||
"autoSetSystemDns": "Auto set system DNS",
|
||||
"details": "{label} details",
|
||||
"creationTime": "Creation time",
|
||||
"progress": "Progress",
|
||||
"host": "Host",
|
||||
"destination": "Destination",
|
||||
"destinationGeoIP": "Destination GeoIP",
|
||||
"destinationIPASN": "Destination IPASN",
|
||||
"specialProxy": "Special proxy",
|
||||
"specialRules": "special rules",
|
||||
"remoteDestination": "Remote destination",
|
||||
"networkType": "Network type",
|
||||
"proxyChains": "Proxy chains",
|
||||
"log": "Log",
|
||||
"connection": "Connection",
|
||||
"request": "Request"
|
||||
"portConflictTip": "Please enter a different port"
|
||||
}
|
||||
@@ -403,24 +403,5 @@
|
||||
"redirPort": "Redirポート",
|
||||
"tproxyPort": "Tproxyポート",
|
||||
"portTip": "{label} は 1024 から 49151 の間でなければなりません",
|
||||
"portConflictTip": "別のポートを入力してください",
|
||||
"import": "インポート",
|
||||
"importFile": "ファイルからインポート",
|
||||
"importUrl": "URLからインポート",
|
||||
"autoSetSystemDns": "オートセットシステムDNS",
|
||||
"details": "{label}詳細",
|
||||
"creationTime": "作成時間",
|
||||
"progress": "進捗",
|
||||
"host": "ホスト",
|
||||
"destination": "宛先",
|
||||
"destinationGeoIP": "宛先地理情報",
|
||||
"destinationIPASN": "宛先IP ASN",
|
||||
"specialProxy": "特殊プロキシ",
|
||||
"specialRules": "特殊ルール",
|
||||
"remoteDestination": "リモート宛先",
|
||||
"networkType": "ネットワーク種別",
|
||||
"proxyChains": "プロキシチェーン",
|
||||
"log": "ログ",
|
||||
"connection": "接続",
|
||||
"request": "リクエスト"
|
||||
"portConflictTip": "別のポートを入力してください"
|
||||
}
|
||||
@@ -403,24 +403,5 @@
|
||||
"redirPort": "Redir-порт",
|
||||
"tproxyPort": "Tproxy-порт",
|
||||
"portTip": "{label} должен быть числом от 1024 до 49151",
|
||||
"portConflictTip": "Введите другой порт",
|
||||
"import": "Импорт",
|
||||
"importFile": "Импорт из файла",
|
||||
"importUrl": "Импорт по URL",
|
||||
"autoSetSystemDns": "Автоматическая настройка системного DNS",
|
||||
"details": "Детали {}",
|
||||
"creationTime": "Время создания",
|
||||
"progress": "Прогресс",
|
||||
"host": "Хост",
|
||||
"destination": "Назначение",
|
||||
"destinationGeoIP": "Геолокация назначения",
|
||||
"destinationIPASN": "ASN назначения",
|
||||
"specialProxy": "Специальный прокси",
|
||||
"specialRules": "Специальные правила",
|
||||
"remoteDestination": "Удалённое назначение",
|
||||
"networkType": "Тип сети",
|
||||
"proxyChains": "Цепочки прокси",
|
||||
"log": "Журнал",
|
||||
"connection": "Соединение",
|
||||
"request": "Запрос"
|
||||
"portConflictTip": "Введите другой порт"
|
||||
}
|
||||
@@ -403,24 +403,5 @@
|
||||
"redirPort": "Redir端口",
|
||||
"tproxyPort": "Tproxy端口",
|
||||
"portTip": "{label} 必须在 1024 到 49151 之间",
|
||||
"portConflictTip": "请输入不同的端口",
|
||||
"import": "导入",
|
||||
"importFile": "通过文件导入",
|
||||
"importUrl": "通过URL导入",
|
||||
"autoSetSystemDns": "自动设置系统DNS",
|
||||
"details": "{label}详情",
|
||||
"creationTime": "创建时间",
|
||||
"progress": "进度",
|
||||
"host": "主机",
|
||||
"destination": "目标地址",
|
||||
"destinationGeoIP": "目标地理定位",
|
||||
"destinationIPASN": "目标IP ASN",
|
||||
"specialProxy": "特殊代理",
|
||||
"specialRules": "特殊规则",
|
||||
"remoteDestination": "远程目标",
|
||||
"networkType": "网络类型",
|
||||
"proxyChains": "代理链",
|
||||
"log": "日志",
|
||||
"connection": "连接",
|
||||
"request": "请求"
|
||||
"portConflictTip": "请输入不同的端口"
|
||||
}
|
||||
|
||||
Submodule core/Clash.Meta updated: 34ccd1202b...a77851dd9a
26
core/go.mod
26
core/go.mod
@@ -6,6 +6,7 @@ replace github.com/metacubex/mihomo => ./Clash.Meta
|
||||
|
||||
require (
|
||||
github.com/metacubex/mihomo v0.0.0-00010101000000-000000000000
|
||||
github.com/samber/lo v1.50.0
|
||||
golang.org/x/sync v0.11.0
|
||||
)
|
||||
|
||||
@@ -20,7 +21,7 @@ require (
|
||||
github.com/cloudflare/circl v1.3.7 // indirect
|
||||
github.com/coreos/go-iptables v0.8.0 // indirect
|
||||
github.com/dlclark/regexp2 v1.11.5 // indirect
|
||||
github.com/ebitengine/purego v0.8.3 // indirect
|
||||
github.com/ebitengine/purego v0.8.3-0.20250507171810-1638563e3615 // indirect
|
||||
github.com/enfein/mieru/v3 v3.13.0 // indirect
|
||||
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 // indirect
|
||||
github.com/ericlagergren/polyval v0.0.0-20220411101811-e25bc10ba391 // indirect
|
||||
@@ -50,27 +51,27 @@ require (
|
||||
github.com/mdlayher/netlink v1.7.2 // indirect
|
||||
github.com/mdlayher/socket v0.4.1 // indirect
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab // indirect
|
||||
github.com/metacubex/bart v0.20.5 // indirect
|
||||
github.com/metacubex/bart v0.19.0 // indirect
|
||||
github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 // indirect
|
||||
github.com/metacubex/chacha v0.1.5 // indirect
|
||||
github.com/metacubex/chacha v0.1.2 // indirect
|
||||
github.com/metacubex/fswatch v0.1.1 // indirect
|
||||
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 // indirect
|
||||
github.com/metacubex/gvisor v0.0.0-20250324165734-5857f47bd43b // indirect
|
||||
github.com/metacubex/nftables v0.0.0-20250503052935-30a69ab87793 // indirect
|
||||
github.com/metacubex/quic-go v0.52.1-0.20250522021943-aef454b9e639 // indirect
|
||||
github.com/metacubex/quic-go v0.51.1-0.20250511032541-4e34341cf18b // indirect
|
||||
github.com/metacubex/randv2 v0.2.0 // indirect
|
||||
github.com/metacubex/sing v0.5.4-0.20250605054047-54dc6097da29 // indirect
|
||||
github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7 // indirect
|
||||
github.com/metacubex/sing-mux v0.3.2 // indirect
|
||||
github.com/metacubex/sing-quic v0.0.0-20250523120938-f1a248e5ec7f // indirect
|
||||
github.com/metacubex/sing-shadowsocks v0.2.11-0.20250621023810-0e9ef9dd0c92 // indirect
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.5-0.20250621023950-93d605a2143d // indirect
|
||||
github.com/metacubex/sing-quic v0.0.0-20250511034158-b46e0e3e81b2 // indirect
|
||||
github.com/metacubex/sing-shadowsocks v0.2.9 // indirect
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.3 // indirect
|
||||
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 // indirect
|
||||
github.com/metacubex/sing-tun v0.4.7-0.20250611091011-60774779fdd8 // indirect
|
||||
github.com/metacubex/sing-vmess v0.2.2 // indirect
|
||||
github.com/metacubex/sing-tun v0.4.6-0.20250503065609-efb9f0beb6f6 // indirect
|
||||
github.com/metacubex/sing-vmess v0.2.1 // indirect
|
||||
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f // indirect
|
||||
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee // indirect
|
||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4 // indirect
|
||||
github.com/metacubex/utls v1.7.4-0.20250610022031-808d767c8c73 // indirect
|
||||
github.com/metacubex/tfo-go v0.0.0-20250503140532-decbcfccbfdf // indirect
|
||||
github.com/metacubex/utls v1.7.0-alpha.3 // indirect
|
||||
github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 // indirect
|
||||
github.com/miekg/dns v1.1.63 // indirect
|
||||
github.com/mroth/weightedrand/v2 v2.1.0 // indirect
|
||||
@@ -84,7 +85,6 @@ require (
|
||||
github.com/quic-go/qpack v0.4.0 // indirect
|
||||
github.com/sagernet/cors v1.2.1 // indirect
|
||||
github.com/sagernet/netlink v0.0.0-20240612041022-b9a21c07ac6a // indirect
|
||||
github.com/samber/lo v1.50.0 // indirect
|
||||
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
|
||||
github.com/sina-ghaderi/poly1305 v0.0.0-20220724002748-c5926b03988b // indirect
|
||||
github.com/sina-ghaderi/rabaead v0.0.0-20220730151906-ab6e06b96e8c // indirect
|
||||
|
||||
48
core/go.sum
48
core/go.sum
@@ -26,8 +26,8 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dlclark/regexp2 v1.11.5 h1:Q/sSnsKerHeCkc/jSTNq1oCm7KiVgUMZRDUoRu0JQZQ=
|
||||
github.com/dlclark/regexp2 v1.11.5/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8=
|
||||
github.com/ebitengine/purego v0.8.3 h1:K+0AjQp63JEZTEMZiwsI9g0+hAMNohwUOtY0RPGexmc=
|
||||
github.com/ebitengine/purego v0.8.3/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/ebitengine/purego v0.8.3-0.20250507171810-1638563e3615 h1:W7mpP4uiOAbBOdDnRXT9EUdauFv7bz+ERT5rPIord00=
|
||||
github.com/ebitengine/purego v0.8.3-0.20250507171810-1638563e3615/go.mod h1:iIjxzd6CiRiOG0UyXP+V1+jWqUXVjPKLAI0mRfJZTmQ=
|
||||
github.com/enfein/mieru/v3 v3.13.0 h1:eGyxLGkb+lut9ebmx+BGwLJ5UMbEc/wGIYO0AXEKy98=
|
||||
github.com/enfein/mieru/v3 v3.13.0/go.mod h1:zJBUCsi5rxyvHM8fjFf+GLaEl4OEjjBXr1s5F6Qd3hM=
|
||||
github.com/ericlagergren/aegis v0.0.0-20250325060835-cd0defd64358 h1:kXYqH/sL8dS/FdoFjr12ePjnLPorPo2FsnrHNuXSDyo=
|
||||
@@ -97,12 +97,12 @@ github.com/mdlayher/socket v0.4.1 h1:eM9y2/jlbs1M615oshPQOHZzj6R6wMT7bX5NPiQvn2U
|
||||
github.com/mdlayher/socket v0.4.1/go.mod h1:cAqeGjoufqdxWkD7DkpyS+wcefOtmu5OQ8KuoJGIReA=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab h1:Chbw+/31UC14YFNr78pESt5Vowlc62zziw05JCUqoL4=
|
||||
github.com/metacubex/amneziawg-go v0.0.0-20240922133038-fdf3a4d5a4ab/go.mod h1:xVKK8jC5Sd3hfh7WjmCq+HorehIbrBijaUWmcuKjPcI=
|
||||
github.com/metacubex/bart v0.20.5 h1:XkgLZ17QxfxkqKdGsojoM2Zu01mmHyyQSFzt2/calTM=
|
||||
github.com/metacubex/bart v0.20.5/go.mod h1:DCcyfP4MC+Zy7sLK7XeGuMw+P5K9mIRsYOBgiE8icsI=
|
||||
github.com/metacubex/bart v0.19.0 h1:XQ9AJeI+WO+phRPkUOoflAFwlqDJnm5BPQpixciJQBY=
|
||||
github.com/metacubex/bart v0.19.0/go.mod h1:DCcyfP4MC+Zy7sLK7XeGuMw+P5K9mIRsYOBgiE8icsI=
|
||||
github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399 h1:oBowHVKZycNtAFbZ6avaCSZJYeme2Nrj+4RpV2cNJig=
|
||||
github.com/metacubex/bbolt v0.0.0-20240822011022-aed6d4850399/go.mod h1:4xcieuIK+M4bGQmQYZVqEaIYqjS1ahO4kXG7EmDgEro=
|
||||
github.com/metacubex/chacha v0.1.5 h1:fKWMb/5c7ZrY8Uoqi79PPFxl+qwR7X/q0OrsAubyX2M=
|
||||
github.com/metacubex/chacha v0.1.5/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8=
|
||||
github.com/metacubex/chacha v0.1.2 h1:QulCq3eVm3TO6+4nVIWJtmSe7BT2GMrgVHuAoqRQnlc=
|
||||
github.com/metacubex/chacha v0.1.2/go.mod h1:Djn9bPZxLTXbJFSeyo0/qzEzQI+gUSSzttuzZM75GH8=
|
||||
github.com/metacubex/fswatch v0.1.1 h1:jqU7C/v+g0qc2RUFgmAOPoVvfl2BXXUXEumn6oQuxhU=
|
||||
github.com/metacubex/fswatch v0.1.1/go.mod h1:czrTT7Zlbz7vWft8RQu9Qqh+JoX+Nnb+UabuyN1YsgI=
|
||||
github.com/metacubex/gopacket v1.1.20-0.20230608035415-7e2f98a3e759 h1:cjd4biTvOzK9ubNCCkQ+ldc4YSH/rILn53l/xGBFHHI=
|
||||
@@ -111,35 +111,35 @@ github.com/metacubex/gvisor v0.0.0-20250324165734-5857f47bd43b h1:RUh4OdVPz/jDrM
|
||||
github.com/metacubex/gvisor v0.0.0-20250324165734-5857f47bd43b/go.mod h1:8LpS0IJW1VmWzUm3ylb0e2SK5QDm5lO/2qwWLZgRpBU=
|
||||
github.com/metacubex/nftables v0.0.0-20250503052935-30a69ab87793 h1:1Qpuy+sU3DmyX9HwI+CrBT/oLNJngvBorR2RbajJcqo=
|
||||
github.com/metacubex/nftables v0.0.0-20250503052935-30a69ab87793/go.mod h1:RjRNb4G52yAgfR+Oe/kp9G4PJJ97Fnj89eY1BFO3YyA=
|
||||
github.com/metacubex/quic-go v0.52.1-0.20250522021943-aef454b9e639 h1:L+1brQNzBhCCxWlicwfK1TlceemCRmrDE4HmcVHc29w=
|
||||
github.com/metacubex/quic-go v0.52.1-0.20250522021943-aef454b9e639/go.mod h1:Kc6h++Q/zf3AxcUCevJhJwgrskJumv+pZdR8g/E/10k=
|
||||
github.com/metacubex/quic-go v0.51.1-0.20250511032541-4e34341cf18b h1:8oDU32eJ+RRhl1FodGgPfxQxtoBAiD9D40XG2XtU/SE=
|
||||
github.com/metacubex/quic-go v0.51.1-0.20250511032541-4e34341cf18b/go.mod h1:9R1NOzCgTcWsdWvOMlmtMuF0uKzuOpsfvEf7U3I8zM0=
|
||||
github.com/metacubex/randv2 v0.2.0 h1:uP38uBvV2SxYfLj53kuvAjbND4RUDfFJjwr4UigMiLs=
|
||||
github.com/metacubex/randv2 v0.2.0/go.mod h1:kFi2SzrQ5WuneuoLLCMkABtiBu6VRrMrWFqSPyj2cxY=
|
||||
github.com/metacubex/sing v0.5.2/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
|
||||
github.com/metacubex/sing v0.5.4-0.20250605054047-54dc6097da29 h1:SD9q025FNTaepuFXFOKDhnGLVu6PQYChBvw2ZYPXeLo=
|
||||
github.com/metacubex/sing v0.5.4-0.20250605054047-54dc6097da29/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
|
||||
github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7 h1:m4nSxvw46JEgxMzzmnXams+ebwabcry4Ydep/zNiesQ=
|
||||
github.com/metacubex/sing v0.5.3-0.20250504031621-1f99e54c15b7/go.mod h1:ypf0mjwlZm0sKdQSY+yQvmsbWa0hNPtkeqyRMGgoN+w=
|
||||
github.com/metacubex/sing-mux v0.3.2 h1:nJv52pyRivHcaZJKk2JgxpaVvj1GAXG81scSa9N7ncw=
|
||||
github.com/metacubex/sing-mux v0.3.2/go.mod h1:3rt1soewn0O6j89GCLmwAQFsq257u0jf2zQSPhTL3Bw=
|
||||
github.com/metacubex/sing-quic v0.0.0-20250523120938-f1a248e5ec7f h1:mP3vIm+9hRFI0C0Vl3pE0NESF/L85FDbuB0tGgUii6I=
|
||||
github.com/metacubex/sing-quic v0.0.0-20250523120938-f1a248e5ec7f/go.mod h1:JPTpf7fpnojsSuwRJExhSZSy63pVbp3VM39+zj+sAJM=
|
||||
github.com/metacubex/sing-shadowsocks v0.2.11-0.20250621023810-0e9ef9dd0c92 h1:Y9ebcKya6ow7VHoESCN5+l4zZvg5eaL2IhI5LLCQxQA=
|
||||
github.com/metacubex/sing-shadowsocks v0.2.11-0.20250621023810-0e9ef9dd0c92/go.mod h1:/squZ38pXrYjqtg8qn+joVvwbpGNYQNp8yxKsMVbCto=
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.5-0.20250621023950-93d605a2143d h1:Ey3A1tA8lVkRbK1FDmwuWj/57Nr8JMdpoVqe45mFzJg=
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.5-0.20250621023950-93d605a2143d/go.mod h1:+ukTd0OPFglT3bnKAYTJWYPbuox6HYNXE235r5tHdUk=
|
||||
github.com/metacubex/sing-quic v0.0.0-20250511034158-b46e0e3e81b2 h1:wfmYgtECbEYo1slMtyo+2kMqscYYDSjU/TVgS3018F4=
|
||||
github.com/metacubex/sing-quic v0.0.0-20250511034158-b46e0e3e81b2/go.mod h1:P1kd57U6XXmXv9PbwWdznUGT0k9bKgFJXF0fEORbIlk=
|
||||
github.com/metacubex/sing-shadowsocks v0.2.9 h1:2e++13WNN7EGjGtvrGLUzW1xrCdQbW2gIFpgw5GEw00=
|
||||
github.com/metacubex/sing-shadowsocks v0.2.9/go.mod h1:CJSEGO4FWQAWe+ZiLZxCweGdjRR60A61SIoVjdjQeBA=
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.3 h1:v3rNS/5Ywh0NIZ6VU/NmdERQIN5RePzyxCFeQsU4Cx0=
|
||||
github.com/metacubex/sing-shadowsocks2 v0.2.3/go.mod h1:/WNy/Q8ahLCoPRriWuFZFD0Jy+JNp1MEQl28Zw6SaF8=
|
||||
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2 h1:gXU+MYPm7Wme3/OAY2FFzVq9d9GxPHOqu5AQfg/ddhI=
|
||||
github.com/metacubex/sing-shadowtls v0.0.0-20250503063515-5d9f966d17a2/go.mod h1:mbfboaXauKJNIHJYxQRa+NJs4JU9NZfkA+I33dS2+9E=
|
||||
github.com/metacubex/sing-tun v0.4.7-0.20250611091011-60774779fdd8 h1:4zWKqxTx75TbfW2EmlQ3hxM6RTRg2PYOAVMCnU4I61I=
|
||||
github.com/metacubex/sing-tun v0.4.7-0.20250611091011-60774779fdd8/go.mod h1:2YywXPWW8Z97kTH7RffOeykKzU+l0aiKlglWV1PAS64=
|
||||
github.com/metacubex/sing-vmess v0.2.2 h1:nG6GIKF1UOGmlzs+BIetdGHkFZ20YqFVIYp5Htqzp+4=
|
||||
github.com/metacubex/sing-vmess v0.2.2/go.mod h1:CVDNcdSLVYFgTHQlubr88d8CdqupAUDqLjROos+H9xk=
|
||||
github.com/metacubex/sing-tun v0.4.6-0.20250503065609-efb9f0beb6f6 h1:TAwL91XPa6x1QK55CRm+VTzPvLPUfEr/uFDnOZArqEU=
|
||||
github.com/metacubex/sing-tun v0.4.6-0.20250503065609-efb9f0beb6f6/go.mod h1:HDaHDL6onAX2ZGbAGUXKp++PohRdNb7Nzt6zxzhox+U=
|
||||
github.com/metacubex/sing-vmess v0.2.1 h1:I6gM3VUjtvJ15D805EUbNH+SRBuqzJeFnuIbKYUsWZ0=
|
||||
github.com/metacubex/sing-vmess v0.2.1/go.mod h1:DsODWItJtOMZNna8Qhheg8r3tUivrcO3vWgaTYKnfTo=
|
||||
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f h1:Sr/DYKYofKHKc4GF3qkRGNuj6XA6c0eqPgEDN+VAsYU=
|
||||
github.com/metacubex/sing-wireguard v0.0.0-20250503063753-2dc62acc626f/go.mod h1:jpAkVLPnCpGSfNyVmj6Cq4YbuZsFepm/Dc+9BAOcR80=
|
||||
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee h1:lp6hJ+4wCLZu113awp7P6odM2okB5s60HUyF0FMqKmo=
|
||||
github.com/metacubex/smux v0.0.0-20250503055512-501391591dee/go.mod h1:4bPD8HWx9jPJ9aE4uadgyN7D1/Wz3KmPy+vale8sKLE=
|
||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4 h1:j1VRTiC9JLR4nUbSikx9OGdu/3AgFDqgcLj4GoqyQkc=
|
||||
github.com/metacubex/tfo-go v0.0.0-20250516165257-e29c16ae41d4/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
|
||||
github.com/metacubex/utls v1.7.4-0.20250610022031-808d767c8c73 h1:HWKsf92BqLYqugATFIJ3hYiEBZ7JF6AoqyvqF39afuI=
|
||||
github.com/metacubex/utls v1.7.4-0.20250610022031-808d767c8c73/go.mod h1:oknYT0qTOwE4hjPmZOEpzVdefnW7bAdGLvZcqmk4TLU=
|
||||
github.com/metacubex/tfo-go v0.0.0-20250503140532-decbcfccbfdf h1:LwID1wz4tzypidd412dd4dC1H0m1TgRCQ/XvRvMJDFM=
|
||||
github.com/metacubex/tfo-go v0.0.0-20250503140532-decbcfccbfdf/go.mod h1:l9oLnLoEXyGZ5RVLsh7QCC5XsouTUyKk4F2nLm2DHLw=
|
||||
github.com/metacubex/utls v1.7.0-alpha.3 h1:cp1cEMUnoifiWrGHRzo+nCwPRveN9yPD8QaRFmfcYxA=
|
||||
github.com/metacubex/utls v1.7.0-alpha.3/go.mod h1:oknYT0qTOwE4hjPmZOEpzVdefnW7bAdGLvZcqmk4TLU=
|
||||
github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181 h1:hJLQviGySBuaynlCwf/oYgIxbVbGRUIKZCxdya9YrbQ=
|
||||
github.com/metacubex/wireguard-go v0.0.0-20240922131502-c182e7471181/go.mod h1:phewKljNYiTVT31Gcif8RiCKnTUOgVWFJjccqYM8s+Y=
|
||||
github.com/miekg/dns v1.1.63 h1:8M5aAw6OMZfFXTT7K5V0Eu5YiiL8l7nUAkyN6C9YwaY=
|
||||
|
||||
@@ -62,7 +62,7 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
});
|
||||
}
|
||||
|
||||
void _autoUpdateGroupTask() {
|
||||
_autoUpdateGroupTask() {
|
||||
_autoUpdateGroupTaskTimer = Timer(const Duration(milliseconds: 20000), () {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
globalState.appController.updateGroupsDebounce();
|
||||
@@ -71,14 +71,14 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
});
|
||||
}
|
||||
|
||||
void _autoUpdateProfilesTask() {
|
||||
_autoUpdateProfilesTask() {
|
||||
_autoUpdateProfilesTaskTimer = Timer(const Duration(minutes: 20), () async {
|
||||
await globalState.appController.autoUpdateProfiles();
|
||||
_autoUpdateProfilesTask();
|
||||
});
|
||||
}
|
||||
|
||||
Widget _buildPlatformState(Widget child) {
|
||||
_buildPlatformState(Widget child) {
|
||||
if (system.isDesktop) {
|
||||
return WindowManager(
|
||||
child: TrayManager(
|
||||
@@ -97,13 +97,13 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildState(Widget child) {
|
||||
_buildState(Widget child) {
|
||||
return AppStateManager(
|
||||
child: ClashManager(
|
||||
child: ConnectivityManager(
|
||||
onConnectivityChanged: (results) async {
|
||||
if (!results.contains(ConnectivityResult.vpn)) {
|
||||
clashCore.closeConnections();
|
||||
await clashCore.closeConnections();
|
||||
}
|
||||
globalState.appController.updateLocalIp();
|
||||
globalState.appController.addCheckIpNumDebounce();
|
||||
@@ -114,7 +114,7 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildPlatformApp(Widget child) {
|
||||
_buildPlatformApp(Widget child) {
|
||||
if (system.isDesktop) {
|
||||
return WindowHeaderContainer(
|
||||
child: child,
|
||||
@@ -125,7 +125,7 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildApp(Widget child) {
|
||||
_buildApp(Widget child) {
|
||||
return MessageManager(
|
||||
child: ThemeManager(
|
||||
child: child,
|
||||
@@ -153,12 +153,8 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
],
|
||||
builder: (_, child) {
|
||||
return AppEnvManager(
|
||||
child: _buildApp(
|
||||
AppSidebarContainer(
|
||||
child: _buildPlatformApp(
|
||||
child!,
|
||||
),
|
||||
),
|
||||
child: _buildPlatformApp(
|
||||
_buildApp(child!),
|
||||
),
|
||||
);
|
||||
},
|
||||
@@ -183,7 +179,7 @@ class ApplicationState extends ConsumerState<Application> {
|
||||
primaryColor: themeProps.primaryColor,
|
||||
).toPureBlack(themeProps.pureBlack),
|
||||
),
|
||||
home: child!,
|
||||
home: child,
|
||||
);
|
||||
},
|
||||
child: const HomePage(),
|
||||
|
||||
@@ -17,7 +17,7 @@ class ClashCore {
|
||||
late ClashHandlerInterface clashInterface;
|
||||
|
||||
ClashCore._internal() {
|
||||
if (system.isAndroid) {
|
||||
if (Platform.isAndroid) {
|
||||
clashInterface = clashLib!;
|
||||
} else {
|
||||
clashInterface = clashService!;
|
||||
@@ -66,11 +66,6 @@ class ClashCore {
|
||||
|
||||
Future<bool> init() async {
|
||||
await initGeo();
|
||||
if (globalState.config.appSetting.openLogs) {
|
||||
clashCore.startLog();
|
||||
} else {
|
||||
clashCore.stopLog();
|
||||
}
|
||||
final homeDirPath = await appPath.homeDirPath;
|
||||
return await clashInterface.init(
|
||||
InitParams(
|
||||
@@ -84,7 +79,7 @@ class ClashCore {
|
||||
return await clashInterface.setState(state);
|
||||
}
|
||||
|
||||
Future<void> shutdown() async {
|
||||
shutdown() async {
|
||||
await clashInterface.shutdown();
|
||||
}
|
||||
|
||||
@@ -107,14 +102,14 @@ class ClashCore {
|
||||
if (proxies.isEmpty) return [];
|
||||
final groupNames = [
|
||||
UsedProxy.GLOBAL.name,
|
||||
...(proxies[UsedProxy.GLOBAL.name]['all'] as List).where((e) {
|
||||
...(proxies[UsedProxy.GLOBAL.name]["all"] as List).where((e) {
|
||||
final proxy = proxies[e] ?? {};
|
||||
return GroupTypeExtension.valueList.contains(proxy['type']);
|
||||
})
|
||||
];
|
||||
final groupsRaw = groupNames.map((groupName) {
|
||||
final group = proxies[groupName];
|
||||
group['all'] = ((group['all'] ?? []) as List)
|
||||
group["all"] = ((group["all"] ?? []) as List)
|
||||
.map(
|
||||
(name) => proxies[name],
|
||||
)
|
||||
@@ -133,22 +128,22 @@ class ClashCore {
|
||||
return await clashInterface.changeProxy(changeProxyParams);
|
||||
}
|
||||
|
||||
Future<List<TrackerInfo>> getConnections() async {
|
||||
Future<List<Connection>> getConnections() async {
|
||||
final res = await clashInterface.getConnections();
|
||||
final connectionsData = json.decode(res) as Map;
|
||||
final connectionsRaw = connectionsData['connections'] as List? ?? [];
|
||||
return connectionsRaw.map((e) => TrackerInfo.fromJson(e)).toList();
|
||||
return connectionsRaw.map((e) => Connection.fromJson(e)).toList();
|
||||
}
|
||||
|
||||
void closeConnection(String id) {
|
||||
closeConnection(String id) {
|
||||
clashInterface.closeConnection(id);
|
||||
}
|
||||
|
||||
void closeConnections() {
|
||||
closeConnections() {
|
||||
clashInterface.closeConnections();
|
||||
}
|
||||
|
||||
void resetConnections() {
|
||||
resetConnections() {
|
||||
clashInterface.resetConnections();
|
||||
}
|
||||
|
||||
@@ -202,11 +197,11 @@ class ClashCore {
|
||||
return clashInterface.updateExternalProvider(providerName);
|
||||
}
|
||||
|
||||
Future<void> startListener() async {
|
||||
startListener() async {
|
||||
await clashInterface.startListener();
|
||||
}
|
||||
|
||||
Future<void> stopListener() async {
|
||||
stopListener() async {
|
||||
await clashInterface.stopListener();
|
||||
}
|
||||
|
||||
@@ -260,23 +255,23 @@ class ClashCore {
|
||||
return int.parse(value);
|
||||
}
|
||||
|
||||
void resetTraffic() {
|
||||
resetTraffic() {
|
||||
clashInterface.resetTraffic();
|
||||
}
|
||||
|
||||
void startLog() {
|
||||
startLog() {
|
||||
clashInterface.startLog();
|
||||
}
|
||||
|
||||
void stopLog() {
|
||||
stopLog() {
|
||||
clashInterface.stopLog();
|
||||
}
|
||||
|
||||
Future<void> requestGc() async {
|
||||
await clashInterface.forceGc();
|
||||
requestGc() {
|
||||
clashInterface.forceGc();
|
||||
}
|
||||
|
||||
Future<void> destroy() async {
|
||||
destroy() async {
|
||||
await clashInterface.destroy();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,11 +57,11 @@ mixin ClashInterface {
|
||||
|
||||
FutureOr<String> getMemory();
|
||||
|
||||
FutureOr<void> resetTraffic();
|
||||
resetTraffic();
|
||||
|
||||
FutureOr<void> startLog();
|
||||
startLog();
|
||||
|
||||
FutureOr<void> stopLog();
|
||||
stopLog();
|
||||
|
||||
Future<bool> crash();
|
||||
|
||||
@@ -89,7 +89,7 @@ mixin AndroidClashInterface {
|
||||
abstract class ClashHandlerInterface with ClashInterface {
|
||||
Map<String, Completer> callbackCompleterMap = {};
|
||||
|
||||
Future<void> handleResult(ActionResult result) async {
|
||||
handleResult(ActionResult result) async {
|
||||
final completer = callbackCompleterMap[result.id];
|
||||
try {
|
||||
switch (result.method) {
|
||||
@@ -105,13 +105,13 @@ abstract class ClashHandlerInterface with ClashInterface {
|
||||
return;
|
||||
}
|
||||
} catch (e) {
|
||||
commonPrint.log('${result.id} error $e');
|
||||
commonPrint.log("${result.id} error $e");
|
||||
}
|
||||
}
|
||||
|
||||
void sendMessage(String message);
|
||||
sendMessage(String message);
|
||||
|
||||
FutureOr<void> reStart();
|
||||
reStart();
|
||||
|
||||
FutureOr<bool> destroy();
|
||||
|
||||
@@ -122,14 +122,14 @@ abstract class ClashHandlerInterface with ClashInterface {
|
||||
FutureOr<T> Function()? onTimeout,
|
||||
T? defaultValue,
|
||||
}) async {
|
||||
final id = '${method.name}#${utils.id}';
|
||||
final id = "${method.name}#${utils.id}";
|
||||
|
||||
callbackCompleterMap[id] = Completer<T>();
|
||||
|
||||
dynamic mDefaultValue = defaultValue;
|
||||
if (mDefaultValue == null) {
|
||||
if (T == String) {
|
||||
mDefaultValue = '';
|
||||
mDefaultValue = "";
|
||||
} else if (T == bool) {
|
||||
mDefaultValue = false;
|
||||
} else if (T == Map) {
|
||||
@@ -290,8 +290,8 @@ abstract class ClashHandlerInterface with ClashInterface {
|
||||
return invoke<String>(
|
||||
method: ActionMethod.sideLoadExternalProvider,
|
||||
data: json.encode({
|
||||
'providerName': providerName,
|
||||
'data': data,
|
||||
"providerName": providerName,
|
||||
"data": data,
|
||||
}),
|
||||
);
|
||||
}
|
||||
@@ -382,9 +382,9 @@ abstract class ClashHandlerInterface with ClashInterface {
|
||||
@override
|
||||
Future<String> asyncTestDelay(String url, String proxyName) {
|
||||
final delayParams = {
|
||||
'proxy-name': proxyName,
|
||||
'timeout': httpTimeoutDuration.inMilliseconds,
|
||||
'test-url': url,
|
||||
"proxy-name": proxyName,
|
||||
"timeout": httpTimeoutDuration.inMilliseconds,
|
||||
"test-url": url,
|
||||
};
|
||||
return invoke<String>(
|
||||
method: ActionMethod.asyncTestDelay,
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
import 'dart:ui';
|
||||
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/common/constant.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:fl_clash/plugins/service.dart';
|
||||
@@ -29,7 +30,7 @@ class ClashLib extends ClashHandlerInterface with AndroidClashInterface {
|
||||
return _canSendCompleter.future;
|
||||
}
|
||||
|
||||
Future<void> _initService() async {
|
||||
_initService() async {
|
||||
await service?.destroy();
|
||||
_registerMainPort(receiverPort.sendPort);
|
||||
receiverPort.listen((message) {
|
||||
@@ -51,7 +52,7 @@ class ClashLib extends ClashHandlerInterface with AndroidClashInterface {
|
||||
await service?.init();
|
||||
}
|
||||
|
||||
void _registerMainPort(SendPort sendPort) {
|
||||
_registerMainPort(SendPort sendPort) {
|
||||
IsolateNameServer.removePortNameMapping(mainIsolate);
|
||||
IsolateNameServer.registerPortWithName(sendPort, mainIsolate);
|
||||
}
|
||||
@@ -138,7 +139,7 @@ class ClashLibHandler {
|
||||
late final DynamicLibrary lib;
|
||||
|
||||
ClashLibHandler._internal() {
|
||||
lib = DynamicLibrary.open('libclash.so');
|
||||
lib = DynamicLibrary.open("libclash.so");
|
||||
clashFFI = ClashFFI(lib);
|
||||
clashFFI.initNativeApiBridge(
|
||||
NativeApi.initializeApiDLData,
|
||||
@@ -168,19 +169,19 @@ class ClashLibHandler {
|
||||
return completer.future;
|
||||
}
|
||||
|
||||
void attachMessagePort(int messagePort) {
|
||||
attachMessagePort(int messagePort) {
|
||||
clashFFI.attachMessagePort(
|
||||
messagePort,
|
||||
);
|
||||
}
|
||||
|
||||
void updateDns(String dns) {
|
||||
updateDns(String dns) {
|
||||
final dnsChar = dns.toNativeUtf8().cast<Char>();
|
||||
clashFFI.updateDns(dnsChar);
|
||||
malloc.free(dnsChar);
|
||||
}
|
||||
|
||||
void setState(CoreState state) {
|
||||
setState(CoreState state) {
|
||||
final stateChar = json.encode(state).toNativeUtf8().cast<Char>();
|
||||
clashFFI.setState(stateChar);
|
||||
malloc.free(stateChar);
|
||||
@@ -220,12 +221,12 @@ class ClashLibHandler {
|
||||
return Traffic.fromMap(json.decode(trafficString));
|
||||
}
|
||||
|
||||
Future<bool> startListener() async {
|
||||
startListener() async {
|
||||
clashFFI.startListener();
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<bool> stopListener() async {
|
||||
stopListener() async {
|
||||
clashFFI.stopListener();
|
||||
return true;
|
||||
}
|
||||
@@ -239,19 +240,18 @@ class ClashLibHandler {
|
||||
return DateTime.fromMillisecondsSinceEpoch(int.parse(runTimeString));
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>> getConfig(String id) async {
|
||||
final path = await appPath.getProfilePath(id);
|
||||
final pathChar = path.toNativeUtf8().cast<Char>();
|
||||
final configRaw = clashFFI.getConfig(pathChar);
|
||||
final configString = configRaw.cast<Utf8>().toDartString();
|
||||
if (configString.isEmpty) {
|
||||
return {};
|
||||
}
|
||||
final config = json.decode(configString);
|
||||
malloc.free(pathChar);
|
||||
clashFFI.freeCString(configRaw);
|
||||
return config;
|
||||
}
|
||||
// Map<String, dynamic> getConfig(String path) {
|
||||
// final pathChar = path.toNativeUtf8().cast<Char>();
|
||||
// final configRaw = clashFFI.getConfig(pathChar);
|
||||
// final configString = configRaw.cast<Utf8>().toDartString();
|
||||
// if (configString.isEmpty) {
|
||||
// return {};
|
||||
// }
|
||||
// final config = json.decode(configString);
|
||||
// malloc.free(pathChar);
|
||||
// clashFFI.freeCString(configRaw);
|
||||
// return config;
|
||||
// }
|
||||
|
||||
Future<String> quickStart(
|
||||
InitParams initParams,
|
||||
@@ -286,7 +286,7 @@ class ClashLibHandler {
|
||||
}
|
||||
|
||||
ClashLib? get clashLib =>
|
||||
system.isAndroid && !globalState.isService ? ClashLib() : null;
|
||||
Platform.isAndroid && !globalState.isService ? ClashLib() : null;
|
||||
|
||||
ClashLibHandler? get clashLibHandler =>
|
||||
system.isAndroid && globalState.isService ? ClashLibHandler() : null;
|
||||
Platform.isAndroid ? ClashLibHandler() : null;
|
||||
|
||||
@@ -23,7 +23,7 @@ class ClashMessage {
|
||||
listener.onDelay(Delay.fromJson(m.data));
|
||||
break;
|
||||
case AppMessageType.request:
|
||||
listener.onRequest(TrackerInfo.fromJson(m.data));
|
||||
listener.onRequest(Connection.fromJson(m.data));
|
||||
break;
|
||||
case AppMessageType.loaded:
|
||||
listener.onLoaded(m.data);
|
||||
|
||||
@@ -28,9 +28,9 @@ class ClashService extends ClashHandlerInterface {
|
||||
reStart();
|
||||
}
|
||||
|
||||
Future<void> _initServer() async {
|
||||
_initServer() async {
|
||||
runZonedGuarded(() async {
|
||||
final address = !system.isWindows
|
||||
final address = !Platform.isWindows
|
||||
? InternetAddress(
|
||||
unixSocketPath,
|
||||
type: InternetAddressType.unix,
|
||||
@@ -83,10 +83,10 @@ class ClashService extends ClashHandlerInterface {
|
||||
await shutdown();
|
||||
}
|
||||
final serverSocket = await serverCompleter.future;
|
||||
final arg = system.isWindows
|
||||
? '${serverSocket.port}'
|
||||
final arg = Platform.isWindows
|
||||
? "${serverSocket.port}"
|
||||
: serverSocket.address.address;
|
||||
if (system.isWindows && await system.checkIsAdmin()) {
|
||||
if (Platform.isWindows && await system.checkIsAdmin()) {
|
||||
final isSuccess = await request.startCoreByHelper(arg);
|
||||
if (isSuccess) {
|
||||
return;
|
||||
@@ -122,8 +122,8 @@ class ClashService extends ClashHandlerInterface {
|
||||
socket.writeln(message);
|
||||
}
|
||||
|
||||
Future<void> _deleteSocketFile() async {
|
||||
if (!system.isWindows) {
|
||||
_deleteSocketFile() async {
|
||||
if (!Platform.isWindows) {
|
||||
final file = File(unixSocketPath);
|
||||
if (await file.exists()) {
|
||||
await file.delete();
|
||||
@@ -131,7 +131,7 @@ class ClashService extends ClashHandlerInterface {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _destroySocket() async {
|
||||
_destroySocket() async {
|
||||
if (socketCompleter.isCompleted) {
|
||||
final lastSocket = await socketCompleter.future;
|
||||
await lastSocket.close();
|
||||
@@ -141,7 +141,7 @@ class ClashService extends ClashHandlerInterface {
|
||||
|
||||
@override
|
||||
shutdown() async {
|
||||
if (system.isWindows) {
|
||||
if (Platform.isWindows) {
|
||||
await request.stopCoreByHelper();
|
||||
}
|
||||
await _destroySocket();
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_clash/plugins/app.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
|
||||
import 'system.dart';
|
||||
|
||||
class Android {
|
||||
Future<void> init() async {
|
||||
init() async {
|
||||
app?.onExit = () async {
|
||||
await globalState.appController.savePreferences();
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
final android = system.isAndroid ? Android() : null;
|
||||
final android = Platform.isAndroid ? Android() : null;
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:archive/archive_io.dart';
|
||||
import 'package:path/path.dart';
|
||||
|
||||
extension ArchiveExt on Archive {
|
||||
void addDirectoryToArchive(String dirPath, String parentPath) {
|
||||
addDirectoryToArchive(String dirPath, String parentPath) {
|
||||
final dir = Directory(dirPath);
|
||||
final entities = dir.listSync(recursive: false);
|
||||
for (final entity in entities) {
|
||||
@@ -20,7 +19,7 @@ extension ArchiveExt on Archive {
|
||||
}
|
||||
}
|
||||
|
||||
void add<T>(String name, T raw) {
|
||||
add<T>(String name, T raw) {
|
||||
final data = json.encode(raw);
|
||||
addFile(
|
||||
ArchiveFile(name, data.length, data),
|
||||
|
||||
@@ -23,10 +23,6 @@ extension ColorExtension on Color {
|
||||
return withAlpha(77);
|
||||
}
|
||||
|
||||
Color get opacity12 {
|
||||
return withAlpha(31);
|
||||
}
|
||||
|
||||
Color get opacity15 {
|
||||
return withAlpha(38);
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ export 'future.dart';
|
||||
export 'http.dart';
|
||||
export 'icons.dart';
|
||||
export 'iterable.dart';
|
||||
export 'javascript.dart';
|
||||
export 'keyboard.dart';
|
||||
export 'launch.dart';
|
||||
export 'link.dart';
|
||||
@@ -37,3 +38,4 @@ export 'text.dart';
|
||||
export 'tray.dart';
|
||||
export 'utils.dart';
|
||||
export 'window.dart';
|
||||
export 'windows.dart';
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import 'dart:io';
|
||||
import 'dart:math';
|
||||
import 'dart:ui';
|
||||
|
||||
@@ -7,13 +8,13 @@ import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
const appName = 'FlClash';
|
||||
const appHelperService = 'FlClashHelperService';
|
||||
const coreName = 'clash.meta';
|
||||
const appName = "FlClash";
|
||||
const appHelperService = "FlClashHelperService";
|
||||
const coreName = "clash.meta";
|
||||
const browserUa =
|
||||
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
|
||||
const packageName = 'com.follow.clash';
|
||||
final unixSocketPath = '/tmp/FlClashSocket_${Random().nextInt(10000)}.sock';
|
||||
"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36";
|
||||
const packageName = "com.follow.clash";
|
||||
final unixSocketPath = "/tmp/FlClashSocket_${Random().nextInt(10000)}.sock";
|
||||
const helperPort = 47890;
|
||||
const maxTextScale = 1.4;
|
||||
const minTextScale = 0.8;
|
||||
@@ -30,25 +31,25 @@ const animateDuration = Duration(milliseconds: 100);
|
||||
const midDuration = Duration(milliseconds: 200);
|
||||
const commonDuration = Duration(milliseconds: 300);
|
||||
const defaultUpdateDuration = Duration(days: 1);
|
||||
const mmdbFileName = 'geoip.metadb';
|
||||
const asnFileName = 'ASN.mmdb';
|
||||
const geoIpFileName = 'GeoIP.dat';
|
||||
const geoSiteFileName = 'GeoSite.dat';
|
||||
const mmdbFileName = "geoip.metadb";
|
||||
const asnFileName = "ASN.mmdb";
|
||||
const geoIpFileName = "GeoIP.dat";
|
||||
const geoSiteFileName = "GeoSite.dat";
|
||||
final double kHeaderHeight = system.isDesktop
|
||||
? !system.isMacOS
|
||||
? !Platform.isMacOS
|
||||
? 40
|
||||
: 28
|
||||
: 0;
|
||||
const profilesDirectoryName = 'profiles';
|
||||
const localhost = '127.0.0.1';
|
||||
const clashConfigKey = 'clash_config';
|
||||
const configKey = 'config';
|
||||
const profilesDirectoryName = "profiles";
|
||||
const localhost = "127.0.0.1";
|
||||
const clashConfigKey = "clash_config";
|
||||
const configKey = "config";
|
||||
const double dialogCommonWidth = 300;
|
||||
const repository = 'chen08209/FlClash';
|
||||
const defaultExternalController = '127.0.0.1:9090';
|
||||
const repository = "chen08209/FlClash";
|
||||
const defaultExternalController = "127.0.0.1:9090";
|
||||
const maxMobileWidth = 600;
|
||||
const maxLaptopWidth = 840;
|
||||
const defaultTestUrl = 'https://www.gstatic.com/generate_204';
|
||||
const defaultTestUrl = "https://www.gstatic.com/generate_204";
|
||||
final commonFilter = ImageFilter.blur(
|
||||
sigmaX: 5,
|
||||
sigmaY: 5,
|
||||
@@ -56,7 +57,7 @@ final commonFilter = ImageFilter.blur(
|
||||
);
|
||||
|
||||
const navigationItemListEquality = ListEquality<NavigationItem>();
|
||||
const trackerInfoListEquality = ListEquality<TrackerInfo>();
|
||||
const connectionListEquality = ListEquality<Connection>();
|
||||
const stringListEquality = ListEquality<String>();
|
||||
const intListEquality = ListEquality<int>();
|
||||
const logListEquality = ListEquality<Log>();
|
||||
@@ -77,9 +78,9 @@ const viewModeColumnsMap = {
|
||||
ViewMode.desktop: [4, 3],
|
||||
};
|
||||
|
||||
const proxiesListStoreKey = PageStorageKey<String>('proxies_list');
|
||||
const toolsStoreKey = PageStorageKey<String>('tools');
|
||||
const profilesStoreKey = PageStorageKey<String>('profiles');
|
||||
// const proxiesStoreKey = PageStorageKey<String>('proxies');
|
||||
// const toolsStoreKey = PageStorageKey<String>('tools');
|
||||
// const profilesStoreKey = PageStorageKey<String>('profiles');
|
||||
|
||||
const defaultPrimaryColor = 0XFFD8C0C3;
|
||||
|
||||
@@ -87,11 +88,11 @@ double getWidgetHeight(num lines) {
|
||||
return max(lines * 84 + (lines - 1) * 16, 0).ap;
|
||||
}
|
||||
|
||||
const maxLength = 1000;
|
||||
const maxLength = 150;
|
||||
|
||||
final mainIsolate = 'FlClashMainIsolate';
|
||||
final mainIsolate = "FlClashMainIsolate";
|
||||
|
||||
final serviceIsolate = 'FlClashServiceIsolate';
|
||||
final serviceIsolate = "FlClashServiceIsolate";
|
||||
|
||||
const defaultPrimaryColors = [
|
||||
0xFF795548,
|
||||
@@ -103,7 +104,7 @@ const defaultPrimaryColors = [
|
||||
0XFF665390,
|
||||
];
|
||||
|
||||
const scriptTemplate = '''
|
||||
const scriptTemplate = """
|
||||
const main = (config) => {
|
||||
return config;
|
||||
}''';
|
||||
}""";
|
||||
|
||||
@@ -7,11 +7,11 @@ extension BuildContextExtension on BuildContext {
|
||||
return findAncestorStateOfType<CommonScaffoldState>();
|
||||
}
|
||||
|
||||
Future<void>? showNotifier(String text) {
|
||||
showNotifier(String text) {
|
||||
return findAncestorStateOfType<MessageManagerState>()?.message(text);
|
||||
}
|
||||
|
||||
void showSnackBar(
|
||||
showSnackBar(
|
||||
String message, {
|
||||
SnackBarAction? action,
|
||||
}) {
|
||||
@@ -72,18 +72,3 @@ extension BuildContextExtension on BuildContext {
|
||||
return state;
|
||||
}
|
||||
}
|
||||
|
||||
class BackHandleInherited extends InheritedWidget {
|
||||
final Function handleBack;
|
||||
|
||||
const BackHandleInherited(
|
||||
{super.key, required this.handleBack, required super.child});
|
||||
|
||||
static BackHandleInherited? of(BuildContext context) =>
|
||||
context.dependOnInheritedWidgetOfExactType<BackHandleInherited>();
|
||||
|
||||
@override
|
||||
bool updateShouldNotify(BackHandleInherited oldWidget) {
|
||||
return handleBack != oldWidget.handleBack;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,34 +17,26 @@ extension DateTimeExtension on DateTime {
|
||||
final difference = currentDateTime.difference(this);
|
||||
final days = difference.inDays;
|
||||
if (days >= 365) {
|
||||
return '${(days / 365).floor()} ${appLocalizations.years}${appLocalizations.ago}';
|
||||
return "${(days / 365).floor()} ${appLocalizations.years}${appLocalizations.ago}";
|
||||
}
|
||||
if (days >= 30) {
|
||||
return '${(days / 30).floor()} ${appLocalizations.months}${appLocalizations.ago}';
|
||||
return "${(days / 30).floor()} ${appLocalizations.months}${appLocalizations.ago}";
|
||||
}
|
||||
if (days >= 1) {
|
||||
return '$days ${appLocalizations.days}${appLocalizations.ago}';
|
||||
return "$days ${appLocalizations.days}${appLocalizations.ago}";
|
||||
}
|
||||
final hours = difference.inHours;
|
||||
if (hours >= 1) {
|
||||
return '$hours ${appLocalizations.hours}${appLocalizations.ago}';
|
||||
return "$hours ${appLocalizations.hours}${appLocalizations.ago}";
|
||||
}
|
||||
final minutes = difference.inMinutes;
|
||||
if (minutes >= 1) {
|
||||
return '$minutes ${appLocalizations.minutes}${appLocalizations.ago}';
|
||||
return "$minutes ${appLocalizations.minutes}${appLocalizations.ago}";
|
||||
}
|
||||
return appLocalizations.just;
|
||||
}
|
||||
|
||||
String get show {
|
||||
return toString().substring(0, 10);
|
||||
}
|
||||
|
||||
String get showFull {
|
||||
return toString().substring(0, 19);
|
||||
}
|
||||
|
||||
String get showTime {
|
||||
return toString().substring(10, 19);
|
||||
return toIso8601String().substring(0, 10);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,18 +38,18 @@ class DAVClient {
|
||||
}
|
||||
}
|
||||
|
||||
String get root => '/$appName';
|
||||
get root => "/$appName";
|
||||
|
||||
String get backupFile => '$root/$fileName';
|
||||
get backupFile => "$root/$fileName";
|
||||
|
||||
Future<bool> backup(Uint8List data) async {
|
||||
await client.mkdir(root);
|
||||
await client.write(backupFile, data);
|
||||
backup(Uint8List data) async {
|
||||
await client.mkdir("$root");
|
||||
await client.write("$backupFile", data);
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<List<int>> recovery() async {
|
||||
await client.mkdir(root);
|
||||
await client.mkdir("$root");
|
||||
final data = await client.read(backupFile);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import 'iterable.dart';
|
||||
|
||||
typedef ValueCallback<T> = T Function();
|
||||
|
||||
class FixedList<T> {
|
||||
final int maxLength;
|
||||
final List<T> _list;
|
||||
@@ -9,12 +7,12 @@ class FixedList<T> {
|
||||
FixedList(this.maxLength, {List<T>? list})
|
||||
: _list = (list ?? [])..truncate(maxLength);
|
||||
|
||||
void add(T item) {
|
||||
add(T item) {
|
||||
_list.add(item);
|
||||
_list.truncate(maxLength);
|
||||
}
|
||||
|
||||
void clear() {
|
||||
clear() {
|
||||
_list.clear();
|
||||
}
|
||||
|
||||
@@ -40,7 +38,7 @@ class FixedMap<K, V> {
|
||||
_map = map ?? {};
|
||||
}
|
||||
|
||||
V updateCacheValue(K key, ValueCallback<V> callback) {
|
||||
updateCacheValue(K key, V Function() callback) {
|
||||
final realValue = _map.updateCacheValue(
|
||||
key,
|
||||
callback,
|
||||
@@ -49,21 +47,21 @@ class FixedMap<K, V> {
|
||||
return realValue;
|
||||
}
|
||||
|
||||
void clear() {
|
||||
clear() {
|
||||
_map.clear();
|
||||
}
|
||||
|
||||
void updateMaxLength(int size) {
|
||||
updateMaxLength(int size) {
|
||||
maxLength = size;
|
||||
_adjustMap();
|
||||
}
|
||||
|
||||
void updateMap(Map<K, V> map) {
|
||||
updateMap(Map<K, V> map) {
|
||||
_map = map;
|
||||
_adjustMap();
|
||||
}
|
||||
|
||||
void _adjustMap() {
|
||||
_adjustMap() {
|
||||
if (_map.length > maxLength) {
|
||||
_map = Map.fromEntries(
|
||||
map.entries.toList()..truncate(maxLength),
|
||||
|
||||
@@ -5,7 +5,7 @@ import 'package:fl_clash/enum/enum.dart';
|
||||
class Debouncer {
|
||||
final Map<FunctionTag, Timer?> _operations = {};
|
||||
|
||||
void call(
|
||||
call(
|
||||
FunctionTag tag,
|
||||
Function func, {
|
||||
List<dynamic>? args,
|
||||
@@ -28,7 +28,7 @@ class Debouncer {
|
||||
);
|
||||
}
|
||||
|
||||
void cancel(dynamic tag) {
|
||||
cancel(dynamic tag) {
|
||||
_operations[tag]?.cancel();
|
||||
_operations[tag] = null;
|
||||
}
|
||||
@@ -37,7 +37,7 @@ class Debouncer {
|
||||
class Throttler {
|
||||
final Map<FunctionTag, Timer?> _operations = {};
|
||||
|
||||
bool call(
|
||||
call(
|
||||
FunctionTag tag,
|
||||
Function func, {
|
||||
List<dynamic>? args,
|
||||
@@ -61,7 +61,7 @@ class Throttler {
|
||||
return false;
|
||||
}
|
||||
|
||||
void cancel(dynamic tag) {
|
||||
cancel(dynamic tag) {
|
||||
_operations[tag]?.cancel();
|
||||
_operations[tag] = null;
|
||||
}
|
||||
@@ -81,7 +81,7 @@ Future<T> retry<T>({
|
||||
}
|
||||
attempts++;
|
||||
}
|
||||
throw 'unknown error';
|
||||
throw "unknown error";
|
||||
}
|
||||
|
||||
final debouncer = Debouncer();
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'dart:ui';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
|
||||
extension CompleterExt<T> on Completer<T> {
|
||||
Future<T> safeFuture({
|
||||
safeFuture({
|
||||
Duration? timeout,
|
||||
VoidCallback? onLast,
|
||||
FutureOr<T> Function()? onTimeout,
|
||||
|
||||
@@ -6,13 +6,13 @@ import 'package:fl_clash/state.dart';
|
||||
class FlClashHttpOverrides extends HttpOverrides {
|
||||
static String handleFindProxy(Uri url) {
|
||||
if ([localhost].contains(url.host)) {
|
||||
return 'DIRECT';
|
||||
return "DIRECT";
|
||||
}
|
||||
final port = globalState.config.patchClashConfig.mixedPort;
|
||||
final isStart = globalState.appState.runTime != null;
|
||||
commonPrint.log('find $url proxy:$isStart');
|
||||
if (!isStart) return 'DIRECT';
|
||||
return 'PROXY localhost:$port';
|
||||
commonPrint.log("find $url proxy:$isStart");
|
||||
if (!isStart) return "DIRECT";
|
||||
return "PROXY localhost:$port";
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class IconsExt {
|
||||
static const IconData target = IconData(0xe900, fontFamily: 'Icons');
|
||||
}
|
||||
class IconsExt{
|
||||
static const IconData target =
|
||||
IconData(0xe900, fontFamily: "Icons");
|
||||
}
|
||||
@@ -47,9 +47,7 @@ extension IterableExt<T> on Iterable<T> {
|
||||
|
||||
extension ListExt<T> on List<T> {
|
||||
void truncate(int maxLength) {
|
||||
if (maxLength == 0) {
|
||||
return;
|
||||
}
|
||||
assert(maxLength > 0);
|
||||
if (length > maxLength) {
|
||||
removeRange(0, length - maxLength);
|
||||
}
|
||||
@@ -72,19 +70,11 @@ extension ListExt<T> on List<T> {
|
||||
return res;
|
||||
}
|
||||
|
||||
List<T> safeSublist(int start, [int? end]) {
|
||||
List<T> safeSublist(int start) {
|
||||
if (start <= 0) return this;
|
||||
if (start > length) return [];
|
||||
if (end != null) {
|
||||
return sublist(start, end.clamp(start, length));
|
||||
}
|
||||
return sublist(start);
|
||||
}
|
||||
|
||||
T safeGet(int index) {
|
||||
if (length > index) return this[index];
|
||||
return last;
|
||||
}
|
||||
}
|
||||
|
||||
extension DoubleListExt on List<double> {
|
||||
@@ -114,10 +104,10 @@ extension DoubleListExt on List<double> {
|
||||
}
|
||||
|
||||
extension MapExt<K, V> on Map<K, V> {
|
||||
V updateCacheValue(K key, V Function() callback) {
|
||||
updateCacheValue(K key, V Function() callback) {
|
||||
if (this[key] == null) {
|
||||
this[key] = callback();
|
||||
}
|
||||
return this[key]!;
|
||||
return this[key];
|
||||
}
|
||||
}
|
||||
|
||||
18
lib/common/javascript.dart
Normal file
18
lib/common/javascript.dart
Normal file
@@ -0,0 +1,18 @@
|
||||
import 'package:flutter_js/flutter_js.dart';
|
||||
|
||||
class Javascript {
|
||||
static Javascript? _instance;
|
||||
|
||||
Javascript._internal();
|
||||
|
||||
JavascriptRuntime get runTime {
|
||||
return getJavascriptRuntime();
|
||||
}
|
||||
|
||||
factory Javascript() {
|
||||
_instance ??= Javascript._internal();
|
||||
return _instance!;
|
||||
}
|
||||
}
|
||||
|
||||
final js = Javascript();
|
||||
@@ -1,8 +1,8 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:uni_platform/uni_platform.dart';
|
||||
|
||||
import 'system.dart';
|
||||
|
||||
final Map<PhysicalKeyboardKey, String> _knownKeyLabels =
|
||||
<PhysicalKeyboardKey, String>{
|
||||
PhysicalKeyboardKey.keyA: 'A',
|
||||
@@ -79,14 +79,14 @@ final Map<PhysicalKeyboardKey, String> _knownKeyLabels =
|
||||
PhysicalKeyboardKey.arrowLeft: '←',
|
||||
PhysicalKeyboardKey.arrowDown: '↓',
|
||||
PhysicalKeyboardKey.arrowUp: '↑',
|
||||
PhysicalKeyboardKey.controlLeft: 'CTRL',
|
||||
PhysicalKeyboardKey.controlLeft: "CTRL",
|
||||
PhysicalKeyboardKey.shiftLeft: 'SHIFT',
|
||||
PhysicalKeyboardKey.altLeft: 'ALT',
|
||||
PhysicalKeyboardKey.metaLeft: system.isMacOS ? '⌘' : 'WIN',
|
||||
PhysicalKeyboardKey.controlRight: 'CTRL',
|
||||
PhysicalKeyboardKey.altLeft: "ALT",
|
||||
PhysicalKeyboardKey.metaLeft: Platform.isMacOS ? '⌘' : 'WIN',
|
||||
PhysicalKeyboardKey.controlRight: "CTRL",
|
||||
PhysicalKeyboardKey.shiftRight: 'SHIFT',
|
||||
PhysicalKeyboardKey.altRight: 'ALT',
|
||||
PhysicalKeyboardKey.metaRight: system.isMacOS ? '⌘' : 'WIN',
|
||||
PhysicalKeyboardKey.altRight: "ALT",
|
||||
PhysicalKeyboardKey.metaRight: Platform.isMacOS ? '⌘' : 'WIN',
|
||||
PhysicalKeyboardKey.fn: 'FN',
|
||||
};
|
||||
|
||||
@@ -101,3 +101,6 @@ extension KeyboardKeyExt on KeyboardKey {
|
||||
return _knownKeyLabels[physicalKey] ?? physicalKey?.debugName ?? 'Unknown';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -34,8 +34,8 @@ class AutoLaunch {
|
||||
return await launchAtStartup.disable();
|
||||
}
|
||||
|
||||
Future<void> updateStatus(bool isAutoLaunch) async {
|
||||
if (kDebugMode) {
|
||||
updateStatus(bool isAutoLaunch) async {
|
||||
if(kDebugMode){
|
||||
return;
|
||||
}
|
||||
if (await isEnable == isAutoLaunch) return;
|
||||
|
||||
@@ -15,9 +15,8 @@ class LinkManager {
|
||||
_appLinks = AppLinks();
|
||||
}
|
||||
|
||||
Future<void> initAppLinksListen(
|
||||
Function(String url) installConfigCallBack) async {
|
||||
commonPrint.log('initAppLinksListen');
|
||||
initAppLinksListen(installConfigCallBack) async {
|
||||
commonPrint.log("initAppLinksListen");
|
||||
destroy();
|
||||
subscription = _appLinks.uriLinkStream.listen(
|
||||
(uri) {
|
||||
@@ -33,7 +32,7 @@ class LinkManager {
|
||||
);
|
||||
}
|
||||
|
||||
void destroy() {
|
||||
destroy() {
|
||||
if (subscription != null) {
|
||||
subscription?.cancel();
|
||||
subscription = null;
|
||||
|
||||
@@ -33,10 +33,10 @@ class Measure {
|
||||
|
||||
double get bodyMediumHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'bodyMediumHeight',
|
||||
"bodyMediumHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.bodyMedium,
|
||||
),
|
||||
).height,
|
||||
@@ -45,10 +45,10 @@ class Measure {
|
||||
|
||||
double get bodyLargeHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'bodyLargeHeight',
|
||||
"bodyLargeHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.bodyLarge,
|
||||
),
|
||||
).height,
|
||||
@@ -57,10 +57,10 @@ class Measure {
|
||||
|
||||
double get bodySmallHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'bodySmallHeight',
|
||||
"bodySmallHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.bodySmall,
|
||||
),
|
||||
).height,
|
||||
@@ -69,10 +69,10 @@ class Measure {
|
||||
|
||||
double get labelSmallHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'labelSmallHeight',
|
||||
"labelSmallHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.labelSmall,
|
||||
),
|
||||
).height,
|
||||
@@ -81,10 +81,10 @@ class Measure {
|
||||
|
||||
double get labelMediumHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'labelMediumHeight',
|
||||
"labelMediumHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.labelMedium,
|
||||
),
|
||||
).height,
|
||||
@@ -93,10 +93,10 @@ class Measure {
|
||||
|
||||
double get titleLargeHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'titleLargeHeight',
|
||||
"titleLargeHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.titleLarge,
|
||||
),
|
||||
).height,
|
||||
@@ -105,10 +105,10 @@ class Measure {
|
||||
|
||||
double get titleMediumHeight {
|
||||
return _measureMap.updateCacheValue(
|
||||
'titleMediumHeight',
|
||||
"titleMediumHeight",
|
||||
() => computeTextSize(
|
||||
Text(
|
||||
'X',
|
||||
"X",
|
||||
style: context.textTheme.titleMedium,
|
||||
),
|
||||
).height,
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:riverpod/riverpod.dart';
|
||||
import 'context.dart';
|
||||
|
||||
mixin AutoDisposeNotifierMixin<T> on AutoDisposeNotifier<T> {
|
||||
set value(T value) {
|
||||
@@ -14,31 +17,37 @@ mixin AutoDisposeNotifierMixin<T> on AutoDisposeNotifier<T> {
|
||||
return res;
|
||||
}
|
||||
|
||||
void onUpdate(T value) {}
|
||||
onUpdate(T value) {}
|
||||
}
|
||||
|
||||
// mixin PageMixin<T extends StatefulWidget> on State<T> {
|
||||
// initPageState() {
|
||||
// WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
// final commonScaffoldState = context.commonScaffoldState;
|
||||
// commonScaffoldState?.actions = actions;
|
||||
// commonScaffoldState?.floatingActionButton = floatingActionButton;
|
||||
// commonScaffoldState?.onKeywordsUpdate = onKeywordsUpdate;
|
||||
// commonScaffoldState?.updateSearchState(
|
||||
// (_) => onSearch != null
|
||||
// ? AppBarSearchState(
|
||||
// onSearch: onSearch!,
|
||||
// )
|
||||
// : null,
|
||||
// );
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// List<Widget> get actions => [];
|
||||
//
|
||||
// Widget? get floatingActionButton => null;
|
||||
//
|
||||
// Function(String)? get onSearch => null;
|
||||
//
|
||||
// Function(List<String>)? get onKeywordsUpdate => null;
|
||||
// }
|
||||
mixin PageMixin<T extends StatefulWidget> on State<T> {
|
||||
void onPageShow() {
|
||||
initPageState();
|
||||
}
|
||||
|
||||
initPageState() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
final commonScaffoldState = context.commonScaffoldState;
|
||||
commonScaffoldState?.actions = actions;
|
||||
commonScaffoldState?.floatingActionButton = floatingActionButton;
|
||||
commonScaffoldState?.onKeywordsUpdate = onKeywordsUpdate;
|
||||
commonScaffoldState?.updateSearchState(
|
||||
(_) => onSearch != null
|
||||
? AppBarSearchState(
|
||||
onSearch: onSearch!,
|
||||
)
|
||||
: null,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void onPageHidden() {}
|
||||
|
||||
List<Widget> get actions => [];
|
||||
|
||||
Widget? get floatingActionButton => null;
|
||||
|
||||
Function(String)? get onSearch => null;
|
||||
|
||||
Function(List<String>)? get onKeywordsUpdate => null;
|
||||
}
|
||||
|
||||
@@ -1,9 +1,7 @@
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/views/views.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class Navigation {
|
||||
static Navigation? _instance;
|
||||
@@ -13,69 +11,62 @@ class Navigation {
|
||||
bool hasProxies = false,
|
||||
}) {
|
||||
return [
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
keep: false,
|
||||
icon: Icon(Icons.space_dashboard),
|
||||
label: PageLabel.dashboard,
|
||||
builder: (_) => const DashboardView(
|
||||
view: DashboardView(
|
||||
key: GlobalObjectKey(PageLabel.dashboard),
|
||||
),
|
||||
),
|
||||
NavigationItem(
|
||||
icon: const Icon(Icons.article),
|
||||
label: PageLabel.proxies,
|
||||
builder: (_) => ProviderScope(
|
||||
overrides: [
|
||||
queryProvider.overrideWith(
|
||||
() => Query(),
|
||||
),
|
||||
],
|
||||
child: const ProxiesView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.proxies,
|
||||
),
|
||||
view: const ProxiesView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.proxies,
|
||||
),
|
||||
),
|
||||
modes: hasProxies
|
||||
? [NavigationItemMode.mobile, NavigationItemMode.desktop]
|
||||
: [],
|
||||
),
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
icon: Icon(Icons.folder),
|
||||
label: PageLabel.profiles,
|
||||
builder: (_) => const ProfilesView(
|
||||
view: ProfilesView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.profiles,
|
||||
),
|
||||
),
|
||||
),
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
icon: Icon(Icons.view_timeline),
|
||||
label: PageLabel.requests,
|
||||
builder: (_) => const RequestsView(
|
||||
view: RequestsView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.requests,
|
||||
),
|
||||
),
|
||||
description: 'requestsDesc',
|
||||
description: "requestsDesc",
|
||||
modes: [NavigationItemMode.desktop, NavigationItemMode.more],
|
||||
),
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
icon: Icon(Icons.ballot),
|
||||
label: PageLabel.connections,
|
||||
builder: (_) => const ConnectionsView(
|
||||
view: ConnectionsView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.connections,
|
||||
),
|
||||
),
|
||||
description: 'connectionsDesc',
|
||||
description: "connectionsDesc",
|
||||
modes: [NavigationItemMode.desktop, NavigationItemMode.more],
|
||||
),
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
icon: Icon(Icons.storage),
|
||||
label: PageLabel.resources,
|
||||
description: 'resourcesDesc',
|
||||
builder: (_) => const ResourcesView(
|
||||
description: "resourcesDesc",
|
||||
view: ResourcesView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.resources,
|
||||
),
|
||||
@@ -85,20 +76,20 @@ class Navigation {
|
||||
NavigationItem(
|
||||
icon: const Icon(Icons.adb),
|
||||
label: PageLabel.logs,
|
||||
builder: (_) => const LogsView(
|
||||
view: const LogsView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.logs,
|
||||
),
|
||||
),
|
||||
description: 'logsDesc',
|
||||
description: "logsDesc",
|
||||
modes: openLogs
|
||||
? [NavigationItemMode.desktop, NavigationItemMode.more]
|
||||
: [],
|
||||
),
|
||||
NavigationItem(
|
||||
const NavigationItem(
|
||||
icon: Icon(Icons.construction),
|
||||
label: PageLabel.tools,
|
||||
builder: (_) => const ToolsView(
|
||||
view: ToolsView(
|
||||
key: GlobalObjectKey(
|
||||
PageLabel.tools,
|
||||
),
|
||||
|
||||
@@ -2,6 +2,7 @@ import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/models/models.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:fl_clash/widgets/dialog.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class BaseNavigator {
|
||||
@@ -20,20 +21,20 @@ class BaseNavigator {
|
||||
);
|
||||
}
|
||||
|
||||
// static Future<T?> modal<T>(BuildContext context, Widget child) async {
|
||||
// if (globalState.appState.viewMode != ViewMode.mobile) {
|
||||
// return await globalState.showCommonDialog<T>(
|
||||
// child: CommonModal(
|
||||
// child: child,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
// return await Navigator.of(context).push<T>(
|
||||
// CommonRoute(
|
||||
// builder: (context) => child,
|
||||
// ),
|
||||
// );
|
||||
// }
|
||||
static Future<T?> modal<T>(BuildContext context, Widget child) async {
|
||||
if (globalState.appState.viewMode != ViewMode.mobile) {
|
||||
return await globalState.showCommonDialog<T>(
|
||||
child: CommonModal(
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
return await Navigator.of(context).push<T>(
|
||||
CommonRoute(
|
||||
builder: (context) => child,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class CommonDesktopRoute<T> extends PageRoute<T> {
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
extension NumExt on num {
|
||||
String fixed({int decimals = 2}) {
|
||||
String fixed({decimals = 2}) {
|
||||
String formatted = toStringAsFixed(decimals);
|
||||
if (formatted.contains('.')) {
|
||||
formatted = formatted.replaceAll(RegExp(r'0*$'), '');
|
||||
@@ -20,7 +20,7 @@ extension NumExt on num {
|
||||
}
|
||||
|
||||
extension DoubleExt on double {
|
||||
bool moreOrEqual(double value) {
|
||||
moreOrEqual(double value) {
|
||||
return this > value || (value - this).abs() < precisionErrorTolerance + 1;
|
||||
}
|
||||
}
|
||||
@@ -46,7 +46,7 @@ extension OffsetExt on Offset {
|
||||
}
|
||||
|
||||
extension RectExt on Rect {
|
||||
bool doRectIntersect(Rect rect) {
|
||||
doRectIntersect(Rect rect) {
|
||||
return left < rect.right &&
|
||||
right > rect.left &&
|
||||
top < rect.bottom &&
|
||||
|
||||
@@ -6,8 +6,8 @@ import 'common.dart';
|
||||
|
||||
extension PackageInfoExtension on PackageInfo {
|
||||
String get ua => [
|
||||
'$appName/v$version',
|
||||
'clash-verge',
|
||||
'Platform/${Platform.operatingSystem}',
|
||||
].join(' ');
|
||||
"$appName/v$version",
|
||||
"clash-verge",
|
||||
"Platform/${Platform.operatingSystem}",
|
||||
].join(" ");
|
||||
}
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:path_provider/path_provider.dart';
|
||||
|
||||
import 'constant.dart';
|
||||
|
||||
class AppPath {
|
||||
static AppPath? _instance;
|
||||
Completer<Directory> dataDir = Completer();
|
||||
@@ -31,7 +32,7 @@ class AppPath {
|
||||
}
|
||||
|
||||
String get executableExtension {
|
||||
return system.isWindows ? '.exe' : '';
|
||||
return Platform.isWindows ? ".exe" : "";
|
||||
}
|
||||
|
||||
String get executableDirPath {
|
||||
@@ -40,11 +41,11 @@ class AppPath {
|
||||
}
|
||||
|
||||
String get corePath {
|
||||
return join(executableDirPath, 'FlClashCore$executableExtension');
|
||||
return join(executableDirPath, "FlClashCore$executableExtension");
|
||||
}
|
||||
|
||||
String get helperPath {
|
||||
return join(executableDirPath, '$appHelperService$executableExtension');
|
||||
return join(executableDirPath, "$appHelperService$executableExtension");
|
||||
}
|
||||
|
||||
Future<String> get downloadDirPath async {
|
||||
@@ -59,12 +60,12 @@ class AppPath {
|
||||
|
||||
Future<String> get lockFilePath async {
|
||||
final directory = await dataDir.future;
|
||||
return join(directory.path, 'FlClash.lock');
|
||||
return join(directory.path, "FlClash.lock");
|
||||
}
|
||||
|
||||
Future<String> get sharedPreferencesPath async {
|
||||
final directory = await dataDir.future;
|
||||
return join(directory.path, 'shared_preferences.json');
|
||||
return join(directory.path, "shared_preferences.json");
|
||||
}
|
||||
|
||||
Future<String> get profilesPath async {
|
||||
@@ -74,31 +75,20 @@ class AppPath {
|
||||
|
||||
Future<String> getProfilePath(String id) async {
|
||||
final directory = await profilesPath;
|
||||
return join(directory, '$id.yaml');
|
||||
return join(directory, "$id.yaml");
|
||||
}
|
||||
|
||||
Future<String> getProvidersDirPath(String id) async {
|
||||
Future<String> getProvidersPath(String id, {String filePath = ""}) async {
|
||||
final directory = await profilesPath;
|
||||
return join(
|
||||
final path = join(
|
||||
directory,
|
||||
'providers',
|
||||
"providers",
|
||||
id,
|
||||
);
|
||||
}
|
||||
|
||||
Future<String> getProvidersFilePath(
|
||||
String id,
|
||||
String type,
|
||||
String url,
|
||||
) async {
|
||||
final directory = await profilesPath;
|
||||
return join(
|
||||
directory,
|
||||
'providers',
|
||||
id,
|
||||
type,
|
||||
url.toMd5(),
|
||||
);
|
||||
if (filePath.isNotEmpty) {
|
||||
return join(path, filePath);
|
||||
}
|
||||
return path;
|
||||
}
|
||||
|
||||
Future<String> get tempPath async {
|
||||
|
||||
@@ -20,9 +20,9 @@ class Picker {
|
||||
final path = await FilePicker.platform.saveFile(
|
||||
fileName: fileName,
|
||||
initialDirectory: await appPath.downloadDirPath,
|
||||
bytes: system.isAndroid ? bytes : null,
|
||||
bytes: Platform.isAndroid ? bytes : null,
|
||||
);
|
||||
if (!system.isAndroid && path != null) {
|
||||
if (!Platform.isAndroid && path != null) {
|
||||
final file = await File(path).create(recursive: true);
|
||||
await file.writeAsBytes(bytes);
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ class Preferences {
|
||||
false;
|
||||
}
|
||||
|
||||
Future<void> clearClashConfig() async {
|
||||
clearClashConfig() async {
|
||||
final preferences = await sharedPreferencesCompleter.future;
|
||||
preferences?.remove(clashConfigKey);
|
||||
}
|
||||
|
||||
Future<void> clearPreferences() async {
|
||||
clearPreferences() async {
|
||||
final sharedPreferencesIns = await sharedPreferencesCompleter.future;
|
||||
sharedPreferencesIns?.clear();
|
||||
}
|
||||
|
||||
@@ -12,8 +12,8 @@ class CommonPrint {
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
void log(String? text) {
|
||||
final payload = '[APP] $text';
|
||||
log(String? text) {
|
||||
final payload = "[FlClash] $text";
|
||||
debugPrint(payload);
|
||||
if (!globalState.isInit) {
|
||||
return;
|
||||
|
||||
@@ -16,12 +16,12 @@ class Render {
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
void active() {
|
||||
active() {
|
||||
resume();
|
||||
pause();
|
||||
}
|
||||
|
||||
void pause() {
|
||||
pause() {
|
||||
throttler.call(
|
||||
FunctionTag.renderPause,
|
||||
_pause,
|
||||
@@ -29,7 +29,7 @@ class Render {
|
||||
);
|
||||
}
|
||||
|
||||
void resume() {
|
||||
resume() {
|
||||
throttler.cancel(FunctionTag.renderPause);
|
||||
_resume();
|
||||
}
|
||||
@@ -41,7 +41,7 @@ class Render {
|
||||
_drawFrame = _dispatcher.onDrawFrame;
|
||||
_dispatcher.onBeginFrame = null;
|
||||
_dispatcher.onDrawFrame = null;
|
||||
commonPrint.log('pause');
|
||||
commonPrint.log("pause");
|
||||
}
|
||||
|
||||
void _resume() {
|
||||
@@ -50,7 +50,7 @@ class Render {
|
||||
_dispatcher.onBeginFrame = _beginFrame;
|
||||
_dispatcher.onDrawFrame = _drawFrame;
|
||||
_dispatcher.scheduleFrame();
|
||||
commonPrint.log('resume');
|
||||
commonPrint.log("resume");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:typed_data';
|
||||
@@ -19,7 +18,7 @@ class Request {
|
||||
_dio = Dio(
|
||||
BaseOptions(
|
||||
headers: {
|
||||
'User-Agent': browserUa,
|
||||
"User-Agent": browserUa,
|
||||
},
|
||||
),
|
||||
);
|
||||
@@ -69,7 +68,7 @@ class Request {
|
||||
|
||||
Future<Map<String, dynamic>?> checkForUpdate() async {
|
||||
final response = await _dio.get(
|
||||
'https://api.github.com/repos/$repository/releases/latest',
|
||||
"https://api.github.com/repos/$repository/releases/latest",
|
||||
options: Options(
|
||||
responseType: ResponseType.json,
|
||||
),
|
||||
@@ -85,55 +84,50 @@ class Request {
|
||||
}
|
||||
|
||||
final Map<String, IpInfo Function(Map<String, dynamic>)> _ipInfoSources = {
|
||||
'https://ipwho.is/': IpInfo.fromIpwhoIsJson,
|
||||
'https://api.ip.sb/geoip/': IpInfo.fromIpSbJson,
|
||||
'https://ipapi.co/json/': IpInfo.fromIpApiCoJson,
|
||||
'https://ipinfo.io/json/': IpInfo.fromIpInfoIoJson,
|
||||
"https://ipwho.is/": IpInfo.fromIpwhoIsJson,
|
||||
"https://api.ip.sb/geoip/": IpInfo.fromIpSbJson,
|
||||
"https://ipapi.co/json/": IpInfo.fromIpApiCoJson,
|
||||
"https://ipinfo.io/json/": IpInfo.fromIpInfoIoJson,
|
||||
};
|
||||
|
||||
Future<Result<IpInfo?>> checkIp({CancelToken? cancelToken}) async {
|
||||
var failureCount = 0;
|
||||
final futures = _ipInfoSources.entries.map((source) async {
|
||||
final Completer<Result<IpInfo?>> completer = Completer();
|
||||
handleFailRes() {
|
||||
if (!completer.isCompleted && failureCount == _ipInfoSources.length) {
|
||||
completer.complete(Result.success(null));
|
||||
Future<IpInfo?> checkIp({CancelToken? cancelToken}) async {
|
||||
for (final source in _ipInfoSources.entries) {
|
||||
try {
|
||||
final response = await Dio()
|
||||
.get<Map<String, dynamic>>(
|
||||
source.key,
|
||||
cancelToken: cancelToken,
|
||||
options: Options(
|
||||
responseType: ResponseType.json,
|
||||
),
|
||||
)
|
||||
.timeout(
|
||||
Duration(
|
||||
seconds: 30,
|
||||
),
|
||||
);
|
||||
if (response.statusCode != 200 || response.data == null) {
|
||||
continue;
|
||||
}
|
||||
if (response.data == null) {
|
||||
continue;
|
||||
}
|
||||
return source.value(response.data!);
|
||||
} catch (e) {
|
||||
commonPrint.log("checkIp error ===> $e");
|
||||
if (e is DioException && e.type == DioExceptionType.cancel) {
|
||||
throw "cancelled";
|
||||
}
|
||||
}
|
||||
|
||||
final future = Dio().get<Map<String, dynamic>>(
|
||||
source.key,
|
||||
cancelToken: cancelToken,
|
||||
options: Options(
|
||||
responseType: ResponseType.json,
|
||||
),
|
||||
);
|
||||
future.then((res) {
|
||||
if (res.statusCode == HttpStatus.ok && res.data != null) {
|
||||
completer.complete(Result.success(source.value(res.data!)));
|
||||
} else {
|
||||
failureCount++;
|
||||
handleFailRes();
|
||||
}
|
||||
}).catchError((e) {
|
||||
failureCount++;
|
||||
if (e == DioExceptionType.cancel) {
|
||||
completer.complete(Result.error('cancelled'));
|
||||
}
|
||||
handleFailRes();
|
||||
});
|
||||
return completer.future;
|
||||
});
|
||||
final res = await Future.any(futures);
|
||||
cancelToken?.cancel();
|
||||
return res;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
Future<bool> pingHelper() async {
|
||||
try {
|
||||
final response = await _dio
|
||||
.get(
|
||||
'http://$localhost:$helperPort/ping',
|
||||
"http://$localhost:$helperPort/ping",
|
||||
options: Options(
|
||||
responseType: ResponseType.plain,
|
||||
),
|
||||
@@ -156,10 +150,10 @@ class Request {
|
||||
try {
|
||||
final response = await _dio
|
||||
.post(
|
||||
'http://$localhost:$helperPort/start',
|
||||
"http://$localhost:$helperPort/start",
|
||||
data: json.encode({
|
||||
'path': appPath.corePath,
|
||||
'arg': arg,
|
||||
"path": appPath.corePath,
|
||||
"arg": arg,
|
||||
}),
|
||||
options: Options(
|
||||
responseType: ResponseType.plain,
|
||||
@@ -184,7 +178,7 @@ class Request {
|
||||
try {
|
||||
final response = await _dio
|
||||
.post(
|
||||
'http://$localhost:$helperPort/stop',
|
||||
"http://$localhost:$helperPort/stop",
|
||||
options: Options(
|
||||
responseType: ResponseType.plain,
|
||||
),
|
||||
|
||||
@@ -35,7 +35,7 @@ class ShowBarScrollBehavior extends BaseScrollBehavior {
|
||||
Widget child,
|
||||
ScrollableDetails details,
|
||||
) {
|
||||
return CommonScrollBar(
|
||||
return CommonAutoHiddenScrollBar(
|
||||
controller: details.controller,
|
||||
child: child,
|
||||
);
|
||||
@@ -88,54 +88,6 @@ class NextClampingScrollPhysics extends ClampingScrollPhysics {
|
||||
}
|
||||
}
|
||||
|
||||
// class CacheScrollPositionController extends ScrollController {
|
||||
// final String key;
|
||||
//
|
||||
// CacheScrollPositionController({
|
||||
// required this.key,
|
||||
// double initialScrollOffset = 0.0,
|
||||
// super.keepScrollOffset = true,
|
||||
// super.debugLabel,
|
||||
// super.onAttach,
|
||||
// super.onDetach,
|
||||
// });
|
||||
//
|
||||
// @override
|
||||
// ScrollPosition createScrollPosition(
|
||||
// ScrollPhysics physics,
|
||||
// ScrollContext context,
|
||||
// ScrollPosition? oldPosition,
|
||||
// ) {
|
||||
// return ScrollPositionWithSingleContext(
|
||||
// physics: physics,
|
||||
// context: context,
|
||||
// initialPixels:
|
||||
// globalState.scrollPositionCache[key] ?? initialScrollOffset,
|
||||
// keepScrollOffset: keepScrollOffset,
|
||||
// oldPosition: oldPosition,
|
||||
// debugLabel: debugLabel,
|
||||
// );
|
||||
// }
|
||||
//
|
||||
// double? get cacheOffset => globalState.scrollPositionCache[key];
|
||||
//
|
||||
// _handleScroll() {
|
||||
// globalState.scrollPositionCache[key] = position.pixels;
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void attach(ScrollPosition position) {
|
||||
// super.attach(position);
|
||||
// addListener(_handleScroll);
|
||||
// }
|
||||
//
|
||||
// @override
|
||||
// void detach(ScrollPosition position) {
|
||||
// removeListener(_handleScroll);
|
||||
// super.detach(position);
|
||||
// }
|
||||
// }
|
||||
|
||||
class ReverseScrollController extends ScrollController {
|
||||
ReverseScrollController({
|
||||
super.initialScrollOffset,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:crypto/crypto.dart';
|
||||
|
||||
import 'print.dart';
|
||||
|
||||
extension StringExtension on String {
|
||||
@@ -47,10 +45,6 @@ extension StringExtension on String {
|
||||
}
|
||||
}
|
||||
|
||||
bool get isSvg {
|
||||
return endsWith('.svg');
|
||||
}
|
||||
|
||||
bool get isRegex {
|
||||
try {
|
||||
RegExp(this);
|
||||
@@ -61,11 +55,6 @@ extension StringExtension on String {
|
||||
}
|
||||
}
|
||||
|
||||
String toMd5() {
|
||||
final bytes = utf8.encode(this);
|
||||
return md5.convert(bytes).toString();
|
||||
}
|
||||
|
||||
// bool containsToLower(String target) {
|
||||
// return toLowerCase().contains(target);
|
||||
// }
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/plugins/app.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:fl_clash/widgets/input.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:path/path.dart';
|
||||
|
||||
class System {
|
||||
static System? _instance;
|
||||
@@ -21,32 +18,25 @@ class System {
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
bool get isDesktop => isWindows || isMacOS || isLinux;
|
||||
|
||||
bool get isWindows => Platform.isWindows;
|
||||
|
||||
bool get isMacOS => Platform.isMacOS;
|
||||
|
||||
bool get isAndroid => Platform.isAndroid;
|
||||
|
||||
bool get isLinux => Platform.isLinux;
|
||||
bool get isDesktop =>
|
||||
Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
||||
|
||||
Future<int> get version async {
|
||||
final deviceInfo = await DeviceInfoPlugin().deviceInfo;
|
||||
return switch (Platform.operatingSystem) {
|
||||
'macos' => (deviceInfo as MacOsDeviceInfo).majorVersion,
|
||||
'android' => (deviceInfo as AndroidDeviceInfo).version.sdkInt,
|
||||
'windows' => (deviceInfo as WindowsDeviceInfo).majorVersion,
|
||||
"macos" => (deviceInfo as MacOsDeviceInfo).majorVersion,
|
||||
"android" => (deviceInfo as AndroidDeviceInfo).version.sdkInt,
|
||||
"windows" => (deviceInfo as WindowsDeviceInfo).majorVersion,
|
||||
String() => 0
|
||||
};
|
||||
}
|
||||
|
||||
Future<bool> checkIsAdmin() async {
|
||||
final corePath = appPath.corePath.replaceAll(' ', '\\\\ ');
|
||||
if (system.isWindows) {
|
||||
if (Platform.isWindows) {
|
||||
final result = await windows?.checkService();
|
||||
return result == WindowsHelperServiceStatus.running;
|
||||
} else if (system.isMacOS) {
|
||||
} else if (Platform.isMacOS) {
|
||||
final result = await Process.run('stat', ['-f', '%Su:%Sg %Sp', corePath]);
|
||||
final output = result.stdout.trim();
|
||||
if (output.startsWith('root:admin') && output.contains('rws')) {
|
||||
@@ -65,7 +55,7 @@ class System {
|
||||
}
|
||||
|
||||
Future<AuthorizeCode> authorizeCore() async {
|
||||
if (system.isAndroid) {
|
||||
if (Platform.isAndroid) {
|
||||
return AuthorizeCode.error;
|
||||
}
|
||||
final corePath = appPath.corePath.replaceAll(' ', '\\\\ ');
|
||||
@@ -74,7 +64,7 @@ class System {
|
||||
return AuthorizeCode.none;
|
||||
}
|
||||
|
||||
if (system.isWindows) {
|
||||
if (Platform.isWindows) {
|
||||
final result = await windows?.registerService();
|
||||
if (result == true) {
|
||||
return AuthorizeCode.success;
|
||||
@@ -82,13 +72,13 @@ class System {
|
||||
return AuthorizeCode.error;
|
||||
}
|
||||
|
||||
if (system.isMacOS) {
|
||||
if (Platform.isMacOS) {
|
||||
final shell = 'chown root:admin $corePath; chmod +sx $corePath';
|
||||
final arguments = [
|
||||
'-e',
|
||||
"-e",
|
||||
'do shell script "$shell" with administrator privileges',
|
||||
];
|
||||
final result = await Process.run('osascript', arguments);
|
||||
final result = await Process.run("osascript", arguments);
|
||||
if (result.exitCode != 0) {
|
||||
return AuthorizeCode.error;
|
||||
}
|
||||
@@ -102,7 +92,7 @@ class System {
|
||||
),
|
||||
);
|
||||
final arguments = [
|
||||
'-c',
|
||||
"-c",
|
||||
'echo "$password" | sudo -S chown root:root "$corePath" && echo "$password" | sudo -S chmod +sx "$corePath"'
|
||||
];
|
||||
final result = await Process.run(shell, arguments);
|
||||
@@ -114,13 +104,13 @@ class System {
|
||||
return AuthorizeCode.error;
|
||||
}
|
||||
|
||||
Future<void> back() async {
|
||||
back() async {
|
||||
await app?.moveTaskToBack();
|
||||
await window?.hide();
|
||||
}
|
||||
|
||||
Future<void> exit() async {
|
||||
if (system.isAndroid) {
|
||||
exit() async {
|
||||
if (Platform.isAndroid) {
|
||||
await SystemNavigator.pop();
|
||||
}
|
||||
await window?.close();
|
||||
@@ -128,287 +118,3 @@ class System {
|
||||
}
|
||||
|
||||
final system = System();
|
||||
|
||||
class Windows {
|
||||
static Windows? _instance;
|
||||
late DynamicLibrary _shell32;
|
||||
|
||||
Windows._internal() {
|
||||
_shell32 = DynamicLibrary.open('shell32.dll');
|
||||
}
|
||||
|
||||
factory Windows() {
|
||||
_instance ??= Windows._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
bool runas(String command, String arguments) {
|
||||
final commandPtr = command.toNativeUtf16();
|
||||
final argumentsPtr = arguments.toNativeUtf16();
|
||||
final operationPtr = 'runas'.toNativeUtf16();
|
||||
|
||||
final shellExecute = _shell32.lookupFunction<
|
||||
Int32 Function(
|
||||
Pointer<Utf16> hwnd,
|
||||
Pointer<Utf16> lpOperation,
|
||||
Pointer<Utf16> lpFile,
|
||||
Pointer<Utf16> lpParameters,
|
||||
Pointer<Utf16> lpDirectory,
|
||||
Int32 nShowCmd),
|
||||
int Function(
|
||||
Pointer<Utf16> hwnd,
|
||||
Pointer<Utf16> lpOperation,
|
||||
Pointer<Utf16> lpFile,
|
||||
Pointer<Utf16> lpParameters,
|
||||
Pointer<Utf16> lpDirectory,
|
||||
int nShowCmd)>('ShellExecuteW');
|
||||
|
||||
final result = shellExecute(
|
||||
nullptr,
|
||||
operationPtr,
|
||||
commandPtr,
|
||||
argumentsPtr,
|
||||
nullptr,
|
||||
1,
|
||||
);
|
||||
|
||||
calloc.free(commandPtr);
|
||||
calloc.free(argumentsPtr);
|
||||
calloc.free(operationPtr);
|
||||
|
||||
commonPrint.log('windows runas: $command $arguments resultCode:$result');
|
||||
|
||||
if (result < 42) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
Future<void> _killProcess(int port) async {
|
||||
final result = await Process.run('netstat', ['-ano']);
|
||||
final lines = result.stdout.toString().trim().split('\n');
|
||||
for (final line in lines) {
|
||||
if (!line.contains(':$port') || !line.contains('LISTENING')) {
|
||||
continue;
|
||||
}
|
||||
final parts = line.trim().split(RegExp(r'\s+'));
|
||||
final pid = int.tryParse(parts.last);
|
||||
if (pid != null) {
|
||||
await Process.run('taskkill', ['/PID', pid.toString(), '/F']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<WindowsHelperServiceStatus> checkService() async {
|
||||
// final qcResult = await Process.run('sc', ['qc', appHelperService]);
|
||||
// final qcOutput = qcResult.stdout.toString();
|
||||
// if (qcResult.exitCode != 0 || !qcOutput.contains(appPath.helperPath)) {
|
||||
// return WindowsHelperServiceStatus.none;
|
||||
// }
|
||||
final result = await Process.run('sc', ['query', appHelperService]);
|
||||
if (result.exitCode != 0) {
|
||||
return WindowsHelperServiceStatus.none;
|
||||
}
|
||||
final output = result.stdout.toString();
|
||||
if (output.contains('RUNNING') && await request.pingHelper()) {
|
||||
return WindowsHelperServiceStatus.running;
|
||||
}
|
||||
return WindowsHelperServiceStatus.presence;
|
||||
}
|
||||
|
||||
Future<bool> registerService() async {
|
||||
final status = await checkService();
|
||||
|
||||
if (status == WindowsHelperServiceStatus.running) {
|
||||
return true;
|
||||
}
|
||||
|
||||
await _killProcess(helperPort);
|
||||
|
||||
final command = [
|
||||
'/c',
|
||||
if (status == WindowsHelperServiceStatus.presence) ...[
|
||||
'sc',
|
||||
'delete',
|
||||
appHelperService,
|
||||
'/force',
|
||||
'&&',
|
||||
],
|
||||
'sc',
|
||||
'create',
|
||||
appHelperService,
|
||||
'binPath= "${appPath.helperPath}"',
|
||||
'start= auto',
|
||||
'&&',
|
||||
'sc',
|
||||
'start',
|
||||
appHelperService,
|
||||
].join(' ');
|
||||
|
||||
final res = runas('cmd.exe', command);
|
||||
|
||||
await Future.delayed(
|
||||
Duration(milliseconds: 300),
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Future<bool> registerTask(String appName) async {
|
||||
final taskXml = '''
|
||||
<?xml version="1.0" encoding="UTF-16"?>
|
||||
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
||||
<Principals>
|
||||
<Principal id="Author">
|
||||
<LogonType>InteractiveToken</LogonType>
|
||||
<RunLevel>HighestAvailable</RunLevel>
|
||||
</Principal>
|
||||
</Principals>
|
||||
<Triggers>
|
||||
<LogonTrigger/>
|
||||
</Triggers>
|
||||
<Settings>
|
||||
<MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
|
||||
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
||||
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
||||
<AllowHardTerminate>false</AllowHardTerminate>
|
||||
<StartWhenAvailable>false</StartWhenAvailable>
|
||||
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
||||
<IdleSettings>
|
||||
<StopOnIdleEnd>false</StopOnIdleEnd>
|
||||
<RestartOnIdle>false</RestartOnIdle>
|
||||
</IdleSettings>
|
||||
<AllowStartOnDemand>true</AllowStartOnDemand>
|
||||
<Enabled>true</Enabled>
|
||||
<Hidden>false</Hidden>
|
||||
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
||||
<WakeToRun>false</WakeToRun>
|
||||
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
|
||||
<Priority>7</Priority>
|
||||
</Settings>
|
||||
<Actions Context="Author">
|
||||
<Exec>
|
||||
<Command>"${Platform.resolvedExecutable}"</Command>
|
||||
</Exec>
|
||||
</Actions>
|
||||
</Task>''';
|
||||
final taskPath = join(await appPath.tempPath, 'task.xml');
|
||||
await File(taskPath).create(recursive: true);
|
||||
await File(taskPath)
|
||||
.writeAsBytes(taskXml.encodeUtf16LeWithBom, flush: true);
|
||||
final commandLine = [
|
||||
'/Create',
|
||||
'/TN',
|
||||
appName,
|
||||
'/XML',
|
||||
'%s',
|
||||
'/F',
|
||||
].join(' ');
|
||||
return runas(
|
||||
'schtasks',
|
||||
commandLine.replaceFirst('%s', taskPath),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final windows = system.isWindows ? Windows() : null;
|
||||
|
||||
class MacOS {
|
||||
static MacOS? _instance;
|
||||
|
||||
List<String>? originDns;
|
||||
|
||||
MacOS._internal();
|
||||
|
||||
factory MacOS() {
|
||||
_instance ??= MacOS._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
Future<String?> get defaultServiceName async {
|
||||
final result = await Process.run('route', ['-n', 'get', 'default']);
|
||||
final output = result.stdout.toString();
|
||||
final deviceLine = output
|
||||
.split('\n')
|
||||
.firstWhere((s) => s.contains('interface:'), orElse: () => '');
|
||||
final lineSplits = deviceLine.trim().split(' ');
|
||||
if (lineSplits.length != 2) {
|
||||
return null;
|
||||
}
|
||||
final device = lineSplits[1];
|
||||
final serviceResult = await Process.run(
|
||||
'networksetup',
|
||||
['-listnetworkserviceorder'],
|
||||
);
|
||||
final serviceResultOutput = serviceResult.stdout.toString();
|
||||
final currentService = serviceResultOutput.split('\n\n').firstWhere(
|
||||
(s) => s.contains('Device: $device'),
|
||||
orElse: () => '',
|
||||
);
|
||||
if (currentService.isEmpty) {
|
||||
return null;
|
||||
}
|
||||
final currentServiceNameLine = currentService.split('\n').firstWhere(
|
||||
(line) => RegExp(r'^\(\d+\).*').hasMatch(line),
|
||||
orElse: () => '');
|
||||
final currentServiceNameLineSplits =
|
||||
currentServiceNameLine.trim().split(' ');
|
||||
if (currentServiceNameLineSplits.length < 2) {
|
||||
return null;
|
||||
}
|
||||
return currentServiceNameLineSplits[1];
|
||||
}
|
||||
|
||||
Future<List<String>?> get systemDns async {
|
||||
final deviceServiceName = await defaultServiceName;
|
||||
if (deviceServiceName == null) {
|
||||
return null;
|
||||
}
|
||||
final result = await Process.run(
|
||||
'networksetup',
|
||||
['-getdnsservers', deviceServiceName],
|
||||
);
|
||||
final output = result.stdout.toString().trim();
|
||||
if (output.startsWith("There aren't any DNS Servers set on")) {
|
||||
originDns = [];
|
||||
} else {
|
||||
originDns = output.split('\n');
|
||||
}
|
||||
return originDns;
|
||||
}
|
||||
|
||||
Future<void> updateDns(bool restore) async {
|
||||
final serviceName = await defaultServiceName;
|
||||
if (serviceName == null) {
|
||||
return;
|
||||
}
|
||||
List<String>? nextDns;
|
||||
if (restore) {
|
||||
nextDns = originDns;
|
||||
} else {
|
||||
final originDns = await systemDns;
|
||||
if (originDns == null) {
|
||||
return;
|
||||
}
|
||||
final needAddDns = '223.5.5.5';
|
||||
if (originDns.contains(needAddDns)) {
|
||||
return;
|
||||
}
|
||||
nextDns = List.from(originDns)..add(needAddDns);
|
||||
}
|
||||
if (nextDns == null) {
|
||||
return;
|
||||
}
|
||||
await Process.run(
|
||||
'networksetup',
|
||||
[
|
||||
'-setdnsservers',
|
||||
serviceName,
|
||||
if (nextDns.isNotEmpty) ...nextDns,
|
||||
if (nextDns.isEmpty) 'Empty',
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final macOS = system.isMacOS ? MacOS() : null;
|
||||
|
||||
@@ -13,7 +13,7 @@ class CommonTheme {
|
||||
|
||||
Color get darkenSecondaryContainer {
|
||||
return _colorMap.updateCacheValue(
|
||||
'darkenSecondaryContainer',
|
||||
"darkenSecondaryContainer",
|
||||
() => context.colorScheme.secondaryContainer
|
||||
.blendDarken(context, factor: 0.1),
|
||||
);
|
||||
@@ -21,7 +21,7 @@ class CommonTheme {
|
||||
|
||||
Color get darkenSecondaryContainerLighter {
|
||||
return _colorMap.updateCacheValue(
|
||||
'darkenSecondaryContainerLighter',
|
||||
"darkenSecondaryContainerLighter",
|
||||
() => context.colorScheme.secondaryContainer
|
||||
.blendDarken(context, factor: 0.1)
|
||||
.opacity60,
|
||||
@@ -30,7 +30,7 @@ class CommonTheme {
|
||||
|
||||
Color get darken2SecondaryContainer {
|
||||
return _colorMap.updateCacheValue(
|
||||
'darken2SecondaryContainer',
|
||||
"darken2SecondaryContainer",
|
||||
() => context.colorScheme.secondaryContainer
|
||||
.blendDarken(context, factor: 0.2),
|
||||
);
|
||||
@@ -38,7 +38,7 @@ class CommonTheme {
|
||||
|
||||
Color get darken3PrimaryContainer {
|
||||
return _colorMap.updateCacheValue(
|
||||
'darken3PrimaryContainer',
|
||||
"darken3PrimaryContainer",
|
||||
() => context.colorScheme.primaryContainer
|
||||
.blendDarken(context, factor: 0.3),
|
||||
);
|
||||
|
||||
@@ -11,7 +11,6 @@ import 'package:tray_manager/tray_manager.dart';
|
||||
|
||||
import 'app_localizations.dart';
|
||||
import 'constant.dart';
|
||||
import 'system.dart';
|
||||
import 'window.dart';
|
||||
|
||||
class Tray {
|
||||
@@ -19,7 +18,7 @@ class Tray {
|
||||
required Brightness? brightness,
|
||||
bool force = false,
|
||||
}) async {
|
||||
if (system.isAndroid) {
|
||||
if (Platform.isAndroid) {
|
||||
return;
|
||||
}
|
||||
if (Platform.isLinux || force) {
|
||||
@@ -39,11 +38,11 @@ class Tray {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> update({
|
||||
update({
|
||||
required TrayState trayState,
|
||||
bool focus = false,
|
||||
}) async {
|
||||
if (system.isAndroid) {
|
||||
if (Platform.isAndroid) {
|
||||
return;
|
||||
}
|
||||
if (!Platform.isLinux) {
|
||||
@@ -81,7 +80,7 @@ class Tray {
|
||||
);
|
||||
}
|
||||
menuItems.add(MenuItem.separator());
|
||||
if (system.isMacOS) {
|
||||
if (Platform.isMacOS) {
|
||||
for (final group in trayState.groups) {
|
||||
List<MenuItem> subMenuItems = [];
|
||||
for (final proxy in group.all) {
|
||||
@@ -170,8 +169,8 @@ class Tray {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateTrayTitle([Traffic? traffic]) async {
|
||||
// if (!system.isMacOS) {
|
||||
updateTrayTitle([Traffic? traffic]) async {
|
||||
// if (!Platform.isMacOS) {
|
||||
// return;
|
||||
// }
|
||||
// if (traffic == null) {
|
||||
@@ -184,10 +183,11 @@ class Tray {
|
||||
}
|
||||
|
||||
Future<void> _copyEnv(int port) async {
|
||||
final url = 'http://127.0.0.1:$port';
|
||||
final url = "http://127.0.0.1:$port";
|
||||
|
||||
final cmdline =
|
||||
system.isWindows ? 'set \$env:all_proxy=$url' : 'export all_proxy=$url';
|
||||
final cmdline = Platform.isWindows
|
||||
? "set \$env:all_proxy=$url"
|
||||
: "export all_proxy=$url";
|
||||
|
||||
await Clipboard.setData(
|
||||
ClipboardData(
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:lpinyin/lpinyin.dart';
|
||||
import 'package:yaml/yaml.dart';
|
||||
|
||||
class Utils {
|
||||
Color? getDelayColor(int? delay) {
|
||||
@@ -23,11 +24,11 @@ class Utils {
|
||||
final random = Random();
|
||||
final randomStr =
|
||||
String.fromCharCodes(List.generate(8, (_) => random.nextInt(26) + 97));
|
||||
return '$timestamp$randomStr';
|
||||
return "$timestamp$randomStr";
|
||||
}
|
||||
|
||||
String getDateStringLast2(int value) {
|
||||
var valueRaw = '0$value';
|
||||
var valueRaw = "0$value";
|
||||
return valueRaw.substring(
|
||||
valueRaw.length - 2,
|
||||
);
|
||||
@@ -73,7 +74,7 @@ class Utils {
|
||||
var inMinutes = difference.inMinutes;
|
||||
var inSeconds = difference.inSeconds;
|
||||
|
||||
return '${getDateStringLast2(inHours)}:${getDateStringLast2(inMinutes)}:${getDateStringLast2(inSeconds)}';
|
||||
return "${getDateStringLast2(inHours)}:${getDateStringLast2(inMinutes)}:${getDateStringLast2(inSeconds)}";
|
||||
}
|
||||
|
||||
String getTimeText(int? timeStamp) {
|
||||
@@ -83,17 +84,17 @@ class Utils {
|
||||
final diff = timeStamp / 1000;
|
||||
final inHours = (diff / 3600).floor();
|
||||
if (inHours > 99) {
|
||||
return '99:59:59';
|
||||
return "99:59:59";
|
||||
}
|
||||
final inMinutes = (diff / 60 % 60).floor();
|
||||
final inSeconds = (diff % 60).floor();
|
||||
|
||||
return '${getDateStringLast2(inHours)}:${getDateStringLast2(inMinutes)}:${getDateStringLast2(inSeconds)}';
|
||||
return "${getDateStringLast2(inHours)}:${getDateStringLast2(inMinutes)}:${getDateStringLast2(inSeconds)}";
|
||||
}
|
||||
|
||||
Locale? getLocaleForString(String? localString) {
|
||||
if (localString == null) return null;
|
||||
var localSplit = localString.split('_');
|
||||
var localSplit = localString.split("_");
|
||||
if (localSplit.length == 1) {
|
||||
return Locale(localSplit[0]);
|
||||
}
|
||||
@@ -137,18 +138,18 @@ class Utils {
|
||||
final number = int.parse(match[1] ?? '0') + 1;
|
||||
return label.replaceFirst(reg, '($number)', label.length - 3 - 1);
|
||||
} else {
|
||||
return '$label(1)';
|
||||
return "$label(1)";
|
||||
}
|
||||
}
|
||||
|
||||
String getTrayIconPath({
|
||||
required Brightness brightness,
|
||||
}) {
|
||||
if (system.isMacOS) {
|
||||
return 'assets/images/icon_white.png';
|
||||
if (Platform.isMacOS) {
|
||||
return "assets/images/icon_white.png";
|
||||
}
|
||||
final suffix = system.isWindows ? 'ico' : 'png';
|
||||
return 'assets/images/icon.$suffix';
|
||||
final suffix = Platform.isWindows ? "ico" : "png";
|
||||
return "assets/images/icon.$suffix";
|
||||
// return switch (brightness) {
|
||||
// Brightness.dark => "assets/images/icon_white.$suffix",
|
||||
// Brightness.light => "assets/images/icon_black.$suffix",
|
||||
@@ -181,7 +182,7 @@ class Utils {
|
||||
String getPinyin(String value) {
|
||||
return value.isNotEmpty
|
||||
? PinyinHelper.getFirstWordPinyin(value.substring(0, 1))
|
||||
: '';
|
||||
: "";
|
||||
}
|
||||
|
||||
String? getFileNameForDisposition(String? disposition) {
|
||||
@@ -189,7 +190,7 @@ class Utils {
|
||||
final parseValue = HeaderValue.parse(disposition);
|
||||
final parameters = parseValue.parameters;
|
||||
final fileNamePointKey = parameters.keys
|
||||
.firstWhere((key) => key == 'filename*', orElse: () => '');
|
||||
.firstWhere((key) => key == "filename*", orElse: () => "");
|
||||
if (fileNamePointKey.isNotEmpty) {
|
||||
final res = parameters[fileNamePointKey]?.split("''") ?? [];
|
||||
if (res.length >= 2) {
|
||||
@@ -197,7 +198,7 @@ class Utils {
|
||||
}
|
||||
}
|
||||
final fileNameKey = parameters.keys
|
||||
.firstWhere((key) => key == 'filename', orElse: () => '');
|
||||
.firstWhere((key) => key == "filename", orElse: () => "");
|
||||
if (fileNameKey.isEmpty) return null;
|
||||
return parameters[fileNameKey];
|
||||
}
|
||||
@@ -250,7 +251,7 @@ class Utils {
|
||||
900,
|
||||
];
|
||||
|
||||
MaterialColor _createPrimarySwatch(Color color) {
|
||||
_createPrimarySwatch(Color color) {
|
||||
final Map<int, Color> swatch = <int, Color>{};
|
||||
final int a = color.alpha8bit;
|
||||
final int r = color.red8bit;
|
||||
@@ -294,11 +295,11 @@ class Utils {
|
||||
}
|
||||
|
||||
String getBackupFileName() {
|
||||
return '${appName}_backup_${DateTime.now().show}.zip';
|
||||
return "${appName}_backup_${DateTime.now().show}.zip";
|
||||
}
|
||||
|
||||
String get logFile {
|
||||
return '${appName}_${DateTime.now().show}.log';
|
||||
return "${appName}_${DateTime.now().show}.log";
|
||||
}
|
||||
|
||||
Future<String?> getLocalIpAddress() async {
|
||||
@@ -324,11 +325,11 @@ class Utils {
|
||||
});
|
||||
return addresses.first.address;
|
||||
}
|
||||
return '';
|
||||
return "";
|
||||
}
|
||||
|
||||
SingleActivator controlSingleActivator(LogicalKeyboardKey trigger) {
|
||||
final control = system.isMacOS ? false : true;
|
||||
final control = Platform.isMacOS ? false : true;
|
||||
return SingleActivator(
|
||||
trigger,
|
||||
control: control,
|
||||
@@ -336,51 +337,51 @@ class Utils {
|
||||
);
|
||||
}
|
||||
|
||||
// dynamic convertYamlNode(dynamic node) {
|
||||
// if (node is YamlMap) {
|
||||
// final map = <String, dynamic>{};
|
||||
// YamlNode? mergeKeyNode;
|
||||
// for (final entry in node.nodes.entries) {
|
||||
// if (entry.key is YamlScalar &&
|
||||
// (entry.key as YamlScalar).value == '<<') {
|
||||
// mergeKeyNode = entry.value;
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (mergeKeyNode != null) {
|
||||
// final mergeValue = mergeKeyNode.value;
|
||||
// if (mergeValue is YamlMap) {
|
||||
// map.addAll(convertYamlNode(mergeValue) as Map<String, dynamic>);
|
||||
// } else if (mergeValue is YamlList) {
|
||||
// for (final node in mergeValue.nodes) {
|
||||
// if (node.value is YamlMap) {
|
||||
// map.addAll(convertYamlNode(node.value) as Map<String, dynamic>);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// node.nodes.forEach((key, value) {
|
||||
// String stringKey;
|
||||
// if (key is YamlScalar) {
|
||||
// stringKey = key.value.toString();
|
||||
// } else {
|
||||
// stringKey = key.toString();
|
||||
// }
|
||||
// map[stringKey] = convertYamlNode(value.value);
|
||||
// });
|
||||
// return map;
|
||||
// } else if (node is YamlList) {
|
||||
// final list = <dynamic>[];
|
||||
// for (final item in node.nodes) {
|
||||
// list.add(convertYamlNode(item.value));
|
||||
// }
|
||||
// return list;
|
||||
// } else if (node is YamlScalar) {
|
||||
// return node.value;
|
||||
// }
|
||||
// return node;
|
||||
// }
|
||||
dynamic convertYamlNode(dynamic node) {
|
||||
if (node is YamlMap) {
|
||||
final map = <String, dynamic>{};
|
||||
YamlNode? mergeKeyNode;
|
||||
for (final entry in node.nodes.entries) {
|
||||
if (entry.key is YamlScalar &&
|
||||
(entry.key as YamlScalar).value == '<<') {
|
||||
mergeKeyNode = entry.value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (mergeKeyNode != null) {
|
||||
final mergeValue = mergeKeyNode.value;
|
||||
if (mergeValue is YamlMap) {
|
||||
map.addAll(convertYamlNode(mergeValue) as Map<String, dynamic>);
|
||||
} else if (mergeValue is YamlList) {
|
||||
for (final node in mergeValue.nodes) {
|
||||
if (node.value is YamlMap) {
|
||||
map.addAll(convertYamlNode(node.value) as Map<String, dynamic>);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
node.nodes.forEach((key, value) {
|
||||
String stringKey;
|
||||
if (key is YamlScalar) {
|
||||
stringKey = key.value.toString();
|
||||
} else {
|
||||
stringKey = key.toString();
|
||||
}
|
||||
map[stringKey] = convertYamlNode(value.value);
|
||||
});
|
||||
return map;
|
||||
} else if (node is YamlList) {
|
||||
final list = <dynamic>[];
|
||||
for (final item in node.nodes) {
|
||||
list.add(convertYamlNode(item.value));
|
||||
}
|
||||
return list;
|
||||
} else if (node is YamlScalar) {
|
||||
return node.value;
|
||||
}
|
||||
return node;
|
||||
}
|
||||
|
||||
FutureOr<T> handleWatch<T>(Function function) async {
|
||||
if (kDebugMode) {
|
||||
|
||||
@@ -3,34 +3,30 @@ import 'dart:io';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_acrylic/flutter_acrylic.dart' as acrylic;
|
||||
import 'package:screen_retriever/screen_retriever.dart';
|
||||
import 'package:window_manager/window_manager.dart';
|
||||
|
||||
class Window {
|
||||
Future<void> init(int version) async {
|
||||
init(int version) async {
|
||||
final props = globalState.config.windowProps;
|
||||
final acquire = await singleInstanceLock.acquire();
|
||||
if (!acquire) {
|
||||
exit(0);
|
||||
}
|
||||
if (system.isWindows) {
|
||||
protocol.register('clash');
|
||||
protocol.register('clashmeta');
|
||||
protocol.register('flclash');
|
||||
}
|
||||
if ((version > 10 && system.isMacOS)) {
|
||||
await acrylic.Window.initialize();
|
||||
if (Platform.isWindows) {
|
||||
protocol.register("clash");
|
||||
protocol.register("clashmeta");
|
||||
protocol.register("flclash");
|
||||
}
|
||||
await windowManager.ensureInitialized();
|
||||
WindowOptions windowOptions = WindowOptions(
|
||||
size: Size(props.width, props.height),
|
||||
minimumSize: const Size(380, 400),
|
||||
);
|
||||
if (!system.isMacOS || version > 10) {
|
||||
if (!Platform.isMacOS || version > 10) {
|
||||
await windowManager.setTitleBarStyle(TitleBarStyle.hidden);
|
||||
}
|
||||
if (!system.isMacOS) {
|
||||
if (!Platform.isMacOS) {
|
||||
final left = props.left ?? 0;
|
||||
final top = props.top ?? 0;
|
||||
final right = left + props.width;
|
||||
@@ -66,14 +62,7 @@ class Window {
|
||||
});
|
||||
}
|
||||
|
||||
void updateMacOSBrightness(Brightness brightness) {
|
||||
if (!system.isMacOS) {
|
||||
return;
|
||||
}
|
||||
acrylic.Window.overrideMacOSBrightness(dark: brightness == Brightness.dark);
|
||||
}
|
||||
|
||||
Future<void> show() async {
|
||||
show() async {
|
||||
render?.resume();
|
||||
await windowManager.show();
|
||||
await windowManager.focus();
|
||||
@@ -82,15 +71,15 @@ class Window {
|
||||
|
||||
Future<bool> get isVisible async {
|
||||
final value = await windowManager.isVisible();
|
||||
commonPrint.log('window visible check: $value');
|
||||
commonPrint.log("window visible check: $value");
|
||||
return value;
|
||||
}
|
||||
|
||||
Future<void> close() async {
|
||||
close() async {
|
||||
exit(0);
|
||||
}
|
||||
|
||||
Future<void> hide() async {
|
||||
hide() async {
|
||||
render?.pause();
|
||||
await windowManager.hide();
|
||||
await windowManager.setSkipTaskbar(true);
|
||||
|
||||
191
lib/common/windows.dart
Normal file
191
lib/common/windows.dart
Normal file
@@ -0,0 +1,191 @@
|
||||
import 'dart:ffi';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:ffi/ffi.dart';
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:path/path.dart';
|
||||
|
||||
class Windows {
|
||||
static Windows? _instance;
|
||||
late DynamicLibrary _shell32;
|
||||
|
||||
Windows._internal() {
|
||||
_shell32 = DynamicLibrary.open('shell32.dll');
|
||||
}
|
||||
|
||||
factory Windows() {
|
||||
_instance ??= Windows._internal();
|
||||
return _instance!;
|
||||
}
|
||||
|
||||
bool runas(String command, String arguments) {
|
||||
final commandPtr = command.toNativeUtf16();
|
||||
final argumentsPtr = arguments.toNativeUtf16();
|
||||
final operationPtr = 'runas'.toNativeUtf16();
|
||||
|
||||
final shellExecute = _shell32.lookupFunction<
|
||||
Int32 Function(
|
||||
Pointer<Utf16> hwnd,
|
||||
Pointer<Utf16> lpOperation,
|
||||
Pointer<Utf16> lpFile,
|
||||
Pointer<Utf16> lpParameters,
|
||||
Pointer<Utf16> lpDirectory,
|
||||
Int32 nShowCmd),
|
||||
int Function(
|
||||
Pointer<Utf16> hwnd,
|
||||
Pointer<Utf16> lpOperation,
|
||||
Pointer<Utf16> lpFile,
|
||||
Pointer<Utf16> lpParameters,
|
||||
Pointer<Utf16> lpDirectory,
|
||||
int nShowCmd)>('ShellExecuteW');
|
||||
|
||||
final result = shellExecute(
|
||||
nullptr,
|
||||
operationPtr,
|
||||
commandPtr,
|
||||
argumentsPtr,
|
||||
nullptr,
|
||||
1,
|
||||
);
|
||||
|
||||
calloc.free(commandPtr);
|
||||
calloc.free(argumentsPtr);
|
||||
calloc.free(operationPtr);
|
||||
|
||||
commonPrint.log("windows runas: $command $arguments resultCode:$result");
|
||||
|
||||
if (result < 42) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
_killProcess(int port) async {
|
||||
final result = await Process.run('netstat', ['-ano']);
|
||||
final lines = result.stdout.toString().trim().split('\n');
|
||||
for (final line in lines) {
|
||||
if (!line.contains(":$port") || !line.contains("LISTENING")) {
|
||||
continue;
|
||||
}
|
||||
final parts = line.trim().split(RegExp(r'\s+'));
|
||||
final pid = int.tryParse(parts.last);
|
||||
if (pid != null) {
|
||||
await Process.run('taskkill', ['/PID', pid.toString(), '/F']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<WindowsHelperServiceStatus> checkService() async {
|
||||
// final qcResult = await Process.run('sc', ['qc', appHelperService]);
|
||||
// final qcOutput = qcResult.stdout.toString();
|
||||
// if (qcResult.exitCode != 0 || !qcOutput.contains(appPath.helperPath)) {
|
||||
// return WindowsHelperServiceStatus.none;
|
||||
// }
|
||||
final result = await Process.run('sc', ['query', appHelperService]);
|
||||
if(result.exitCode != 0){
|
||||
return WindowsHelperServiceStatus.none;
|
||||
}
|
||||
final output = result.stdout.toString();
|
||||
if (output.contains("RUNNING") && await request.pingHelper()) {
|
||||
return WindowsHelperServiceStatus.running;
|
||||
}
|
||||
return WindowsHelperServiceStatus.presence;
|
||||
}
|
||||
|
||||
Future<bool> registerService() async {
|
||||
final status = await checkService();
|
||||
|
||||
if (status == WindowsHelperServiceStatus.running) {
|
||||
return true;
|
||||
}
|
||||
|
||||
await _killProcess(helperPort);
|
||||
|
||||
final command = [
|
||||
"/c",
|
||||
if (status == WindowsHelperServiceStatus.presence) ...[
|
||||
"sc",
|
||||
"delete",
|
||||
appHelperService,
|
||||
"/force",
|
||||
"&&",
|
||||
],
|
||||
"sc",
|
||||
"create",
|
||||
appHelperService,
|
||||
'binPath= "${appPath.helperPath}"',
|
||||
'start= auto',
|
||||
"&&",
|
||||
"sc",
|
||||
"start",
|
||||
appHelperService,
|
||||
].join(" ");
|
||||
|
||||
final res = runas("cmd.exe", command);
|
||||
|
||||
await Future.delayed(
|
||||
Duration(milliseconds: 300),
|
||||
);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
Future<bool> registerTask(String appName) async {
|
||||
final taskXml = '''
|
||||
<?xml version="1.0" encoding="UTF-16"?>
|
||||
<Task version="1.3" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
|
||||
<Principals>
|
||||
<Principal id="Author">
|
||||
<LogonType>InteractiveToken</LogonType>
|
||||
<RunLevel>HighestAvailable</RunLevel>
|
||||
</Principal>
|
||||
</Principals>
|
||||
<Triggers>
|
||||
<LogonTrigger/>
|
||||
</Triggers>
|
||||
<Settings>
|
||||
<MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
|
||||
<DisallowStartIfOnBatteries>false</DisallowStartIfOnBatteries>
|
||||
<StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
|
||||
<AllowHardTerminate>false</AllowHardTerminate>
|
||||
<StartWhenAvailable>false</StartWhenAvailable>
|
||||
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
|
||||
<IdleSettings>
|
||||
<StopOnIdleEnd>false</StopOnIdleEnd>
|
||||
<RestartOnIdle>false</RestartOnIdle>
|
||||
</IdleSettings>
|
||||
<AllowStartOnDemand>true</AllowStartOnDemand>
|
||||
<Enabled>true</Enabled>
|
||||
<Hidden>false</Hidden>
|
||||
<RunOnlyIfIdle>false</RunOnlyIfIdle>
|
||||
<WakeToRun>false</WakeToRun>
|
||||
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
|
||||
<Priority>7</Priority>
|
||||
</Settings>
|
||||
<Actions Context="Author">
|
||||
<Exec>
|
||||
<Command>"${Platform.resolvedExecutable}"</Command>
|
||||
</Exec>
|
||||
</Actions>
|
||||
</Task>''';
|
||||
final taskPath = join(await appPath.tempPath, "task.xml");
|
||||
await File(taskPath).create(recursive: true);
|
||||
await File(taskPath)
|
||||
.writeAsBytes(taskXml.encodeUtf16LeWithBom, flush: true);
|
||||
final commandLine = [
|
||||
'/Create',
|
||||
'/TN',
|
||||
appName,
|
||||
'/XML',
|
||||
"%s",
|
||||
'/F',
|
||||
].join(" ");
|
||||
return runas(
|
||||
'schtasks',
|
||||
commandLine.replaceFirst("%s", taskPath),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
final windows = Platform.isWindows ? Windows() : null;
|
||||
@@ -2,6 +2,7 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'dart:io';
|
||||
import 'dart:isolate';
|
||||
import 'dart:typed_data';
|
||||
|
||||
import 'package:archive/archive.dart';
|
||||
import 'package:fl_clash/clash/clash.dart';
|
||||
@@ -11,9 +12,7 @@ import 'package:fl_clash/plugins/app.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:fl_clash/widgets/dialog.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:path/path.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
@@ -23,6 +22,7 @@ import 'models/models.dart';
|
||||
import 'views/profiles/override_profile.dart';
|
||||
|
||||
class AppController {
|
||||
bool lastTunEnable = false;
|
||||
int? lastProfileModified;
|
||||
|
||||
final BuildContext context;
|
||||
@@ -30,29 +30,29 @@ class AppController {
|
||||
|
||||
AppController(this.context, WidgetRef ref) : _ref = ref;
|
||||
|
||||
void setupClashConfigDebounce() {
|
||||
setupClashConfigDebounce() {
|
||||
debouncer.call(FunctionTag.setupClashConfig, () async {
|
||||
await setupClashConfig();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> updateClashConfigDebounce() async {
|
||||
updateClashConfigDebounce() {
|
||||
debouncer.call(FunctionTag.updateClashConfig, () async {
|
||||
await updateClashConfig();
|
||||
});
|
||||
}
|
||||
|
||||
void updateGroupsDebounce() {
|
||||
updateGroupsDebounce() {
|
||||
debouncer.call(FunctionTag.updateGroups, updateGroups);
|
||||
}
|
||||
|
||||
void addCheckIpNumDebounce() {
|
||||
addCheckIpNumDebounce() {
|
||||
debouncer.call(FunctionTag.addCheckIpNum, () {
|
||||
_ref.read(checkIpNumProvider.notifier).add();
|
||||
});
|
||||
}
|
||||
|
||||
void applyProfileDebounce({
|
||||
applyProfileDebounce({
|
||||
bool silence = false,
|
||||
}) {
|
||||
debouncer.call(FunctionTag.applyProfile, (silence) {
|
||||
@@ -60,11 +60,11 @@ class AppController {
|
||||
}, args: [silence]);
|
||||
}
|
||||
|
||||
void savePreferencesDebounce() {
|
||||
savePreferencesDebounce() {
|
||||
debouncer.call(FunctionTag.savePreferences, savePreferences);
|
||||
}
|
||||
|
||||
void changeProxyDebounce(String groupName, String proxyName) {
|
||||
changeProxyDebounce(String groupName, String proxyName) {
|
||||
debouncer.call(FunctionTag.changeProxy,
|
||||
(String groupName, String proxyName) async {
|
||||
await changeProxy(
|
||||
@@ -75,8 +75,8 @@ class AppController {
|
||||
}, args: [groupName, proxyName]);
|
||||
}
|
||||
|
||||
Future<void> restartCore() async {
|
||||
commonPrint.log('restart core');
|
||||
restartCore() async {
|
||||
commonPrint.log("restart core");
|
||||
await clashService?.reStart();
|
||||
await _initCore();
|
||||
if (_ref.read(runTimeProvider.notifier).isStart) {
|
||||
@@ -84,7 +84,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateStatus(bool isStart) async {
|
||||
updateStatus(bool isStart) async {
|
||||
if (isStart) {
|
||||
await globalState.handleStart([
|
||||
updateRunTime,
|
||||
@@ -103,7 +103,7 @@ class AppController {
|
||||
applyProfileDebounce();
|
||||
} else {
|
||||
await globalState.handleStop();
|
||||
clashCore.resetTraffic();
|
||||
await clashCore.resetTraffic();
|
||||
_ref.read(trafficsProvider.notifier).clear();
|
||||
_ref.read(totalTrafficProvider.notifier).value = Traffic();
|
||||
_ref.read(runTimeProvider.notifier).value = null;
|
||||
@@ -111,7 +111,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void updateRunTime() {
|
||||
updateRunTime() {
|
||||
final startTime = globalState.startTime;
|
||||
if (startTime != null) {
|
||||
final startTimeStamp = startTime.millisecondsSinceEpoch;
|
||||
@@ -122,20 +122,20 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateTraffic() async {
|
||||
updateTraffic() async {
|
||||
final traffic = await clashCore.getTraffic();
|
||||
_ref.read(trafficsProvider.notifier).addTraffic(traffic);
|
||||
_ref.read(totalTrafficProvider.notifier).value =
|
||||
await clashCore.getTotalTraffic();
|
||||
}
|
||||
|
||||
Future<void> addProfile(Profile profile) async {
|
||||
addProfile(Profile profile) async {
|
||||
_ref.read(profilesProvider.notifier).setProfile(profile);
|
||||
if (_ref.read(currentProfileIdProvider) != null) return;
|
||||
_ref.read(currentProfileIdProvider.notifier).value = profile.id;
|
||||
}
|
||||
|
||||
Future<void> deleteProfile(String id) async {
|
||||
deleteProfile(String id) async {
|
||||
_ref.read(profilesProvider.notifier).deleteProfileById(id);
|
||||
clearEffect(id);
|
||||
if (globalState.config.currentProfileId == id) {
|
||||
@@ -151,12 +151,12 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateProviders() async {
|
||||
updateProviders() async {
|
||||
_ref.read(providersProvider.notifier).value =
|
||||
await clashCore.getExternalProviders();
|
||||
}
|
||||
|
||||
Future<void> updateLocalIp() async {
|
||||
updateLocalIp() async {
|
||||
_ref.read(localIpProvider.notifier).value = null;
|
||||
await Future.delayed(commonDuration);
|
||||
_ref.read(localIpProvider.notifier).value = await utils.getLocalIpAddress();
|
||||
@@ -172,26 +172,26 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void setProfile(Profile profile) {
|
||||
setProfile(Profile profile) {
|
||||
_ref.read(profilesProvider.notifier).setProfile(profile);
|
||||
}
|
||||
|
||||
void setProfileAndAutoApply(Profile profile) {
|
||||
setProfileAndAutoApply(Profile profile) {
|
||||
_ref.read(profilesProvider.notifier).setProfile(profile);
|
||||
if (profile.id == _ref.read(currentProfileIdProvider)) {
|
||||
applyProfileDebounce(silence: true);
|
||||
}
|
||||
}
|
||||
|
||||
void setProfiles(List<Profile> profiles) {
|
||||
setProfiles(List<Profile> profiles) {
|
||||
_ref.read(profilesProvider.notifier).value = profiles;
|
||||
}
|
||||
|
||||
void addLog(Log log) {
|
||||
addLog(Log log) {
|
||||
_ref.read(logsProvider).add(log);
|
||||
}
|
||||
|
||||
void updateOrAddHotKeyAction(HotKeyAction hotKeyAction) {
|
||||
updateOrAddHotKeyAction(HotKeyAction hotKeyAction) {
|
||||
final hotKeyActions = _ref.read(hotKeyActionsProvider);
|
||||
final index =
|
||||
hotKeyActions.indexWhere((item) => item.action == hotKeyAction.action);
|
||||
@@ -220,26 +220,26 @@ class AppController {
|
||||
return _ref.read(getProxiesColumnsProvider);
|
||||
}
|
||||
|
||||
dynamic addSortNum() {
|
||||
addSortNum() {
|
||||
return _ref.read(sortNumProvider.notifier).add();
|
||||
}
|
||||
|
||||
String? getCurrentGroupName() {
|
||||
getCurrentGroupName() {
|
||||
final currentGroupName = _ref.read(currentProfileProvider.select(
|
||||
(state) => state?.currentGroupName,
|
||||
));
|
||||
return currentGroupName;
|
||||
}
|
||||
|
||||
ProxyCardState getProxyCardState(String proxyName) {
|
||||
ProxyCardState getProxyCardState(proxyName) {
|
||||
return _ref.read(getProxyCardStateProvider(proxyName));
|
||||
}
|
||||
|
||||
String? getSelectedProxyName(String groupName) {
|
||||
getSelectedProxyName(groupName) {
|
||||
return _ref.read(getSelectedProxyNameProvider(groupName));
|
||||
}
|
||||
|
||||
void updateCurrentGroupName(String groupName) {
|
||||
updateCurrentGroupName(String groupName) {
|
||||
final profile = _ref.read(currentProfileProvider);
|
||||
if (profile == null || profile.currentGroupName == groupName) {
|
||||
return;
|
||||
@@ -250,12 +250,11 @@ class AppController {
|
||||
}
|
||||
|
||||
Future<void> updateClashConfig() async {
|
||||
await safeRun(
|
||||
() async {
|
||||
await _updateClashConfig();
|
||||
},
|
||||
needLoading: true,
|
||||
);
|
||||
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
|
||||
if (commonScaffoldState?.mounted != true) return;
|
||||
await commonScaffoldState?.loadingRun(() async {
|
||||
await _updateClashConfig();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _updateClashConfig() async {
|
||||
@@ -264,55 +263,49 @@ class AppController {
|
||||
if (res.isError) {
|
||||
return;
|
||||
}
|
||||
final realTunEnable = _ref.read(realTunEnableProvider);
|
||||
lastTunEnable = res.data == true;
|
||||
final message = await clashCore.updateConfig(
|
||||
updateParams.copyWith.tun(
|
||||
enable: realTunEnable,
|
||||
enable: lastTunEnable,
|
||||
),
|
||||
);
|
||||
if (message.isNotEmpty) throw message;
|
||||
}
|
||||
|
||||
Future<Result<bool>> _requestAdmin(bool enableTun) async {
|
||||
if(system.isWindows && kDebugMode){
|
||||
return Result.success(false);
|
||||
}
|
||||
final realTunEnable = _ref.read(realTunEnableProvider);
|
||||
if (enableTun != realTunEnable && realTunEnable == false) {
|
||||
if (enableTun != lastTunEnable && lastTunEnable == false) {
|
||||
final code = await system.authorizeCore();
|
||||
switch (code) {
|
||||
case AuthorizeCode.none:
|
||||
return Result.success(enableTun);
|
||||
case AuthorizeCode.success:
|
||||
await restartCore();
|
||||
return Result.error('');
|
||||
case AuthorizeCode.none:
|
||||
break;
|
||||
return Result.error("");
|
||||
case AuthorizeCode.error:
|
||||
enableTun = false;
|
||||
break;
|
||||
return Result.success(false);
|
||||
}
|
||||
}
|
||||
_ref.read(realTunEnableProvider.notifier).value = enableTun;
|
||||
return Result.success(enableTun);
|
||||
}
|
||||
|
||||
Future<void> setupClashConfig() async {
|
||||
await safeRun(
|
||||
() async {
|
||||
await _setupClashConfig();
|
||||
},
|
||||
needLoading: true,
|
||||
);
|
||||
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
|
||||
if (commonScaffoldState?.mounted != true) return;
|
||||
await commonScaffoldState?.loadingRun(() async {
|
||||
await _setupClashConfig();
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _setupClashConfig() async {
|
||||
_setupClashConfig() async {
|
||||
await _ref.read(currentProfileProvider)?.checkAndUpdate();
|
||||
final patchConfig = _ref.read(patchClashConfigProvider);
|
||||
final res = await _requestAdmin(patchConfig.tun.enable);
|
||||
if (res.isError) {
|
||||
return;
|
||||
}
|
||||
final realTunEnable = _ref.read(realTunEnableProvider);
|
||||
final realPatchConfig = patchConfig.copyWith.tun(enable: realTunEnable);
|
||||
lastTunEnable = res.data == true;
|
||||
final realPatchConfig = patchConfig.copyWith.tun(enable: lastTunEnable);
|
||||
final params = await globalState.getSetupParams(
|
||||
pathConfig: realPatchConfig,
|
||||
);
|
||||
@@ -338,32 +331,29 @@ class AppController {
|
||||
if (silence) {
|
||||
await _applyProfile();
|
||||
} else {
|
||||
await safeRun(
|
||||
() async {
|
||||
await _applyProfile();
|
||||
},
|
||||
needLoading: true,
|
||||
);
|
||||
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
|
||||
if (commonScaffoldState?.mounted != true) return;
|
||||
await commonScaffoldState?.loadingRun(() async {
|
||||
await _applyProfile();
|
||||
});
|
||||
}
|
||||
addCheckIpNumDebounce();
|
||||
}
|
||||
|
||||
void handleChangeProfile() {
|
||||
handleChangeProfile() {
|
||||
_ref.read(delayDataSourceProvider.notifier).value = {};
|
||||
applyProfile();
|
||||
_ref.read(logsProvider.notifier).value = FixedList(500);
|
||||
_ref.read(requestsProvider.notifier).value = FixedList(500);
|
||||
globalState.computeHeightMapCache = {};
|
||||
globalState.cacheHeightMap = {};
|
||||
globalState.cacheScrollPosition = {};
|
||||
}
|
||||
|
||||
void updateBrightness() {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_ref.read(systemBrightnessProvider.notifier).value =
|
||||
WidgetsBinding.instance.platformDispatcher.platformBrightness;
|
||||
});
|
||||
updateBrightness(Brightness brightness) {
|
||||
_ref.read(appBrightnessProvider.notifier).value = brightness;
|
||||
}
|
||||
|
||||
Future<void> autoUpdateProfiles() async {
|
||||
autoUpdateProfiles() async {
|
||||
for (final profile in _ref.read(profilesProvider)) {
|
||||
if (!profile.autoUpdate) continue;
|
||||
final isNotNeedUpdate = profile.lastUpdateDate
|
||||
@@ -395,7 +385,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> updateProfiles() async {
|
||||
updateProfiles() async {
|
||||
for (final profile in _ref.read(profilesProvider)) {
|
||||
if (profile.type == ProfileType.file) {
|
||||
continue;
|
||||
@@ -404,12 +394,12 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> savePreferences() async {
|
||||
commonPrint.log('save preferences');
|
||||
savePreferences() async {
|
||||
commonPrint.log("save preferences");
|
||||
await preferences.saveConfig(globalState.config);
|
||||
}
|
||||
|
||||
Future<void> changeProxy({
|
||||
changeProxy({
|
||||
required String groupName,
|
||||
required String proxyName,
|
||||
}) async {
|
||||
@@ -425,13 +415,13 @@ class AppController {
|
||||
addCheckIpNumDebounce();
|
||||
}
|
||||
|
||||
Future<void> handleBackOrExit() async {
|
||||
handleBackOrExit() async {
|
||||
if (_ref.read(backBlockProvider)) {
|
||||
return;
|
||||
}
|
||||
if (_ref.read(appSettingProvider).minimizeOnExit) {
|
||||
if (system.isDesktop) {
|
||||
await savePreferences();
|
||||
await savePreferencesDebounce();
|
||||
}
|
||||
await system.back();
|
||||
} else {
|
||||
@@ -439,21 +429,20 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void backBlock() {
|
||||
backBlock() {
|
||||
_ref.read(backBlockProvider.notifier).value = true;
|
||||
}
|
||||
|
||||
void unBackBlock() {
|
||||
unBackBlock() {
|
||||
_ref.read(backBlockProvider.notifier).value = false;
|
||||
}
|
||||
|
||||
Future<void> handleExit() async {
|
||||
handleExit() async {
|
||||
Future.delayed(commonDuration, () {
|
||||
system.exit();
|
||||
});
|
||||
try {
|
||||
await savePreferences();
|
||||
await macOS?.updateDns(true);
|
||||
await proxy?.stopProxy();
|
||||
await clashCore.shutdown();
|
||||
await clashService?.destroy();
|
||||
@@ -464,19 +453,19 @@ class AppController {
|
||||
|
||||
Future handleClear() async {
|
||||
await preferences.clearPreferences();
|
||||
commonPrint.log('clear preferences');
|
||||
commonPrint.log("clear preferences");
|
||||
globalState.config = Config(
|
||||
themeProps: defaultThemeProps,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> autoCheckUpdate() async {
|
||||
autoCheckUpdate() async {
|
||||
if (!_ref.read(appSettingProvider).autoCheckUpdate) return;
|
||||
final res = await request.checkForUpdate();
|
||||
checkUpdateResultHandle(data: res);
|
||||
}
|
||||
|
||||
Future<void> checkUpdateResultHandle({
|
||||
checkUpdateResultHandle({
|
||||
Map<String, dynamic>? data,
|
||||
bool handleError = false,
|
||||
}) async {
|
||||
@@ -491,16 +480,16 @@ class AppController {
|
||||
final res = await globalState.showMessage(
|
||||
title: appLocalizations.discoverNewVersion,
|
||||
message: TextSpan(
|
||||
text: '$tagName \n',
|
||||
text: "$tagName \n",
|
||||
style: textTheme.headlineSmall,
|
||||
children: [
|
||||
TextSpan(
|
||||
text: '\n',
|
||||
text: "\n",
|
||||
style: textTheme.bodyMedium,
|
||||
),
|
||||
for (final submit in submits)
|
||||
TextSpan(
|
||||
text: '- $submit \n',
|
||||
text: "- $submit \n",
|
||||
style: textTheme.bodyMedium,
|
||||
),
|
||||
],
|
||||
@@ -511,7 +500,7 @@ class AppController {
|
||||
return;
|
||||
}
|
||||
launchUrl(
|
||||
Uri.parse('https://github.com/$repository/releases/latest'),
|
||||
Uri.parse("https://github.com/$repository/releases/latest"),
|
||||
);
|
||||
} else if (handleError) {
|
||||
globalState.showMessage(
|
||||
@@ -523,7 +512,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _handlePreference() async {
|
||||
_handlePreference() async {
|
||||
if (await preferences.isInit) {
|
||||
return;
|
||||
}
|
||||
@@ -552,11 +541,9 @@ class AppController {
|
||||
await applyProfile();
|
||||
}
|
||||
|
||||
Future<void> init() async {
|
||||
init() async {
|
||||
FlutterError.onError = (details) {
|
||||
if (kDebugMode) {
|
||||
commonPrint.log(details.stack.toString());
|
||||
}
|
||||
commonPrint.log(details.stack.toString());
|
||||
};
|
||||
updateTray(true);
|
||||
await _initCore();
|
||||
@@ -576,8 +563,8 @@ class AppController {
|
||||
_ref.read(initProvider.notifier).value = true;
|
||||
}
|
||||
|
||||
Future<void> _initStatus() async {
|
||||
if (system.isAndroid) {
|
||||
_initStatus() async {
|
||||
if (Platform.isAndroid) {
|
||||
await globalState.updateStartTime();
|
||||
}
|
||||
final status = globalState.isStart == true
|
||||
@@ -590,28 +577,28 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void setDelay(Delay delay) {
|
||||
setDelay(Delay delay) {
|
||||
_ref.read(delayDataSourceProvider.notifier).setDelay(delay);
|
||||
}
|
||||
|
||||
void toPage(PageLabel pageLabel) {
|
||||
toPage(PageLabel pageLabel) {
|
||||
_ref.read(currentPageLabelProvider.notifier).value = pageLabel;
|
||||
}
|
||||
|
||||
void toProfiles() {
|
||||
toProfiles() {
|
||||
toPage(PageLabel.profiles);
|
||||
}
|
||||
|
||||
void initLink() {
|
||||
initLink() {
|
||||
linkManager.initAppLinksListen(
|
||||
(url) async {
|
||||
final res = await globalState.showMessage(
|
||||
title: '${appLocalizations.add}${appLocalizations.profile}',
|
||||
title: "${appLocalizations.add}${appLocalizations.profile}",
|
||||
message: TextSpan(
|
||||
children: [
|
||||
TextSpan(text: appLocalizations.doYouWantToPass),
|
||||
TextSpan(
|
||||
text: ' $url ',
|
||||
text: " $url ",
|
||||
style: TextStyle(
|
||||
color: Theme.of(context).colorScheme.primary,
|
||||
decoration: TextDecoration.underline,
|
||||
@@ -620,7 +607,7 @@ class AppController {
|
||||
),
|
||||
TextSpan(
|
||||
text:
|
||||
'${appLocalizations.create}${appLocalizations.profile}'),
|
||||
"${appLocalizations.create}${appLocalizations.profile}"),
|
||||
],
|
||||
),
|
||||
);
|
||||
@@ -663,7 +650,7 @@ class AppController {
|
||||
false;
|
||||
}
|
||||
|
||||
Future<void> _handlerDisclaimer() async {
|
||||
_handlerDisclaimer() async {
|
||||
if (_ref.read(appSettingProvider).disclaimerAccepted) {
|
||||
return;
|
||||
}
|
||||
@@ -674,64 +661,62 @@ class AppController {
|
||||
return;
|
||||
}
|
||||
|
||||
Future<void> addProfileFormURL(String url) async {
|
||||
addProfileFormURL(String url) async {
|
||||
if (globalState.navigatorKey.currentState?.canPop() ?? false) {
|
||||
globalState.navigatorKey.currentState?.popUntil((route) => route.isFirst);
|
||||
}
|
||||
toProfiles();
|
||||
|
||||
final profile = await safeRun(
|
||||
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
|
||||
if (commonScaffoldState?.mounted != true) return;
|
||||
final profile = await commonScaffoldState?.loadingRun<Profile>(
|
||||
() async {
|
||||
return await Profile.normal(
|
||||
url: url,
|
||||
).update();
|
||||
},
|
||||
needLoading: true,
|
||||
title: '${appLocalizations.add}${appLocalizations.profile}',
|
||||
title: "${appLocalizations.add}${appLocalizations.profile}",
|
||||
);
|
||||
if (profile != null) {
|
||||
await addProfile(profile);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> addProfileFormFile() async {
|
||||
final platformFile = await safeRun(picker.pickerFile);
|
||||
addProfileFormFile() async {
|
||||
final platformFile = await globalState.safeRun(picker.pickerFile);
|
||||
final bytes = platformFile?.bytes;
|
||||
if (bytes == null) {
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
if (!context.mounted) return;
|
||||
globalState.navigatorKey.currentState?.popUntil((route) => route.isFirst);
|
||||
toProfiles();
|
||||
|
||||
final profile = await safeRun(
|
||||
final commonScaffoldState = globalState.homeScaffoldKey.currentState;
|
||||
if (commonScaffoldState?.mounted != true) return;
|
||||
final profile = await commonScaffoldState?.loadingRun<Profile?>(
|
||||
() async {
|
||||
await Future.delayed(const Duration(milliseconds: 300));
|
||||
return await Profile.normal(label: platformFile?.name).saveFile(bytes);
|
||||
},
|
||||
needLoading: true,
|
||||
title: '${appLocalizations.add}${appLocalizations.profile}',
|
||||
title: "${appLocalizations.add}${appLocalizations.profile}",
|
||||
);
|
||||
if (profile != null) {
|
||||
await addProfile(profile);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> addProfileFormQrCode() async {
|
||||
final url = await safeRun(
|
||||
picker.pickerConfigQRCode,
|
||||
);
|
||||
addProfileFormQrCode() async {
|
||||
final url = await globalState.safeRun(picker.pickerConfigQRCode);
|
||||
if (url == null) return;
|
||||
addProfileFormURL(url);
|
||||
}
|
||||
|
||||
void updateViewSize(Size size) {
|
||||
updateViewSize(Size size) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_ref.read(viewSizeProvider.notifier).value = size;
|
||||
});
|
||||
}
|
||||
|
||||
void setProvider(ExternalProvider? provider) {
|
||||
setProvider(ExternalProvider? provider) {
|
||||
_ref.read(providersProvider.notifier).setProvider(provider);
|
||||
}
|
||||
|
||||
@@ -776,31 +761,27 @@ class AppController {
|
||||
);
|
||||
}
|
||||
|
||||
List<Proxy> getSortProxies({
|
||||
required List<Proxy> proxies,
|
||||
required ProxiesSortType sortType,
|
||||
String? testUrl,
|
||||
}) {
|
||||
return switch (sortType) {
|
||||
List<Proxy> getSortProxies(List<Proxy> proxies, [String? url]) {
|
||||
return switch (_ref.read(proxiesStyleSettingProvider).sortType) {
|
||||
ProxiesSortType.none => proxies,
|
||||
ProxiesSortType.delay => _sortOfDelay(
|
||||
proxies: proxies,
|
||||
testUrl: testUrl,
|
||||
testUrl: url,
|
||||
),
|
||||
ProxiesSortType.name => _sortOfName(proxies),
|
||||
};
|
||||
}
|
||||
|
||||
Future<Null> clearEffect(String profileId) async {
|
||||
clearEffect(String profileId) async {
|
||||
final profilePath = await appPath.getProfilePath(profileId);
|
||||
final providersDirPath = await appPath.getProvidersDirPath(profileId);
|
||||
final providersPath = await appPath.getProvidersPath(profileId);
|
||||
return await Isolate.run(() async {
|
||||
final profileFile = File(profilePath);
|
||||
final isExists = await profileFile.exists();
|
||||
if (isExists) {
|
||||
profileFile.delete(recursive: true);
|
||||
}
|
||||
final providersFileDir = File(providersDirPath);
|
||||
final providersFileDir = File(providersPath);
|
||||
final providersFileIsExists = await providersFileDir.exists();
|
||||
if (providersFileIsExists) {
|
||||
providersFileDir.delete(recursive: true);
|
||||
@@ -808,13 +789,13 @@ class AppController {
|
||||
});
|
||||
}
|
||||
|
||||
void updateTun() {
|
||||
updateTun() {
|
||||
_ref.read(patchClashConfigProvider.notifier).updateState(
|
||||
(state) => state.copyWith.tun(enable: !state.tun.enable),
|
||||
);
|
||||
}
|
||||
|
||||
void updateSystemProxy() {
|
||||
updateSystemProxy() {
|
||||
_ref.read(networkSettingProvider.notifier).updateState(
|
||||
(state) => state.copyWith(
|
||||
systemProxy: !state.systemProxy,
|
||||
@@ -833,11 +814,11 @@ class AppController {
|
||||
return _ref.read(packagesProvider);
|
||||
}
|
||||
|
||||
void updateStart() {
|
||||
updateStart() {
|
||||
updateStatus(!_ref.read(runTimeProvider.notifier).isStart);
|
||||
}
|
||||
|
||||
void updateCurrentSelectedMap(String groupName, String proxyName) {
|
||||
updateCurrentSelectedMap(String groupName, String proxyName) {
|
||||
final currentProfile = _ref.read(currentProfileProvider);
|
||||
if (currentProfile != null &&
|
||||
currentProfile.selectedMap[groupName] != proxyName) {
|
||||
@@ -852,7 +833,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void updateCurrentUnfoldSet(Set<String> value) {
|
||||
updateCurrentUnfoldSet(Set<String> value) {
|
||||
final currentProfile = _ref.read(currentProfileProvider);
|
||||
if (currentProfile == null) {
|
||||
return;
|
||||
@@ -864,7 +845,7 @@ class AppController {
|
||||
);
|
||||
}
|
||||
|
||||
void changeMode(Mode mode) {
|
||||
changeMode(Mode mode) {
|
||||
_ref.read(patchClashConfigProvider.notifier).updateState(
|
||||
(state) => state.copyWith(mode: mode),
|
||||
);
|
||||
@@ -874,7 +855,7 @@ class AppController {
|
||||
addCheckIpNumDebounce();
|
||||
}
|
||||
|
||||
void updateAutoLaunch() {
|
||||
updateAutoLaunch() {
|
||||
_ref.read(appSettingProvider.notifier).updateState(
|
||||
(state) => state.copyWith(
|
||||
autoLaunch: !state.autoLaunch,
|
||||
@@ -882,7 +863,7 @@ class AppController {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> updateVisible() async {
|
||||
updateVisible() async {
|
||||
final visible = await window?.isVisible;
|
||||
if (visible != null && !visible) {
|
||||
window?.show();
|
||||
@@ -891,7 +872,7 @@ class AppController {
|
||||
}
|
||||
}
|
||||
|
||||
void updateMode() {
|
||||
updateMode() {
|
||||
_ref.read(patchClashConfigProvider.notifier).updateState(
|
||||
(state) {
|
||||
final index = Mode.values.indexWhere((item) => item == state.mode);
|
||||
@@ -906,7 +887,7 @@ class AppController {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> handleAddOrUpdate(WidgetRef ref, [Rule? rule]) async {
|
||||
handleAddOrUpdate(WidgetRef ref, [Rule? rule]) async {
|
||||
final res = await globalState.showCommonDialog<Rule>(
|
||||
child: AddRuleDialog(
|
||||
rule: rule,
|
||||
@@ -943,7 +924,7 @@ class AppController {
|
||||
(item) => item.toString(),
|
||||
);
|
||||
final data = await Isolate.run<List<int>>(() async {
|
||||
final logsRawString = logsRaw.join('\n');
|
||||
final logsRawString = logsRaw.join("\n");
|
||||
return utf8.encode(logsRawString);
|
||||
});
|
||||
return await picker.saveFile(
|
||||
@@ -959,20 +940,20 @@ class AppController {
|
||||
final configJson = globalState.config.toJson();
|
||||
return Isolate.run<List<int>>(() async {
|
||||
final archive = Archive();
|
||||
archive.add('config.json', configJson);
|
||||
archive.addDirectoryToArchive(profilesPath, homeDirPath);
|
||||
archive.add("config.json", configJson);
|
||||
await archive.addDirectoryToArchive(profilesPath, homeDirPath);
|
||||
final zipEncoder = ZipEncoder();
|
||||
return zipEncoder.encode(archive) ?? [];
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> updateTray([bool focus = false]) async {
|
||||
updateTray([bool focus = false]) async {
|
||||
tray.update(
|
||||
trayState: _ref.read(trayStateProvider),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> recoveryData(
|
||||
recoveryData(
|
||||
List<int> data,
|
||||
RecoveryOption recoveryOption,
|
||||
) async {
|
||||
@@ -982,12 +963,12 @@ class AppController {
|
||||
});
|
||||
final homeDirPath = await appPath.homeDirPath;
|
||||
final configs =
|
||||
archive.files.where((item) => item.name.endsWith('.json')).toList();
|
||||
archive.files.where((item) => item.name.endsWith(".json")).toList();
|
||||
final profiles =
|
||||
archive.files.where((item) => !item.name.endsWith('.json'));
|
||||
archive.files.where((item) => !item.name.endsWith(".json"));
|
||||
final configIndex =
|
||||
configs.indexWhere((config) => config.name == 'config.json');
|
||||
if (configIndex == -1) throw 'invalid backup file';
|
||||
configs.indexWhere((config) => config.name == "config.json");
|
||||
if (configIndex == -1) throw "invalid backup file";
|
||||
final configFile = configs[configIndex];
|
||||
var tempConfig = Config.compatibleFromJson(
|
||||
json.decode(
|
||||
@@ -1001,7 +982,7 @@ class AppController {
|
||||
await file.writeAsBytes(profile.content);
|
||||
}
|
||||
final clashConfigIndex =
|
||||
configs.indexWhere((config) => config.name == 'clashConfig.json');
|
||||
configs.indexWhere((config) => config.name == "clashConfig.json");
|
||||
if (clashConfigIndex != -1) {
|
||||
final clashConfigFile = configs[clashConfigIndex];
|
||||
tempConfig = tempConfig.copyWith(
|
||||
@@ -1020,7 +1001,7 @@ class AppController {
|
||||
);
|
||||
}
|
||||
|
||||
void _recovery(Config config, RecoveryOption recoveryOption) {
|
||||
_recovery(Config config, RecoveryOption recoveryOption) {
|
||||
final recoveryStrategy = _ref.read(appSettingProvider.select(
|
||||
(state) => state.recoveryStrategy,
|
||||
));
|
||||
@@ -1050,42 +1031,10 @@ class AppController {
|
||||
_ref.read(overrideDnsProvider.notifier).value = config.overrideDns;
|
||||
_ref.read(networkSettingProvider.notifier).value = config.networkProps;
|
||||
_ref.read(hotKeyActionsProvider.notifier).value = config.hotKeyActions;
|
||||
_ref.read(scriptStateProvider.notifier).value = config.scriptProps;
|
||||
}
|
||||
final currentProfile = _ref.read(currentProfileProvider);
|
||||
if (currentProfile == null) {
|
||||
_ref.read(currentProfileIdProvider.notifier).value = profiles.first.id;
|
||||
}
|
||||
}
|
||||
|
||||
Future<T?> safeRun<T>(
|
||||
FutureOr<T> Function() futureFunction, {
|
||||
String? title,
|
||||
bool needLoading = false,
|
||||
bool silence = true,
|
||||
}) async {
|
||||
final realSilence = needLoading == true ? true : silence;
|
||||
try {
|
||||
if (needLoading) {
|
||||
_ref.read(loadingProvider.notifier).value = true;
|
||||
}
|
||||
final res = await futureFunction();
|
||||
return res;
|
||||
} catch (e) {
|
||||
commonPrint.log('$e');
|
||||
if (realSilence) {
|
||||
globalState.showNotifier(e.toString());
|
||||
} else {
|
||||
globalState.showMessage(
|
||||
title: title ?? appLocalizations.tip,
|
||||
message: TextSpan(
|
||||
text: e.toString(),
|
||||
),
|
||||
);
|
||||
}
|
||||
return null;
|
||||
} finally {
|
||||
_ref.read(loadingProvider.notifier).value = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,8 @@
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_clash/common/system.dart';
|
||||
import 'package:fl_clash/views/dashboard/widgets/widgets.dart';
|
||||
import 'package:fl_clash/widgets/widgets.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
import 'package:hotkey_manager/hotkey_manager.dart';
|
||||
@@ -17,16 +15,16 @@ enum SupportPlatform {
|
||||
Android;
|
||||
|
||||
static SupportPlatform get currentPlatform {
|
||||
if (system.isWindows) {
|
||||
if (Platform.isWindows) {
|
||||
return SupportPlatform.Windows;
|
||||
} else if (system.isMacOS) {
|
||||
} else if (Platform.isMacOS) {
|
||||
return SupportPlatform.MacOS;
|
||||
} else if (Platform.isLinux) {
|
||||
return SupportPlatform.Linux;
|
||||
} else if (system.isAndroid) {
|
||||
} else if (Platform.isAndroid) {
|
||||
return SupportPlatform.Android;
|
||||
}
|
||||
throw 'invalid platform';
|
||||
throw "invalid platform";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,11 +43,11 @@ enum GroupType {
|
||||
|
||||
static GroupType parseProfileType(String type) {
|
||||
return switch (type) {
|
||||
'url-test' => URLTest,
|
||||
'select' => Selector,
|
||||
'fallback' => Fallback,
|
||||
'load-balance' => LoadBalance,
|
||||
'relay' => Relay,
|
||||
"url-test" => URLTest,
|
||||
"select" => Selector,
|
||||
"fallback" => Fallback,
|
||||
"load-balance" => LoadBalance,
|
||||
"relay" => Relay,
|
||||
String() => throw UnimplementedError(),
|
||||
};
|
||||
}
|
||||
@@ -60,7 +58,7 @@ enum GroupName { GLOBAL, Proxy, Auto, Fallback }
|
||||
extension GroupTypeExtension on GroupType {
|
||||
static List<String> get valueList => GroupType.values
|
||||
.map(
|
||||
(e) => e.toString().split('.').last,
|
||||
(e) => e.toString().split(".").last,
|
||||
)
|
||||
.toList();
|
||||
|
||||
@@ -82,7 +80,7 @@ enum UsedProxy { GLOBAL, DIRECT, REJECT }
|
||||
extension UsedProxyExtension on UsedProxy {
|
||||
static List<String> get valueList => UsedProxy.values
|
||||
.map(
|
||||
(e) => e.toString().split('.').last,
|
||||
(e) => e.toString().split(".").last,
|
||||
)
|
||||
.toList();
|
||||
|
||||
@@ -99,18 +97,7 @@ enum LogLevel {
|
||||
warning,
|
||||
error,
|
||||
silent,
|
||||
}
|
||||
|
||||
extension LogLevelExt on LogLevel {
|
||||
Color? get color {
|
||||
return switch (this) {
|
||||
LogLevel.silent => Colors.grey.shade700,
|
||||
LogLevel.debug => Colors.grey.shade400,
|
||||
LogLevel.info => null,
|
||||
LogLevel.warning => Colors.yellowAccent,
|
||||
LogLevel.error => Colors.redAccent,
|
||||
};
|
||||
}
|
||||
app,
|
||||
}
|
||||
|
||||
enum TransportProtocol { udp, tcp }
|
||||
@@ -173,18 +160,18 @@ enum ProxyCardType { expand, shrink, min }
|
||||
|
||||
enum DnsMode {
|
||||
normal,
|
||||
@JsonValue('fake-ip')
|
||||
@JsonValue("fake-ip")
|
||||
fakeIp,
|
||||
@JsonValue('redir-host')
|
||||
@JsonValue("redir-host")
|
||||
redirHost,
|
||||
hosts
|
||||
}
|
||||
|
||||
enum ExternalControllerStatus {
|
||||
@JsonValue('')
|
||||
close(''),
|
||||
@JsonValue('127.0.0.1:9090')
|
||||
open('127.0.0.1:9090');
|
||||
@JsonValue("")
|
||||
close(""),
|
||||
@JsonValue("127.0.0.1:9090")
|
||||
open("127.0.0.1:9090");
|
||||
|
||||
final String value;
|
||||
|
||||
@@ -248,9 +235,9 @@ enum ProxiesIconStyle {
|
||||
}
|
||||
|
||||
enum FontFamily {
|
||||
twEmoji('Twemoji'),
|
||||
jetBrainsMono('JetBrainsMono'),
|
||||
icon('Icons');
|
||||
twEmoji("Twemoji"),
|
||||
jetBrainsMono("JetBrainsMono"),
|
||||
icon("Icons");
|
||||
|
||||
final String value;
|
||||
|
||||
@@ -333,7 +320,6 @@ enum FunctionTag {
|
||||
proxiesTabChange,
|
||||
logs,
|
||||
requests,
|
||||
autoScrollToEnd,
|
||||
}
|
||||
|
||||
enum DashboardWidget {
|
||||
@@ -437,39 +423,39 @@ enum PageLabel {
|
||||
}
|
||||
|
||||
enum RuleAction {
|
||||
DOMAIN('DOMAIN'),
|
||||
DOMAIN_SUFFIX('DOMAIN-SUFFIX'),
|
||||
DOMAIN_KEYWORD('DOMAIN-KEYWORD'),
|
||||
DOMAIN_REGEX('DOMAIN-REGEX'),
|
||||
GEOSITE('GEOSITE'),
|
||||
IP_CIDR('IP-CIDR'),
|
||||
IP_CIDR6('IP-CIDR6'),
|
||||
IP_SUFFIX('IP-SUFFIX'),
|
||||
IP_ASN('IP-ASN'),
|
||||
GEOIP('GEOIP'),
|
||||
SRC_GEOIP('SRC-GEOIP'),
|
||||
SRC_IP_ASN('SRC-IP-ASN'),
|
||||
SRC_IP_CIDR('SRC-IP-CIDR'),
|
||||
SRC_IP_SUFFIX('SRC-IP-SUFFIX'),
|
||||
DST_PORT('DST-PORT'),
|
||||
SRC_PORT('SRC-PORT'),
|
||||
IN_PORT('IN-PORT'),
|
||||
IN_TYPE('IN-TYPE'),
|
||||
IN_USER('IN-USER'),
|
||||
IN_NAME('IN-NAME'),
|
||||
PROCESS_PATH('PROCESS-PATH'),
|
||||
PROCESS_PATH_REGEX('PROCESS-PATH-REGEX'),
|
||||
PROCESS_NAME('PROCESS-NAME'),
|
||||
PROCESS_NAME_REGEX('PROCESS-NAME-REGEX'),
|
||||
UID('UID'),
|
||||
NETWORK('NETWORK'),
|
||||
DSCP('DSCP'),
|
||||
RULE_SET('RULE-SET'),
|
||||
AND('AND'),
|
||||
OR('OR'),
|
||||
NOT('NOT'),
|
||||
SUB_RULE('SUB-RULE'),
|
||||
MATCH('MATCH');
|
||||
DOMAIN("DOMAIN"),
|
||||
DOMAIN_SUFFIX("DOMAIN-SUFFIX"),
|
||||
DOMAIN_KEYWORD("DOMAIN-KEYWORD"),
|
||||
DOMAIN_REGEX("DOMAIN-REGEX"),
|
||||
GEOSITE("GEOSITE"),
|
||||
IP_CIDR("IP-CIDR"),
|
||||
IP_CIDR6("IP-CIDR6"),
|
||||
IP_SUFFIX("IP-SUFFIX"),
|
||||
IP_ASN("IP-ASN"),
|
||||
GEOIP("GEOIP"),
|
||||
SRC_GEOIP("SRC-GEOIP"),
|
||||
SRC_IP_ASN("SRC-IP-ASN"),
|
||||
SRC_IP_CIDR("SRC-IP-CIDR"),
|
||||
SRC_IP_SUFFIX("SRC-IP-SUFFIX"),
|
||||
DST_PORT("DST-PORT"),
|
||||
SRC_PORT("SRC-PORT"),
|
||||
IN_PORT("IN-PORT"),
|
||||
IN_TYPE("IN-TYPE"),
|
||||
IN_USER("IN-USER"),
|
||||
IN_NAME("IN-NAME"),
|
||||
PROCESS_PATH("PROCESS-PATH"),
|
||||
PROCESS_PATH_REGEX("PROCESS-PATH-REGEX"),
|
||||
PROCESS_NAME("PROCESS-NAME"),
|
||||
PROCESS_NAME_REGEX("PROCESS-NAME-REGEX"),
|
||||
UID("UID"),
|
||||
NETWORK("NETWORK"),
|
||||
DSCP("DSCP"),
|
||||
RULE_SET("RULE-SET"),
|
||||
AND("AND"),
|
||||
OR("OR"),
|
||||
NOT("NOT"),
|
||||
SUB_RULE("SUB-RULE"),
|
||||
MATCH("MATCH");
|
||||
|
||||
final String value;
|
||||
|
||||
@@ -507,22 +493,9 @@ enum CacheTag {
|
||||
logs,
|
||||
rules,
|
||||
requests,
|
||||
proxiesList,
|
||||
}
|
||||
|
||||
enum Language {
|
||||
yaml,
|
||||
javaScript,
|
||||
}
|
||||
|
||||
enum ImportOption {
|
||||
file,
|
||||
url,
|
||||
}
|
||||
|
||||
enum ScrollPositionCacheKeys {
|
||||
tools,
|
||||
profiles,
|
||||
proxiesList,
|
||||
proxiesTabList,
|
||||
}
|
||||
|
||||
@@ -26,21 +26,19 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
static String m1(label) =>
|
||||
"Are you sure you want to delete the current ${label}?";
|
||||
|
||||
static String m2(label) => "${label} details";
|
||||
static String m2(label) => "${label} cannot be empty";
|
||||
|
||||
static String m3(label) => "${label} cannot be empty";
|
||||
static String m3(label) => "Current ${label} already exists";
|
||||
|
||||
static String m4(label) => "Current ${label} already exists";
|
||||
static String m4(label) => "No ${label} at the moment";
|
||||
|
||||
static String m5(label) => "No ${label} at the moment";
|
||||
static String m5(label) => "${label} must be a number";
|
||||
|
||||
static String m6(label) => "${label} must be a number";
|
||||
static String m6(label) => "${label} must be between 1024 and 49151";
|
||||
|
||||
static String m7(label) => "${label} must be between 1024 and 49151";
|
||||
static String m7(count) => "${count} items have been selected";
|
||||
|
||||
static String m8(count) => "${count} items have been selected";
|
||||
|
||||
static String m9(label) => "${label} must be a url";
|
||||
static String m8(label) => "${label} must be a url";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
@@ -125,9 +123,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"autoRunDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Auto run when the application is opened",
|
||||
),
|
||||
"autoSetSystemDns": MessageLookupByLibrary.simpleMessage(
|
||||
"Auto set system DNS",
|
||||
),
|
||||
"autoUpdate": MessageLookupByLibrary.simpleMessage("Auto update"),
|
||||
"autoUpdateInterval": MessageLookupByLibrary.simpleMessage(
|
||||
"Auto update interval (minutes)",
|
||||
@@ -177,7 +172,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Opening it will lose part of its application ability and gain the support of full amount of Clash.",
|
||||
),
|
||||
"confirm": MessageLookupByLibrary.simpleMessage("Confirm"),
|
||||
"connection": MessageLookupByLibrary.simpleMessage("Connection"),
|
||||
"connections": MessageLookupByLibrary.simpleMessage("Connections"),
|
||||
"connectionsDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"View current connections data",
|
||||
@@ -197,7 +191,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"country": MessageLookupByLibrary.simpleMessage("Country"),
|
||||
"crashTest": MessageLookupByLibrary.simpleMessage("Crash test"),
|
||||
"create": MessageLookupByLibrary.simpleMessage("Create"),
|
||||
"creationTime": MessageLookupByLibrary.simpleMessage("Creation time"),
|
||||
"cut": MessageLookupByLibrary.simpleMessage("Cut"),
|
||||
"dark": MessageLookupByLibrary.simpleMessage("Dark"),
|
||||
"dashboard": MessageLookupByLibrary.simpleMessage("Dashboard"),
|
||||
@@ -218,14 +211,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"desc": MessageLookupByLibrary.simpleMessage(
|
||||
"A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free.",
|
||||
),
|
||||
"destination": MessageLookupByLibrary.simpleMessage("Destination"),
|
||||
"destinationGeoIP": MessageLookupByLibrary.simpleMessage(
|
||||
"Destination GeoIP",
|
||||
),
|
||||
"destinationIPASN": MessageLookupByLibrary.simpleMessage(
|
||||
"Destination IPASN",
|
||||
),
|
||||
"details": m2,
|
||||
"detectionTip": MessageLookupByLibrary.simpleMessage(
|
||||
"Relying on third-party api is for reference only",
|
||||
),
|
||||
@@ -254,7 +239,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"domain": MessageLookupByLibrary.simpleMessage("Domain"),
|
||||
"download": MessageLookupByLibrary.simpleMessage("Download"),
|
||||
"edit": MessageLookupByLibrary.simpleMessage("Edit"),
|
||||
"emptyTip": m3,
|
||||
"emptyTip": m2,
|
||||
"en": MessageLookupByLibrary.simpleMessage("English"),
|
||||
"enableOverride": MessageLookupByLibrary.simpleMessage("Enable override"),
|
||||
"entries": MessageLookupByLibrary.simpleMessage(" entries"),
|
||||
@@ -262,7 +247,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"excludeDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"When the app is in the background, the app is hidden from the recent task",
|
||||
),
|
||||
"existsTip": m4,
|
||||
"existsTip": m3,
|
||||
"exit": MessageLookupByLibrary.simpleMessage("Exit"),
|
||||
"expand": MessageLookupByLibrary.simpleMessage("Standard"),
|
||||
"expirationTime": MessageLookupByLibrary.simpleMessage("Expiration time"),
|
||||
@@ -324,7 +309,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"hasCacheChange": MessageLookupByLibrary.simpleMessage(
|
||||
"Do you want to cache the changes?",
|
||||
),
|
||||
"host": MessageLookupByLibrary.simpleMessage("Host"),
|
||||
"hostsDesc": MessageLookupByLibrary.simpleMessage("Add Hosts"),
|
||||
"hotkeyConflict": MessageLookupByLibrary.simpleMessage("Hotkey conflict"),
|
||||
"hotkeyManagement": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -339,10 +323,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Icon configuration",
|
||||
),
|
||||
"iconStyle": MessageLookupByLibrary.simpleMessage("Icon style"),
|
||||
"import": MessageLookupByLibrary.simpleMessage("Import"),
|
||||
"importFile": MessageLookupByLibrary.simpleMessage("Import from file"),
|
||||
"importFromURL": MessageLookupByLibrary.simpleMessage("Import from URL"),
|
||||
"importUrl": MessageLookupByLibrary.simpleMessage("Import from URL"),
|
||||
"infiniteTime": MessageLookupByLibrary.simpleMessage("Long term effective"),
|
||||
"init": MessageLookupByLibrary.simpleMessage("Init"),
|
||||
"inputCorrectHotkey": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -379,7 +360,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"localRecoveryDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Recovery data from file",
|
||||
),
|
||||
"log": MessageLookupByLibrary.simpleMessage("Log"),
|
||||
"logLevel": MessageLookupByLibrary.simpleMessage("LogLevel"),
|
||||
"logcat": MessageLookupByLibrary.simpleMessage("Logcat"),
|
||||
"logcatDesc": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -429,7 +409,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Network detection",
|
||||
),
|
||||
"networkSpeed": MessageLookupByLibrary.simpleMessage("Network speed"),
|
||||
"networkType": MessageLookupByLibrary.simpleMessage("Network type"),
|
||||
"neutralScheme": MessageLookupByLibrary.simpleMessage("Neutral"),
|
||||
"noData": MessageLookupByLibrary.simpleMessage("No data"),
|
||||
"noHotKey": MessageLookupByLibrary.simpleMessage("No HotKey"),
|
||||
@@ -450,8 +429,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"nullProfileDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"No profile, Please add a profile",
|
||||
),
|
||||
"nullTip": m5,
|
||||
"numberTip": m6,
|
||||
"nullTip": m4,
|
||||
"numberTip": m5,
|
||||
"oneColumn": MessageLookupByLibrary.simpleMessage("One column"),
|
||||
"onlyIcon": MessageLookupByLibrary.simpleMessage("Icon"),
|
||||
"onlyOtherApps": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -505,7 +484,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"portConflictTip": MessageLookupByLibrary.simpleMessage(
|
||||
"Please enter a different port",
|
||||
),
|
||||
"portTip": m7,
|
||||
"portTip": m6,
|
||||
"preferH3Desc": MessageLookupByLibrary.simpleMessage(
|
||||
"Prioritize the use of DOH\'s http/3",
|
||||
),
|
||||
@@ -539,12 +518,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"profiles": MessageLookupByLibrary.simpleMessage("Profiles"),
|
||||
"profilesSort": MessageLookupByLibrary.simpleMessage("Profiles sort"),
|
||||
"progress": MessageLookupByLibrary.simpleMessage("Progress"),
|
||||
"project": MessageLookupByLibrary.simpleMessage("Project"),
|
||||
"providers": MessageLookupByLibrary.simpleMessage("Providers"),
|
||||
"proxies": MessageLookupByLibrary.simpleMessage("Proxies"),
|
||||
"proxiesSetting": MessageLookupByLibrary.simpleMessage("Proxies setting"),
|
||||
"proxyChains": MessageLookupByLibrary.simpleMessage("Proxy chains"),
|
||||
"proxyGroup": MessageLookupByLibrary.simpleMessage("Proxy group"),
|
||||
"proxyNameserver": MessageLookupByLibrary.simpleMessage("Proxy nameserver"),
|
||||
"proxyNameserverDesc": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -583,15 +560,11 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"remoteBackupDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Backup local data to WebDAV",
|
||||
),
|
||||
"remoteDestination": MessageLookupByLibrary.simpleMessage(
|
||||
"Remote destination",
|
||||
),
|
||||
"remoteRecoveryDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Recovery data from WebDAV",
|
||||
),
|
||||
"remove": MessageLookupByLibrary.simpleMessage("Remove"),
|
||||
"rename": MessageLookupByLibrary.simpleMessage("Rename"),
|
||||
"request": MessageLookupByLibrary.simpleMessage("Request"),
|
||||
"requests": MessageLookupByLibrary.simpleMessage("Requests"),
|
||||
"requestsDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"View recently request records",
|
||||
@@ -632,7 +605,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"seconds": MessageLookupByLibrary.simpleMessage("Seconds"),
|
||||
"selectAll": MessageLookupByLibrary.simpleMessage("Select all"),
|
||||
"selected": MessageLookupByLibrary.simpleMessage("Selected"),
|
||||
"selectedCountTitle": m8,
|
||||
"selectedCountTitle": m7,
|
||||
"settings": MessageLookupByLibrary.simpleMessage("Settings"),
|
||||
"show": MessageLookupByLibrary.simpleMessage("Show"),
|
||||
"shrink": MessageLookupByLibrary.simpleMessage("Shrink"),
|
||||
@@ -645,8 +618,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sort": MessageLookupByLibrary.simpleMessage("Sort"),
|
||||
"source": MessageLookupByLibrary.simpleMessage("Source"),
|
||||
"sourceIp": MessageLookupByLibrary.simpleMessage("Source IP"),
|
||||
"specialProxy": MessageLookupByLibrary.simpleMessage("Special proxy"),
|
||||
"specialRules": MessageLookupByLibrary.simpleMessage("special rules"),
|
||||
"stackMode": MessageLookupByLibrary.simpleMessage("Stack mode"),
|
||||
"standard": MessageLookupByLibrary.simpleMessage("Standard"),
|
||||
"start": MessageLookupByLibrary.simpleMessage("Start"),
|
||||
@@ -715,7 +686,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"urlDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Obtain profile through URL",
|
||||
),
|
||||
"urlTip": m9,
|
||||
"urlTip": m8,
|
||||
"useHosts": MessageLookupByLibrary.simpleMessage("Use hosts"),
|
||||
"useSystemHosts": MessageLookupByLibrary.simpleMessage("Use system hosts"),
|
||||
"value": MessageLookupByLibrary.simpleMessage("Value"),
|
||||
|
||||
@@ -24,21 +24,19 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m1(label) => "現在の${label}を削除してもよろしいですか?";
|
||||
|
||||
static String m2(label) => "${label}詳細";
|
||||
static String m2(label) => "${label}は空欄にできません";
|
||||
|
||||
static String m3(label) => "${label}は空欄にできません";
|
||||
static String m3(label) => "現在の${label}は既に存在しています";
|
||||
|
||||
static String m4(label) => "現在の${label}は既に存在しています";
|
||||
static String m4(label) => "現在${label}はありません";
|
||||
|
||||
static String m5(label) => "現在${label}はありません";
|
||||
static String m5(label) => "${label}は数字でなければなりません";
|
||||
|
||||
static String m6(label) => "${label}は数字でなければなりません";
|
||||
static String m6(label) => "${label} は 1024 から 49151 の間でなければなりません";
|
||||
|
||||
static String m7(label) => "${label} は 1024 から 49151 の間でなければなりません";
|
||||
static String m7(count) => "${count} 項目が選択されています";
|
||||
|
||||
static String m8(count) => "${count} 項目が選択されています";
|
||||
|
||||
static String m9(label) => "${label}はURLである必要があります";
|
||||
static String m8(label) => "${label}はURLである必要があります";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
@@ -95,7 +93,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"autoLaunchDesc": MessageLookupByLibrary.simpleMessage("システムの自動起動に従う"),
|
||||
"autoRun": MessageLookupByLibrary.simpleMessage("自動実行"),
|
||||
"autoRunDesc": MessageLookupByLibrary.simpleMessage("アプリ起動時に自動実行"),
|
||||
"autoSetSystemDns": MessageLookupByLibrary.simpleMessage("オートセットシステムDNS"),
|
||||
"autoUpdate": MessageLookupByLibrary.simpleMessage("自動更新"),
|
||||
"autoUpdateInterval": MessageLookupByLibrary.simpleMessage("自動更新間隔(分)"),
|
||||
"backup": MessageLookupByLibrary.simpleMessage("バックアップ"),
|
||||
@@ -133,7 +130,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"有効化すると一部機能を失いますが、Clashの完全サポートを獲得",
|
||||
),
|
||||
"confirm": MessageLookupByLibrary.simpleMessage("確認"),
|
||||
"connection": MessageLookupByLibrary.simpleMessage("接続"),
|
||||
"connections": MessageLookupByLibrary.simpleMessage("接続"),
|
||||
"connectionsDesc": MessageLookupByLibrary.simpleMessage("現在の接続データを表示"),
|
||||
"connectivity": MessageLookupByLibrary.simpleMessage("接続性:"),
|
||||
@@ -149,7 +145,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"country": MessageLookupByLibrary.simpleMessage("国"),
|
||||
"crashTest": MessageLookupByLibrary.simpleMessage("クラッシュテスト"),
|
||||
"create": MessageLookupByLibrary.simpleMessage("作成"),
|
||||
"creationTime": MessageLookupByLibrary.simpleMessage("作成時間"),
|
||||
"cut": MessageLookupByLibrary.simpleMessage("切り取り"),
|
||||
"dark": MessageLookupByLibrary.simpleMessage("ダーク"),
|
||||
"dashboard": MessageLookupByLibrary.simpleMessage("ダッシュボード"),
|
||||
@@ -168,10 +163,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"desc": MessageLookupByLibrary.simpleMessage(
|
||||
"ClashMetaベースのマルチプラットフォームプロキシクライアント。シンプルで使いやすく、オープンソースで広告なし。",
|
||||
),
|
||||
"destination": MessageLookupByLibrary.simpleMessage("宛先"),
|
||||
"destinationGeoIP": MessageLookupByLibrary.simpleMessage("宛先地理情報"),
|
||||
"destinationIPASN": MessageLookupByLibrary.simpleMessage("宛先IP ASN"),
|
||||
"details": m2,
|
||||
"detectionTip": MessageLookupByLibrary.simpleMessage("サードパーティAPIに依存(参考値)"),
|
||||
"developerMode": MessageLookupByLibrary.simpleMessage("デベロッパーモード"),
|
||||
"developerModeEnableTip": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -190,7 +181,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"domain": MessageLookupByLibrary.simpleMessage("ドメイン"),
|
||||
"download": MessageLookupByLibrary.simpleMessage("ダウンロード"),
|
||||
"edit": MessageLookupByLibrary.simpleMessage("編集"),
|
||||
"emptyTip": m3,
|
||||
"emptyTip": m2,
|
||||
"en": MessageLookupByLibrary.simpleMessage("英語"),
|
||||
"enableOverride": MessageLookupByLibrary.simpleMessage("上書きを有効化"),
|
||||
"entries": MessageLookupByLibrary.simpleMessage(" エントリ"),
|
||||
@@ -198,7 +189,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"excludeDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"アプリがバックグラウンド時に最近のタスクから非表示",
|
||||
),
|
||||
"existsTip": m4,
|
||||
"existsTip": m3,
|
||||
"exit": MessageLookupByLibrary.simpleMessage("終了"),
|
||||
"expand": MessageLookupByLibrary.simpleMessage("標準"),
|
||||
"expirationTime": MessageLookupByLibrary.simpleMessage("有効期限"),
|
||||
@@ -244,7 +235,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"go": MessageLookupByLibrary.simpleMessage("移動"),
|
||||
"goDownload": MessageLookupByLibrary.simpleMessage("ダウンロードへ"),
|
||||
"hasCacheChange": MessageLookupByLibrary.simpleMessage("変更をキャッシュしますか?"),
|
||||
"host": MessageLookupByLibrary.simpleMessage("ホスト"),
|
||||
"hostsDesc": MessageLookupByLibrary.simpleMessage("ホストを追加"),
|
||||
"hotkeyConflict": MessageLookupByLibrary.simpleMessage("ホットキー競合"),
|
||||
"hotkeyManagement": MessageLookupByLibrary.simpleMessage("ホットキー管理"),
|
||||
@@ -255,10 +245,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"icon": MessageLookupByLibrary.simpleMessage("アイコン"),
|
||||
"iconConfiguration": MessageLookupByLibrary.simpleMessage("アイコン設定"),
|
||||
"iconStyle": MessageLookupByLibrary.simpleMessage("アイコンスタイル"),
|
||||
"import": MessageLookupByLibrary.simpleMessage("インポート"),
|
||||
"importFile": MessageLookupByLibrary.simpleMessage("ファイルからインポート"),
|
||||
"importFromURL": MessageLookupByLibrary.simpleMessage("URLからインポート"),
|
||||
"importUrl": MessageLookupByLibrary.simpleMessage("URLからインポート"),
|
||||
"infiniteTime": MessageLookupByLibrary.simpleMessage("長期有効"),
|
||||
"init": MessageLookupByLibrary.simpleMessage("初期化"),
|
||||
"inputCorrectHotkey": MessageLookupByLibrary.simpleMessage("正しいホットキーを入力"),
|
||||
@@ -283,7 +270,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"local": MessageLookupByLibrary.simpleMessage("ローカル"),
|
||||
"localBackupDesc": MessageLookupByLibrary.simpleMessage("ローカルにデータをバックアップ"),
|
||||
"localRecoveryDesc": MessageLookupByLibrary.simpleMessage("ファイルからデータを復元"),
|
||||
"log": MessageLookupByLibrary.simpleMessage("ログ"),
|
||||
"logLevel": MessageLookupByLibrary.simpleMessage("ログレベル"),
|
||||
"logcat": MessageLookupByLibrary.simpleMessage("ログキャット"),
|
||||
"logcatDesc": MessageLookupByLibrary.simpleMessage("無効化するとログエントリを非表示"),
|
||||
@@ -319,7 +305,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"networkDesc": MessageLookupByLibrary.simpleMessage("ネットワーク関連設定の変更"),
|
||||
"networkDetection": MessageLookupByLibrary.simpleMessage("ネットワーク検出"),
|
||||
"networkSpeed": MessageLookupByLibrary.simpleMessage("ネットワーク速度"),
|
||||
"networkType": MessageLookupByLibrary.simpleMessage("ネットワーク種別"),
|
||||
"neutralScheme": MessageLookupByLibrary.simpleMessage("ニュートラル"),
|
||||
"noData": MessageLookupByLibrary.simpleMessage("データなし"),
|
||||
"noHotKey": MessageLookupByLibrary.simpleMessage("ホットキーなし"),
|
||||
@@ -340,8 +325,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"nullProfileDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"プロファイルがありません。追加してください",
|
||||
),
|
||||
"nullTip": m5,
|
||||
"numberTip": m6,
|
||||
"nullTip": m4,
|
||||
"numberTip": m5,
|
||||
"oneColumn": MessageLookupByLibrary.simpleMessage("1列"),
|
||||
"onlyIcon": MessageLookupByLibrary.simpleMessage("アイコンのみ"),
|
||||
"onlyOtherApps": MessageLookupByLibrary.simpleMessage("サードパーティアプリのみ"),
|
||||
@@ -383,7 +368,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"port": MessageLookupByLibrary.simpleMessage("ポート"),
|
||||
"portConflictTip": MessageLookupByLibrary.simpleMessage("別のポートを入力してください"),
|
||||
"portTip": m7,
|
||||
"portTip": m6,
|
||||
"preferH3Desc": MessageLookupByLibrary.simpleMessage("DOHのHTTP/3を優先使用"),
|
||||
"pressKeyboard": MessageLookupByLibrary.simpleMessage("キーボードを押してください"),
|
||||
"preview": MessageLookupByLibrary.simpleMessage("プレビュー"),
|
||||
@@ -409,12 +394,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"profiles": MessageLookupByLibrary.simpleMessage("プロファイル一覧"),
|
||||
"profilesSort": MessageLookupByLibrary.simpleMessage("プロファイルの並び替え"),
|
||||
"progress": MessageLookupByLibrary.simpleMessage("進捗"),
|
||||
"project": MessageLookupByLibrary.simpleMessage("プロジェクト"),
|
||||
"providers": MessageLookupByLibrary.simpleMessage("プロバイダー"),
|
||||
"proxies": MessageLookupByLibrary.simpleMessage("プロキシ"),
|
||||
"proxiesSetting": MessageLookupByLibrary.simpleMessage("プロキシ設定"),
|
||||
"proxyChains": MessageLookupByLibrary.simpleMessage("プロキシチェーン"),
|
||||
"proxyGroup": MessageLookupByLibrary.simpleMessage("プロキシグループ"),
|
||||
"proxyNameserver": MessageLookupByLibrary.simpleMessage("プロキシネームサーバー"),
|
||||
"proxyNameserverDesc": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -443,13 +426,11 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"remoteBackupDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"WebDAVにデータをバックアップ",
|
||||
),
|
||||
"remoteDestination": MessageLookupByLibrary.simpleMessage("リモート宛先"),
|
||||
"remoteRecoveryDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"WebDAVからデータを復元",
|
||||
),
|
||||
"remove": MessageLookupByLibrary.simpleMessage("削除"),
|
||||
"rename": MessageLookupByLibrary.simpleMessage("リネーム"),
|
||||
"request": MessageLookupByLibrary.simpleMessage("リクエスト"),
|
||||
"requests": MessageLookupByLibrary.simpleMessage("リクエスト"),
|
||||
"requestsDesc": MessageLookupByLibrary.simpleMessage("最近のリクエスト記録を表示"),
|
||||
"reset": MessageLookupByLibrary.simpleMessage("リセット"),
|
||||
@@ -480,7 +461,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"seconds": MessageLookupByLibrary.simpleMessage("秒"),
|
||||
"selectAll": MessageLookupByLibrary.simpleMessage("すべて選択"),
|
||||
"selected": MessageLookupByLibrary.simpleMessage("選択済み"),
|
||||
"selectedCountTitle": m8,
|
||||
"selectedCountTitle": m7,
|
||||
"settings": MessageLookupByLibrary.simpleMessage("設定"),
|
||||
"show": MessageLookupByLibrary.simpleMessage("表示"),
|
||||
"shrink": MessageLookupByLibrary.simpleMessage("縮小"),
|
||||
@@ -491,8 +472,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sort": MessageLookupByLibrary.simpleMessage("並び替え"),
|
||||
"source": MessageLookupByLibrary.simpleMessage("ソース"),
|
||||
"sourceIp": MessageLookupByLibrary.simpleMessage("送信元IP"),
|
||||
"specialProxy": MessageLookupByLibrary.simpleMessage("特殊プロキシ"),
|
||||
"specialRules": MessageLookupByLibrary.simpleMessage("特殊ルール"),
|
||||
"stackMode": MessageLookupByLibrary.simpleMessage("スタックモード"),
|
||||
"standard": MessageLookupByLibrary.simpleMessage("標準"),
|
||||
"start": MessageLookupByLibrary.simpleMessage("開始"),
|
||||
@@ -549,7 +528,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"upload": MessageLookupByLibrary.simpleMessage("アップロード"),
|
||||
"url": MessageLookupByLibrary.simpleMessage("URL"),
|
||||
"urlDesc": MessageLookupByLibrary.simpleMessage("URL経由でプロファイルを取得"),
|
||||
"urlTip": m9,
|
||||
"urlTip": m8,
|
||||
"useHosts": MessageLookupByLibrary.simpleMessage("ホストを使用"),
|
||||
"useSystemHosts": MessageLookupByLibrary.simpleMessage("システムホストを使用"),
|
||||
"value": MessageLookupByLibrary.simpleMessage("値"),
|
||||
|
||||
@@ -25,21 +25,19 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m1(label) => "Вы уверены, что хотите удалить текущий ${label}?";
|
||||
|
||||
static String m2(label) => "Детали {}";
|
||||
static String m2(label) => "${label} не может быть пустым";
|
||||
|
||||
static String m3(label) => "${label} не может быть пустым";
|
||||
static String m3(label) => "Текущий ${label} уже существует";
|
||||
|
||||
static String m4(label) => "Текущий ${label} уже существует";
|
||||
static String m4(label) => "Сейчас ${label} нет";
|
||||
|
||||
static String m5(label) => "Сейчас ${label} нет";
|
||||
static String m5(label) => "${label} должно быть числом";
|
||||
|
||||
static String m6(label) => "${label} должно быть числом";
|
||||
static String m6(label) => "${label} должен быть числом от 1024 до 49151";
|
||||
|
||||
static String m7(label) => "${label} должен быть числом от 1024 до 49151";
|
||||
static String m7(count) => "Выбрано ${count} элементов";
|
||||
|
||||
static String m8(count) => "Выбрано ${count} элементов";
|
||||
|
||||
static String m9(label) => "${label} должен быть URL";
|
||||
static String m8(label) => "${label} должен быть URL";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
@@ -122,9 +120,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"autoRunDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Автоматический запуск при открытии приложения",
|
||||
),
|
||||
"autoSetSystemDns": MessageLookupByLibrary.simpleMessage(
|
||||
"Автоматическая настройка системного DNS",
|
||||
),
|
||||
"autoUpdate": MessageLookupByLibrary.simpleMessage("Автообновление"),
|
||||
"autoUpdateInterval": MessageLookupByLibrary.simpleMessage(
|
||||
"Интервал автообновления (минуты)",
|
||||
@@ -182,7 +177,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Включение приведет к потере части функциональности приложения, но обеспечит полную поддержку Clash.",
|
||||
),
|
||||
"confirm": MessageLookupByLibrary.simpleMessage("Подтвердить"),
|
||||
"connection": MessageLookupByLibrary.simpleMessage("Соединение"),
|
||||
"connections": MessageLookupByLibrary.simpleMessage("Соединения"),
|
||||
"connectionsDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Просмотр текущих данных о соединениях",
|
||||
@@ -202,7 +196,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"country": MessageLookupByLibrary.simpleMessage("Страна"),
|
||||
"crashTest": MessageLookupByLibrary.simpleMessage("Тест на сбои"),
|
||||
"create": MessageLookupByLibrary.simpleMessage("Создать"),
|
||||
"creationTime": MessageLookupByLibrary.simpleMessage("Время создания"),
|
||||
"cut": MessageLookupByLibrary.simpleMessage("Вырезать"),
|
||||
"dark": MessageLookupByLibrary.simpleMessage("Темный"),
|
||||
"dashboard": MessageLookupByLibrary.simpleMessage("Панель управления"),
|
||||
@@ -225,12 +218,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"desc": MessageLookupByLibrary.simpleMessage(
|
||||
"Многоплатформенный прокси-клиент на основе ClashMeta, простой и удобный в использовании, с открытым исходным кодом и без рекламы.",
|
||||
),
|
||||
"destination": MessageLookupByLibrary.simpleMessage("Назначение"),
|
||||
"destinationGeoIP": MessageLookupByLibrary.simpleMessage(
|
||||
"Геолокация назначения",
|
||||
),
|
||||
"destinationIPASN": MessageLookupByLibrary.simpleMessage("ASN назначения"),
|
||||
"details": m2,
|
||||
"detectionTip": MessageLookupByLibrary.simpleMessage(
|
||||
"Опирается на сторонний API, только для справки",
|
||||
),
|
||||
@@ -261,7 +248,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"domain": MessageLookupByLibrary.simpleMessage("Домен"),
|
||||
"download": MessageLookupByLibrary.simpleMessage("Скачивание"),
|
||||
"edit": MessageLookupByLibrary.simpleMessage("Редактировать"),
|
||||
"emptyTip": m3,
|
||||
"emptyTip": m2,
|
||||
"en": MessageLookupByLibrary.simpleMessage("Английский"),
|
||||
"enableOverride": MessageLookupByLibrary.simpleMessage(
|
||||
"Включить переопределение",
|
||||
@@ -273,7 +260,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"excludeDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Когда приложение находится в фоновом режиме, оно скрыто из последних задач",
|
||||
),
|
||||
"existsTip": m4,
|
||||
"existsTip": m3,
|
||||
"exit": MessageLookupByLibrary.simpleMessage("Выход"),
|
||||
"expand": MessageLookupByLibrary.simpleMessage("Стандартный"),
|
||||
"expirationTime": MessageLookupByLibrary.simpleMessage("Время истечения"),
|
||||
@@ -339,7 +326,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"hasCacheChange": MessageLookupByLibrary.simpleMessage(
|
||||
"Хотите сохранить изменения в кэше?",
|
||||
),
|
||||
"host": MessageLookupByLibrary.simpleMessage("Хост"),
|
||||
"hostsDesc": MessageLookupByLibrary.simpleMessage("Добавить Hosts"),
|
||||
"hotkeyConflict": MessageLookupByLibrary.simpleMessage(
|
||||
"Конфликт горячих клавиш",
|
||||
@@ -356,10 +342,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Конфигурация иконки",
|
||||
),
|
||||
"iconStyle": MessageLookupByLibrary.simpleMessage("Стиль иконки"),
|
||||
"import": MessageLookupByLibrary.simpleMessage("Импорт"),
|
||||
"importFile": MessageLookupByLibrary.simpleMessage("Импорт из файла"),
|
||||
"importFromURL": MessageLookupByLibrary.simpleMessage("Импорт из URL"),
|
||||
"importUrl": MessageLookupByLibrary.simpleMessage("Импорт по URL"),
|
||||
"infiniteTime": MessageLookupByLibrary.simpleMessage(
|
||||
"Долгосрочное действие",
|
||||
),
|
||||
@@ -398,7 +381,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"localRecoveryDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Восстановление данных из файла",
|
||||
),
|
||||
"log": MessageLookupByLibrary.simpleMessage("Журнал"),
|
||||
"logLevel": MessageLookupByLibrary.simpleMessage("Уровень логов"),
|
||||
"logcat": MessageLookupByLibrary.simpleMessage("Logcat"),
|
||||
"logcatDesc": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -452,7 +434,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"Обнаружение сети",
|
||||
),
|
||||
"networkSpeed": MessageLookupByLibrary.simpleMessage("Скорость сети"),
|
||||
"networkType": MessageLookupByLibrary.simpleMessage("Тип сети"),
|
||||
"neutralScheme": MessageLookupByLibrary.simpleMessage("Нейтральные"),
|
||||
"noData": MessageLookupByLibrary.simpleMessage("Нет данных"),
|
||||
"noHotKey": MessageLookupByLibrary.simpleMessage("Нет горячей клавиши"),
|
||||
@@ -475,8 +456,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"nullProfileDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Нет профиля, пожалуйста, добавьте профиль",
|
||||
),
|
||||
"nullTip": m5,
|
||||
"numberTip": m6,
|
||||
"nullTip": m4,
|
||||
"numberTip": m5,
|
||||
"oneColumn": MessageLookupByLibrary.simpleMessage("Один столбец"),
|
||||
"onlyIcon": MessageLookupByLibrary.simpleMessage("Только иконка"),
|
||||
"onlyOtherApps": MessageLookupByLibrary.simpleMessage(
|
||||
@@ -532,7 +513,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"portConflictTip": MessageLookupByLibrary.simpleMessage(
|
||||
"Введите другой порт",
|
||||
),
|
||||
"portTip": m7,
|
||||
"portTip": m6,
|
||||
"preferH3Desc": MessageLookupByLibrary.simpleMessage(
|
||||
"Приоритетное использование HTTP/3 для DOH",
|
||||
),
|
||||
@@ -566,12 +547,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"profiles": MessageLookupByLibrary.simpleMessage("Профили"),
|
||||
"profilesSort": MessageLookupByLibrary.simpleMessage("Сортировка профилей"),
|
||||
"progress": MessageLookupByLibrary.simpleMessage("Прогресс"),
|
||||
"project": MessageLookupByLibrary.simpleMessage("Проект"),
|
||||
"providers": MessageLookupByLibrary.simpleMessage("Провайдеры"),
|
||||
"proxies": MessageLookupByLibrary.simpleMessage("Прокси"),
|
||||
"proxiesSetting": MessageLookupByLibrary.simpleMessage("Настройка прокси"),
|
||||
"proxyChains": MessageLookupByLibrary.simpleMessage("Цепочки прокси"),
|
||||
"proxyGroup": MessageLookupByLibrary.simpleMessage("Группа прокси"),
|
||||
"proxyNameserver": MessageLookupByLibrary.simpleMessage(
|
||||
"Прокси-сервер имен",
|
||||
@@ -616,15 +595,11 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"remoteBackupDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Резервное копирование локальных данных на WebDAV",
|
||||
),
|
||||
"remoteDestination": MessageLookupByLibrary.simpleMessage(
|
||||
"Удалённое назначение",
|
||||
),
|
||||
"remoteRecoveryDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Восстановление данных с WebDAV",
|
||||
),
|
||||
"remove": MessageLookupByLibrary.simpleMessage("Удалить"),
|
||||
"rename": MessageLookupByLibrary.simpleMessage("Переименовать"),
|
||||
"request": MessageLookupByLibrary.simpleMessage("Запрос"),
|
||||
"requests": MessageLookupByLibrary.simpleMessage("Запросы"),
|
||||
"requestsDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Просмотр последних записей запросов",
|
||||
@@ -667,7 +642,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"seconds": MessageLookupByLibrary.simpleMessage("Секунд"),
|
||||
"selectAll": MessageLookupByLibrary.simpleMessage("Выбрать все"),
|
||||
"selected": MessageLookupByLibrary.simpleMessage("Выбрано"),
|
||||
"selectedCountTitle": m8,
|
||||
"selectedCountTitle": m7,
|
||||
"settings": MessageLookupByLibrary.simpleMessage("Настройки"),
|
||||
"show": MessageLookupByLibrary.simpleMessage("Показать"),
|
||||
"shrink": MessageLookupByLibrary.simpleMessage("Сжать"),
|
||||
@@ -680,8 +655,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sort": MessageLookupByLibrary.simpleMessage("Сортировка"),
|
||||
"source": MessageLookupByLibrary.simpleMessage("Источник"),
|
||||
"sourceIp": MessageLookupByLibrary.simpleMessage("Исходный IP"),
|
||||
"specialProxy": MessageLookupByLibrary.simpleMessage("Специальный прокси"),
|
||||
"specialRules": MessageLookupByLibrary.simpleMessage("Специальные правила"),
|
||||
"stackMode": MessageLookupByLibrary.simpleMessage("Режим стека"),
|
||||
"standard": MessageLookupByLibrary.simpleMessage("Стандартный"),
|
||||
"start": MessageLookupByLibrary.simpleMessage("Старт"),
|
||||
@@ -754,7 +727,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"urlDesc": MessageLookupByLibrary.simpleMessage(
|
||||
"Получить профиль через URL",
|
||||
),
|
||||
"urlTip": m9,
|
||||
"urlTip": m8,
|
||||
"useHosts": MessageLookupByLibrary.simpleMessage("Использовать hosts"),
|
||||
"useSystemHosts": MessageLookupByLibrary.simpleMessage(
|
||||
"Использовать системные hosts",
|
||||
|
||||
@@ -24,21 +24,19 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
|
||||
static String m1(label) => "确定删除当前${label}吗?";
|
||||
|
||||
static String m2(label) => "${label}详情";
|
||||
static String m2(label) => "${label}不能为空";
|
||||
|
||||
static String m3(label) => "${label}不能为空";
|
||||
static String m3(label) => "${label}当前已存在";
|
||||
|
||||
static String m4(label) => "${label}当前已存在";
|
||||
static String m4(label) => "暂无${label}";
|
||||
|
||||
static String m5(label) => "暂无${label}";
|
||||
static String m5(label) => "${label}必须为数字";
|
||||
|
||||
static String m6(label) => "${label}必须为数字";
|
||||
static String m6(label) => "${label} 必须在 1024 到 49151 之间";
|
||||
|
||||
static String m7(label) => "${label} 必须在 1024 到 49151 之间";
|
||||
static String m7(count) => "已选择 ${count} 项";
|
||||
|
||||
static String m8(count) => "已选择 ${count} 项";
|
||||
|
||||
static String m9(label) => "${label}必须为URL";
|
||||
static String m8(label) => "${label}必须为URL";
|
||||
|
||||
final messages = _notInlinedMessages(_notInlinedMessages);
|
||||
static Map<String, Function> _notInlinedMessages(_) => <String, Function>{
|
||||
@@ -89,7 +87,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"autoLaunchDesc": MessageLookupByLibrary.simpleMessage("跟随系统自启动"),
|
||||
"autoRun": MessageLookupByLibrary.simpleMessage("自动运行"),
|
||||
"autoRunDesc": MessageLookupByLibrary.simpleMessage("应用打开时自动运行"),
|
||||
"autoSetSystemDns": MessageLookupByLibrary.simpleMessage("自动设置系统DNS"),
|
||||
"autoUpdate": MessageLookupByLibrary.simpleMessage("自动更新"),
|
||||
"autoUpdateInterval": MessageLookupByLibrary.simpleMessage("自动更新间隔(分钟)"),
|
||||
"backup": MessageLookupByLibrary.simpleMessage("备份"),
|
||||
@@ -123,7 +120,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"开启将失去部分应用能力,获得全量的Clash的支持",
|
||||
),
|
||||
"confirm": MessageLookupByLibrary.simpleMessage("确定"),
|
||||
"connection": MessageLookupByLibrary.simpleMessage("连接"),
|
||||
"connections": MessageLookupByLibrary.simpleMessage("连接"),
|
||||
"connectionsDesc": MessageLookupByLibrary.simpleMessage("查看当前连接数据"),
|
||||
"connectivity": MessageLookupByLibrary.simpleMessage("连通性:"),
|
||||
@@ -139,7 +135,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"country": MessageLookupByLibrary.simpleMessage("区域"),
|
||||
"crashTest": MessageLookupByLibrary.simpleMessage("崩溃测试"),
|
||||
"create": MessageLookupByLibrary.simpleMessage("创建"),
|
||||
"creationTime": MessageLookupByLibrary.simpleMessage("创建时间"),
|
||||
"cut": MessageLookupByLibrary.simpleMessage("剪切"),
|
||||
"dark": MessageLookupByLibrary.simpleMessage("深色"),
|
||||
"dashboard": MessageLookupByLibrary.simpleMessage("仪表盘"),
|
||||
@@ -156,10 +151,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"desc": MessageLookupByLibrary.simpleMessage(
|
||||
"基于ClashMeta的多平台代理客户端,简单易用,开源无广告。",
|
||||
),
|
||||
"destination": MessageLookupByLibrary.simpleMessage("目标地址"),
|
||||
"destinationGeoIP": MessageLookupByLibrary.simpleMessage("目标地理定位"),
|
||||
"destinationIPASN": MessageLookupByLibrary.simpleMessage("目标IP ASN"),
|
||||
"details": m2,
|
||||
"detectionTip": MessageLookupByLibrary.simpleMessage("依赖第三方api,仅供参考"),
|
||||
"developerMode": MessageLookupByLibrary.simpleMessage("开发者模式"),
|
||||
"developerModeEnableTip": MessageLookupByLibrary.simpleMessage("开发者模式已启用。"),
|
||||
@@ -176,13 +167,13 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"domain": MessageLookupByLibrary.simpleMessage("域名"),
|
||||
"download": MessageLookupByLibrary.simpleMessage("下载"),
|
||||
"edit": MessageLookupByLibrary.simpleMessage("编辑"),
|
||||
"emptyTip": m3,
|
||||
"emptyTip": m2,
|
||||
"en": MessageLookupByLibrary.simpleMessage("英语"),
|
||||
"enableOverride": MessageLookupByLibrary.simpleMessage("启用覆写"),
|
||||
"entries": MessageLookupByLibrary.simpleMessage("个条目"),
|
||||
"exclude": MessageLookupByLibrary.simpleMessage("从最近任务中隐藏"),
|
||||
"excludeDesc": MessageLookupByLibrary.simpleMessage("应用在后台时,从最近任务中隐藏应用"),
|
||||
"existsTip": m4,
|
||||
"existsTip": m3,
|
||||
"exit": MessageLookupByLibrary.simpleMessage("退出"),
|
||||
"expand": MessageLookupByLibrary.simpleMessage("标准"),
|
||||
"expirationTime": MessageLookupByLibrary.simpleMessage("到期时间"),
|
||||
@@ -222,7 +213,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"go": MessageLookupByLibrary.simpleMessage("前往"),
|
||||
"goDownload": MessageLookupByLibrary.simpleMessage("前往下载"),
|
||||
"hasCacheChange": MessageLookupByLibrary.simpleMessage("是否缓存修改"),
|
||||
"host": MessageLookupByLibrary.simpleMessage("主机"),
|
||||
"hostsDesc": MessageLookupByLibrary.simpleMessage("追加Hosts"),
|
||||
"hotkeyConflict": MessageLookupByLibrary.simpleMessage("快捷键冲突"),
|
||||
"hotkeyManagement": MessageLookupByLibrary.simpleMessage("快捷键管理"),
|
||||
@@ -231,10 +221,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"icon": MessageLookupByLibrary.simpleMessage("图片"),
|
||||
"iconConfiguration": MessageLookupByLibrary.simpleMessage("图片配置"),
|
||||
"iconStyle": MessageLookupByLibrary.simpleMessage("图标样式"),
|
||||
"import": MessageLookupByLibrary.simpleMessage("导入"),
|
||||
"importFile": MessageLookupByLibrary.simpleMessage("通过文件导入"),
|
||||
"importFromURL": MessageLookupByLibrary.simpleMessage("从URL导入"),
|
||||
"importUrl": MessageLookupByLibrary.simpleMessage("通过URL导入"),
|
||||
"infiniteTime": MessageLookupByLibrary.simpleMessage("长期有效"),
|
||||
"init": MessageLookupByLibrary.simpleMessage("初始化"),
|
||||
"inputCorrectHotkey": MessageLookupByLibrary.simpleMessage("请输入正确的快捷键"),
|
||||
@@ -257,7 +244,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"local": MessageLookupByLibrary.simpleMessage("本地"),
|
||||
"localBackupDesc": MessageLookupByLibrary.simpleMessage("备份数据到本地"),
|
||||
"localRecoveryDesc": MessageLookupByLibrary.simpleMessage("通过文件恢复数据"),
|
||||
"log": MessageLookupByLibrary.simpleMessage("日志"),
|
||||
"logLevel": MessageLookupByLibrary.simpleMessage("日志等级"),
|
||||
"logcat": MessageLookupByLibrary.simpleMessage("日志捕获"),
|
||||
"logcatDesc": MessageLookupByLibrary.simpleMessage("禁用将会隐藏日志入口"),
|
||||
@@ -289,7 +275,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"networkDesc": MessageLookupByLibrary.simpleMessage("修改网络相关设置"),
|
||||
"networkDetection": MessageLookupByLibrary.simpleMessage("网络检测"),
|
||||
"networkSpeed": MessageLookupByLibrary.simpleMessage("网络速度"),
|
||||
"networkType": MessageLookupByLibrary.simpleMessage("网络类型"),
|
||||
"neutralScheme": MessageLookupByLibrary.simpleMessage("中性"),
|
||||
"noData": MessageLookupByLibrary.simpleMessage("暂无数据"),
|
||||
"noHotKey": MessageLookupByLibrary.simpleMessage("暂无快捷键"),
|
||||
@@ -304,8 +289,8 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"none": MessageLookupByLibrary.simpleMessage("无"),
|
||||
"notSelectedTip": MessageLookupByLibrary.simpleMessage("当前代理组无法选中"),
|
||||
"nullProfileDesc": MessageLookupByLibrary.simpleMessage("没有配置文件,请先添加配置文件"),
|
||||
"nullTip": m5,
|
||||
"numberTip": m6,
|
||||
"nullTip": m4,
|
||||
"numberTip": m5,
|
||||
"oneColumn": MessageLookupByLibrary.simpleMessage("一列"),
|
||||
"onlyIcon": MessageLookupByLibrary.simpleMessage("仅图标"),
|
||||
"onlyOtherApps": MessageLookupByLibrary.simpleMessage("仅第三方应用"),
|
||||
@@ -337,7 +322,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"port": MessageLookupByLibrary.simpleMessage("端口"),
|
||||
"portConflictTip": MessageLookupByLibrary.simpleMessage("请输入不同的端口"),
|
||||
"portTip": m7,
|
||||
"portTip": m6,
|
||||
"preferH3Desc": MessageLookupByLibrary.simpleMessage("优先使用DOH的http/3"),
|
||||
"pressKeyboard": MessageLookupByLibrary.simpleMessage("请按下按键"),
|
||||
"preview": MessageLookupByLibrary.simpleMessage("预览"),
|
||||
@@ -361,12 +346,10 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
),
|
||||
"profiles": MessageLookupByLibrary.simpleMessage("配置"),
|
||||
"profilesSort": MessageLookupByLibrary.simpleMessage("配置排序"),
|
||||
"progress": MessageLookupByLibrary.simpleMessage("进度"),
|
||||
"project": MessageLookupByLibrary.simpleMessage("项目"),
|
||||
"providers": MessageLookupByLibrary.simpleMessage("提供者"),
|
||||
"proxies": MessageLookupByLibrary.simpleMessage("代理"),
|
||||
"proxiesSetting": MessageLookupByLibrary.simpleMessage("代理设置"),
|
||||
"proxyChains": MessageLookupByLibrary.simpleMessage("代理链"),
|
||||
"proxyGroup": MessageLookupByLibrary.simpleMessage("代理组"),
|
||||
"proxyNameserver": MessageLookupByLibrary.simpleMessage("代理域名服务器"),
|
||||
"proxyNameserverDesc": MessageLookupByLibrary.simpleMessage("用于解析代理节点的域名"),
|
||||
@@ -389,11 +372,9 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"regExp": MessageLookupByLibrary.simpleMessage("正则"),
|
||||
"remote": MessageLookupByLibrary.simpleMessage("远程"),
|
||||
"remoteBackupDesc": MessageLookupByLibrary.simpleMessage("备份数据到WebDAV"),
|
||||
"remoteDestination": MessageLookupByLibrary.simpleMessage("远程目标"),
|
||||
"remoteRecoveryDesc": MessageLookupByLibrary.simpleMessage("通过WebDAV恢复数据"),
|
||||
"remove": MessageLookupByLibrary.simpleMessage("移除"),
|
||||
"rename": MessageLookupByLibrary.simpleMessage("重命名"),
|
||||
"request": MessageLookupByLibrary.simpleMessage("请求"),
|
||||
"requests": MessageLookupByLibrary.simpleMessage("请求"),
|
||||
"requestsDesc": MessageLookupByLibrary.simpleMessage("查看最近请求记录"),
|
||||
"reset": MessageLookupByLibrary.simpleMessage("重置"),
|
||||
@@ -422,7 +403,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"seconds": MessageLookupByLibrary.simpleMessage("秒"),
|
||||
"selectAll": MessageLookupByLibrary.simpleMessage("全选"),
|
||||
"selected": MessageLookupByLibrary.simpleMessage("已选择"),
|
||||
"selectedCountTitle": m8,
|
||||
"selectedCountTitle": m7,
|
||||
"settings": MessageLookupByLibrary.simpleMessage("设置"),
|
||||
"show": MessageLookupByLibrary.simpleMessage("显示"),
|
||||
"shrink": MessageLookupByLibrary.simpleMessage("紧凑"),
|
||||
@@ -433,8 +414,6 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"sort": MessageLookupByLibrary.simpleMessage("排序"),
|
||||
"source": MessageLookupByLibrary.simpleMessage("来源"),
|
||||
"sourceIp": MessageLookupByLibrary.simpleMessage("源IP"),
|
||||
"specialProxy": MessageLookupByLibrary.simpleMessage("特殊代理"),
|
||||
"specialRules": MessageLookupByLibrary.simpleMessage("特殊规则"),
|
||||
"stackMode": MessageLookupByLibrary.simpleMessage("栈模式"),
|
||||
"standard": MessageLookupByLibrary.simpleMessage("标准"),
|
||||
"start": MessageLookupByLibrary.simpleMessage("启动"),
|
||||
@@ -487,7 +466,7 @@ class MessageLookup extends MessageLookupByLibrary {
|
||||
"upload": MessageLookupByLibrary.simpleMessage("上传"),
|
||||
"url": MessageLookupByLibrary.simpleMessage("URL"),
|
||||
"urlDesc": MessageLookupByLibrary.simpleMessage("通过URL获取配置文件"),
|
||||
"urlTip": m9,
|
||||
"urlTip": m8,
|
||||
"useHosts": MessageLookupByLibrary.simpleMessage("使用Hosts"),
|
||||
"useSystemHosts": MessageLookupByLibrary.simpleMessage("使用系统Hosts"),
|
||||
"value": MessageLookupByLibrary.simpleMessage("值"),
|
||||
|
||||
@@ -3104,161 +3104,6 @@ class AppLocalizations {
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Import`
|
||||
String get import {
|
||||
return Intl.message('Import', name: 'import', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Import from file`
|
||||
String get importFile {
|
||||
return Intl.message(
|
||||
'Import from file',
|
||||
name: 'importFile',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Import from URL`
|
||||
String get importUrl {
|
||||
return Intl.message(
|
||||
'Import from URL',
|
||||
name: 'importUrl',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Auto set system DNS`
|
||||
String get autoSetSystemDns {
|
||||
return Intl.message(
|
||||
'Auto set system DNS',
|
||||
name: 'autoSetSystemDns',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `{label} details`
|
||||
String details(Object label) {
|
||||
return Intl.message(
|
||||
'$label details',
|
||||
name: 'details',
|
||||
desc: '',
|
||||
args: [label],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Creation time`
|
||||
String get creationTime {
|
||||
return Intl.message(
|
||||
'Creation time',
|
||||
name: 'creationTime',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Progress`
|
||||
String get progress {
|
||||
return Intl.message('Progress', name: 'progress', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Host`
|
||||
String get host {
|
||||
return Intl.message('Host', name: 'host', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Destination`
|
||||
String get destination {
|
||||
return Intl.message('Destination', name: 'destination', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Destination GeoIP`
|
||||
String get destinationGeoIP {
|
||||
return Intl.message(
|
||||
'Destination GeoIP',
|
||||
name: 'destinationGeoIP',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Destination IPASN`
|
||||
String get destinationIPASN {
|
||||
return Intl.message(
|
||||
'Destination IPASN',
|
||||
name: 'destinationIPASN',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Special proxy`
|
||||
String get specialProxy {
|
||||
return Intl.message(
|
||||
'Special proxy',
|
||||
name: 'specialProxy',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `special rules`
|
||||
String get specialRules {
|
||||
return Intl.message(
|
||||
'special rules',
|
||||
name: 'specialRules',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Remote destination`
|
||||
String get remoteDestination {
|
||||
return Intl.message(
|
||||
'Remote destination',
|
||||
name: 'remoteDestination',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Network type`
|
||||
String get networkType {
|
||||
return Intl.message(
|
||||
'Network type',
|
||||
name: 'networkType',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Proxy chains`
|
||||
String get proxyChains {
|
||||
return Intl.message(
|
||||
'Proxy chains',
|
||||
name: 'proxyChains',
|
||||
desc: '',
|
||||
args: [],
|
||||
);
|
||||
}
|
||||
|
||||
/// `Log`
|
||||
String get log {
|
||||
return Intl.message('Log', name: 'log', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Connection`
|
||||
String get connection {
|
||||
return Intl.message('Connection', name: 'connection', desc: '', args: []);
|
||||
}
|
||||
|
||||
/// `Request`
|
||||
String get request {
|
||||
return Intl.message('Request', name: 'request', desc: '', args: []);
|
||||
}
|
||||
}
|
||||
|
||||
class AppLocalizationDelegate extends LocalizationsDelegate<AppLocalizations> {
|
||||
|
||||
@@ -36,7 +36,7 @@ Future<void> main() async {
|
||||
Future<void> _service(List<String> flags) async {
|
||||
globalState.isService = true;
|
||||
WidgetsFlutterBinding.ensureInitialized();
|
||||
final quickStart = flags.contains('quick');
|
||||
final quickStart = flags.contains("quick");
|
||||
final clashLibHandler = ClashLibHandler();
|
||||
await globalState.init();
|
||||
|
||||
@@ -54,8 +54,8 @@ Future<void> _service(List<String> flags) async {
|
||||
vpn?.handleGetStartForegroundParams = () {
|
||||
final traffic = clashLibHandler.getTraffic();
|
||||
return json.encode({
|
||||
'title': clashLibHandler.getCurrentProfileName(),
|
||||
'content': '$traffic'
|
||||
"title": clashLibHandler.getCurrentProfileName(),
|
||||
"content": "$traffic"
|
||||
});
|
||||
};
|
||||
|
||||
@@ -69,7 +69,7 @@ Future<void> _service(List<String> flags) async {
|
||||
if (!quickStart) {
|
||||
_handleMainIpc(clashLibHandler);
|
||||
} else {
|
||||
commonPrint.log('quick start');
|
||||
commonPrint.log("quick start");
|
||||
await ClashCore.initGeo();
|
||||
app?.tip(appLocalizations.startVpn);
|
||||
final homeDirPath = await appPath.homeDirPath;
|
||||
@@ -106,7 +106,7 @@ Future<void> _service(List<String> flags) async {
|
||||
}
|
||||
}
|
||||
|
||||
void _handleMainIpc(ClashLibHandler clashLibHandler) {
|
||||
_handleMainIpc(ClashLibHandler clashLibHandler) {
|
||||
final sendPort = IsolateNameServer.lookupPortByName(mainIsolate);
|
||||
if (sendPort == null) {
|
||||
return;
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:fl_clash/plugins/app.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/providers/config.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class AndroidManager extends ConsumerStatefulWidget {
|
||||
@@ -19,10 +20,14 @@ class _AndroidContainerState extends ConsumerState<AndroidManager> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
ref.listenManual(appSettingProvider.select((state) => state.hidden),
|
||||
(prev, next) {
|
||||
app?.updateExcludeFromRecents(next);
|
||||
}, fireImmediately: true);
|
||||
SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge);
|
||||
ref.listenManual(
|
||||
appSettingProvider.select((state) => state.hidden),
|
||||
(prev, next) {
|
||||
app?.updateExcludeFromRecents(next);
|
||||
},
|
||||
fireImmediately: true
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -1,286 +0,0 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/manager/window_manager.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_acrylic/widgets/transparent_macos_sidebar.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
class AppStateManager extends ConsumerStatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
const AppStateManager({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<AppStateManager> createState() => _AppStateManagerState();
|
||||
}
|
||||
|
||||
class _AppStateManagerState extends ConsumerState<AppStateManager>
|
||||
with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
ref.listenManual(layoutChangeProvider, (prev, next) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (prev != next) {
|
||||
globalState.computeHeightMapCache = {};
|
||||
}
|
||||
});
|
||||
});
|
||||
ref.listenManual(
|
||||
checkIpProvider,
|
||||
(prev, next) {
|
||||
if (prev != next && next.b) {
|
||||
detectionState.startCheck();
|
||||
}
|
||||
},
|
||||
fireImmediately: true,
|
||||
);
|
||||
ref.listenManual(configStateProvider, (prev, next) {
|
||||
if (prev != next) {
|
||||
globalState.appController.savePreferencesDebounce();
|
||||
}
|
||||
});
|
||||
if (window == null) {
|
||||
return;
|
||||
}
|
||||
ref.listenManual(
|
||||
autoSetSystemDnsStateProvider,
|
||||
(prev, next) async {
|
||||
if (prev == next) {
|
||||
return;
|
||||
}
|
||||
if (next.a == true && next.b == true) {
|
||||
macOS?.updateDns(false);
|
||||
} else {
|
||||
macOS?.updateDns(true);
|
||||
}
|
||||
},
|
||||
);
|
||||
ref.listenManual(
|
||||
currentBrightnessProvider,
|
||||
(prev, next) {
|
||||
if (prev == next) {
|
||||
return;
|
||||
}
|
||||
window?.updateMacOSBrightness(next);
|
||||
},
|
||||
fireImmediately: true,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||
commonPrint.log('$state');
|
||||
if (state == AppLifecycleState.paused ||
|
||||
state == AppLifecycleState.inactive) {
|
||||
globalState.appController.savePreferences();
|
||||
} else {
|
||||
render?.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangePlatformBrightness() {
|
||||
globalState.appController.updateBrightness();
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Listener(
|
||||
onPointerHover: (_) {
|
||||
render?.resume();
|
||||
},
|
||||
child: widget.child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppEnvManager extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const AppEnvManager({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (kDebugMode) {
|
||||
if (globalState.isPre) {
|
||||
return Banner(
|
||||
message: 'DEBUG',
|
||||
location: BannerLocation.topEnd,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (globalState.isPre) {
|
||||
return Banner(
|
||||
message: 'PRE',
|
||||
location: BannerLocation.topEnd,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
||||
class AppSidebarContainer extends ConsumerWidget {
|
||||
final Widget child;
|
||||
|
||||
const AppSidebarContainer({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
Widget _buildLoading() {
|
||||
return Consumer(
|
||||
builder: (_, ref, __) {
|
||||
final loading = ref.watch(loadingProvider);
|
||||
final isMobileView = ref.watch(isMobileViewProvider);
|
||||
return loading && !isMobileView
|
||||
? RotatedBox(
|
||||
quarterTurns: 1,
|
||||
child: const LinearProgressIndicator(),
|
||||
)
|
||||
: Container();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBackground({
|
||||
required BuildContext context,
|
||||
required Widget child,
|
||||
}) {
|
||||
if (!system.isMacOS) {
|
||||
return Material(
|
||||
color: context.colorScheme.surfaceContainer,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
return TransparentMacOSSidebar(
|
||||
child: Material(
|
||||
color: Colors.transparent,
|
||||
child: child,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final navigationState = ref.watch(navigationStateProvider);
|
||||
final navigationItems = navigationState.navigationItems;
|
||||
final isMobileView = navigationState.viewMode == ViewMode.mobile;
|
||||
if (isMobileView) {
|
||||
return child;
|
||||
}
|
||||
final currentIndex = navigationState.currentIndex;
|
||||
final showLabel = ref.watch(appSettingProvider).showLabel;
|
||||
return Row(
|
||||
children: [
|
||||
Stack(
|
||||
alignment: Alignment.topRight,
|
||||
children: [
|
||||
_buildBackground(
|
||||
context: context,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
height: 32,
|
||||
),
|
||||
if (!system.isMacOS) ...[
|
||||
AppIcon(),
|
||||
SizedBox(
|
||||
height: 12,
|
||||
),
|
||||
],
|
||||
Expanded(
|
||||
child: ScrollConfiguration(
|
||||
behavior: HiddenBarScrollBehavior(),
|
||||
child: SingleChildScrollView(
|
||||
child: IntrinsicHeight(
|
||||
child: NavigationRail(
|
||||
backgroundColor: Colors.transparent,
|
||||
selectedLabelTextStyle:
|
||||
context.textTheme.labelLarge!.copyWith(
|
||||
color: context.colorScheme.onSurface,
|
||||
),
|
||||
unselectedLabelTextStyle:
|
||||
context.textTheme.labelLarge!.copyWith(
|
||||
color: context.colorScheme.onSurface,
|
||||
),
|
||||
destinations: navigationItems
|
||||
.map(
|
||||
(e) => NavigationRailDestination(
|
||||
icon: e.icon,
|
||||
label: Text(
|
||||
Intl.message(e.label.name),
|
||||
),
|
||||
),
|
||||
)
|
||||
.toList(),
|
||||
onDestinationSelected: (index) {
|
||||
globalState.appController
|
||||
.toPage(navigationItems[index].label);
|
||||
},
|
||||
extended: false,
|
||||
selectedIndex: currentIndex,
|
||||
labelType: showLabel
|
||||
? NavigationRailLabelType.all
|
||||
: NavigationRailLabelType.none,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
ref.read(appSettingProvider.notifier).updateState(
|
||||
(state) => state.copyWith(
|
||||
showLabel: !state.showLabel,
|
||||
),
|
||||
);
|
||||
},
|
||||
icon: Icon(
|
||||
Icons.menu,
|
||||
color: context.colorScheme.onSurfaceVariant,
|
||||
),
|
||||
),
|
||||
const SizedBox(
|
||||
height: 16,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
_buildLoading(),
|
||||
],
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: ClipRect(
|
||||
child: child,
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
109
lib/manager/app_state_manager.dart
Normal file
109
lib/manager/app_state_manager.dart
Normal file
@@ -0,0 +1,109 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
class AppStateManager extends ConsumerStatefulWidget {
|
||||
final Widget child;
|
||||
|
||||
const AppStateManager({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
@override
|
||||
ConsumerState<AppStateManager> createState() => _AppStateManagerState();
|
||||
}
|
||||
|
||||
class _AppStateManagerState extends ConsumerState<AppStateManager>
|
||||
with WidgetsBindingObserver {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
WidgetsBinding.instance.addObserver(this);
|
||||
ref.listenManual(layoutChangeProvider, (prev, next) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
if (prev != next) {
|
||||
globalState.cacheHeightMap = {};
|
||||
}
|
||||
});
|
||||
});
|
||||
ref.listenManual(
|
||||
checkIpProvider,
|
||||
(prev, next) {
|
||||
if (prev != next && next.b) {
|
||||
detectionState.startCheck();
|
||||
}
|
||||
},
|
||||
fireImmediately: true,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
WidgetsBinding.instance.removeObserver(this);
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> didChangeAppLifecycleState(AppLifecycleState state) async {
|
||||
commonPrint.log("$state");
|
||||
if (state == AppLifecycleState.paused ||
|
||||
state == AppLifecycleState.inactive) {
|
||||
globalState.appController.savePreferences();
|
||||
} else {
|
||||
render?.resume();
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void didChangePlatformBrightness() {
|
||||
globalState.appController.updateBrightness(
|
||||
WidgetsBinding.instance.platformDispatcher.platformBrightness,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Listener(
|
||||
onPointerHover: (_) {
|
||||
render?.resume();
|
||||
},
|
||||
child: widget.child,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class AppEnvManager extends StatelessWidget {
|
||||
final Widget child;
|
||||
|
||||
const AppEnvManager({
|
||||
super.key,
|
||||
required this.child,
|
||||
});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (kDebugMode) {
|
||||
if (globalState.isPre) {
|
||||
return Banner(
|
||||
message: 'DEBUG',
|
||||
location: BannerLocation.topEnd,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
}
|
||||
if (globalState.isPre) {
|
||||
return Banner(
|
||||
message: 'PRE',
|
||||
location: BannerLocation.topEnd,
|
||||
child: child,
|
||||
);
|
||||
}
|
||||
return child;
|
||||
}
|
||||
}
|
||||
@@ -57,6 +57,7 @@ class _ClashContainerState extends ConsumerState<ClashManager>
|
||||
clashCore.stopLog();
|
||||
}
|
||||
},
|
||||
fireImmediately: true,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -74,7 +75,7 @@ class _ClashContainerState extends ConsumerState<ClashManager>
|
||||
debouncer.call(
|
||||
FunctionTag.updateDelay,
|
||||
() async {
|
||||
appController.updateGroupsDebounce();
|
||||
await appController.updateGroupsDebounce();
|
||||
},
|
||||
duration: const Duration(milliseconds: 5000),
|
||||
);
|
||||
@@ -90,9 +91,9 @@ class _ClashContainerState extends ConsumerState<ClashManager>
|
||||
}
|
||||
|
||||
@override
|
||||
void onRequest(TrackerInfo trackerInfo) async {
|
||||
ref.read(requestsProvider.notifier).addRequest(trackerInfo);
|
||||
super.onRequest(trackerInfo);
|
||||
void onRequest(Connection connection) async {
|
||||
ref.read(requestsProvider.notifier).addRequest(connection);
|
||||
super.onRequest(connection);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -102,7 +103,7 @@ class _ClashContainerState extends ConsumerState<ClashManager>
|
||||
providerName,
|
||||
),
|
||||
);
|
||||
globalState.appController.updateGroupsDebounce();
|
||||
await globalState.appController.updateGroupsDebounce();
|
||||
super.onLoaded(providerName);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class _HotKeyManagerState extends ConsumerState<HotKeyManager> {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _handleHotKeyAction(HotAction action) async {
|
||||
_handleHotKeyAction(HotAction action) async {
|
||||
switch (action) {
|
||||
case HotAction.mode:
|
||||
globalState.appController.updateMode();
|
||||
@@ -50,7 +50,7 @@ class _HotKeyManagerState extends ConsumerState<HotKeyManager> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _updateHotKeys({
|
||||
_updateHotKeys({
|
||||
required List<HotKeyAction> hotKeyActions,
|
||||
}) async {
|
||||
await hotKeyManager.unregisterAll();
|
||||
@@ -78,7 +78,7 @@ class _HotKeyManagerState extends ConsumerState<HotKeyManager> {
|
||||
await Future.wait(hotkeyActionHandles);
|
||||
}
|
||||
|
||||
Shortcuts _buildShortcuts(Widget child) {
|
||||
_buildShortcuts(Widget child) {
|
||||
return Shortcuts(
|
||||
shortcuts: {
|
||||
utils.controlSingleActivator(LogicalKeyboardKey.keyW):
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
export 'tray_manager.dart';
|
||||
export 'window_manager.dart';
|
||||
export 'android_manager.dart';
|
||||
export 'app_manager.dart';
|
||||
export 'clash_manager.dart';
|
||||
export 'tile_manager.dart';
|
||||
export 'app_state_manager.dart';
|
||||
export 'vpn_manager.dart';
|
||||
export 'proxy_manager.dart';
|
||||
export 'connectivity_manager.dart';
|
||||
export 'message_manager.dart';
|
||||
export 'proxy_manager.dart';
|
||||
export 'theme_manager.dart';
|
||||
export 'tile_manager.dart';
|
||||
export 'tray_manager.dart';
|
||||
export 'vpn_manager.dart';
|
||||
export 'window_manager.dart';
|
||||
export 'theme_manager.dart';
|
||||
@@ -44,7 +44,7 @@ class MessageManagerState extends State<MessageManager> {
|
||||
await _showMessage();
|
||||
}
|
||||
|
||||
Future<void> _showMessage() async {
|
||||
_showMessage() async {
|
||||
if (_pushing == true) {
|
||||
return;
|
||||
}
|
||||
@@ -65,7 +65,7 @@ class MessageManagerState extends State<MessageManager> {
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> _handleRemove(CommonMessage commonMessage) async {
|
||||
_handleRemove(CommonMessage commonMessage) async {
|
||||
_messagesNotifier.value = List<CommonMessage>.from(_messagesNotifier.value)
|
||||
..remove(commonMessage);
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class ProxyManager extends ConsumerStatefulWidget {
|
||||
}
|
||||
|
||||
class _ProxyManagerState extends ConsumerState<ProxyManager> {
|
||||
Future<void> _updateProxy(ProxyState proxyState) async {
|
||||
_updateProxy(ProxyState proxyState) async {
|
||||
final isStart = proxyState.isStart;
|
||||
final systemProxy = proxyState.systemProxy;
|
||||
final port = proxyState.port;
|
||||
|
||||
@@ -1,15 +1,12 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/common/constant.dart';
|
||||
import 'package:fl_clash/common/measure.dart';
|
||||
import 'package:fl_clash/common/theme.dart';
|
||||
import 'package:fl_clash/providers/config.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
|
||||
import '../providers/state.dart';
|
||||
|
||||
class ThemeManager extends ConsumerWidget {
|
||||
final Widget child;
|
||||
|
||||
@@ -18,54 +15,6 @@ class ThemeManager extends ConsumerWidget {
|
||||
required this.child,
|
||||
});
|
||||
|
||||
Widget _buildSystemUi(Widget child) {
|
||||
if (!system.isAndroid) {
|
||||
return child;
|
||||
}
|
||||
return AnnotatedRegion<SystemUiMode>(
|
||||
sized: false,
|
||||
value: SystemUiMode.edgeToEdge,
|
||||
child: Consumer(
|
||||
builder: (context, ref, _) {
|
||||
final brightness = ref.watch(currentBrightnessProvider);
|
||||
final iconBrightness = brightness == Brightness.light
|
||||
? Brightness.dark
|
||||
: Brightness.light;
|
||||
globalState.appState = globalState.appState.copyWith(
|
||||
systemUiOverlayStyle: SystemUiOverlayStyle(
|
||||
statusBarColor: Colors.transparent,
|
||||
statusBarIconBrightness: iconBrightness,
|
||||
systemNavigationBarIconBrightness: iconBrightness,
|
||||
systemNavigationBarColor: context.colorScheme.surface,
|
||||
systemNavigationBarDividerColor: Colors.transparent,
|
||||
),
|
||||
);
|
||||
return AnnotatedRegion<SystemUiOverlayStyle>(
|
||||
value: globalState.appState.systemUiOverlayStyle,
|
||||
sized: false,
|
||||
child: child,
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
// _buildScrollbar(Widget child) {
|
||||
// return Consumer(
|
||||
// builder: (_, ref, child) {
|
||||
// final isMobileView = ref.read(isMobileViewProvider);
|
||||
// if (isMobileView) {
|
||||
// return ScrollConfiguration(
|
||||
// behavior: HiddenBarScrollBehavior(),
|
||||
// child: child!,
|
||||
// );
|
||||
// }
|
||||
// return child!;
|
||||
// },
|
||||
// child: child,
|
||||
// );
|
||||
// }
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, ref) {
|
||||
final textScale = ref.read(
|
||||
@@ -100,7 +49,7 @@ class ThemeManager extends ConsumerWidget {
|
||||
container.maxHeight,
|
||||
),
|
||||
);
|
||||
return _buildSystemUi(child);
|
||||
return child;
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
@@ -39,7 +39,7 @@ class _TrayContainerState extends ConsumerState<TrayManager> with TrayListener {
|
||||
|
||||
@override
|
||||
void onTrayIconRightMouseDown() {
|
||||
trayManager.popUpContextMenu(bringAppToFront: true);
|
||||
trayManager.popUpContextMenu();
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -27,7 +27,7 @@ class _VpnContainerState extends ConsumerState<VpnManager> {
|
||||
});
|
||||
}
|
||||
|
||||
void showTip() {
|
||||
showTip() {
|
||||
debouncer.call(
|
||||
FunctionTag.vpnTip,
|
||||
() {
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:fl_clash/providers/providers.dart';
|
||||
import 'package:fl_clash/providers/app.dart';
|
||||
import 'package:fl_clash/providers/config.dart';
|
||||
import 'package:fl_clash/state.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||
@@ -57,7 +59,7 @@ class _WindowContainerState extends ConsumerState<WindowManager>
|
||||
@override
|
||||
void onWindowFocus() {
|
||||
super.onWindowFocus();
|
||||
commonPrint.log('focus');
|
||||
commonPrint.log("focus");
|
||||
render?.resume();
|
||||
}
|
||||
|
||||
@@ -94,16 +96,15 @@ class _WindowContainerState extends ConsumerState<WindowManager>
|
||||
@override
|
||||
void onWindowMinimize() async {
|
||||
globalState.appController.savePreferencesDebounce();
|
||||
commonPrint.log('minimize');
|
||||
commonPrint.log("minimize");
|
||||
render?.pause();
|
||||
super.onWindowMinimize();
|
||||
}
|
||||
|
||||
@override
|
||||
void onWindowRestore() {
|
||||
commonPrint.log('restore');
|
||||
render?.resume();
|
||||
super.onWindowRestore();
|
||||
Future<void> onTaskbarCreated() async {
|
||||
// globalState.appController.updateTray(true);
|
||||
super.onTaskbarCreated();
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -126,9 +127,8 @@ class WindowHeaderContainer extends StatelessWidget {
|
||||
Widget build(BuildContext context) {
|
||||
return Consumer(
|
||||
builder: (_, ref, child) {
|
||||
final isMobileView = ref.watch(isMobileViewProvider);
|
||||
final version = ref.watch(versionProvider);
|
||||
if ((version <= 10 || !isMobileView) && system.isMacOS) {
|
||||
if (version <= 10 && Platform.isMacOS) {
|
||||
return child!;
|
||||
}
|
||||
return Stack(
|
||||
@@ -170,7 +170,7 @@ class _WindowHeaderState extends State<WindowHeader> {
|
||||
_initNotifier();
|
||||
}
|
||||
|
||||
Future<void> _initNotifier() async {
|
||||
_initNotifier() async {
|
||||
isMaximizedNotifier.value = await windowManager.isMaximized();
|
||||
isPinNotifier.value = await windowManager.isAlwaysOnTop();
|
||||
}
|
||||
@@ -182,7 +182,7 @@ class _WindowHeaderState extends State<WindowHeader> {
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _updateMaximized() async {
|
||||
_updateMaximized() async {
|
||||
final isMaximized = await windowManager.isMaximized();
|
||||
switch (isMaximized) {
|
||||
case true:
|
||||
@@ -195,13 +195,13 @@ class _WindowHeaderState extends State<WindowHeader> {
|
||||
isMaximizedNotifier.value = await windowManager.isMaximized();
|
||||
}
|
||||
|
||||
Future<void> _updatePin() async {
|
||||
_updatePin() async {
|
||||
final isAlwaysOnTop = await windowManager.isAlwaysOnTop();
|
||||
await windowManager.setAlwaysOnTop(!isAlwaysOnTop);
|
||||
isPinNotifier.value = await windowManager.isAlwaysOnTop();
|
||||
}
|
||||
|
||||
Widget _buildActions() {
|
||||
_buildActions() {
|
||||
return Row(
|
||||
children: [
|
||||
IconButton(
|
||||
@@ -279,11 +279,15 @@ class _WindowHeaderState extends State<WindowHeader> {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (system.isMacOS)
|
||||
if (Platform.isMacOS)
|
||||
const Text(
|
||||
appName,
|
||||
)
|
||||
else ...[
|
||||
const Positioned(
|
||||
left: 0,
|
||||
child: AppIcon(),
|
||||
),
|
||||
Positioned(
|
||||
right: 0,
|
||||
child: _buildActions(),
|
||||
@@ -301,18 +305,24 @@ class AppIcon extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
decoration: BoxDecoration(
|
||||
color: context.colorScheme.primaryContainer,
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
),
|
||||
padding: EdgeInsets.all(6),
|
||||
child: SizedBox(
|
||||
width: 28,
|
||||
height: 28,
|
||||
child: CircleAvatar(
|
||||
foregroundImage: AssetImage('assets/images/icon.png'),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
margin: const EdgeInsets.only(left: 8),
|
||||
child: const Row(
|
||||
children: [
|
||||
SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircleAvatar(
|
||||
foregroundImage: AssetImage("assets/images/icon.png"),
|
||||
backgroundColor: Colors.transparent,
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 8,
|
||||
),
|
||||
Text(
|
||||
appName,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import 'package:fl_clash/common/common.dart';
|
||||
import 'package:fl_clash/enum/enum.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
import 'common.dart';
|
||||
@@ -22,18 +22,16 @@ class AppState with _$AppState {
|
||||
@Default({}) DelayMap delayMap,
|
||||
@Default([]) List<Group> groups,
|
||||
@Default(0) int checkIpNum,
|
||||
required Brightness brightness,
|
||||
Brightness? brightness,
|
||||
int? runTime,
|
||||
@Default([]) List<ExternalProvider> providers,
|
||||
String? localIp,
|
||||
required FixedList<TrackerInfo> requests,
|
||||
required FixedList<Connection> requests,
|
||||
required int version,
|
||||
required FixedList<Log> logs,
|
||||
required FixedList<Traffic> traffics,
|
||||
required Traffic totalTraffic,
|
||||
@Default(false) bool realTunEnable,
|
||||
@Default(false) bool loading,
|
||||
required SystemUiOverlayStyle systemUiOverlayStyle,
|
||||
@Default("") String proxiesQuery,
|
||||
}) = _AppState;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,88 +19,88 @@ const defaultMixedPort = 7890;
|
||||
const defaultKeepAliveInterval = 30;
|
||||
|
||||
const defaultBypassPrivateRouteAddress = [
|
||||
'1.0.0.0/8',
|
||||
'2.0.0.0/7',
|
||||
'4.0.0.0/6',
|
||||
'8.0.0.0/7',
|
||||
'11.0.0.0/8',
|
||||
'12.0.0.0/6',
|
||||
'16.0.0.0/4',
|
||||
'32.0.0.0/3',
|
||||
'64.0.0.0/3',
|
||||
'96.0.0.0/4',
|
||||
'112.0.0.0/5',
|
||||
'120.0.0.0/6',
|
||||
'124.0.0.0/7',
|
||||
'126.0.0.0/8',
|
||||
'128.0.0.0/3',
|
||||
'160.0.0.0/5',
|
||||
'168.0.0.0/8',
|
||||
'169.0.0.0/9',
|
||||
'169.128.0.0/10',
|
||||
'169.192.0.0/11',
|
||||
'169.224.0.0/12',
|
||||
'169.240.0.0/13',
|
||||
'169.248.0.0/14',
|
||||
'169.252.0.0/15',
|
||||
'169.255.0.0/16',
|
||||
'170.0.0.0/7',
|
||||
'172.0.0.0/12',
|
||||
'172.32.0.0/11',
|
||||
'172.64.0.0/10',
|
||||
'172.128.0.0/9',
|
||||
'173.0.0.0/8',
|
||||
'174.0.0.0/7',
|
||||
'176.0.0.0/4',
|
||||
'192.0.0.0/9',
|
||||
'192.128.0.0/11',
|
||||
'192.160.0.0/13',
|
||||
'192.169.0.0/16',
|
||||
'192.170.0.0/15',
|
||||
'192.172.0.0/14',
|
||||
'192.176.0.0/12',
|
||||
'192.192.0.0/10',
|
||||
'193.0.0.0/8',
|
||||
'194.0.0.0/7',
|
||||
'196.0.0.0/6',
|
||||
'200.0.0.0/5',
|
||||
'208.0.0.0/4',
|
||||
'240.0.0.0/5',
|
||||
'248.0.0.0/6',
|
||||
'252.0.0.0/7',
|
||||
'254.0.0.0/8',
|
||||
'255.0.0.0/9',
|
||||
'255.128.0.0/10',
|
||||
'255.192.0.0/11',
|
||||
'255.224.0.0/12',
|
||||
'255.240.0.0/13',
|
||||
'255.248.0.0/14',
|
||||
'255.252.0.0/15',
|
||||
'255.254.0.0/16',
|
||||
'255.255.0.0/17',
|
||||
'255.255.128.0/18',
|
||||
'255.255.192.0/19',
|
||||
'255.255.224.0/20',
|
||||
'255.255.240.0/21',
|
||||
'255.255.248.0/22',
|
||||
'255.255.252.0/23',
|
||||
'255.255.254.0/24',
|
||||
'255.255.255.0/25',
|
||||
'255.255.255.128/26',
|
||||
'255.255.255.192/27',
|
||||
'255.255.255.224/28',
|
||||
'255.255.255.240/29',
|
||||
'255.255.255.248/30',
|
||||
'255.255.255.252/31',
|
||||
'255.255.255.254/32',
|
||||
'::/1',
|
||||
'8000::/2',
|
||||
'c000::/3',
|
||||
'e000::/4',
|
||||
'f000::/5',
|
||||
'f800::/6',
|
||||
'fe00::/9',
|
||||
'fec0::/10'
|
||||
"1.0.0.0/8",
|
||||
"2.0.0.0/7",
|
||||
"4.0.0.0/6",
|
||||
"8.0.0.0/7",
|
||||
"11.0.0.0/8",
|
||||
"12.0.0.0/6",
|
||||
"16.0.0.0/4",
|
||||
"32.0.0.0/3",
|
||||
"64.0.0.0/3",
|
||||
"96.0.0.0/4",
|
||||
"112.0.0.0/5",
|
||||
"120.0.0.0/6",
|
||||
"124.0.0.0/7",
|
||||
"126.0.0.0/8",
|
||||
"128.0.0.0/3",
|
||||
"160.0.0.0/5",
|
||||
"168.0.0.0/8",
|
||||
"169.0.0.0/9",
|
||||
"169.128.0.0/10",
|
||||
"169.192.0.0/11",
|
||||
"169.224.0.0/12",
|
||||
"169.240.0.0/13",
|
||||
"169.248.0.0/14",
|
||||
"169.252.0.0/15",
|
||||
"169.255.0.0/16",
|
||||
"170.0.0.0/7",
|
||||
"172.0.0.0/12",
|
||||
"172.32.0.0/11",
|
||||
"172.64.0.0/10",
|
||||
"172.128.0.0/9",
|
||||
"173.0.0.0/8",
|
||||
"174.0.0.0/7",
|
||||
"176.0.0.0/4",
|
||||
"192.0.0.0/9",
|
||||
"192.128.0.0/11",
|
||||
"192.160.0.0/13",
|
||||
"192.169.0.0/16",
|
||||
"192.170.0.0/15",
|
||||
"192.172.0.0/14",
|
||||
"192.176.0.0/12",
|
||||
"192.192.0.0/10",
|
||||
"193.0.0.0/8",
|
||||
"194.0.0.0/7",
|
||||
"196.0.0.0/6",
|
||||
"200.0.0.0/5",
|
||||
"208.0.0.0/4",
|
||||
"240.0.0.0/5",
|
||||
"248.0.0.0/6",
|
||||
"252.0.0.0/7",
|
||||
"254.0.0.0/8",
|
||||
"255.0.0.0/9",
|
||||
"255.128.0.0/10",
|
||||
"255.192.0.0/11",
|
||||
"255.224.0.0/12",
|
||||
"255.240.0.0/13",
|
||||
"255.248.0.0/14",
|
||||
"255.252.0.0/15",
|
||||
"255.254.0.0/16",
|
||||
"255.255.0.0/17",
|
||||
"255.255.128.0/18",
|
||||
"255.255.192.0/19",
|
||||
"255.255.224.0/20",
|
||||
"255.255.240.0/21",
|
||||
"255.255.248.0/22",
|
||||
"255.255.252.0/23",
|
||||
"255.255.254.0/24",
|
||||
"255.255.255.0/25",
|
||||
"255.255.255.128/26",
|
||||
"255.255.255.192/27",
|
||||
"255.255.255.224/28",
|
||||
"255.255.255.240/29",
|
||||
"255.255.255.248/30",
|
||||
"255.255.255.252/31",
|
||||
"255.255.255.254/32",
|
||||
"::/1",
|
||||
"8000::/2",
|
||||
"c000::/3",
|
||||
"e000::/4",
|
||||
"f000::/5",
|
||||
"f800::/6",
|
||||
"fe00::/9",
|
||||
"fec0::/10"
|
||||
];
|
||||
|
||||
@freezed
|
||||
@@ -117,11 +117,11 @@ class ProxyGroup with _$ProxyGroup {
|
||||
bool? lazy,
|
||||
String? url,
|
||||
int? timeout,
|
||||
@JsonKey(name: 'max-failed-times') int? maxFailedTimes,
|
||||
@JsonKey(name: "max-failed-times") int? maxFailedTimes,
|
||||
String? filter,
|
||||
@JsonKey(name: 'expected-filter') String? excludeFilter,
|
||||
@JsonKey(name: 'exclude-type') String? excludeType,
|
||||
@JsonKey(name: 'expected-status') dynamic expectedStatus,
|
||||
@JsonKey(name: "expected-filter") String? excludeFilter,
|
||||
@JsonKey(name: "exclude-type") String? excludeType,
|
||||
@JsonKey(name: "expected-status") dynamic expectedStatus,
|
||||
bool? hidden,
|
||||
String? icon,
|
||||
}) = _ProxyGroup;
|
||||
@@ -144,15 +144,15 @@ class RuleProvider with _$RuleProvider {
|
||||
class Sniffer with _$Sniffer {
|
||||
const factory Sniffer({
|
||||
@Default(false) bool enable,
|
||||
@Default(true) @JsonKey(name: 'override-destination') bool overrideDest,
|
||||
@Default(true) @JsonKey(name: "override-destination") bool overrideDest,
|
||||
@Default([]) List<String> sniffing,
|
||||
@Default([]) @JsonKey(name: 'force-domain') List<String> forceDomain,
|
||||
@Default([]) @JsonKey(name: 'skip-src-address') List<String> skipSrcAddress,
|
||||
@Default([]) @JsonKey(name: 'skip-dst-address') List<String> skipDstAddress,
|
||||
@Default([]) @JsonKey(name: 'skip-domain') List<String> skipDomain,
|
||||
@Default([]) @JsonKey(name: 'port-whitelist') List<String> port,
|
||||
@Default(true) @JsonKey(name: 'force-dns-mapping') bool forceDnsMapping,
|
||||
@Default(true) @JsonKey(name: 'parse-pure-ip') bool parsePureIp,
|
||||
@Default([]) @JsonKey(name: "force-domain") List<String> forceDomain,
|
||||
@Default([]) @JsonKey(name: "skip-src-address") List<String> skipSrcAddress,
|
||||
@Default([]) @JsonKey(name: "skip-dst-address") List<String> skipDstAddress,
|
||||
@Default([]) @JsonKey(name: "skip-domain") List<String> skipDomain,
|
||||
@Default([]) @JsonKey(name: "port-whitelist") List<String> port,
|
||||
@Default(true) @JsonKey(name: "force-dns-mapping") bool forceDnsMapping,
|
||||
@Default(true) @JsonKey(name: "parse-pure-ip") bool parsePureIp,
|
||||
@Default({}) Map<String, SnifferConfig> sniff,
|
||||
}) = _Sniffer;
|
||||
|
||||
@@ -168,7 +168,7 @@ List<String> _formJsonPorts(List? ports) {
|
||||
class SnifferConfig with _$SnifferConfig {
|
||||
const factory SnifferConfig({
|
||||
@Default([]) @JsonKey(fromJson: _formJsonPorts) List<String> ports,
|
||||
@JsonKey(name: 'override-destination') bool? overrideDest,
|
||||
@JsonKey(name: "override-destination") bool? overrideDest,
|
||||
}) = _SnifferConfig;
|
||||
|
||||
factory SnifferConfig.fromJson(Map<String, Object?> json) =>
|
||||
@@ -180,10 +180,10 @@ class Tun with _$Tun {
|
||||
const factory Tun({
|
||||
@Default(false) bool enable,
|
||||
@Default(appName) String device,
|
||||
@JsonKey(name: 'auto-route') @Default(false) bool autoRoute,
|
||||
@JsonKey(name: "auto-route") @Default(false) bool autoRoute,
|
||||
@Default(TunStack.mixed) TunStack stack,
|
||||
@JsonKey(name: 'dns-hijack') @Default(['any:53']) List<String> dnsHijack,
|
||||
@JsonKey(name: 'route-address') @Default([]) List<String> routeAddress,
|
||||
@JsonKey(name: "dns-hijack") @Default(["any:53"]) List<String> dnsHijack,
|
||||
@JsonKey(name: "route-address") @Default([]) List<String> routeAddress,
|
||||
}) = _Tun;
|
||||
|
||||
factory Tun.fromJson(Map<String, Object?> json) => _$TunFromJson(json);
|
||||
@@ -200,35 +200,17 @@ class Tun with _$Tun {
|
||||
}
|
||||
}
|
||||
|
||||
extension TunExt on Tun {
|
||||
Tun getRealTun(RouteMode routeMode) {
|
||||
final mRouteAddress = routeMode == RouteMode.bypassPrivate
|
||||
? defaultBypassPrivateRouteAddress
|
||||
: routeAddress;
|
||||
return switch (system.isDesktop) {
|
||||
true => copyWith(
|
||||
autoRoute: true,
|
||||
routeAddress: [],
|
||||
),
|
||||
false => copyWith(
|
||||
autoRoute: mRouteAddress.isEmpty ? true : false,
|
||||
routeAddress: mRouteAddress,
|
||||
),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@freezed
|
||||
class FallbackFilter with _$FallbackFilter {
|
||||
const factory FallbackFilter({
|
||||
@Default(true) bool geoip,
|
||||
@Default('CN') @JsonKey(name: 'geoip-code') String geoipCode,
|
||||
@Default(['gfw']) List<String> geosite,
|
||||
@Default(['240.0.0.0/4']) List<String> ipcidr,
|
||||
@Default("CN") @JsonKey(name: "geoip-code") String geoipCode,
|
||||
@Default(["gfw"]) List<String> geosite,
|
||||
@Default(["240.0.0.0/4"]) List<String> ipcidr,
|
||||
@Default([
|
||||
'+.google.com',
|
||||
'+.facebook.com',
|
||||
'+.youtube.com',
|
||||
"+.google.com",
|
||||
"+.facebook.com",
|
||||
"+.youtube.com",
|
||||
])
|
||||
List<String> domain,
|
||||
}) = _FallbackFilter;
|
||||
@@ -241,51 +223,51 @@ class FallbackFilter with _$FallbackFilter {
|
||||
class Dns with _$Dns {
|
||||
const factory Dns({
|
||||
@Default(true) bool enable,
|
||||
@Default('0.0.0.0:1053') String listen,
|
||||
@Default(false) @JsonKey(name: 'prefer-h3') bool preferH3,
|
||||
@Default(true) @JsonKey(name: 'use-hosts') bool useHosts,
|
||||
@Default(true) @JsonKey(name: 'use-system-hosts') bool useSystemHosts,
|
||||
@Default(false) @JsonKey(name: 'respect-rules') bool respectRules,
|
||||
@Default("0.0.0.0:1053") String listen,
|
||||
@Default(false) @JsonKey(name: "prefer-h3") bool preferH3,
|
||||
@Default(true) @JsonKey(name: "use-hosts") bool useHosts,
|
||||
@Default(true) @JsonKey(name: "use-system-hosts") bool useSystemHosts,
|
||||
@Default(false) @JsonKey(name: "respect-rules") bool respectRules,
|
||||
@Default(false) bool ipv6,
|
||||
@Default(['223.5.5.5'])
|
||||
@JsonKey(name: 'default-nameserver')
|
||||
@Default(["223.5.5.5"])
|
||||
@JsonKey(name: "default-nameserver")
|
||||
List<String> defaultNameserver,
|
||||
@Default(DnsMode.fakeIp)
|
||||
@JsonKey(name: 'enhanced-mode')
|
||||
@JsonKey(name: "enhanced-mode")
|
||||
DnsMode enhancedMode,
|
||||
@Default('198.18.0.1/16')
|
||||
@JsonKey(name: 'fake-ip-range')
|
||||
@Default("198.18.0.1/16")
|
||||
@JsonKey(name: "fake-ip-range")
|
||||
String fakeIpRange,
|
||||
@Default([
|
||||
'*.lan',
|
||||
'localhost.ptlogin2.qq.com',
|
||||
"*.lan",
|
||||
"localhost.ptlogin2.qq.com",
|
||||
])
|
||||
@JsonKey(name: 'fake-ip-filter')
|
||||
@JsonKey(name: "fake-ip-filter")
|
||||
List<String> fakeIpFilter,
|
||||
@Default({
|
||||
'www.baidu.com': '114.114.114.114',
|
||||
'+.internal.crop.com': '10.0.0.1',
|
||||
'geosite:cn': 'https://doh.pub/dns-query'
|
||||
"www.baidu.com": "114.114.114.114",
|
||||
"+.internal.crop.com": "10.0.0.1",
|
||||
"geosite:cn": "https://doh.pub/dns-query"
|
||||
})
|
||||
@JsonKey(name: 'nameserver-policy')
|
||||
@JsonKey(name: "nameserver-policy")
|
||||
Map<String, String> nameserverPolicy,
|
||||
@Default([
|
||||
'https://doh.pub/dns-query',
|
||||
'https://dns.alidns.com/dns-query',
|
||||
"https://doh.pub/dns-query",
|
||||
"https://dns.alidns.com/dns-query",
|
||||
])
|
||||
List<String> nameserver,
|
||||
@Default([
|
||||
'tls://8.8.4.4',
|
||||
'tls://1.1.1.1',
|
||||
"tls://8.8.4.4",
|
||||
"tls://1.1.1.1",
|
||||
])
|
||||
List<String> fallback,
|
||||
@Default([
|
||||
'https://doh.pub/dns-query',
|
||||
"https://doh.pub/dns-query",
|
||||
])
|
||||
@JsonKey(name: 'proxy-server-nameserver')
|
||||
@JsonKey(name: "proxy-server-nameserver")
|
||||
List<String> proxyServerNameserver,
|
||||
@Default(FallbackFilter())
|
||||
@JsonKey(name: 'fallback-filter')
|
||||
@JsonKey(name: "fallback-filter")
|
||||
FallbackFilter fallbackFilter,
|
||||
}) = _Dns;
|
||||
|
||||
@@ -304,19 +286,19 @@ class Dns with _$Dns {
|
||||
class GeoXUrl with _$GeoXUrl {
|
||||
const factory GeoXUrl({
|
||||
@Default(
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb",
|
||||
)
|
||||
String mmdb,
|
||||
@Default(
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb",
|
||||
)
|
||||
String asn,
|
||||
@Default(
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat",
|
||||
)
|
||||
String geoip,
|
||||
@Default(
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat",
|
||||
)
|
||||
String geosite,
|
||||
}) = _GeoXUrl;
|
||||
@@ -349,10 +331,10 @@ class ParsedRule with _$ParsedRule {
|
||||
}) = _ParsedRule;
|
||||
|
||||
factory ParsedRule.parseString(String value) {
|
||||
final splits = value.split(',');
|
||||
final splits = value.split(",");
|
||||
final shortSplits = splits
|
||||
.where(
|
||||
(item) => !item.contains('src') && !item.contains('no-resolve'),
|
||||
(item) => !item.contains("src") && !item.contains("no-resolve"),
|
||||
)
|
||||
.toList();
|
||||
final ruleAction = RuleAction.values.firstWhere(
|
||||
@@ -372,17 +354,17 @@ class ParsedRule with _$ParsedRule {
|
||||
String? ruleProvider;
|
||||
|
||||
if (ruleAction == RuleAction.RULE_SET) {
|
||||
ruleProvider = shortSplits.sublist(1, shortSplits.length - 1).join(',');
|
||||
ruleProvider = shortSplits.sublist(1, shortSplits.length - 1).join(",");
|
||||
} else {
|
||||
content = shortSplits.sublist(1, shortSplits.length - 1).join(',');
|
||||
content = shortSplits.sublist(1, shortSplits.length - 1).join(",");
|
||||
}
|
||||
|
||||
return ParsedRule(
|
||||
ruleAction: ruleAction,
|
||||
content: content,
|
||||
src: splits.contains('src'),
|
||||
src: splits.contains("src"),
|
||||
ruleProvider: ruleProvider,
|
||||
noResolve: splits.contains('no-resolve'),
|
||||
noResolve: splits.contains("no-resolve"),
|
||||
subRule: subRule,
|
||||
ruleTarget: ruleTarget,
|
||||
);
|
||||
@@ -396,10 +378,10 @@ extension ParsedRuleExt on ParsedRule {
|
||||
ruleAction == RuleAction.RULE_SET ? ruleProvider : content,
|
||||
ruleAction == RuleAction.SUB_RULE ? subRule : ruleTarget,
|
||||
if (ruleAction.hasParams) ...[
|
||||
if (src) 'src',
|
||||
if (noResolve) 'no-resolve',
|
||||
if (src) "src",
|
||||
if (noResolve) "no-resolve",
|
||||
]
|
||||
].join(',');
|
||||
].join(",");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,7 +412,7 @@ class SubRule with _$SubRule {
|
||||
_$SubRuleFromJson(json);
|
||||
}
|
||||
|
||||
List<Rule> _genRule(List<dynamic>? rules) {
|
||||
_genRule(List<dynamic>? rules) {
|
||||
if (rules == null) {
|
||||
return [];
|
||||
}
|
||||
@@ -458,12 +440,12 @@ List<SubRule> _genSubRules(Map<String, dynamic> json) {
|
||||
@freezed
|
||||
class ClashConfigSnippet with _$ClashConfigSnippet {
|
||||
const factory ClashConfigSnippet({
|
||||
@Default([]) @JsonKey(name: 'proxy-groups') List<ProxyGroup> proxyGroups,
|
||||
@JsonKey(fromJson: _genRule, name: 'rules') @Default([]) List<Rule> rule,
|
||||
@JsonKey(name: 'rule-providers', fromJson: _genRuleProviders)
|
||||
@Default([]) @JsonKey(name: "proxy-groups") List<ProxyGroup> proxyGroups,
|
||||
@JsonKey(fromJson: _genRule, name: "rules") @Default([]) List<Rule> rule,
|
||||
@JsonKey(name: "rule-providers", fromJson: _genRuleProviders)
|
||||
@Default([])
|
||||
List<RuleProvider> ruleProvider,
|
||||
@JsonKey(name: 'sub-rules', fromJson: _genSubRules)
|
||||
@JsonKey(name: "sub-rules", fromJson: _genSubRules)
|
||||
@Default([])
|
||||
List<SubRule> subRules,
|
||||
}) = _ClashConfigSnippet;
|
||||
@@ -475,39 +457,39 @@ class ClashConfigSnippet with _$ClashConfigSnippet {
|
||||
@freezed
|
||||
class ClashConfig with _$ClashConfig {
|
||||
const factory ClashConfig({
|
||||
@Default(defaultMixedPort) @JsonKey(name: 'mixed-port') int mixedPort,
|
||||
@Default(0) @JsonKey(name: 'socks-port') int socksPort,
|
||||
@Default(0) @JsonKey(name: 'port') int port,
|
||||
@Default(0) @JsonKey(name: 'redir-port') int redirPort,
|
||||
@Default(0) @JsonKey(name: 'tproxy-port') int tproxyPort,
|
||||
@Default(defaultMixedPort) @JsonKey(name: "mixed-port") int mixedPort,
|
||||
@Default(0) @JsonKey(name: "socks-port") int socksPort,
|
||||
@Default(0) @JsonKey(name: "port") int port,
|
||||
@Default(0) @JsonKey(name: "redir-port") int redirPort,
|
||||
@Default(0) @JsonKey(name: "tproxy-port") int tproxyPort,
|
||||
@Default(Mode.rule) Mode mode,
|
||||
@Default(false) @JsonKey(name: 'allow-lan') bool allowLan,
|
||||
@Default(LogLevel.error) @JsonKey(name: 'log-level') LogLevel logLevel,
|
||||
@Default(false) @JsonKey(name: "allow-lan") bool allowLan,
|
||||
@Default(LogLevel.error) @JsonKey(name: "log-level") LogLevel logLevel,
|
||||
@Default(false) bool ipv6,
|
||||
@Default(FindProcessMode.off)
|
||||
@JsonKey(
|
||||
name: 'find-process-mode',
|
||||
name: "find-process-mode",
|
||||
unknownEnumValue: FindProcessMode.always,
|
||||
)
|
||||
FindProcessMode findProcessMode,
|
||||
@Default(defaultKeepAliveInterval)
|
||||
@JsonKey(name: 'keep-alive-interval')
|
||||
@JsonKey(name: "keep-alive-interval")
|
||||
int keepAliveInterval,
|
||||
@Default(true) @JsonKey(name: 'unified-delay') bool unifiedDelay,
|
||||
@Default(true) @JsonKey(name: 'tcp-concurrent') bool tcpConcurrent,
|
||||
@Default(true) @JsonKey(name: "unified-delay") bool unifiedDelay,
|
||||
@Default(true) @JsonKey(name: "tcp-concurrent") bool tcpConcurrent,
|
||||
@Default(defaultTun) @JsonKey(fromJson: Tun.safeFormJson) Tun tun,
|
||||
@Default(defaultDns) @JsonKey(fromJson: Dns.safeDnsFromJson) Dns dns,
|
||||
@Default(defaultGeoXUrl)
|
||||
@JsonKey(name: 'geox-url', fromJson: GeoXUrl.safeFormJson)
|
||||
@JsonKey(name: "geox-url", fromJson: GeoXUrl.safeFormJson)
|
||||
GeoXUrl geoXUrl,
|
||||
@Default(GeodataLoader.memconservative)
|
||||
@JsonKey(name: 'geodata-loader')
|
||||
@JsonKey(name: "geodata-loader")
|
||||
GeodataLoader geodataLoader,
|
||||
@Default([]) @JsonKey(name: 'proxy-groups') List<ProxyGroup> proxyGroups,
|
||||
@Default([]) @JsonKey(name: "proxy-groups") List<ProxyGroup> proxyGroups,
|
||||
@Default([]) List<String> rule,
|
||||
@JsonKey(name: 'global-ua') String? globalUa,
|
||||
@JsonKey(name: "global-ua") String? globalUa,
|
||||
@Default(ExternalControllerStatus.close)
|
||||
@JsonKey(name: 'external-controller')
|
||||
@JsonKey(name: "external-controller")
|
||||
ExternalControllerStatus externalController,
|
||||
@Default({}) HostsMap hosts,
|
||||
}) = _ClashConfig;
|
||||
|
||||
@@ -16,7 +16,7 @@ class NavigationItem with _$NavigationItem {
|
||||
required Icon icon,
|
||||
required PageLabel label,
|
||||
final String? description,
|
||||
required WidgetBuilder builder,
|
||||
required Widget view,
|
||||
@Default(true) bool keep,
|
||||
String? path,
|
||||
@Default([NavigationItemMode.mobile, NavigationItemMode.desktop])
|
||||
@@ -41,23 +41,15 @@ class Package with _$Package {
|
||||
@freezed
|
||||
class Metadata with _$Metadata {
|
||||
const factory Metadata({
|
||||
@Default(0) int uid,
|
||||
@Default('') String network,
|
||||
@Default('') String sourceIP,
|
||||
@Default('') String sourcePort,
|
||||
@Default('') String destinationIP,
|
||||
@Default('') String destinationPort,
|
||||
@Default('') String host,
|
||||
DnsMode? dnsMode,
|
||||
@Default('') String process,
|
||||
@Default('') String processPath,
|
||||
@Default('') String remoteDestination,
|
||||
@Default([]) List<String> sourceGeoIP,
|
||||
@Default([]) List<String> destinationGeoIP,
|
||||
@Default('') String destinationIPASN,
|
||||
@Default('') String sourceIPASN,
|
||||
@Default('') String specialRules,
|
||||
@Default('') String specialProxy,
|
||||
required int uid,
|
||||
required String network,
|
||||
required String sourceIP,
|
||||
required String sourcePort,
|
||||
required String destinationIP,
|
||||
required String destinationPort,
|
||||
required String host,
|
||||
required String process,
|
||||
required String remoteDestination,
|
||||
}) = _Metadata;
|
||||
|
||||
factory Metadata.fromJson(Map<String, Object?> json) =>
|
||||
@@ -65,48 +57,35 @@ class Metadata with _$Metadata {
|
||||
}
|
||||
|
||||
@freezed
|
||||
class TrackerInfo with _$TrackerInfo {
|
||||
const factory TrackerInfo({
|
||||
class Connection with _$Connection {
|
||||
const factory Connection({
|
||||
required String id,
|
||||
@Default(0) int upload,
|
||||
@Default(0) int download,
|
||||
num? upload,
|
||||
num? download,
|
||||
required DateTime start,
|
||||
required Metadata metadata,
|
||||
required List<String> chains,
|
||||
required String rule,
|
||||
required String rulePayload,
|
||||
int? downloadSpeed,
|
||||
int? uploadSpeed,
|
||||
}) = _TrackerInfo;
|
||||
}) = _Connection;
|
||||
|
||||
factory TrackerInfo.fromJson(Map<String, Object?> json) =>
|
||||
_$TrackerInfoFromJson(json);
|
||||
factory Connection.fromJson(Map<String, Object?> json) =>
|
||||
_$ConnectionFromJson(json);
|
||||
}
|
||||
|
||||
extension TrackerInfoExt on TrackerInfo {
|
||||
extension ConnectionExt on Connection {
|
||||
String get desc {
|
||||
var text = '${metadata.network}://';
|
||||
var text = "${metadata.network}://";
|
||||
final ips = [
|
||||
metadata.host,
|
||||
metadata.destinationIP,
|
||||
].where((ip) => ip.isNotEmpty);
|
||||
text += ips.join('/');
|
||||
text += ':${metadata.destinationPort}';
|
||||
text += ips.join("/");
|
||||
text += ":${metadata.destinationPort}";
|
||||
return text;
|
||||
}
|
||||
|
||||
String get progressText {
|
||||
final process = metadata.process;
|
||||
final uid = metadata.uid;
|
||||
if (uid != 0) {
|
||||
return '$process($uid)';
|
||||
}
|
||||
return process;
|
||||
}
|
||||
}
|
||||
|
||||
String _logDateTime(dynamic _) {
|
||||
return DateTime.now().showFull;
|
||||
String _logDateTime(_) {
|
||||
return DateTime.now().toString();
|
||||
}
|
||||
|
||||
// String _logId(_) {
|
||||
@@ -116,9 +95,8 @@ String _logDateTime(dynamic _) {
|
||||
@freezed
|
||||
class Log with _$Log {
|
||||
const factory Log({
|
||||
// @JsonKey(fromJson: _logId) required String id,
|
||||
@JsonKey(name: 'LogLevel') @Default(LogLevel.info) LogLevel logLevel,
|
||||
@JsonKey(name: 'Payload') @Default('') String payload,
|
||||
@JsonKey(name: "LogLevel") @Default(LogLevel.app) LogLevel logLevel,
|
||||
@JsonKey(name: "Payload") @Default("") String payload,
|
||||
@JsonKey(fromJson: _logDateTime) required String dateTime,
|
||||
}) = _Log;
|
||||
|
||||
@@ -140,8 +118,8 @@ class LogsState with _$LogsState {
|
||||
const factory LogsState({
|
||||
@Default([]) List<Log> logs,
|
||||
@Default([]) List<String> keywords,
|
||||
@Default('') String query,
|
||||
@Default(true) bool autoScrollToEnd,
|
||||
@Default("") String query,
|
||||
@Default(false) bool loading,
|
||||
}) = _LogsState;
|
||||
}
|
||||
|
||||
@@ -160,28 +138,27 @@ extension LogsStateExt on LogsState {
|
||||
}
|
||||
|
||||
@freezed
|
||||
class TrackerInfosState with _$TrackerInfosState {
|
||||
const factory TrackerInfosState({
|
||||
@Default([]) List<TrackerInfo> trackerInfos,
|
||||
class ConnectionsState with _$ConnectionsState {
|
||||
const factory ConnectionsState({
|
||||
@Default([]) List<Connection> connections,
|
||||
@Default([]) List<String> keywords,
|
||||
@Default('') String query,
|
||||
@Default(true) bool autoScrollToEnd,
|
||||
}) = _TrackerInfosState;
|
||||
@Default("") String query,
|
||||
@Default(false) bool loading,
|
||||
}) = _ConnectionsState;
|
||||
}
|
||||
|
||||
extension TrackerInfosStateExt on TrackerInfosState {
|
||||
List<TrackerInfo> get list {
|
||||
extension ConnectionsStateExt on ConnectionsState {
|
||||
List<Connection> get list {
|
||||
final lowerQuery = query.toLowerCase().trim();
|
||||
final lowQuery = query.toLowerCase();
|
||||
return trackerInfos.where((trackerInfo) {
|
||||
final chains = trackerInfo.chains;
|
||||
final process = trackerInfo.metadata.process;
|
||||
final networkText = trackerInfo.metadata.network.toLowerCase();
|
||||
final hostText = trackerInfo.metadata.host.toLowerCase();
|
||||
final destinationIPText =
|
||||
trackerInfo.metadata.destinationIP.toLowerCase();
|
||||
final processText = trackerInfo.metadata.process.toLowerCase();
|
||||
final chainsText = chains.join('').toLowerCase();
|
||||
return connections.where((connection) {
|
||||
final chains = connection.chains;
|
||||
final process = connection.metadata.process;
|
||||
final networkText = connection.metadata.network.toLowerCase();
|
||||
final hostText = connection.metadata.host.toLowerCase();
|
||||
final destinationIPText = connection.metadata.destinationIP.toLowerCase();
|
||||
final processText = connection.metadata.process.toLowerCase();
|
||||
final chainsText = chains.join("").toLowerCase();
|
||||
return {...chains, process}.containsAll(keywords) &&
|
||||
(networkText.contains(lowerQuery) ||
|
||||
hostText.contains(lowerQuery) ||
|
||||
@@ -192,7 +169,7 @@ extension TrackerInfosStateExt on TrackerInfosState {
|
||||
}
|
||||
}
|
||||
|
||||
const defaultDavFileName = 'backup.zip';
|
||||
const defaultDavFileName = "backup.zip";
|
||||
|
||||
@freezed
|
||||
class DAV with _$DAV {
|
||||
@@ -216,14 +193,14 @@ class FileInfo with _$FileInfo {
|
||||
|
||||
extension FileInfoExt on FileInfo {
|
||||
String get desc =>
|
||||
'${TrafficValue(value: size).show} · ${lastModified.lastUpdateTimeDesc}';
|
||||
"${TrafficValue(value: size).show} · ${lastModified.lastUpdateTimeDesc}";
|
||||
}
|
||||
|
||||
@freezed
|
||||
class VersionInfo with _$VersionInfo {
|
||||
const factory VersionInfo({
|
||||
@Default('') String clashName,
|
||||
@Default('') String version,
|
||||
@Default("") String clashName,
|
||||
@Default("") String version,
|
||||
}) = _VersionInfo;
|
||||
|
||||
factory VersionInfo.fromJson(Map<String, Object?> json) =>
|
||||
@@ -249,10 +226,6 @@ class Traffic {
|
||||
);
|
||||
}
|
||||
|
||||
String toSpeedText() {
|
||||
return '↑ $up/s ↓ $down/s';
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '$up↑ $down↓';
|
||||
@@ -301,7 +274,7 @@ class Group with _$Group {
|
||||
String? now,
|
||||
bool? hidden,
|
||||
String? testUrl,
|
||||
@Default('') String icon,
|
||||
@Default("") String icon,
|
||||
required String name,
|
||||
}) = _Group;
|
||||
|
||||
@@ -316,7 +289,7 @@ extension GroupsExt on List<Group> {
|
||||
}
|
||||
|
||||
extension GroupExt on Group {
|
||||
String get realNow => now ?? '';
|
||||
String get realNow => now ?? "";
|
||||
|
||||
String getCurrentSelectedName(String proxyName) {
|
||||
if (type.isComputedSelected) {
|
||||
@@ -334,10 +307,10 @@ class TrafficValue {
|
||||
|
||||
int get value => _value;
|
||||
|
||||
String get show => '$showValue $showUnit';
|
||||
String get show => "$showValue $showUnit";
|
||||
|
||||
String get shortShow =>
|
||||
'${trafficValueShow.value.fixed(decimals: 1)} $showUnit';
|
||||
"${trafficValueShow.value.fixed(decimals: 1)} $showUnit";
|
||||
|
||||
String get showValue => trafficValueShow.value.fixed();
|
||||
|
||||
@@ -374,7 +347,7 @@ class TrafficValue {
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return '$showValue$showUnit';
|
||||
return "$showValue$showUnit";
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -438,56 +411,56 @@ class IpInfo {
|
||||
static IpInfo fromIpInfoIoJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'ip': final String ip,
|
||||
'country': final String country,
|
||||
"ip": final String ip,
|
||||
"country": final String country,
|
||||
} =>
|
||||
IpInfo(
|
||||
ip: ip,
|
||||
countryCode: country,
|
||||
),
|
||||
_ => throw const FormatException('invalid json'),
|
||||
_ => throw const FormatException("invalid json"),
|
||||
};
|
||||
}
|
||||
|
||||
static IpInfo fromIpApiCoJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'ip': final String ip,
|
||||
'country_code': final String countryCode,
|
||||
"ip": final String ip,
|
||||
"country_code": final String countryCode,
|
||||
} =>
|
||||
IpInfo(
|
||||
ip: ip,
|
||||
countryCode: countryCode,
|
||||
),
|
||||
_ => throw const FormatException('invalid json'),
|
||||
_ => throw const FormatException("invalid json"),
|
||||
};
|
||||
}
|
||||
|
||||
static IpInfo fromIpSbJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'ip': final String ip,
|
||||
'country_code': final String countryCode,
|
||||
"ip": final String ip,
|
||||
"country_code": final String countryCode,
|
||||
} =>
|
||||
IpInfo(
|
||||
ip: ip,
|
||||
countryCode: countryCode,
|
||||
),
|
||||
_ => throw const FormatException('invalid json'),
|
||||
_ => throw const FormatException("invalid json"),
|
||||
};
|
||||
}
|
||||
|
||||
static IpInfo fromIpwhoIsJson(Map<String, dynamic> json) {
|
||||
return switch (json) {
|
||||
{
|
||||
'ip': final String ip,
|
||||
'country_code': final String countryCode,
|
||||
"ip": final String ip,
|
||||
"country_code": final String countryCode,
|
||||
} =>
|
||||
IpInfo(
|
||||
ip: ip,
|
||||
countryCode: countryCode,
|
||||
),
|
||||
_ => throw const FormatException('invalid json'),
|
||||
_ => throw const FormatException("invalid json"),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -566,7 +539,7 @@ class Result<T> with _$Result<T> {
|
||||
factory Result.success(T data) => Result(
|
||||
data: data,
|
||||
type: ResultType.success,
|
||||
message: '',
|
||||
message: "",
|
||||
);
|
||||
|
||||
factory Result.error(String message) => Result(
|
||||
|
||||
@@ -11,23 +11,23 @@ part 'generated/config.freezed.dart';
|
||||
part 'generated/config.g.dart';
|
||||
|
||||
const defaultBypassDomain = [
|
||||
'*zhihu.com',
|
||||
'*zhimg.com',
|
||||
'*jd.com',
|
||||
'100ime-iat-api.xfyun.cn',
|
||||
'*360buyimg.com',
|
||||
'localhost',
|
||||
'*.local',
|
||||
'127.*',
|
||||
'10.*',
|
||||
'172.16.*',
|
||||
'172.17.*',
|
||||
'172.18.*',
|
||||
'172.19.*',
|
||||
'172.2*',
|
||||
'172.30.*',
|
||||
'172.31.*',
|
||||
'192.168.*'
|
||||
"*zhihu.com",
|
||||
"*zhimg.com",
|
||||
"*jd.com",
|
||||
"100ime-iat-api.xfyun.cn",
|
||||
"*360buyimg.com",
|
||||
"localhost",
|
||||
"*.local",
|
||||
"127.*",
|
||||
"10.*",
|
||||
"172.16.*",
|
||||
"172.17.*",
|
||||
"172.18.*",
|
||||
"172.19.*",
|
||||
"172.2*",
|
||||
"172.30.*",
|
||||
"172.31.*",
|
||||
"192.168.*"
|
||||
];
|
||||
|
||||
const defaultAppSettingProps = AppSettingProps();
|
||||
@@ -152,8 +152,7 @@ class NetworkProps with _$NetworkProps {
|
||||
const factory NetworkProps({
|
||||
@Default(true) bool systemProxy,
|
||||
@Default(defaultBypassDomain) List<String> bypassDomain,
|
||||
@Default(RouteMode.config) RouteMode routeMode,
|
||||
@Default(true) bool autoSetSystemDns,
|
||||
@Default(RouteMode.bypassPrivate) RouteMode routeMode,
|
||||
}) = _NetworkProps;
|
||||
|
||||
factory NetworkProps.fromJson(Map<String, Object?>? json) =>
|
||||
@@ -178,8 +177,8 @@ class ProxiesStyle with _$ProxiesStyle {
|
||||
@freezed
|
||||
class TextScale with _$TextScale {
|
||||
const factory TextScale({
|
||||
@Default(false) bool enable,
|
||||
@Default(1.0) double scale,
|
||||
@Default(false) enable,
|
||||
@Default(1.0) scale,
|
||||
}) = _TextScale;
|
||||
|
||||
factory TextScale.fromJson(Map<String, Object?> json) =>
|
||||
@@ -265,12 +264,12 @@ class Config with _$Config {
|
||||
|
||||
factory Config.compatibleFromJson(Map<String, Object?> json) {
|
||||
try {
|
||||
final accessControlMap = json['accessControl'];
|
||||
final isAccessControl = json['isAccessControl'];
|
||||
final accessControlMap = json["accessControl"];
|
||||
final isAccessControl = json["isAccessControl"];
|
||||
if (accessControlMap != null) {
|
||||
(accessControlMap as Map)['enable'] = isAccessControl;
|
||||
if (json['vpnProps'] != null) {
|
||||
(json['vpnProps'] as Map)['accessControl'] = accessControlMap;
|
||||
(accessControlMap as Map)["enable"] = isAccessControl;
|
||||
if (json["vpnProps"] != null) {
|
||||
(json["vpnProps"] as Map)["accessControl"] = accessControlMap;
|
||||
}
|
||||
}
|
||||
} catch (_) {}
|
||||
|
||||
@@ -12,7 +12,7 @@ abstract mixin class AppMessageListener {
|
||||
|
||||
void onDelay(Delay delay) {}
|
||||
|
||||
void onRequest(TrackerInfo connection) {}
|
||||
void onRequest(Connection connection) {}
|
||||
|
||||
void onLoaded(String providerName) {}
|
||||
}
|
||||
@@ -26,9 +26,9 @@ abstract mixin class AppMessageListener {
|
||||
@freezed
|
||||
class SetupParams with _$SetupParams {
|
||||
const factory SetupParams({
|
||||
@JsonKey(name: 'config') required Map<String, dynamic> config,
|
||||
@JsonKey(name: 'selected-map') required Map<String, String> selectedMap,
|
||||
@JsonKey(name: 'test-url') required String testUrl,
|
||||
@JsonKey(name: "config") required Map<String, dynamic> config,
|
||||
@JsonKey(name: "selected-map") required Map<String, String> selectedMap,
|
||||
@JsonKey(name: "test-url") required String testUrl,
|
||||
}) = _SetupParams;
|
||||
|
||||
factory SetupParams.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -68,10 +68,10 @@ class UpdateParams with _$UpdateParams {
|
||||
@freezed
|
||||
class CoreState with _$CoreState {
|
||||
const factory CoreState({
|
||||
@JsonKey(name: 'vpn-props') required VpnProps vpnProps,
|
||||
@JsonKey(name: 'only-statistics-proxy') required bool onlyStatisticsProxy,
|
||||
@JsonKey(name: 'current-profile-name') required String currentProfileName,
|
||||
@JsonKey(name: 'bypass-domain') @Default([]) List<String> bypassDomain,
|
||||
@JsonKey(name: "vpn-props") required VpnProps vpnProps,
|
||||
@JsonKey(name: "only-statistics-proxy") required bool onlyStatisticsProxy,
|
||||
@JsonKey(name: "current-profile-name") required String currentProfileName,
|
||||
@JsonKey(name: "bypass-domain") @Default([]) List<String> bypassDomain,
|
||||
}) = _CoreState;
|
||||
|
||||
factory CoreState.fromJson(Map<String, Object?> json) =>
|
||||
@@ -100,7 +100,7 @@ class AndroidVpnOptions with _$AndroidVpnOptions {
|
||||
@freezed
|
||||
class InitParams with _$InitParams {
|
||||
const factory InitParams({
|
||||
@JsonKey(name: 'home-dir') required String homeDir,
|
||||
@JsonKey(name: "home-dir") required String homeDir,
|
||||
required int version,
|
||||
}) = _InitParams;
|
||||
|
||||
@@ -111,8 +111,8 @@ class InitParams with _$InitParams {
|
||||
@freezed
|
||||
class ChangeProxyParams with _$ChangeProxyParams {
|
||||
const factory ChangeProxyParams({
|
||||
@JsonKey(name: 'group-name') required String groupName,
|
||||
@JsonKey(name: 'proxy-name') required String proxyName,
|
||||
@JsonKey(name: "group-name") required String groupName,
|
||||
@JsonKey(name: "proxy-name") required String proxyName,
|
||||
}) = _ChangeProxyParams;
|
||||
|
||||
factory ChangeProxyParams.fromJson(Map<String, Object?> json) =>
|
||||
@@ -122,8 +122,8 @@ class ChangeProxyParams with _$ChangeProxyParams {
|
||||
@freezed
|
||||
class UpdateGeoDataParams with _$UpdateGeoDataParams {
|
||||
const factory UpdateGeoDataParams({
|
||||
@JsonKey(name: 'geo-type') required String geoType,
|
||||
@JsonKey(name: 'geo-name') required String geoName,
|
||||
@JsonKey(name: "geo-type") required String geoType,
|
||||
@JsonKey(name: "geo-name") required String geoName,
|
||||
}) = _UpdateGeoDataParams;
|
||||
|
||||
factory UpdateGeoDataParams.fromJson(Map<String, Object?> json) =>
|
||||
@@ -197,10 +197,10 @@ class Now with _$Now {
|
||||
@freezed
|
||||
class ProviderSubscriptionInfo with _$ProviderSubscriptionInfo {
|
||||
const factory ProviderSubscriptionInfo({
|
||||
@JsonKey(name: 'UPLOAD') @Default(0) int upload,
|
||||
@JsonKey(name: 'DOWNLOAD') @Default(0) int download,
|
||||
@JsonKey(name: 'TOTAL') @Default(0) int total,
|
||||
@JsonKey(name: 'EXPIRE') @Default(0) int expire,
|
||||
@JsonKey(name: "UPLOAD") @Default(0) int upload,
|
||||
@JsonKey(name: "DOWNLOAD") @Default(0) int download,
|
||||
@JsonKey(name: "TOTAL") @Default(0) int total,
|
||||
@JsonKey(name: "EXPIRE") @Default(0) int expire,
|
||||
}) = _ProviderSubscriptionInfo;
|
||||
|
||||
factory ProviderSubscriptionInfo.fromJson(Map<String, Object?> json) =>
|
||||
@@ -224,11 +224,11 @@ class ExternalProvider with _$ExternalProvider {
|
||||
required String type,
|
||||
String? path,
|
||||
required int count,
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
SubscriptionInfo? subscriptionInfo,
|
||||
@Default(false) bool isUpdating,
|
||||
@JsonKey(name: 'vehicle-type') required String vehicleType,
|
||||
@JsonKey(name: 'update-at') required DateTime updateAt,
|
||||
@JsonKey(name: "vehicle-type") required String vehicleType,
|
||||
@JsonKey(name: "update-at") required DateTime updateAt,
|
||||
}) = _ExternalProvider;
|
||||
|
||||
factory ExternalProvider.fromJson(Map<String, Object?> json) =>
|
||||
|
||||
@@ -26,19 +26,16 @@ mixin _$AppState {
|
||||
throw _privateConstructorUsedError;
|
||||
List<Group> get groups => throw _privateConstructorUsedError;
|
||||
int get checkIpNum => throw _privateConstructorUsedError;
|
||||
Brightness get brightness => throw _privateConstructorUsedError;
|
||||
Brightness? get brightness => throw _privateConstructorUsedError;
|
||||
int? get runTime => throw _privateConstructorUsedError;
|
||||
List<ExternalProvider> get providers => throw _privateConstructorUsedError;
|
||||
String? get localIp => throw _privateConstructorUsedError;
|
||||
FixedList<TrackerInfo> get requests => throw _privateConstructorUsedError;
|
||||
FixedList<Connection> get requests => throw _privateConstructorUsedError;
|
||||
int get version => throw _privateConstructorUsedError;
|
||||
FixedList<Log> get logs => throw _privateConstructorUsedError;
|
||||
FixedList<Traffic> get traffics => throw _privateConstructorUsedError;
|
||||
Traffic get totalTraffic => throw _privateConstructorUsedError;
|
||||
bool get realTunEnable => throw _privateConstructorUsedError;
|
||||
bool get loading => throw _privateConstructorUsedError;
|
||||
SystemUiOverlayStyle get systemUiOverlayStyle =>
|
||||
throw _privateConstructorUsedError;
|
||||
String get proxiesQuery => throw _privateConstructorUsedError;
|
||||
|
||||
/// Create a copy of AppState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -62,18 +59,16 @@ abstract class $AppStateCopyWith<$Res> {
|
||||
Map<String, Map<String, int?>> delayMap,
|
||||
List<Group> groups,
|
||||
int checkIpNum,
|
||||
Brightness brightness,
|
||||
Brightness? brightness,
|
||||
int? runTime,
|
||||
List<ExternalProvider> providers,
|
||||
String? localIp,
|
||||
FixedList<TrackerInfo> requests,
|
||||
FixedList<Connection> requests,
|
||||
int version,
|
||||
FixedList<Log> logs,
|
||||
FixedList<Traffic> traffics,
|
||||
Traffic totalTraffic,
|
||||
bool realTunEnable,
|
||||
bool loading,
|
||||
SystemUiOverlayStyle systemUiOverlayStyle});
|
||||
String proxiesQuery});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -100,7 +95,7 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
|
||||
Object? delayMap = null,
|
||||
Object? groups = null,
|
||||
Object? checkIpNum = null,
|
||||
Object? brightness = null,
|
||||
Object? brightness = freezed,
|
||||
Object? runTime = freezed,
|
||||
Object? providers = null,
|
||||
Object? localIp = freezed,
|
||||
@@ -109,9 +104,7 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
|
||||
Object? logs = null,
|
||||
Object? traffics = null,
|
||||
Object? totalTraffic = null,
|
||||
Object? realTunEnable = null,
|
||||
Object? loading = null,
|
||||
Object? systemUiOverlayStyle = null,
|
||||
Object? proxiesQuery = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
isInit: null == isInit
|
||||
@@ -150,10 +143,10 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
|
||||
? _value.checkIpNum
|
||||
: checkIpNum // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
brightness: null == brightness
|
||||
brightness: freezed == brightness
|
||||
? _value.brightness
|
||||
: brightness // ignore: cast_nullable_to_non_nullable
|
||||
as Brightness,
|
||||
as Brightness?,
|
||||
runTime: freezed == runTime
|
||||
? _value.runTime
|
||||
: runTime // ignore: cast_nullable_to_non_nullable
|
||||
@@ -169,7 +162,7 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
|
||||
requests: null == requests
|
||||
? _value.requests
|
||||
: requests // ignore: cast_nullable_to_non_nullable
|
||||
as FixedList<TrackerInfo>,
|
||||
as FixedList<Connection>,
|
||||
version: null == version
|
||||
? _value.version
|
||||
: version // ignore: cast_nullable_to_non_nullable
|
||||
@@ -186,18 +179,10 @@ class _$AppStateCopyWithImpl<$Res, $Val extends AppState>
|
||||
? _value.totalTraffic
|
||||
: totalTraffic // ignore: cast_nullable_to_non_nullable
|
||||
as Traffic,
|
||||
realTunEnable: null == realTunEnable
|
||||
? _value.realTunEnable
|
||||
: realTunEnable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
loading: null == loading
|
||||
? _value.loading
|
||||
: loading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
systemUiOverlayStyle: null == systemUiOverlayStyle
|
||||
? _value.systemUiOverlayStyle
|
||||
: systemUiOverlayStyle // ignore: cast_nullable_to_non_nullable
|
||||
as SystemUiOverlayStyle,
|
||||
proxiesQuery: null == proxiesQuery
|
||||
? _value.proxiesQuery
|
||||
: proxiesQuery // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -220,18 +205,16 @@ abstract class _$$AppStateImplCopyWith<$Res>
|
||||
Map<String, Map<String, int?>> delayMap,
|
||||
List<Group> groups,
|
||||
int checkIpNum,
|
||||
Brightness brightness,
|
||||
Brightness? brightness,
|
||||
int? runTime,
|
||||
List<ExternalProvider> providers,
|
||||
String? localIp,
|
||||
FixedList<TrackerInfo> requests,
|
||||
FixedList<Connection> requests,
|
||||
int version,
|
||||
FixedList<Log> logs,
|
||||
FixedList<Traffic> traffics,
|
||||
Traffic totalTraffic,
|
||||
bool realTunEnable,
|
||||
bool loading,
|
||||
SystemUiOverlayStyle systemUiOverlayStyle});
|
||||
String proxiesQuery});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -256,7 +239,7 @@ class __$$AppStateImplCopyWithImpl<$Res>
|
||||
Object? delayMap = null,
|
||||
Object? groups = null,
|
||||
Object? checkIpNum = null,
|
||||
Object? brightness = null,
|
||||
Object? brightness = freezed,
|
||||
Object? runTime = freezed,
|
||||
Object? providers = null,
|
||||
Object? localIp = freezed,
|
||||
@@ -265,9 +248,7 @@ class __$$AppStateImplCopyWithImpl<$Res>
|
||||
Object? logs = null,
|
||||
Object? traffics = null,
|
||||
Object? totalTraffic = null,
|
||||
Object? realTunEnable = null,
|
||||
Object? loading = null,
|
||||
Object? systemUiOverlayStyle = null,
|
||||
Object? proxiesQuery = null,
|
||||
}) {
|
||||
return _then(_$AppStateImpl(
|
||||
isInit: null == isInit
|
||||
@@ -306,10 +287,10 @@ class __$$AppStateImplCopyWithImpl<$Res>
|
||||
? _value.checkIpNum
|
||||
: checkIpNum // ignore: cast_nullable_to_non_nullable
|
||||
as int,
|
||||
brightness: null == brightness
|
||||
brightness: freezed == brightness
|
||||
? _value.brightness
|
||||
: brightness // ignore: cast_nullable_to_non_nullable
|
||||
as Brightness,
|
||||
as Brightness?,
|
||||
runTime: freezed == runTime
|
||||
? _value.runTime
|
||||
: runTime // ignore: cast_nullable_to_non_nullable
|
||||
@@ -325,7 +306,7 @@ class __$$AppStateImplCopyWithImpl<$Res>
|
||||
requests: null == requests
|
||||
? _value.requests
|
||||
: requests // ignore: cast_nullable_to_non_nullable
|
||||
as FixedList<TrackerInfo>,
|
||||
as FixedList<Connection>,
|
||||
version: null == version
|
||||
? _value.version
|
||||
: version // ignore: cast_nullable_to_non_nullable
|
||||
@@ -342,18 +323,10 @@ class __$$AppStateImplCopyWithImpl<$Res>
|
||||
? _value.totalTraffic
|
||||
: totalTraffic // ignore: cast_nullable_to_non_nullable
|
||||
as Traffic,
|
||||
realTunEnable: null == realTunEnable
|
||||
? _value.realTunEnable
|
||||
: realTunEnable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
loading: null == loading
|
||||
? _value.loading
|
||||
: loading // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
systemUiOverlayStyle: null == systemUiOverlayStyle
|
||||
? _value.systemUiOverlayStyle
|
||||
: systemUiOverlayStyle // ignore: cast_nullable_to_non_nullable
|
||||
as SystemUiOverlayStyle,
|
||||
proxiesQuery: null == proxiesQuery
|
||||
? _value.proxiesQuery
|
||||
: proxiesQuery // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -371,7 +344,7 @@ class _$AppStateImpl implements _AppState {
|
||||
final Map<String, Map<String, int?>> delayMap = const {},
|
||||
final List<Group> groups = const [],
|
||||
this.checkIpNum = 0,
|
||||
required this.brightness,
|
||||
this.brightness,
|
||||
this.runTime,
|
||||
final List<ExternalProvider> providers = const [],
|
||||
this.localIp,
|
||||
@@ -380,9 +353,7 @@ class _$AppStateImpl implements _AppState {
|
||||
required this.logs,
|
||||
required this.traffics,
|
||||
required this.totalTraffic,
|
||||
this.realTunEnable = false,
|
||||
this.loading = false,
|
||||
required this.systemUiOverlayStyle})
|
||||
this.proxiesQuery = ""})
|
||||
: _packages = packages,
|
||||
_delayMap = delayMap,
|
||||
_groups = groups,
|
||||
@@ -433,7 +404,7 @@ class _$AppStateImpl implements _AppState {
|
||||
@JsonKey()
|
||||
final int checkIpNum;
|
||||
@override
|
||||
final Brightness brightness;
|
||||
final Brightness? brightness;
|
||||
@override
|
||||
final int? runTime;
|
||||
final List<ExternalProvider> _providers;
|
||||
@@ -448,7 +419,7 @@ class _$AppStateImpl implements _AppState {
|
||||
@override
|
||||
final String? localIp;
|
||||
@override
|
||||
final FixedList<TrackerInfo> requests;
|
||||
final FixedList<Connection> requests;
|
||||
@override
|
||||
final int version;
|
||||
@override
|
||||
@@ -459,16 +430,11 @@ class _$AppStateImpl implements _AppState {
|
||||
final Traffic totalTraffic;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool realTunEnable;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool loading;
|
||||
@override
|
||||
final SystemUiOverlayStyle systemUiOverlayStyle;
|
||||
final String proxiesQuery;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AppState(isInit: $isInit, backBlock: $backBlock, pageLabel: $pageLabel, packages: $packages, sortNum: $sortNum, viewSize: $viewSize, delayMap: $delayMap, groups: $groups, checkIpNum: $checkIpNum, brightness: $brightness, runTime: $runTime, providers: $providers, localIp: $localIp, requests: $requests, version: $version, logs: $logs, traffics: $traffics, totalTraffic: $totalTraffic, realTunEnable: $realTunEnable, loading: $loading, systemUiOverlayStyle: $systemUiOverlayStyle)';
|
||||
return 'AppState(isInit: $isInit, backBlock: $backBlock, pageLabel: $pageLabel, packages: $packages, sortNum: $sortNum, viewSize: $viewSize, delayMap: $delayMap, groups: $groups, checkIpNum: $checkIpNum, brightness: $brightness, runTime: $runTime, providers: $providers, localIp: $localIp, requests: $requests, version: $version, logs: $logs, traffics: $traffics, totalTraffic: $totalTraffic, proxiesQuery: $proxiesQuery)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -503,11 +469,8 @@ class _$AppStateImpl implements _AppState {
|
||||
other.traffics == traffics) &&
|
||||
(identical(other.totalTraffic, totalTraffic) ||
|
||||
other.totalTraffic == totalTraffic) &&
|
||||
(identical(other.realTunEnable, realTunEnable) ||
|
||||
other.realTunEnable == realTunEnable) &&
|
||||
(identical(other.loading, loading) || other.loading == loading) &&
|
||||
(identical(other.systemUiOverlayStyle, systemUiOverlayStyle) ||
|
||||
other.systemUiOverlayStyle == systemUiOverlayStyle));
|
||||
(identical(other.proxiesQuery, proxiesQuery) ||
|
||||
other.proxiesQuery == proxiesQuery));
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -531,9 +494,7 @@ class _$AppStateImpl implements _AppState {
|
||||
logs,
|
||||
traffics,
|
||||
totalTraffic,
|
||||
realTunEnable,
|
||||
loading,
|
||||
systemUiOverlayStyle
|
||||
proxiesQuery
|
||||
]);
|
||||
|
||||
/// Create a copy of AppState
|
||||
@@ -547,28 +508,25 @@ class _$AppStateImpl implements _AppState {
|
||||
|
||||
abstract class _AppState implements AppState {
|
||||
const factory _AppState(
|
||||
{final bool isInit,
|
||||
final bool backBlock,
|
||||
final PageLabel pageLabel,
|
||||
final List<Package> packages,
|
||||
final int sortNum,
|
||||
required final Size viewSize,
|
||||
final Map<String, Map<String, int?>> delayMap,
|
||||
final List<Group> groups,
|
||||
final int checkIpNum,
|
||||
required final Brightness brightness,
|
||||
final int? runTime,
|
||||
final List<ExternalProvider> providers,
|
||||
final String? localIp,
|
||||
required final FixedList<TrackerInfo> requests,
|
||||
required final int version,
|
||||
required final FixedList<Log> logs,
|
||||
required final FixedList<Traffic> traffics,
|
||||
required final Traffic totalTraffic,
|
||||
final bool realTunEnable,
|
||||
final bool loading,
|
||||
required final SystemUiOverlayStyle systemUiOverlayStyle}) =
|
||||
_$AppStateImpl;
|
||||
{final bool isInit,
|
||||
final bool backBlock,
|
||||
final PageLabel pageLabel,
|
||||
final List<Package> packages,
|
||||
final int sortNum,
|
||||
required final Size viewSize,
|
||||
final Map<String, Map<String, int?>> delayMap,
|
||||
final List<Group> groups,
|
||||
final int checkIpNum,
|
||||
final Brightness? brightness,
|
||||
final int? runTime,
|
||||
final List<ExternalProvider> providers,
|
||||
final String? localIp,
|
||||
required final FixedList<Connection> requests,
|
||||
required final int version,
|
||||
required final FixedList<Log> logs,
|
||||
required final FixedList<Traffic> traffics,
|
||||
required final Traffic totalTraffic,
|
||||
final String proxiesQuery}) = _$AppStateImpl;
|
||||
|
||||
@override
|
||||
bool get isInit;
|
||||
@@ -589,7 +547,7 @@ abstract class _AppState implements AppState {
|
||||
@override
|
||||
int get checkIpNum;
|
||||
@override
|
||||
Brightness get brightness;
|
||||
Brightness? get brightness;
|
||||
@override
|
||||
int? get runTime;
|
||||
@override
|
||||
@@ -597,7 +555,7 @@ abstract class _AppState implements AppState {
|
||||
@override
|
||||
String? get localIp;
|
||||
@override
|
||||
FixedList<TrackerInfo> get requests;
|
||||
FixedList<Connection> get requests;
|
||||
@override
|
||||
int get version;
|
||||
@override
|
||||
@@ -607,11 +565,7 @@ abstract class _AppState implements AppState {
|
||||
@override
|
||||
Traffic get totalTraffic;
|
||||
@override
|
||||
bool get realTunEnable;
|
||||
@override
|
||||
bool get loading;
|
||||
@override
|
||||
SystemUiOverlayStyle get systemUiOverlayStyle;
|
||||
String get proxiesQuery;
|
||||
|
||||
/// Create a copy of AppState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -138,7 +138,7 @@ _$TunImpl _$$TunImplFromJson(Map<String, dynamic> json) => _$TunImpl(
|
||||
dnsHijack: (json['dns-hijack'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['any:53'],
|
||||
const ["any:53"],
|
||||
routeAddress: (json['route-address'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
@@ -163,19 +163,19 @@ const _$TunStackEnumMap = {
|
||||
_$FallbackFilterImpl _$$FallbackFilterImplFromJson(Map<String, dynamic> json) =>
|
||||
_$FallbackFilterImpl(
|
||||
geoip: json['geoip'] as bool? ?? true,
|
||||
geoipCode: json['geoip-code'] as String? ?? 'CN',
|
||||
geoipCode: json['geoip-code'] as String? ?? "CN",
|
||||
geosite: (json['geosite'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['gfw'],
|
||||
const ["gfw"],
|
||||
ipcidr: (json['ipcidr'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['240.0.0.0/4'],
|
||||
const ["240.0.0.0/4"],
|
||||
domain: (json['domain'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['+.google.com', '+.facebook.com', '+.youtube.com'],
|
||||
const ["+.google.com", "+.facebook.com", "+.youtube.com"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$FallbackFilterImplToJson(
|
||||
@@ -190,7 +190,7 @@ Map<String, dynamic> _$$FallbackFilterImplToJson(
|
||||
|
||||
_$DnsImpl _$$DnsImplFromJson(Map<String, dynamic> json) => _$DnsImpl(
|
||||
enable: json['enable'] as bool? ?? true,
|
||||
listen: json['listen'] as String? ?? '0.0.0.0:1053',
|
||||
listen: json['listen'] as String? ?? "0.0.0.0:1053",
|
||||
preferH3: json['prefer-h3'] as bool? ?? false,
|
||||
useHosts: json['use-hosts'] as bool? ?? true,
|
||||
useSystemHosts: json['use-system-hosts'] as bool? ?? true,
|
||||
@@ -199,39 +199,39 @@ _$DnsImpl _$$DnsImplFromJson(Map<String, dynamic> json) => _$DnsImpl(
|
||||
defaultNameserver: (json['default-nameserver'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['223.5.5.5'],
|
||||
const ["223.5.5.5"],
|
||||
enhancedMode:
|
||||
$enumDecodeNullable(_$DnsModeEnumMap, json['enhanced-mode']) ??
|
||||
DnsMode.fakeIp,
|
||||
fakeIpRange: json['fake-ip-range'] as String? ?? '198.18.0.1/16',
|
||||
fakeIpRange: json['fake-ip-range'] as String? ?? "198.18.0.1/16",
|
||||
fakeIpFilter: (json['fake-ip-filter'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['*.lan', 'localhost.ptlogin2.qq.com'],
|
||||
const ["*.lan", "localhost.ptlogin2.qq.com"],
|
||||
nameserverPolicy:
|
||||
(json['nameserver-policy'] as Map<String, dynamic>?)?.map(
|
||||
(k, e) => MapEntry(k, e as String),
|
||||
) ??
|
||||
const {
|
||||
'www.baidu.com': '114.114.114.114',
|
||||
'+.internal.crop.com': '10.0.0.1',
|
||||
'geosite:cn': 'https://doh.pub/dns-query'
|
||||
"www.baidu.com": "114.114.114.114",
|
||||
"+.internal.crop.com": "10.0.0.1",
|
||||
"geosite:cn": "https://doh.pub/dns-query"
|
||||
},
|
||||
nameserver: (json['nameserver'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [
|
||||
'https://doh.pub/dns-query',
|
||||
'https://dns.alidns.com/dns-query'
|
||||
"https://doh.pub/dns-query",
|
||||
"https://dns.alidns.com/dns-query"
|
||||
],
|
||||
fallback: (json['fallback'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['tls://8.8.4.4', 'tls://1.1.1.1'],
|
||||
const ["tls://8.8.4.4", "tls://1.1.1.1"],
|
||||
proxyServerNameserver: (json['proxy-server-nameserver'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const ['https://doh.pub/dns-query'],
|
||||
const ["https://doh.pub/dns-query"],
|
||||
fallbackFilter: json['fallback-filter'] == null
|
||||
? const FallbackFilter()
|
||||
: FallbackFilter.fromJson(
|
||||
@@ -267,13 +267,13 @@ const _$DnsModeEnumMap = {
|
||||
_$GeoXUrlImpl _$$GeoXUrlImplFromJson(Map<String, dynamic> json) =>
|
||||
_$GeoXUrlImpl(
|
||||
mmdb: json['mmdb'] as String? ??
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.metadb",
|
||||
asn: json['asn'] as String? ??
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/GeoLite2-ASN.mmdb",
|
||||
geoip: json['geoip'] as String? ??
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.dat",
|
||||
geosite: json['geosite'] as String? ??
|
||||
'https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat',
|
||||
"https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.dat",
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$GeoXUrlImplToJson(_$GeoXUrlImpl instance) =>
|
||||
@@ -418,6 +418,7 @@ const _$LogLevelEnumMap = {
|
||||
LogLevel.warning: 'warning',
|
||||
LogLevel.error: 'error',
|
||||
LogLevel.silent: 'silent',
|
||||
LogLevel.app: 'app',
|
||||
};
|
||||
|
||||
const _$FindProcessModeEnumMap = {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -26,29 +26,15 @@ Map<String, dynamic> _$$PackageImplToJson(_$PackageImpl instance) =>
|
||||
|
||||
_$MetadataImpl _$$MetadataImplFromJson(Map<String, dynamic> json) =>
|
||||
_$MetadataImpl(
|
||||
uid: (json['uid'] as num?)?.toInt() ?? 0,
|
||||
network: json['network'] as String? ?? '',
|
||||
sourceIP: json['sourceIP'] as String? ?? '',
|
||||
sourcePort: json['sourcePort'] as String? ?? '',
|
||||
destinationIP: json['destinationIP'] as String? ?? '',
|
||||
destinationPort: json['destinationPort'] as String? ?? '',
|
||||
host: json['host'] as String? ?? '',
|
||||
dnsMode: $enumDecodeNullable(_$DnsModeEnumMap, json['dnsMode']),
|
||||
process: json['process'] as String? ?? '',
|
||||
processPath: json['processPath'] as String? ?? '',
|
||||
remoteDestination: json['remoteDestination'] as String? ?? '',
|
||||
sourceGeoIP: (json['sourceGeoIP'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
destinationGeoIP: (json['destinationGeoIP'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
const [],
|
||||
destinationIPASN: json['destinationIPASN'] as String? ?? '',
|
||||
sourceIPASN: json['sourceIPASN'] as String? ?? '',
|
||||
specialRules: json['specialRules'] as String? ?? '',
|
||||
specialProxy: json['specialProxy'] as String? ?? '',
|
||||
uid: (json['uid'] as num).toInt(),
|
||||
network: json['network'] as String,
|
||||
sourceIP: json['sourceIP'] as String,
|
||||
sourcePort: json['sourcePort'] as String,
|
||||
destinationIP: json['destinationIP'] as String,
|
||||
destinationPort: json['destinationPort'] as String,
|
||||
host: json['host'] as String,
|
||||
process: json['process'] as String,
|
||||
remoteDestination: json['remoteDestination'] as String,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$MetadataImplToJson(_$MetadataImpl instance) =>
|
||||
@@ -60,41 +46,22 @@ Map<String, dynamic> _$$MetadataImplToJson(_$MetadataImpl instance) =>
|
||||
'destinationIP': instance.destinationIP,
|
||||
'destinationPort': instance.destinationPort,
|
||||
'host': instance.host,
|
||||
'dnsMode': _$DnsModeEnumMap[instance.dnsMode],
|
||||
'process': instance.process,
|
||||
'processPath': instance.processPath,
|
||||
'remoteDestination': instance.remoteDestination,
|
||||
'sourceGeoIP': instance.sourceGeoIP,
|
||||
'destinationGeoIP': instance.destinationGeoIP,
|
||||
'destinationIPASN': instance.destinationIPASN,
|
||||
'sourceIPASN': instance.sourceIPASN,
|
||||
'specialRules': instance.specialRules,
|
||||
'specialProxy': instance.specialProxy,
|
||||
};
|
||||
|
||||
const _$DnsModeEnumMap = {
|
||||
DnsMode.normal: 'normal',
|
||||
DnsMode.fakeIp: 'fake-ip',
|
||||
DnsMode.redirHost: 'redir-host',
|
||||
DnsMode.hosts: 'hosts',
|
||||
};
|
||||
|
||||
_$TrackerInfoImpl _$$TrackerInfoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$TrackerInfoImpl(
|
||||
_$ConnectionImpl _$$ConnectionImplFromJson(Map<String, dynamic> json) =>
|
||||
_$ConnectionImpl(
|
||||
id: json['id'] as String,
|
||||
upload: (json['upload'] as num?)?.toInt() ?? 0,
|
||||
download: (json['download'] as num?)?.toInt() ?? 0,
|
||||
upload: json['upload'] as num?,
|
||||
download: json['download'] as num?,
|
||||
start: DateTime.parse(json['start'] as String),
|
||||
metadata: Metadata.fromJson(json['metadata'] as Map<String, dynamic>),
|
||||
chains:
|
||||
(json['chains'] as List<dynamic>).map((e) => e as String).toList(),
|
||||
rule: json['rule'] as String,
|
||||
rulePayload: json['rulePayload'] as String,
|
||||
downloadSpeed: (json['downloadSpeed'] as num?)?.toInt(),
|
||||
uploadSpeed: (json['uploadSpeed'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TrackerInfoImplToJson(_$TrackerInfoImpl instance) =>
|
||||
Map<String, dynamic> _$$ConnectionImplToJson(_$ConnectionImpl instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'upload': instance.upload,
|
||||
@@ -102,16 +69,12 @@ Map<String, dynamic> _$$TrackerInfoImplToJson(_$TrackerInfoImpl instance) =>
|
||||
'start': instance.start.toIso8601String(),
|
||||
'metadata': instance.metadata,
|
||||
'chains': instance.chains,
|
||||
'rule': instance.rule,
|
||||
'rulePayload': instance.rulePayload,
|
||||
'downloadSpeed': instance.downloadSpeed,
|
||||
'uploadSpeed': instance.uploadSpeed,
|
||||
};
|
||||
|
||||
_$LogImpl _$$LogImplFromJson(Map<String, dynamic> json) => _$LogImpl(
|
||||
logLevel: $enumDecodeNullable(_$LogLevelEnumMap, json['LogLevel']) ??
|
||||
LogLevel.info,
|
||||
payload: json['Payload'] as String? ?? '',
|
||||
LogLevel.app,
|
||||
payload: json['Payload'] as String? ?? "",
|
||||
dateTime: _logDateTime(json['dateTime']),
|
||||
);
|
||||
|
||||
@@ -127,6 +90,7 @@ const _$LogLevelEnumMap = {
|
||||
LogLevel.warning: 'warning',
|
||||
LogLevel.error: 'error',
|
||||
LogLevel.silent: 'silent',
|
||||
LogLevel.app: 'app',
|
||||
};
|
||||
|
||||
_$DAVImpl _$$DAVImplFromJson(Map<String, dynamic> json) => _$DAVImpl(
|
||||
@@ -145,8 +109,8 @@ Map<String, dynamic> _$$DAVImplToJson(_$DAVImpl instance) => <String, dynamic>{
|
||||
|
||||
_$VersionInfoImpl _$$VersionInfoImplFromJson(Map<String, dynamic> json) =>
|
||||
_$VersionInfoImpl(
|
||||
clashName: json['clashName'] as String? ?? '',
|
||||
version: json['version'] as String? ?? '',
|
||||
clashName: json['clashName'] as String? ?? "",
|
||||
version: json['version'] as String? ?? "",
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$VersionInfoImplToJson(_$VersionInfoImpl instance) =>
|
||||
@@ -177,7 +141,7 @@ _$GroupImpl _$$GroupImplFromJson(Map<String, dynamic> json) => _$GroupImpl(
|
||||
now: json['now'] as String?,
|
||||
hidden: json['hidden'] as bool?,
|
||||
testUrl: json['testUrl'] as String?,
|
||||
icon: json['icon'] as String? ?? '',
|
||||
icon: json['icon'] as String? ?? "",
|
||||
name: json['name'] as String,
|
||||
);
|
||||
|
||||
|
||||
@@ -1325,7 +1325,6 @@ mixin _$NetworkProps {
|
||||
bool get systemProxy => throw _privateConstructorUsedError;
|
||||
List<String> get bypassDomain => throw _privateConstructorUsedError;
|
||||
RouteMode get routeMode => throw _privateConstructorUsedError;
|
||||
bool get autoSetSystemDns => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this NetworkProps to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -1343,11 +1342,7 @@ abstract class $NetworkPropsCopyWith<$Res> {
|
||||
NetworkProps value, $Res Function(NetworkProps) then) =
|
||||
_$NetworkPropsCopyWithImpl<$Res, NetworkProps>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool systemProxy,
|
||||
List<String> bypassDomain,
|
||||
RouteMode routeMode,
|
||||
bool autoSetSystemDns});
|
||||
$Res call({bool systemProxy, List<String> bypassDomain, RouteMode routeMode});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1368,7 +1363,6 @@ class _$NetworkPropsCopyWithImpl<$Res, $Val extends NetworkProps>
|
||||
Object? systemProxy = null,
|
||||
Object? bypassDomain = null,
|
||||
Object? routeMode = null,
|
||||
Object? autoSetSystemDns = null,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
systemProxy: null == systemProxy
|
||||
@@ -1383,10 +1377,6 @@ class _$NetworkPropsCopyWithImpl<$Res, $Val extends NetworkProps>
|
||||
? _value.routeMode
|
||||
: routeMode // ignore: cast_nullable_to_non_nullable
|
||||
as RouteMode,
|
||||
autoSetSystemDns: null == autoSetSystemDns
|
||||
? _value.autoSetSystemDns
|
||||
: autoSetSystemDns // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -1399,11 +1389,7 @@ abstract class _$$NetworkPropsImplCopyWith<$Res>
|
||||
__$$NetworkPropsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{bool systemProxy,
|
||||
List<String> bypassDomain,
|
||||
RouteMode routeMode,
|
||||
bool autoSetSystemDns});
|
||||
$Res call({bool systemProxy, List<String> bypassDomain, RouteMode routeMode});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1422,7 +1408,6 @@ class __$$NetworkPropsImplCopyWithImpl<$Res>
|
||||
Object? systemProxy = null,
|
||||
Object? bypassDomain = null,
|
||||
Object? routeMode = null,
|
||||
Object? autoSetSystemDns = null,
|
||||
}) {
|
||||
return _then(_$NetworkPropsImpl(
|
||||
systemProxy: null == systemProxy
|
||||
@@ -1437,10 +1422,6 @@ class __$$NetworkPropsImplCopyWithImpl<$Res>
|
||||
? _value.routeMode
|
||||
: routeMode // ignore: cast_nullable_to_non_nullable
|
||||
as RouteMode,
|
||||
autoSetSystemDns: null == autoSetSystemDns
|
||||
? _value.autoSetSystemDns
|
||||
: autoSetSystemDns // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1451,8 +1432,7 @@ class _$NetworkPropsImpl implements _NetworkProps {
|
||||
const _$NetworkPropsImpl(
|
||||
{this.systemProxy = true,
|
||||
final List<String> bypassDomain = defaultBypassDomain,
|
||||
this.routeMode = RouteMode.config,
|
||||
this.autoSetSystemDns = true})
|
||||
this.routeMode = RouteMode.bypassPrivate})
|
||||
: _bypassDomain = bypassDomain;
|
||||
|
||||
factory _$NetworkPropsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -1473,13 +1453,10 @@ class _$NetworkPropsImpl implements _NetworkProps {
|
||||
@override
|
||||
@JsonKey()
|
||||
final RouteMode routeMode;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool autoSetSystemDns;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'NetworkProps(systemProxy: $systemProxy, bypassDomain: $bypassDomain, routeMode: $routeMode, autoSetSystemDns: $autoSetSystemDns)';
|
||||
return 'NetworkProps(systemProxy: $systemProxy, bypassDomain: $bypassDomain, routeMode: $routeMode)';
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -1492,19 +1469,13 @@ class _$NetworkPropsImpl implements _NetworkProps {
|
||||
const DeepCollectionEquality()
|
||||
.equals(other._bypassDomain, _bypassDomain) &&
|
||||
(identical(other.routeMode, routeMode) ||
|
||||
other.routeMode == routeMode) &&
|
||||
(identical(other.autoSetSystemDns, autoSetSystemDns) ||
|
||||
other.autoSetSystemDns == autoSetSystemDns));
|
||||
other.routeMode == routeMode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
systemProxy,
|
||||
const DeepCollectionEquality().hash(_bypassDomain),
|
||||
routeMode,
|
||||
autoSetSystemDns);
|
||||
int get hashCode => Object.hash(runtimeType, systemProxy,
|
||||
const DeepCollectionEquality().hash(_bypassDomain), routeMode);
|
||||
|
||||
/// Create a copy of NetworkProps
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1526,8 +1497,7 @@ abstract class _NetworkProps implements NetworkProps {
|
||||
const factory _NetworkProps(
|
||||
{final bool systemProxy,
|
||||
final List<String> bypassDomain,
|
||||
final RouteMode routeMode,
|
||||
final bool autoSetSystemDns}) = _$NetworkPropsImpl;
|
||||
final RouteMode routeMode}) = _$NetworkPropsImpl;
|
||||
|
||||
factory _NetworkProps.fromJson(Map<String, dynamic> json) =
|
||||
_$NetworkPropsImpl.fromJson;
|
||||
@@ -1538,8 +1508,6 @@ abstract class _NetworkProps implements NetworkProps {
|
||||
List<String> get bypassDomain;
|
||||
@override
|
||||
RouteMode get routeMode;
|
||||
@override
|
||||
bool get autoSetSystemDns;
|
||||
|
||||
/// Create a copy of NetworkProps
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1824,8 +1792,8 @@ TextScale _$TextScaleFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$TextScale {
|
||||
bool get enable => throw _privateConstructorUsedError;
|
||||
double get scale => throw _privateConstructorUsedError;
|
||||
dynamic get enable => throw _privateConstructorUsedError;
|
||||
dynamic get scale => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this TextScale to a JSON map.
|
||||
Map<String, dynamic> toJson() => throw _privateConstructorUsedError;
|
||||
@@ -1842,7 +1810,7 @@ abstract class $TextScaleCopyWith<$Res> {
|
||||
factory $TextScaleCopyWith(TextScale value, $Res Function(TextScale) then) =
|
||||
_$TextScaleCopyWithImpl<$Res, TextScale>;
|
||||
@useResult
|
||||
$Res call({bool enable, double scale});
|
||||
$Res call({dynamic enable, dynamic scale});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1860,18 +1828,18 @@ class _$TextScaleCopyWithImpl<$Res, $Val extends TextScale>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? enable = null,
|
||||
Object? scale = null,
|
||||
Object? enable = freezed,
|
||||
Object? scale = freezed,
|
||||
}) {
|
||||
return _then(_value.copyWith(
|
||||
enable: null == enable
|
||||
enable: freezed == enable
|
||||
? _value.enable
|
||||
: enable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
scale: null == scale
|
||||
as dynamic,
|
||||
scale: freezed == scale
|
||||
? _value.scale
|
||||
: scale // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
as dynamic,
|
||||
) as $Val);
|
||||
}
|
||||
}
|
||||
@@ -1884,7 +1852,7 @@ abstract class _$$TextScaleImplCopyWith<$Res>
|
||||
__$$TextScaleImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({bool enable, double scale});
|
||||
$Res call({dynamic enable, dynamic scale});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1900,18 +1868,12 @@ class __$$TextScaleImplCopyWithImpl<$Res>
|
||||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? enable = null,
|
||||
Object? scale = null,
|
||||
Object? enable = freezed,
|
||||
Object? scale = freezed,
|
||||
}) {
|
||||
return _then(_$TextScaleImpl(
|
||||
enable: null == enable
|
||||
? _value.enable
|
||||
: enable // ignore: cast_nullable_to_non_nullable
|
||||
as bool,
|
||||
scale: null == scale
|
||||
? _value.scale
|
||||
: scale // ignore: cast_nullable_to_non_nullable
|
||||
as double,
|
||||
enable: freezed == enable ? _value.enable! : enable,
|
||||
scale: freezed == scale ? _value.scale! : scale,
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1926,10 +1888,10 @@ class _$TextScaleImpl implements _TextScale {
|
||||
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool enable;
|
||||
final dynamic enable;
|
||||
@override
|
||||
@JsonKey()
|
||||
final double scale;
|
||||
final dynamic scale;
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
@@ -1941,13 +1903,16 @@ class _$TextScaleImpl implements _TextScale {
|
||||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _$TextScaleImpl &&
|
||||
(identical(other.enable, enable) || other.enable == enable) &&
|
||||
(identical(other.scale, scale) || other.scale == scale));
|
||||
const DeepCollectionEquality().equals(other.enable, enable) &&
|
||||
const DeepCollectionEquality().equals(other.scale, scale));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType, enable, scale);
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
const DeepCollectionEquality().hash(enable),
|
||||
const DeepCollectionEquality().hash(scale));
|
||||
|
||||
/// Create a copy of TextScale
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@@ -1966,16 +1931,16 @@ class _$TextScaleImpl implements _TextScale {
|
||||
}
|
||||
|
||||
abstract class _TextScale implements TextScale {
|
||||
const factory _TextScale({final bool enable, final double scale}) =
|
||||
const factory _TextScale({final dynamic enable, final dynamic scale}) =
|
||||
_$TextScaleImpl;
|
||||
|
||||
factory _TextScale.fromJson(Map<String, dynamic> json) =
|
||||
_$TextScaleImpl.fromJson;
|
||||
|
||||
@override
|
||||
bool get enable;
|
||||
dynamic get enable;
|
||||
@override
|
||||
double get scale;
|
||||
dynamic get scale;
|
||||
|
||||
/// Create a copy of TextScale
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
||||
@@ -160,8 +160,7 @@ _$NetworkPropsImpl _$$NetworkPropsImplFromJson(Map<String, dynamic> json) =>
|
||||
.toList() ??
|
||||
defaultBypassDomain,
|
||||
routeMode: $enumDecodeNullable(_$RouteModeEnumMap, json['routeMode']) ??
|
||||
RouteMode.config,
|
||||
autoSetSystemDns: json['autoSetSystemDns'] as bool? ?? true,
|
||||
RouteMode.bypassPrivate,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$NetworkPropsImplToJson(_$NetworkPropsImpl instance) =>
|
||||
@@ -169,7 +168,6 @@ Map<String, dynamic> _$$NetworkPropsImplToJson(_$NetworkPropsImpl instance) =>
|
||||
'systemProxy': instance.systemProxy,
|
||||
'bypassDomain': instance.bypassDomain,
|
||||
'routeMode': _$RouteModeEnumMap[instance.routeMode]!,
|
||||
'autoSetSystemDns': instance.autoSetSystemDns,
|
||||
};
|
||||
|
||||
const _$RouteModeEnumMap = {
|
||||
@@ -238,8 +236,8 @@ const _$ProxyCardTypeEnumMap = {
|
||||
|
||||
_$TextScaleImpl _$$TextScaleImplFromJson(Map<String, dynamic> json) =>
|
||||
_$TextScaleImpl(
|
||||
enable: json['enable'] as bool? ?? false,
|
||||
scale: (json['scale'] as num?)?.toDouble() ?? 1.0,
|
||||
enable: json['enable'] ?? false,
|
||||
scale: json['scale'] ?? 1.0,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$$TextScaleImplToJson(_$TextScaleImpl instance) =>
|
||||
|
||||
@@ -20,11 +20,11 @@ SetupParams _$SetupParamsFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SetupParams {
|
||||
@JsonKey(name: 'config')
|
||||
@JsonKey(name: "config")
|
||||
Map<String, dynamic> get config => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'selected-map')
|
||||
@JsonKey(name: "selected-map")
|
||||
Map<String, String> get selectedMap => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'test-url')
|
||||
@JsonKey(name: "test-url")
|
||||
String get testUrl => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this SetupParams to a JSON map.
|
||||
@@ -44,9 +44,9 @@ abstract class $SetupParamsCopyWith<$Res> {
|
||||
_$SetupParamsCopyWithImpl<$Res, SetupParams>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'config') Map<String, dynamic> config,
|
||||
@JsonKey(name: 'selected-map') Map<String, String> selectedMap,
|
||||
@JsonKey(name: 'test-url') String testUrl});
|
||||
{@JsonKey(name: "config") Map<String, dynamic> config,
|
||||
@JsonKey(name: "selected-map") Map<String, String> selectedMap,
|
||||
@JsonKey(name: "test-url") String testUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -94,9 +94,9 @@ abstract class _$$SetupParamsImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'config') Map<String, dynamic> config,
|
||||
@JsonKey(name: 'selected-map') Map<String, String> selectedMap,
|
||||
@JsonKey(name: 'test-url') String testUrl});
|
||||
{@JsonKey(name: "config") Map<String, dynamic> config,
|
||||
@JsonKey(name: "selected-map") Map<String, String> selectedMap,
|
||||
@JsonKey(name: "test-url") String testUrl});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -137,10 +137,10 @@ class __$$SetupParamsImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$SetupParamsImpl implements _SetupParams {
|
||||
const _$SetupParamsImpl(
|
||||
{@JsonKey(name: 'config') required final Map<String, dynamic> config,
|
||||
@JsonKey(name: 'selected-map')
|
||||
{@JsonKey(name: "config") required final Map<String, dynamic> config,
|
||||
@JsonKey(name: "selected-map")
|
||||
required final Map<String, String> selectedMap,
|
||||
@JsonKey(name: 'test-url') required this.testUrl})
|
||||
@JsonKey(name: "test-url") required this.testUrl})
|
||||
: _config = config,
|
||||
_selectedMap = selectedMap;
|
||||
|
||||
@@ -149,7 +149,7 @@ class _$SetupParamsImpl implements _SetupParams {
|
||||
|
||||
final Map<String, dynamic> _config;
|
||||
@override
|
||||
@JsonKey(name: 'config')
|
||||
@JsonKey(name: "config")
|
||||
Map<String, dynamic> get config {
|
||||
if (_config is EqualUnmodifiableMapView) return _config;
|
||||
// ignore: implicit_dynamic_type
|
||||
@@ -158,7 +158,7 @@ class _$SetupParamsImpl implements _SetupParams {
|
||||
|
||||
final Map<String, String> _selectedMap;
|
||||
@override
|
||||
@JsonKey(name: 'selected-map')
|
||||
@JsonKey(name: "selected-map")
|
||||
Map<String, String> get selectedMap {
|
||||
if (_selectedMap is EqualUnmodifiableMapView) return _selectedMap;
|
||||
// ignore: implicit_dynamic_type
|
||||
@@ -166,7 +166,7 @@ class _$SetupParamsImpl implements _SetupParams {
|
||||
}
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'test-url')
|
||||
@JsonKey(name: "test-url")
|
||||
final String testUrl;
|
||||
|
||||
@override
|
||||
@@ -211,23 +211,23 @@ class _$SetupParamsImpl implements _SetupParams {
|
||||
|
||||
abstract class _SetupParams implements SetupParams {
|
||||
const factory _SetupParams(
|
||||
{@JsonKey(name: 'config') required final Map<String, dynamic> config,
|
||||
@JsonKey(name: 'selected-map')
|
||||
{@JsonKey(name: "config") required final Map<String, dynamic> config,
|
||||
@JsonKey(name: "selected-map")
|
||||
required final Map<String, String> selectedMap,
|
||||
@JsonKey(name: 'test-url') required final String testUrl}) =
|
||||
@JsonKey(name: "test-url") required final String testUrl}) =
|
||||
_$SetupParamsImpl;
|
||||
|
||||
factory _SetupParams.fromJson(Map<String, dynamic> json) =
|
||||
_$SetupParamsImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'config')
|
||||
@JsonKey(name: "config")
|
||||
Map<String, dynamic> get config;
|
||||
@override
|
||||
@JsonKey(name: 'selected-map')
|
||||
@JsonKey(name: "selected-map")
|
||||
Map<String, String> get selectedMap;
|
||||
@override
|
||||
@JsonKey(name: 'test-url')
|
||||
@JsonKey(name: "test-url")
|
||||
String get testUrl;
|
||||
|
||||
/// Create a copy of SetupParams
|
||||
@@ -637,13 +637,13 @@ CoreState _$CoreStateFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CoreState {
|
||||
@JsonKey(name: 'vpn-props')
|
||||
@JsonKey(name: "vpn-props")
|
||||
VpnProps get vpnProps => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'only-statistics-proxy')
|
||||
@JsonKey(name: "only-statistics-proxy")
|
||||
bool get onlyStatisticsProxy => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'current-profile-name')
|
||||
@JsonKey(name: "current-profile-name")
|
||||
String get currentProfileName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'bypass-domain')
|
||||
@JsonKey(name: "bypass-domain")
|
||||
List<String> get bypassDomain => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this CoreState to a JSON map.
|
||||
@@ -662,10 +662,10 @@ abstract class $CoreStateCopyWith<$Res> {
|
||||
_$CoreStateCopyWithImpl<$Res, CoreState>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'vpn-props') VpnProps vpnProps,
|
||||
@JsonKey(name: 'only-statistics-proxy') bool onlyStatisticsProxy,
|
||||
@JsonKey(name: 'current-profile-name') String currentProfileName,
|
||||
@JsonKey(name: 'bypass-domain') List<String> bypassDomain});
|
||||
{@JsonKey(name: "vpn-props") VpnProps vpnProps,
|
||||
@JsonKey(name: "only-statistics-proxy") bool onlyStatisticsProxy,
|
||||
@JsonKey(name: "current-profile-name") String currentProfileName,
|
||||
@JsonKey(name: "bypass-domain") List<String> bypassDomain});
|
||||
|
||||
$VpnPropsCopyWith<$Res> get vpnProps;
|
||||
}
|
||||
@@ -730,10 +730,10 @@ abstract class _$$CoreStateImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'vpn-props') VpnProps vpnProps,
|
||||
@JsonKey(name: 'only-statistics-proxy') bool onlyStatisticsProxy,
|
||||
@JsonKey(name: 'current-profile-name') String currentProfileName,
|
||||
@JsonKey(name: 'bypass-domain') List<String> bypassDomain});
|
||||
{@JsonKey(name: "vpn-props") VpnProps vpnProps,
|
||||
@JsonKey(name: "only-statistics-proxy") bool onlyStatisticsProxy,
|
||||
@JsonKey(name: "current-profile-name") String currentProfileName,
|
||||
@JsonKey(name: "bypass-domain") List<String> bypassDomain});
|
||||
|
||||
@override
|
||||
$VpnPropsCopyWith<$Res> get vpnProps;
|
||||
@@ -782,10 +782,10 @@ class __$$CoreStateImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$CoreStateImpl implements _CoreState {
|
||||
const _$CoreStateImpl(
|
||||
{@JsonKey(name: 'vpn-props') required this.vpnProps,
|
||||
@JsonKey(name: 'only-statistics-proxy') required this.onlyStatisticsProxy,
|
||||
@JsonKey(name: 'current-profile-name') required this.currentProfileName,
|
||||
@JsonKey(name: 'bypass-domain')
|
||||
{@JsonKey(name: "vpn-props") required this.vpnProps,
|
||||
@JsonKey(name: "only-statistics-proxy") required this.onlyStatisticsProxy,
|
||||
@JsonKey(name: "current-profile-name") required this.currentProfileName,
|
||||
@JsonKey(name: "bypass-domain")
|
||||
final List<String> bypassDomain = const []})
|
||||
: _bypassDomain = bypassDomain;
|
||||
|
||||
@@ -793,17 +793,17 @@ class _$CoreStateImpl implements _CoreState {
|
||||
_$$CoreStateImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vpn-props')
|
||||
@JsonKey(name: "vpn-props")
|
||||
final VpnProps vpnProps;
|
||||
@override
|
||||
@JsonKey(name: 'only-statistics-proxy')
|
||||
@JsonKey(name: "only-statistics-proxy")
|
||||
final bool onlyStatisticsProxy;
|
||||
@override
|
||||
@JsonKey(name: 'current-profile-name')
|
||||
@JsonKey(name: "current-profile-name")
|
||||
final String currentProfileName;
|
||||
final List<String> _bypassDomain;
|
||||
@override
|
||||
@JsonKey(name: 'bypass-domain')
|
||||
@JsonKey(name: "bypass-domain")
|
||||
List<String> get bypassDomain {
|
||||
if (_bypassDomain is EqualUnmodifiableListView) return _bypassDomain;
|
||||
// ignore: implicit_dynamic_type
|
||||
@@ -853,28 +853,28 @@ class _$CoreStateImpl implements _CoreState {
|
||||
|
||||
abstract class _CoreState implements CoreState {
|
||||
const factory _CoreState(
|
||||
{@JsonKey(name: 'vpn-props') required final VpnProps vpnProps,
|
||||
@JsonKey(name: 'only-statistics-proxy')
|
||||
{@JsonKey(name: "vpn-props") required final VpnProps vpnProps,
|
||||
@JsonKey(name: "only-statistics-proxy")
|
||||
required final bool onlyStatisticsProxy,
|
||||
@JsonKey(name: 'current-profile-name')
|
||||
@JsonKey(name: "current-profile-name")
|
||||
required final String currentProfileName,
|
||||
@JsonKey(name: 'bypass-domain') final List<String> bypassDomain}) =
|
||||
@JsonKey(name: "bypass-domain") final List<String> bypassDomain}) =
|
||||
_$CoreStateImpl;
|
||||
|
||||
factory _CoreState.fromJson(Map<String, dynamic> json) =
|
||||
_$CoreStateImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'vpn-props')
|
||||
@JsonKey(name: "vpn-props")
|
||||
VpnProps get vpnProps;
|
||||
@override
|
||||
@JsonKey(name: 'only-statistics-proxy')
|
||||
@JsonKey(name: "only-statistics-proxy")
|
||||
bool get onlyStatisticsProxy;
|
||||
@override
|
||||
@JsonKey(name: 'current-profile-name')
|
||||
@JsonKey(name: "current-profile-name")
|
||||
String get currentProfileName;
|
||||
@override
|
||||
@JsonKey(name: 'bypass-domain')
|
||||
@JsonKey(name: "bypass-domain")
|
||||
List<String> get bypassDomain;
|
||||
|
||||
/// Create a copy of CoreState
|
||||
@@ -1278,7 +1278,7 @@ InitParams _$InitParamsFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$InitParams {
|
||||
@JsonKey(name: 'home-dir')
|
||||
@JsonKey(name: "home-dir")
|
||||
String get homeDir => throw _privateConstructorUsedError;
|
||||
int get version => throw _privateConstructorUsedError;
|
||||
|
||||
@@ -1298,7 +1298,7 @@ abstract class $InitParamsCopyWith<$Res> {
|
||||
InitParams value, $Res Function(InitParams) then) =
|
||||
_$InitParamsCopyWithImpl<$Res, InitParams>;
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'home-dir') String homeDir, int version});
|
||||
$Res call({@JsonKey(name: "home-dir") String homeDir, int version});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1340,7 +1340,7 @@ abstract class _$$InitParamsImplCopyWith<$Res>
|
||||
__$$InitParamsImplCopyWithImpl<$Res>;
|
||||
@override
|
||||
@useResult
|
||||
$Res call({@JsonKey(name: 'home-dir') String homeDir, int version});
|
||||
$Res call({@JsonKey(name: "home-dir") String homeDir, int version});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1376,14 +1376,14 @@ class __$$InitParamsImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$InitParamsImpl implements _InitParams {
|
||||
const _$InitParamsImpl(
|
||||
{@JsonKey(name: 'home-dir') required this.homeDir,
|
||||
{@JsonKey(name: "home-dir") required this.homeDir,
|
||||
required this.version});
|
||||
|
||||
factory _$InitParamsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$InitParamsImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'home-dir')
|
||||
@JsonKey(name: "home-dir")
|
||||
final String homeDir;
|
||||
@override
|
||||
final int version;
|
||||
@@ -1424,14 +1424,14 @@ class _$InitParamsImpl implements _InitParams {
|
||||
|
||||
abstract class _InitParams implements InitParams {
|
||||
const factory _InitParams(
|
||||
{@JsonKey(name: 'home-dir') required final String homeDir,
|
||||
{@JsonKey(name: "home-dir") required final String homeDir,
|
||||
required final int version}) = _$InitParamsImpl;
|
||||
|
||||
factory _InitParams.fromJson(Map<String, dynamic> json) =
|
||||
_$InitParamsImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'home-dir')
|
||||
@JsonKey(name: "home-dir")
|
||||
String get homeDir;
|
||||
@override
|
||||
int get version;
|
||||
@@ -1450,9 +1450,9 @@ ChangeProxyParams _$ChangeProxyParamsFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChangeProxyParams {
|
||||
@JsonKey(name: 'group-name')
|
||||
@JsonKey(name: "group-name")
|
||||
String get groupName => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'proxy-name')
|
||||
@JsonKey(name: "proxy-name")
|
||||
String get proxyName => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ChangeProxyParams to a JSON map.
|
||||
@@ -1472,8 +1472,8 @@ abstract class $ChangeProxyParamsCopyWith<$Res> {
|
||||
_$ChangeProxyParamsCopyWithImpl<$Res, ChangeProxyParams>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'group-name') String groupName,
|
||||
@JsonKey(name: 'proxy-name') String proxyName});
|
||||
{@JsonKey(name: "group-name") String groupName,
|
||||
@JsonKey(name: "proxy-name") String proxyName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1516,8 +1516,8 @@ abstract class _$$ChangeProxyParamsImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'group-name') String groupName,
|
||||
@JsonKey(name: 'proxy-name') String proxyName});
|
||||
{@JsonKey(name: "group-name") String groupName,
|
||||
@JsonKey(name: "proxy-name") String proxyName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1553,17 +1553,17 @@ class __$$ChangeProxyParamsImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$ChangeProxyParamsImpl implements _ChangeProxyParams {
|
||||
const _$ChangeProxyParamsImpl(
|
||||
{@JsonKey(name: 'group-name') required this.groupName,
|
||||
@JsonKey(name: 'proxy-name') required this.proxyName});
|
||||
{@JsonKey(name: "group-name") required this.groupName,
|
||||
@JsonKey(name: "proxy-name") required this.proxyName});
|
||||
|
||||
factory _$ChangeProxyParamsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ChangeProxyParamsImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'group-name')
|
||||
@JsonKey(name: "group-name")
|
||||
final String groupName;
|
||||
@override
|
||||
@JsonKey(name: 'proxy-name')
|
||||
@JsonKey(name: "proxy-name")
|
||||
final String proxyName;
|
||||
|
||||
@override
|
||||
@@ -1605,18 +1605,18 @@ class _$ChangeProxyParamsImpl implements _ChangeProxyParams {
|
||||
|
||||
abstract class _ChangeProxyParams implements ChangeProxyParams {
|
||||
const factory _ChangeProxyParams(
|
||||
{@JsonKey(name: 'group-name') required final String groupName,
|
||||
@JsonKey(name: 'proxy-name') required final String proxyName}) =
|
||||
{@JsonKey(name: "group-name") required final String groupName,
|
||||
@JsonKey(name: "proxy-name") required final String proxyName}) =
|
||||
_$ChangeProxyParamsImpl;
|
||||
|
||||
factory _ChangeProxyParams.fromJson(Map<String, dynamic> json) =
|
||||
_$ChangeProxyParamsImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'group-name')
|
||||
@JsonKey(name: "group-name")
|
||||
String get groupName;
|
||||
@override
|
||||
@JsonKey(name: 'proxy-name')
|
||||
@JsonKey(name: "proxy-name")
|
||||
String get proxyName;
|
||||
|
||||
/// Create a copy of ChangeProxyParams
|
||||
@@ -1633,9 +1633,9 @@ UpdateGeoDataParams _$UpdateGeoDataParamsFromJson(Map<String, dynamic> json) {
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UpdateGeoDataParams {
|
||||
@JsonKey(name: 'geo-type')
|
||||
@JsonKey(name: "geo-type")
|
||||
String get geoType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'geo-name')
|
||||
@JsonKey(name: "geo-name")
|
||||
String get geoName => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this UpdateGeoDataParams to a JSON map.
|
||||
@@ -1655,8 +1655,8 @@ abstract class $UpdateGeoDataParamsCopyWith<$Res> {
|
||||
_$UpdateGeoDataParamsCopyWithImpl<$Res, UpdateGeoDataParams>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'geo-type') String geoType,
|
||||
@JsonKey(name: 'geo-name') String geoName});
|
||||
{@JsonKey(name: "geo-type") String geoType,
|
||||
@JsonKey(name: "geo-name") String geoName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1699,8 +1699,8 @@ abstract class _$$UpdateGeoDataParamsImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'geo-type') String geoType,
|
||||
@JsonKey(name: 'geo-name') String geoName});
|
||||
{@JsonKey(name: "geo-type") String geoType,
|
||||
@JsonKey(name: "geo-name") String geoName});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -1736,17 +1736,17 @@ class __$$UpdateGeoDataParamsImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$UpdateGeoDataParamsImpl implements _UpdateGeoDataParams {
|
||||
const _$UpdateGeoDataParamsImpl(
|
||||
{@JsonKey(name: 'geo-type') required this.geoType,
|
||||
@JsonKey(name: 'geo-name') required this.geoName});
|
||||
{@JsonKey(name: "geo-type") required this.geoType,
|
||||
@JsonKey(name: "geo-name") required this.geoName});
|
||||
|
||||
factory _$UpdateGeoDataParamsImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$UpdateGeoDataParamsImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'geo-type')
|
||||
@JsonKey(name: "geo-type")
|
||||
final String geoType;
|
||||
@override
|
||||
@JsonKey(name: 'geo-name')
|
||||
@JsonKey(name: "geo-name")
|
||||
final String geoName;
|
||||
|
||||
@override
|
||||
@@ -1786,18 +1786,18 @@ class _$UpdateGeoDataParamsImpl implements _UpdateGeoDataParams {
|
||||
|
||||
abstract class _UpdateGeoDataParams implements UpdateGeoDataParams {
|
||||
const factory _UpdateGeoDataParams(
|
||||
{@JsonKey(name: 'geo-type') required final String geoType,
|
||||
@JsonKey(name: 'geo-name') required final String geoName}) =
|
||||
{@JsonKey(name: "geo-type") required final String geoType,
|
||||
@JsonKey(name: "geo-name") required final String geoName}) =
|
||||
_$UpdateGeoDataParamsImpl;
|
||||
|
||||
factory _UpdateGeoDataParams.fromJson(Map<String, dynamic> json) =
|
||||
_$UpdateGeoDataParamsImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'geo-type')
|
||||
@JsonKey(name: "geo-type")
|
||||
String get geoType;
|
||||
@override
|
||||
@JsonKey(name: 'geo-name')
|
||||
@JsonKey(name: "geo-name")
|
||||
String get geoName;
|
||||
|
||||
/// Create a copy of UpdateGeoDataParams
|
||||
@@ -2489,13 +2489,13 @@ ProviderSubscriptionInfo _$ProviderSubscriptionInfoFromJson(
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ProviderSubscriptionInfo {
|
||||
@JsonKey(name: 'UPLOAD')
|
||||
@JsonKey(name: "UPLOAD")
|
||||
int get upload => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'DOWNLOAD')
|
||||
@JsonKey(name: "DOWNLOAD")
|
||||
int get download => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'TOTAL')
|
||||
@JsonKey(name: "TOTAL")
|
||||
int get total => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'EXPIRE')
|
||||
@JsonKey(name: "EXPIRE")
|
||||
int get expire => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ProviderSubscriptionInfo to a JSON map.
|
||||
@@ -2515,10 +2515,10 @@ abstract class $ProviderSubscriptionInfoCopyWith<$Res> {
|
||||
_$ProviderSubscriptionInfoCopyWithImpl<$Res, ProviderSubscriptionInfo>;
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'UPLOAD') int upload,
|
||||
@JsonKey(name: 'DOWNLOAD') int download,
|
||||
@JsonKey(name: 'TOTAL') int total,
|
||||
@JsonKey(name: 'EXPIRE') int expire});
|
||||
{@JsonKey(name: "UPLOAD") int upload,
|
||||
@JsonKey(name: "DOWNLOAD") int download,
|
||||
@JsonKey(name: "TOTAL") int total,
|
||||
@JsonKey(name: "EXPIRE") int expire});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -2573,10 +2573,10 @@ abstract class _$$ProviderSubscriptionInfoImplCopyWith<$Res>
|
||||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{@JsonKey(name: 'UPLOAD') int upload,
|
||||
@JsonKey(name: 'DOWNLOAD') int download,
|
||||
@JsonKey(name: 'TOTAL') int total,
|
||||
@JsonKey(name: 'EXPIRE') int expire});
|
||||
{@JsonKey(name: "UPLOAD") int upload,
|
||||
@JsonKey(name: "DOWNLOAD") int download,
|
||||
@JsonKey(name: "TOTAL") int total,
|
||||
@JsonKey(name: "EXPIRE") int expire});
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@@ -2624,25 +2624,25 @@ class __$$ProviderSubscriptionInfoImplCopyWithImpl<$Res>
|
||||
@JsonSerializable()
|
||||
class _$ProviderSubscriptionInfoImpl implements _ProviderSubscriptionInfo {
|
||||
const _$ProviderSubscriptionInfoImpl(
|
||||
{@JsonKey(name: 'UPLOAD') this.upload = 0,
|
||||
@JsonKey(name: 'DOWNLOAD') this.download = 0,
|
||||
@JsonKey(name: 'TOTAL') this.total = 0,
|
||||
@JsonKey(name: 'EXPIRE') this.expire = 0});
|
||||
{@JsonKey(name: "UPLOAD") this.upload = 0,
|
||||
@JsonKey(name: "DOWNLOAD") this.download = 0,
|
||||
@JsonKey(name: "TOTAL") this.total = 0,
|
||||
@JsonKey(name: "EXPIRE") this.expire = 0});
|
||||
|
||||
factory _$ProviderSubscriptionInfoImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ProviderSubscriptionInfoImplFromJson(json);
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'UPLOAD')
|
||||
@JsonKey(name: "UPLOAD")
|
||||
final int upload;
|
||||
@override
|
||||
@JsonKey(name: 'DOWNLOAD')
|
||||
@JsonKey(name: "DOWNLOAD")
|
||||
final int download;
|
||||
@override
|
||||
@JsonKey(name: 'TOTAL')
|
||||
@JsonKey(name: "TOTAL")
|
||||
final int total;
|
||||
@override
|
||||
@JsonKey(name: 'EXPIRE')
|
||||
@JsonKey(name: "EXPIRE")
|
||||
final int expire;
|
||||
|
||||
@override
|
||||
@@ -2685,26 +2685,26 @@ class _$ProviderSubscriptionInfoImpl implements _ProviderSubscriptionInfo {
|
||||
|
||||
abstract class _ProviderSubscriptionInfo implements ProviderSubscriptionInfo {
|
||||
const factory _ProviderSubscriptionInfo(
|
||||
{@JsonKey(name: 'UPLOAD') final int upload,
|
||||
@JsonKey(name: 'DOWNLOAD') final int download,
|
||||
@JsonKey(name: 'TOTAL') final int total,
|
||||
@JsonKey(name: 'EXPIRE') final int expire}) =
|
||||
{@JsonKey(name: "UPLOAD") final int upload,
|
||||
@JsonKey(name: "DOWNLOAD") final int download,
|
||||
@JsonKey(name: "TOTAL") final int total,
|
||||
@JsonKey(name: "EXPIRE") final int expire}) =
|
||||
_$ProviderSubscriptionInfoImpl;
|
||||
|
||||
factory _ProviderSubscriptionInfo.fromJson(Map<String, dynamic> json) =
|
||||
_$ProviderSubscriptionInfoImpl.fromJson;
|
||||
|
||||
@override
|
||||
@JsonKey(name: 'UPLOAD')
|
||||
@JsonKey(name: "UPLOAD")
|
||||
int get upload;
|
||||
@override
|
||||
@JsonKey(name: 'DOWNLOAD')
|
||||
@JsonKey(name: "DOWNLOAD")
|
||||
int get download;
|
||||
@override
|
||||
@JsonKey(name: 'TOTAL')
|
||||
@JsonKey(name: "TOTAL")
|
||||
int get total;
|
||||
@override
|
||||
@JsonKey(name: 'EXPIRE')
|
||||
@JsonKey(name: "EXPIRE")
|
||||
int get expire;
|
||||
|
||||
/// Create a copy of ProviderSubscriptionInfo
|
||||
@@ -2725,12 +2725,12 @@ mixin _$ExternalProvider {
|
||||
String get type => throw _privateConstructorUsedError;
|
||||
String? get path => throw _privateConstructorUsedError;
|
||||
int get count => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
SubscriptionInfo? get subscriptionInfo => throw _privateConstructorUsedError;
|
||||
bool get isUpdating => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'vehicle-type')
|
||||
@JsonKey(name: "vehicle-type")
|
||||
String get vehicleType => throw _privateConstructorUsedError;
|
||||
@JsonKey(name: 'update-at')
|
||||
@JsonKey(name: "update-at")
|
||||
DateTime get updateAt => throw _privateConstructorUsedError;
|
||||
|
||||
/// Serializes this ExternalProvider to a JSON map.
|
||||
@@ -2754,11 +2754,11 @@ abstract class $ExternalProviderCopyWith<$Res> {
|
||||
String type,
|
||||
String? path,
|
||||
int count,
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
SubscriptionInfo? subscriptionInfo,
|
||||
bool isUpdating,
|
||||
@JsonKey(name: 'vehicle-type') String vehicleType,
|
||||
@JsonKey(name: 'update-at') DateTime updateAt});
|
||||
@JsonKey(name: "vehicle-type") String vehicleType,
|
||||
@JsonKey(name: "update-at") DateTime updateAt});
|
||||
|
||||
$SubscriptionInfoCopyWith<$Res>? get subscriptionInfo;
|
||||
}
|
||||
@@ -2851,11 +2851,11 @@ abstract class _$$ExternalProviderImplCopyWith<$Res>
|
||||
String type,
|
||||
String? path,
|
||||
int count,
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
SubscriptionInfo? subscriptionInfo,
|
||||
bool isUpdating,
|
||||
@JsonKey(name: 'vehicle-type') String vehicleType,
|
||||
@JsonKey(name: 'update-at') DateTime updateAt});
|
||||
@JsonKey(name: "vehicle-type") String vehicleType,
|
||||
@JsonKey(name: "update-at") DateTime updateAt});
|
||||
|
||||
@override
|
||||
$SubscriptionInfoCopyWith<$Res>? get subscriptionInfo;
|
||||
@@ -2928,11 +2928,11 @@ class _$ExternalProviderImpl implements _ExternalProvider {
|
||||
required this.type,
|
||||
this.path,
|
||||
required this.count,
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
this.subscriptionInfo,
|
||||
this.isUpdating = false,
|
||||
@JsonKey(name: 'vehicle-type') required this.vehicleType,
|
||||
@JsonKey(name: 'update-at') required this.updateAt});
|
||||
@JsonKey(name: "vehicle-type") required this.vehicleType,
|
||||
@JsonKey(name: "update-at") required this.updateAt});
|
||||
|
||||
factory _$ExternalProviderImpl.fromJson(Map<String, dynamic> json) =>
|
||||
_$$ExternalProviderImplFromJson(json);
|
||||
@@ -2946,16 +2946,16 @@ class _$ExternalProviderImpl implements _ExternalProvider {
|
||||
@override
|
||||
final int count;
|
||||
@override
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
final SubscriptionInfo? subscriptionInfo;
|
||||
@override
|
||||
@JsonKey()
|
||||
final bool isUpdating;
|
||||
@override
|
||||
@JsonKey(name: 'vehicle-type')
|
||||
@JsonKey(name: "vehicle-type")
|
||||
final String vehicleType;
|
||||
@override
|
||||
@JsonKey(name: 'update-at')
|
||||
@JsonKey(name: "update-at")
|
||||
final DateTime updateAt;
|
||||
|
||||
@override
|
||||
@@ -3010,11 +3010,11 @@ abstract class _ExternalProvider implements ExternalProvider {
|
||||
required final String type,
|
||||
final String? path,
|
||||
required final int count,
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
final SubscriptionInfo? subscriptionInfo,
|
||||
final bool isUpdating,
|
||||
@JsonKey(name: 'vehicle-type') required final String vehicleType,
|
||||
@JsonKey(name: 'update-at')
|
||||
@JsonKey(name: "vehicle-type") required final String vehicleType,
|
||||
@JsonKey(name: "update-at")
|
||||
required final DateTime updateAt}) = _$ExternalProviderImpl;
|
||||
|
||||
factory _ExternalProvider.fromJson(Map<String, dynamic> json) =
|
||||
@@ -3029,15 +3029,15 @@ abstract class _ExternalProvider implements ExternalProvider {
|
||||
@override
|
||||
int get count;
|
||||
@override
|
||||
@JsonKey(name: 'subscription-info', fromJson: subscriptionInfoFormCore)
|
||||
@JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore)
|
||||
SubscriptionInfo? get subscriptionInfo;
|
||||
@override
|
||||
bool get isUpdating;
|
||||
@override
|
||||
@JsonKey(name: 'vehicle-type')
|
||||
@JsonKey(name: "vehicle-type")
|
||||
String get vehicleType;
|
||||
@override
|
||||
@JsonKey(name: 'update-at')
|
||||
@JsonKey(name: "update-at")
|
||||
DateTime get updateAt;
|
||||
|
||||
/// Create a copy of ExternalProvider
|
||||
|
||||
@@ -68,6 +68,7 @@ const _$LogLevelEnumMap = {
|
||||
LogLevel.warning: 'warning',
|
||||
LogLevel.error: 'error',
|
||||
LogLevel.silent: 'silent',
|
||||
LogLevel.app: 'app',
|
||||
};
|
||||
|
||||
const _$ExternalControllerStatusEnumMap = {
|
||||
|
||||
@@ -492,7 +492,7 @@ class _$ProfileImpl implements _Profile {
|
||||
{required this.id,
|
||||
this.label,
|
||||
this.currentGroupName,
|
||||
this.url = '',
|
||||
this.url = "",
|
||||
this.lastUpdateDate,
|
||||
required this.autoUpdateDuration,
|
||||
this.subscriptionInfo,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user