From 22e71ec6e177792f35ab3680ea2d1b99e8874eee Mon Sep 17 00:00:00 2001 From: chen08209 Date: Sat, 9 Nov 2024 20:17:57 +0800 Subject: [PATCH] Fix windows tray issues Support setting bypassDomain Update flutter version Fix android service issues Fix macos dock exit button issues Add route address setting Optimize provider view --- .../kotlin/com/follow/clash/extensions/Ext.kt | 37 +- .../kotlin/com/follow/clash/models/Props.kt | 4 +- .../follow/clash/services/FlClashService.kt | 35 +- .../clash/services/FlClashVpnService.kt | 25 +- core/Clash.Meta | 2 +- core/common.go | 175 +- core/hub.go | 492 - core/lib.go | 475 + core/state.go | 1 + core/state/state.go | 2 + lib/application.dart | 3 +- lib/clash/core.dart | 1 + lib/clash/generated/clash_ffi.dart | 8771 ++++++++--------- lib/common/color.dart | 1 - lib/common/link.dart | 7 +- lib/common/window.dart | 4 - lib/controller.dart | 131 +- lib/enum/enum.dart | 5 + lib/fragments/config/config.dart | 1 + lib/fragments/config/network.dart | 187 +- lib/fragments/dashboard/dashboard.dart | 21 +- lib/fragments/dashboard/intranet_ip.dart | 30 +- ...{status_switch.dart => status_button.dart} | 86 +- lib/fragments/profiles/profiles.dart | 44 +- lib/fragments/proxies/list.dart | 11 +- lib/fragments/proxies/providers.dart | 20 +- lib/l10n/arb/intl_en.arb | 9 +- lib/l10n/arb/intl_zh_CN.arb | 13 +- lib/l10n/intl/messages_en.dart | 10 + lib/l10n/intl/messages_zh_CN.dart | 12 +- lib/l10n/l10n.dart | 70 + lib/main.dart | 12 + lib/manager/app_state_manager.dart | 2 - lib/manager/clash_manager.dart | 9 +- lib/manager/proxy_manager.dart | 9 +- lib/manager/tile_manager.dart | 3 - lib/manager/tray_manager.dart | 9 +- lib/manager/window_manager.dart | 12 +- lib/models/clash_config.dart | 122 +- lib/models/config.dart | 37 +- lib/models/ffi.dart | 32 +- .../generated/clash_config.freezed.dart | 65 +- lib/models/generated/clash_config.g.dart | 16 +- lib/models/generated/common.freezed.dart | 263 +- lib/models/generated/config.freezed.dart | 308 +- lib/models/generated/config.g.dart | 22 +- lib/models/generated/ffi.freezed.dart | 696 +- lib/models/generated/ffi.g.dart | 31 +- lib/models/generated/profile.freezed.dart | 172 +- lib/models/generated/profile.g.dart | 15 +- lib/models/generated/selector.freezed.dart | 427 +- lib/models/profile.dart | 25 +- lib/models/selector.dart | 5 +- lib/plugins/vpn.dart | 1 + lib/state.dart | 161 +- lib/widgets/back_scope.dart | 4 +- lib/widgets/list.dart | 18 +- lib/widgets/sheet.dart | 2 +- lib/widgets/subscription_info_view.dart | 53 + lib/widgets/widgets.dart | 41 +- linux/flutter/generated_plugin_registrant.cc | 8 +- linux/flutter/generated_plugins.cmake | 2 +- macos/Flutter/GeneratedPluginRegistrant.swift | 10 +- macos/Runner/AppDelegate.swift | 40 +- macos/Runner/MainFlutterWindow.swift | 3 +- plugins/proxy/lib/proxy.dart | 197 +- plugins/proxy/lib/proxy_method_channel.dart | 9 +- .../proxy/lib/proxy_platform_interface.dart | 2 +- plugins/proxy/windows/proxy_plugin.cpp | 30 +- plugins/window_ext/.metadata | 13 +- plugins/window_ext/example/.gitignore | 43 - plugins/window_ext/example/README.md | 16 - .../window_ext/example/analysis_options.yaml | 28 - .../plugin_integration_test.dart | 25 - plugins/window_ext/example/lib/main.dart | 63 - plugins/window_ext/example/pubspec.lock | 283 - plugins/window_ext/example/pubspec.yaml | 85 - .../window_ext/example/test/widget_test.dart | 27 - plugins/window_ext/example/windows/.gitignore | 17 - .../window_ext/example/windows/CMakeLists.txt | 110 - .../example/windows/flutter/CMakeLists.txt | 109 - .../example/windows/runner/CMakeLists.txt | 40 - .../example/windows/runner/Runner.rc | 121 - .../example/windows/runner/flutter_window.cpp | 71 - .../example/windows/runner/flutter_window.h | 33 - .../example/windows/runner/main.cpp | 43 - .../example/windows/runner/resource.h | 16 - .../windows/runner/resources/app_icon.ico | Bin 33772 -> 0 bytes .../windows/runner/runner.exe.manifest | 20 - .../example/windows/runner/utils.cpp | 65 - .../window_ext/example/windows/runner/utils.h | 19 - .../example/windows/runner/win32_window.cpp | 288 - .../example/windows/runner/win32_window.h | 102 - .../window_ext/lib/window_ext_listener.dart | 2 + .../window_ext/lib/window_ext_manager.dart | 10 +- .../macos/Classes/WindowExtPlugin.swift | 25 + plugins/window_ext/macos/window_ext.podspec | 23 + plugins/window_ext/pubspec.yaml | 2 + .../test/window_ext_method_channel_test.dart | 27 - plugins/window_ext/test/window_ext_test.dart | 29 - pubspec.lock | 273 +- pubspec.yaml | 19 +- test/command_test.dart | 8 +- .../flutter/generated_plugin_registrant.cc | 9 +- windows/flutter/generated_plugins.cmake | 3 +- 105 files changed, 7553 insertions(+), 8072 deletions(-) create mode 100644 core/lib.go rename lib/fragments/dashboard/{status_switch.dart => status_button.dart} (59%) create mode 100644 lib/widgets/subscription_info_view.dart delete mode 100644 plugins/window_ext/example/.gitignore delete mode 100644 plugins/window_ext/example/README.md delete mode 100644 plugins/window_ext/example/analysis_options.yaml delete mode 100644 plugins/window_ext/example/integration_test/plugin_integration_test.dart delete mode 100644 plugins/window_ext/example/lib/main.dart delete mode 100644 plugins/window_ext/example/pubspec.lock delete mode 100644 plugins/window_ext/example/pubspec.yaml delete mode 100644 plugins/window_ext/example/test/widget_test.dart delete mode 100644 plugins/window_ext/example/windows/.gitignore delete mode 100644 plugins/window_ext/example/windows/CMakeLists.txt delete mode 100644 plugins/window_ext/example/windows/flutter/CMakeLists.txt delete mode 100644 plugins/window_ext/example/windows/runner/CMakeLists.txt delete mode 100644 plugins/window_ext/example/windows/runner/Runner.rc delete mode 100644 plugins/window_ext/example/windows/runner/flutter_window.cpp delete mode 100644 plugins/window_ext/example/windows/runner/flutter_window.h delete mode 100644 plugins/window_ext/example/windows/runner/main.cpp delete mode 100644 plugins/window_ext/example/windows/runner/resource.h delete mode 100644 plugins/window_ext/example/windows/runner/resources/app_icon.ico delete mode 100644 plugins/window_ext/example/windows/runner/runner.exe.manifest delete mode 100644 plugins/window_ext/example/windows/runner/utils.cpp delete mode 100644 plugins/window_ext/example/windows/runner/utils.h delete mode 100644 plugins/window_ext/example/windows/runner/win32_window.cpp delete mode 100644 plugins/window_ext/example/windows/runner/win32_window.h create mode 100644 plugins/window_ext/macos/Classes/WindowExtPlugin.swift create mode 100644 plugins/window_ext/macos/window_ext.podspec delete mode 100644 plugins/window_ext/test/window_ext_method_channel_test.dart delete mode 100644 plugins/window_ext/test/window_ext_test.dart diff --git a/android/app/src/main/kotlin/com/follow/clash/extensions/Ext.kt b/android/app/src/main/kotlin/com/follow/clash/extensions/Ext.kt index ffc7ae5..0bbc4e8 100644 --- a/android/app/src/main/kotlin/com/follow/clash/extensions/Ext.kt +++ b/android/app/src/main/kotlin/com/follow/clash/extensions/Ext.kt @@ -15,6 +15,7 @@ import androidx.core.graphics.drawable.toBitmap import com.follow.clash.TempActivity import com.follow.clash.models.CIDR import com.follow.clash.models.Metadata +import com.follow.clash.models.VpnOptions import io.flutter.plugin.common.MethodChannel import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext @@ -42,6 +43,40 @@ fun Metadata.getProtocol(): Int? { return null } +fun VpnOptions.getIpv4RouteAddress(): List { + return routeAddress.filter { + it.isIpv4() + }.map { + it.toCIDR() + } +} + +fun VpnOptions.getIpv6RouteAddress(): List { + return routeAddress.filter { + it.isIpv6() + }.map { + it.toCIDR() + } +} + +fun String.isIpv4(): Boolean { + val parts = split("/") + if (parts.size != 2) { + throw IllegalArgumentException("Invalid CIDR format") + } + val address = InetAddress.getByName(parts[0]) + return address.address.size == 4 +} + +fun String.isIpv6(): Boolean { + val parts = split("/") + if (parts.size != 2) { + throw IllegalArgumentException("Invalid CIDR format") + } + val address = InetAddress.getByName(parts[0]) + return address.address.size == 16 +} + fun String.toCIDR(): CIDR { val parts = split("/") if (parts.size != 2) { @@ -79,7 +114,7 @@ fun InetAddress.asSocketAddressText(port: Int): String { } } -fun Context.wrapAction(action: String):String{ +fun Context.wrapAction(action: String): String { return "${this.packageName}.action.$action" } diff --git a/android/app/src/main/kotlin/com/follow/clash/models/Props.kt b/android/app/src/main/kotlin/com/follow/clash/models/Props.kt index b40a7b6..980aa86 100644 --- a/android/app/src/main/kotlin/com/follow/clash/models/Props.kt +++ b/android/app/src/main/kotlin/com/follow/clash/models/Props.kt @@ -3,8 +3,7 @@ package com.follow.clash.models import java.net.InetAddress enum class AccessControlMode { - acceptSelected, - rejectSelected, + acceptSelected, rejectSelected, } data class AccessControl( @@ -22,6 +21,7 @@ data class VpnOptions( val allowBypass: Boolean, val systemProxy: Boolean, val bypassDomain: List, + val routeAddress: List, val ipv4Address: String, val ipv6Address: String, val dnsServerAddress: String, diff --git a/android/app/src/main/kotlin/com/follow/clash/services/FlClashService.kt b/android/app/src/main/kotlin/com/follow/clash/services/FlClashService.kt index 74aa226..c4a676c 100644 --- a/android/app/src/main/kotlin/com/follow/clash/services/FlClashService.kt +++ b/android/app/src/main/kotlin/com/follow/clash/services/FlClashService.kt @@ -17,6 +17,9 @@ import com.follow.clash.GlobalState import com.follow.clash.MainActivity import com.follow.clash.extensions.getActionPendingIntent import com.follow.clash.models.VpnOptions +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch class FlClashService : Service(), BaseServiceInterface { @@ -69,7 +72,7 @@ class FlClashService : Service(), BaseServiceInterface { addAction( 0, GlobalState.getText("stop"), - getActionPendingIntent("CHANGE") + getActionPendingIntent("STOP") ) setOngoing(true) setShowWhen(false) @@ -89,21 +92,23 @@ class FlClashService : Service(), BaseServiceInterface { @SuppressLint("ForegroundServiceType", "WrongConstant") override fun startForeground(title: String, content: String) { - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - val manager = getSystemService(NotificationManager::class.java) - var channel = manager?.getNotificationChannel(CHANNEL) - if (channel == null) { - channel = - NotificationChannel(CHANNEL, "FlClash", NotificationManager.IMPORTANCE_LOW) - manager?.createNotificationChannel(channel) + CoroutineScope(Dispatchers.Default).launch { + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + val manager = getSystemService(NotificationManager::class.java) + var channel = manager?.getNotificationChannel(CHANNEL) + if (channel == null) { + channel = + NotificationChannel(CHANNEL, "FlClash", NotificationManager.IMPORTANCE_LOW) + manager?.createNotificationChannel(channel) + } + } + val notification = + notificationBuilder.setContentTitle(title).setContentText(content).build() + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { + startForeground(notificationId, notification, FOREGROUND_SERVICE_TYPE_SPECIAL_USE) + } else { + startForeground(notificationId, notification) } - } - val notification = - notificationBuilder.setContentTitle(title).setContentText(content).build() - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE) { - startForeground(notificationId, notification, FOREGROUND_SERVICE_TYPE_SPECIAL_USE) - } else { - startForeground(notificationId, notification) } } } \ No newline at end of file diff --git a/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt b/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt index e5d1caa..61676c1 100644 --- a/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt +++ b/android/app/src/main/kotlin/com/follow/clash/services/FlClashVpnService.kt @@ -15,20 +15,21 @@ import android.os.Build import android.os.IBinder import android.os.Parcel import android.os.RemoteException +import android.util.Log import androidx.core.app.NotificationCompat import com.follow.clash.BaseServiceInterface import com.follow.clash.GlobalState import com.follow.clash.MainActivity import com.follow.clash.R -import com.follow.clash.TempActivity import com.follow.clash.extensions.getActionPendingIntent +import com.follow.clash.extensions.getIpv4RouteAddress +import com.follow.clash.extensions.getIpv6RouteAddress import com.follow.clash.extensions.toCIDR import com.follow.clash.models.AccessControlMode import com.follow.clash.models.VpnOptions import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch -import kotlinx.coroutines.runBlocking class FlClashVpnService : VpnService(), BaseServiceInterface { @@ -42,12 +43,28 @@ class FlClashVpnService : VpnService(), BaseServiceInterface { if (options.ipv4Address.isNotEmpty()) { val cidr = options.ipv4Address.toCIDR() addAddress(cidr.address, cidr.prefixLength) - addRoute("0.0.0.0", 0) + val routeAddress = options.getIpv4RouteAddress() + if (routeAddress.isNotEmpty()) { + routeAddress.forEach { i -> + Log.d("addRoute4", "address: ${i.address} prefixLength:${i.prefixLength}") + addRoute(i.address, i.prefixLength) + } + } else { + addRoute("0.0.0.0", 0) + } } if (options.ipv6Address.isNotEmpty()) { val cidr = options.ipv6Address.toCIDR() addAddress(cidr.address, cidr.prefixLength) - addRoute("::", 0) + val routeAddress = options.getIpv6RouteAddress() + if (routeAddress.isNotEmpty()) { + routeAddress.forEach { i -> + Log.d("addRoute6", "address: ${i.address} prefixLength:${i.prefixLength}") + addRoute(i.address, i.prefixLength) + } + } else { + addRoute("::", 0) + } } addDnsServer(options.dnsServerAddress) setMtu(9000) diff --git a/core/Clash.Meta b/core/Clash.Meta index 317fd5e..148f1a2 160000 --- a/core/Clash.Meta +++ b/core/Clash.Meta @@ -1 +1 @@ -Subproject commit 317fd5ece01f788e75673763761cd06f6be1d4b2 +Subproject commit 148f1a2445cf90a98e922006293b1df0d5886c9a diff --git a/core/common.go b/core/common.go index 3f8955e..0ffca86 100644 --- a/core/common.go +++ b/core/common.go @@ -66,12 +66,13 @@ type ProcessMapItem struct { } type ExternalProvider struct { - Name string `json:"name"` - Type string `json:"type"` - VehicleType string `json:"vehicle-type"` - Count int `json:"count"` - Path string `json:"path"` - UpdateAt time.Time `json:"update-at"` + Name string `json:"name"` + Type string `json:"type"` + VehicleType string `json:"vehicle-type"` + Count int `json:"count"` + Path string `json:"path"` + UpdateAt time.Time `json:"update-at"` + SubscriptionInfo *provider.SubscriptionInfo `json:"subscription-info"` } type ExternalProviders []ExternalProvider @@ -198,12 +199,13 @@ func toExternalProvider(p cp.Provider) (*ExternalProvider, error) { case *provider.ProxySetProvider: psp := p.(*provider.ProxySetProvider) return &ExternalProvider{ - Name: psp.Name(), - Type: psp.Type().String(), - VehicleType: psp.VehicleType().String(), - Count: psp.Count(), - Path: psp.Vehicle().Path(), - UpdateAt: psp.UpdatedAt(), + Name: psp.Name(), + Type: psp.Type().String(), + VehicleType: psp.VehicleType().String(), + Count: psp.Count(), + UpdateAt: psp.UpdatedAt(), + Path: psp.Vehicle().Path(), + SubscriptionInfo: psp.GetSubscriptionInfo(), }, nil case *rp.RuleSetProvider: rsp := p.(*rp.RuleSetProvider) @@ -212,8 +214,8 @@ func toExternalProvider(p cp.Provider) (*ExternalProvider, error) { Type: rsp.Type().String(), VehicleType: rsp.VehicleType().String(), Count: rsp.Count(), - Path: rsp.Vehicle().Path(), UpdateAt: rsp.UpdatedAt(), + Path: rsp.Vehicle().Path(), }, nil default: return nil, errors.New("not external provider") @@ -247,152 +249,6 @@ func decorationConfig(profileId string, cfg config.RawConfig) *config.RawConfig return prof } -//func Reduce[T any, U any](s []T, initVal U, f func(U, T) U) U { -// for _, v := range s { -// initVal = f(initVal, v) -// } -// return initVal -//} -// -//func Map[T, U any](slice []T, fn func(T) U) []U { -// result := make([]U, len(slice)) -// for i, v := range slice { -// result[i] = fn(v) -// } -// return result -//} -// -//func replaceFromMap(s string, m map[string]string) string { -// for k, v := range m { -// s = strings.ReplaceAll(s, k, v) -// } -// return s -//} -// -//func removeDuplicateFromSlice[T any](slice []T) []T { -// result := make([]T, 0) -// seen := make(map[any]struct{}) -// for _, value := range slice { -// if _, ok := seen[value]; !ok { -// result = append(result, value) -// seen[value] = struct{}{} -// } -// } -// return result -//} - -//func generateProxyGroupAndRule(proxyGroup *[]map[string]any, rule *[]string) { -// var replacements = map[string]string{} -// var selectArr []map[string]any -// var urlTestArr []map[string]any -// var fallbackArr []map[string]any -// for _, group := range *proxyGroup { -// switch group["type"] { -// case "select": -// selectArr = append(selectArr, group) -// replacements[group["name"].(string)] = "Proxy" -// break -// case "url-test": -// urlTestArr = append(urlTestArr, group) -// replacements[group["name"].(string)] = "Auto" -// break -// case "fallback": -// fallbackArr = append(fallbackArr, group) -// replacements[group["name"].(string)] = "Fallback" -// break -// default: -// break -// } -// } -// -// ProxyProxies := Reduce(selectArr, []string{}, func(res []string, cur map[string]any) []string { -// if cur["proxies"] == nil { -// return res -// } -// for _, proxyName := range cur["proxies"].([]interface{}) { -// if str, ok := proxyName.(string); ok { -// str = replaceFromMap(str, replacements) -// if str != "Proxy" { -// res = append(res, str) -// } -// } -// } -// return res -// }) -// -// ProxyProxies = removeDuplicateFromSlice(ProxyProxies) -// -// AutoProxies := Reduce(urlTestArr, []string{}, func(res []string, cur map[string]any) []string { -// if cur["proxies"] == nil { -// return res -// } -// for _, proxyName := range cur["proxies"].([]interface{}) { -// if str, ok := proxyName.(string); ok { -// str = replaceFromMap(str, replacements) -// if str != "Auto" { -// res = append(res, str) -// } -// } -// } -// return res -// }) -// -// AutoProxies = removeDuplicateFromSlice(AutoProxies) -// -// FallbackProxies := Reduce(fallbackArr, []string{}, func(res []string, cur map[string]any) []string { -// if cur["proxies"] == nil { -// return res -// } -// for _, proxyName := range cur["proxies"].([]interface{}) { -// if str, ok := proxyName.(string); ok { -// str = replaceFromMap(str, replacements) -// if str != "Fallback" { -// res = append(res, str) -// } -// } -// } -// return res -// }) -// -// FallbackProxies = removeDuplicateFromSlice(FallbackProxies) -// -// var computedProxyGroup []map[string]any -// -// if len(ProxyProxies) > 0 { -// computedProxyGroup = append(computedProxyGroup, -// map[string]any{ -// "name": "Proxy", -// "type": "select", -// "proxies": ProxyProxies, -// }) -// } -// -// if len(AutoProxies) > 0 { -// computedProxyGroup = append(computedProxyGroup, -// map[string]any{ -// "name": "Auto", -// "type": "url-test", -// "proxies": AutoProxies, -// }) -// } -// -// if len(FallbackProxies) > 0 { -// computedProxyGroup = append(computedProxyGroup, -// map[string]any{ -// "name": "Fallback", -// "type": "fallback", -// "proxies": FallbackProxies, -// }) -// } -// -// computedRule := Map(*rule, func(value string) string { -// return replaceFromMap(value, replacements) -// }) -// -// *proxyGroup = computedProxyGroup -// *rule = computedRule -//} - func genHosts(hosts, patchHosts map[string]any) { for k, v := range patchHosts { hosts[k] = v @@ -582,6 +438,5 @@ func applyConfig() error { patchSelectGroup() } updateListeners(cfg.General, cfg.Listeners) - externalProviders = getExternalProvidersRaw() return err } diff --git a/core/hub.go b/core/hub.go index c0ec42c..06ab7d0 100644 --- a/core/hub.go +++ b/core/hub.go @@ -1,493 +1 @@ package main - -/* -#include -*/ -import "C" -import ( - "context" - bridge "core/dart-bridge" - "core/state" - "encoding/json" - "fmt" - "github.com/metacubex/mihomo/common/utils" - "os" - "runtime" - "sort" - "sync" - "time" - "unsafe" - - "github.com/metacubex/mihomo/adapter" - "github.com/metacubex/mihomo/adapter/outboundgroup" - "github.com/metacubex/mihomo/adapter/provider" - "github.com/metacubex/mihomo/component/updater" - "github.com/metacubex/mihomo/config" - "github.com/metacubex/mihomo/constant" - cp "github.com/metacubex/mihomo/constant/provider" - "github.com/metacubex/mihomo/hub/executor" - "github.com/metacubex/mihomo/log" - "github.com/metacubex/mihomo/tunnel" - "github.com/metacubex/mihomo/tunnel/statistic" -) - -var configParams = ConfigExtendedParams{} - -var externalProviders = map[string]cp.Provider{} - -var isInit = false - -//export start -func start() { - runLock.Lock() - defer runLock.Unlock() - isRunning = true -} - -//export stop -func stop() { - runLock.Lock() - go func() { - defer runLock.Unlock() - isRunning = false - stopListeners() - }() -} - -//export initClash -func initClash(homeDirStr *C.char) bool { - if !isInit { - constant.SetHomeDir(C.GoString(homeDirStr)) - isInit = true - } - return isInit -} - -//export getIsInit -func getIsInit() bool { - return isInit -} - -//export restartClash -func restartClash() bool { - execPath, _ := os.Executable() - go restartExecutable(execPath) - return true -} - -//export shutdownClash -func shutdownClash() bool { - stopListeners() - executor.Shutdown() - runtime.GC() - isInit = false - return true -} - -//export forceGc -func forceGc() { - go func() { - log.Infoln("[APP] request force GC") - runtime.GC() - }() -} - -//export validateConfig -func validateConfig(s *C.char, port C.longlong) { - i := int64(port) - bytes := []byte(C.GoString(s)) - go func() { - _, err := config.UnmarshalRawConfig(bytes) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - bridge.SendToPort(i, "") - }() -} - -var updateLock sync.Mutex - -//export updateConfig -func updateConfig(s *C.char, port C.longlong) { - i := int64(port) - paramsString := C.GoString(s) - go func() { - updateLock.Lock() - defer updateLock.Unlock() - var params = &GenerateConfigParams{} - err := json.Unmarshal([]byte(paramsString), params) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - configParams = params.Params - prof := decorationConfig(params.ProfileId, params.Config) - state.CurrentRawConfig = prof - err = applyConfig() - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - bridge.SendToPort(i, "") - }() -} - -//export clearEffect -func clearEffect(s *C.char) { - id := C.GoString(s) - go func() { - _ = removeFile(getProfilePath(id)) - _ = removeFile(getProfileProvidersPath(id)) - }() -} - -//export getProxies -func getProxies() *C.char { - data, err := json.Marshal(tunnel.ProxiesWithProviders()) - if err != nil { - return C.CString("") - } - return C.CString(string(data)) -} - -//export changeProxy -func changeProxy(s *C.char) { - paramsString := C.GoString(s) - var params = &ChangeProxyParams{} - err := json.Unmarshal([]byte(paramsString), params) - if err != nil { - log.Infoln("Unmarshal ChangeProxyParams %v", err) - } - groupName := *params.GroupName - proxyName := *params.ProxyName - proxies := tunnel.ProxiesWithProviders() - group, ok := proxies[groupName] - if !ok { - return - } - adapterProxy := group.(*adapter.Proxy) - selector, ok := adapterProxy.ProxyAdapter.(outboundgroup.SelectAble) - if !ok { - return - } - if proxyName == "" { - selector.ForceSet(proxyName) - } else { - err = selector.Set(proxyName) - } - if err == nil { - log.Infoln("[SelectAble] %s selected %s", groupName, proxyName) - } -} - -//export getTraffic -func getTraffic() *C.char { - up, down := statistic.DefaultManager.Current(state.CurrentState.OnlyProxy) - traffic := map[string]int64{ - "up": up, - "down": down, - } - data, err := json.Marshal(traffic) - if err != nil { - fmt.Println("Error:", err) - return C.CString("") - } - return C.CString(string(data)) -} - -//export getTotalTraffic -func getTotalTraffic() *C.char { - up, down := statistic.DefaultManager.Total(state.CurrentState.OnlyProxy) - traffic := map[string]int64{ - "up": up, - "down": down, - } - data, err := json.Marshal(traffic) - if err != nil { - fmt.Println("Error:", err) - return C.CString("") - } - return C.CString(string(data)) -} - -//export resetTraffic -func resetTraffic() { - statistic.DefaultManager.ResetStatistic() -} - -//export asyncTestDelay -func asyncTestDelay(s *C.char, port C.longlong) { - i := int64(port) - paramsString := C.GoString(s) - b.Go(paramsString, func() (bool, error) { - var params = &TestDelayParams{} - err := json.Unmarshal([]byte(paramsString), params) - if err != nil { - bridge.SendToPort(i, "") - return false, nil - } - - expectedStatus, err := utils.NewUnsignedRanges[uint16]("") - if err != nil { - bridge.SendToPort(i, "") - return false, nil - } - - ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*time.Duration(params.Timeout)) - defer cancel() - - proxies := tunnel.ProxiesWithProviders() - proxy := proxies[params.ProxyName] - - delayData := &Delay{ - Name: params.ProxyName, - } - - if proxy == nil { - delayData.Value = -1 - data, _ := json.Marshal(delayData) - bridge.SendToPort(i, string(data)) - return false, nil - } - - delay, err := proxy.URLTest(ctx, constant.DefaultTestURL, expectedStatus) - if err != nil || delay == 0 { - delayData.Value = -1 - data, _ := json.Marshal(delayData) - bridge.SendToPort(i, string(data)) - return false, nil - } - - delayData.Value = int32(delay) - data, _ := json.Marshal(delayData) - bridge.SendToPort(i, string(data)) - return false, nil - }) -} - -//export getVersionInfo -func getVersionInfo() *C.char { - versionInfo := map[string]string{ - "clashName": constant.Name, - "version": "1.18.5", - } - data, err := json.Marshal(versionInfo) - if err != nil { - fmt.Println("Error:", err) - return C.CString("") - } - return C.CString(string(data)) -} - -//export getConnections -func getConnections() *C.char { - snapshot := statistic.DefaultManager.Snapshot() - data, err := json.Marshal(snapshot) - if err != nil { - fmt.Println("Error:", err) - return C.CString("") - } - return C.CString(string(data)) -} - -//export closeConnections -func closeConnections() { - statistic.DefaultManager.Range(func(c statistic.Tracker) bool { - err := c.Close() - if err != nil { - return false - } - return true - }) -} - -//export closeConnection -func closeConnection(id *C.char) { - connectionId := C.GoString(id) - c := statistic.DefaultManager.Get(connectionId) - if c == nil { - return - } - _ = c.Close() -} - -//export getProviders -func getProviders() *C.char { - data, err := json.Marshal(tunnel.Providers()) - var msg *C.char - if err != nil { - msg = C.CString("") - return msg - } - msg = C.CString(string(data)) - return msg -} - -//export getProvider -func getProvider(name *C.char) *C.char { - providerName := C.GoString(name) - providers := tunnel.Providers() - data, err := json.Marshal(providers[providerName]) - if err != nil { - return C.CString("") - } - return C.CString(string(data)) -} - -//export getExternalProviders -func getExternalProviders() *C.char { - eps := make([]ExternalProvider, 0) - for _, p := range externalProviders { - externalProvider, err := toExternalProvider(p) - if err != nil { - continue - } - eps = append(eps, *externalProvider) - } - sort.Sort(ExternalProviders(eps)) - data, err := json.Marshal(eps) - if err != nil { - return C.CString("") - } - return C.CString(string(data)) -} - -//export getExternalProvider -func getExternalProvider(name *C.char) *C.char { - externalProviderName := C.GoString(name) - externalProvider, exist := externalProviders[externalProviderName] - if !exist { - return C.CString("") - } - e, err := toExternalProvider(externalProvider) - if err != nil { - return C.CString("") - } - data, err := json.Marshal(e) - if err != nil { - return C.CString("") - } - return C.CString(string(data)) -} - -//export updateGeoData -func updateGeoData(geoType *C.char, geoName *C.char, port C.longlong) { - i := int64(port) - geoTypeString := C.GoString(geoType) - geoNameString := C.GoString(geoName) - go func() { - path := constant.Path.Resolve(geoNameString) - switch geoTypeString { - case "MMDB": - err := updater.UpdateMMDBWithPath(path) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - case "ASN": - err := updater.UpdateASNWithPath(path) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - case "GeoIp": - err := updater.UpdateGeoIpWithPath(path) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - case "GeoSite": - err := updater.UpdateGeoSiteWithPath(path) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - } - bridge.SendToPort(i, "") - }() -} - -//export updateExternalProvider -func updateExternalProvider(providerName *C.char, port C.longlong) { - i := int64(port) - providerNameString := C.GoString(providerName) - go func() { - externalProvider, exist := externalProviders[providerNameString] - if !exist { - bridge.SendToPort(i, "external provider is not exist") - return - } - err := externalProvider.Update() - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - bridge.SendToPort(i, "") - }() -} - -//export sideLoadExternalProvider -func sideLoadExternalProvider(providerName *C.char, data *C.char, port C.longlong) { - i := int64(port) - bytes := []byte(C.GoString(data)) - providerNameString := C.GoString(providerName) - go func() { - externalProvider, exist := externalProviders[providerNameString] - if !exist { - bridge.SendToPort(i, "external provider is not exist") - return - } - err := sideUpdateExternalProvider(externalProvider, bytes) - if err != nil { - bridge.SendToPort(i, err.Error()) - return - } - bridge.SendToPort(i, "") - }() -} - -//export initNativeApiBridge -func initNativeApiBridge(api unsafe.Pointer) { - bridge.InitDartApi(api) -} - -//export initMessage -func initMessage(port C.longlong) { - i := int64(port) - Port = i -} - -//export freeCString -func freeCString(s *C.char) { - C.free(unsafe.Pointer(s)) -} - -func init() { - provider.HealthcheckHook = func(name string, delay uint16) { - delayData := &Delay{ - Name: name, - } - if delay == 0 { - delayData.Value = -1 - } else { - delayData.Value = int32(delay) - } - SendMessage(Message{ - Type: DelayMessage, - Data: delayData, - }) - } - statistic.DefaultRequestNotify = func(c statistic.Tracker) { - SendMessage(Message{ - Type: RequestMessage, - Data: c, - }) - } - executor.DefaultProviderLoadedHook = func(providerName string) { - SendMessage(Message{ - Type: LoadedMessage, - Data: providerName, - }) - } -} diff --git a/core/lib.go b/core/lib.go new file mode 100644 index 0000000..f7a6291 --- /dev/null +++ b/core/lib.go @@ -0,0 +1,475 @@ +package main + +/* +#include +*/ +import "C" +import ( + "context" + bridge "core/dart-bridge" + "core/state" + "encoding/json" + "fmt" + "github.com/metacubex/mihomo/common/utils" + "os" + "runtime" + "sort" + "sync" + "time" + "unsafe" + + "github.com/metacubex/mihomo/adapter" + "github.com/metacubex/mihomo/adapter/outboundgroup" + "github.com/metacubex/mihomo/adapter/provider" + "github.com/metacubex/mihomo/component/updater" + "github.com/metacubex/mihomo/config" + "github.com/metacubex/mihomo/constant" + cp "github.com/metacubex/mihomo/constant/provider" + "github.com/metacubex/mihomo/hub/executor" + "github.com/metacubex/mihomo/log" + "github.com/metacubex/mihomo/tunnel" + "github.com/metacubex/mihomo/tunnel/statistic" +) + +var configParams = ConfigExtendedParams{} + +var externalProviders = map[string]cp.Provider{} + +var isInit = false + +//export start +func start() { + runLock.Lock() + defer runLock.Unlock() + isRunning = true +} + +//export stop +func stop() { + runLock.Lock() + go func() { + defer runLock.Unlock() + isRunning = false + stopListeners() + }() +} + +//export initClash +func initClash(homeDirStr *C.char) bool { + if !isInit { + constant.SetHomeDir(C.GoString(homeDirStr)) + isInit = true + } + return isInit +} + +//export getIsInit +func getIsInit() bool { + return isInit +} + +//export restartClash +func restartClash() bool { + execPath, _ := os.Executable() + go restartExecutable(execPath) + return true +} + +//export shutdownClash +func shutdownClash() bool { + stopListeners() + executor.Shutdown() + runtime.GC() + isInit = false + return true +} + +//export forceGc +func forceGc() { + go func() { + log.Infoln("[APP] request force GC") + runtime.GC() + }() +} + +//export validateConfig +func validateConfig(s *C.char, port C.longlong) { + i := int64(port) + bytes := []byte(C.GoString(s)) + go func() { + _, err := config.UnmarshalRawConfig(bytes) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + bridge.SendToPort(i, "") + }() +} + +var updateLock sync.Mutex + +//export updateConfig +func updateConfig(s *C.char, port C.longlong) { + i := int64(port) + paramsString := C.GoString(s) + go func() { + updateLock.Lock() + defer updateLock.Unlock() + var params = &GenerateConfigParams{} + err := json.Unmarshal([]byte(paramsString), params) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + configParams = params.Params + prof := decorationConfig(params.ProfileId, params.Config) + state.CurrentRawConfig = prof + err = applyConfig() + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + bridge.SendToPort(i, "") + }() +} + +//export clearEffect +func clearEffect(s *C.char) { + id := C.GoString(s) + go func() { + _ = removeFile(getProfilePath(id)) + _ = removeFile(getProfileProvidersPath(id)) + }() +} + +//export getProxies +func getProxies() *C.char { + data, err := json.Marshal(tunnel.ProxiesWithProviders()) + if err != nil { + return C.CString("") + } + return C.CString(string(data)) +} + +//export changeProxy +func changeProxy(s *C.char) { + paramsString := C.GoString(s) + var params = &ChangeProxyParams{} + err := json.Unmarshal([]byte(paramsString), params) + if err != nil { + log.Infoln("Unmarshal ChangeProxyParams %v", err) + } + groupName := *params.GroupName + proxyName := *params.ProxyName + proxies := tunnel.ProxiesWithProviders() + group, ok := proxies[groupName] + if !ok { + return + } + adapterProxy := group.(*adapter.Proxy) + selector, ok := adapterProxy.ProxyAdapter.(outboundgroup.SelectAble) + if !ok { + return + } + if proxyName == "" { + selector.ForceSet(proxyName) + } else { + err = selector.Set(proxyName) + } + if err == nil { + log.Infoln("[SelectAble] %s selected %s", groupName, proxyName) + } +} + +//export getTraffic +func getTraffic() *C.char { + up, down := statistic.DefaultManager.Current(state.CurrentState.OnlyProxy) + traffic := map[string]int64{ + "up": up, + "down": down, + } + data, err := json.Marshal(traffic) + if err != nil { + fmt.Println("Error:", err) + return C.CString("") + } + return C.CString(string(data)) +} + +//export getTotalTraffic +func getTotalTraffic() *C.char { + up, down := statistic.DefaultManager.Total(state.CurrentState.OnlyProxy) + traffic := map[string]int64{ + "up": up, + "down": down, + } + data, err := json.Marshal(traffic) + if err != nil { + fmt.Println("Error:", err) + return C.CString("") + } + return C.CString(string(data)) +} + +//export resetTraffic +func resetTraffic() { + statistic.DefaultManager.ResetStatistic() +} + +//export asyncTestDelay +func asyncTestDelay(s *C.char, port C.longlong) { + i := int64(port) + paramsString := C.GoString(s) + b.Go(paramsString, func() (bool, error) { + var params = &TestDelayParams{} + err := json.Unmarshal([]byte(paramsString), params) + if err != nil { + bridge.SendToPort(i, "") + return false, nil + } + + expectedStatus, err := utils.NewUnsignedRanges[uint16]("") + if err != nil { + bridge.SendToPort(i, "") + return false, nil + } + + ctx, cancel := context.WithTimeout(context.Background(), time.Millisecond*time.Duration(params.Timeout)) + defer cancel() + + proxies := tunnel.ProxiesWithProviders() + proxy := proxies[params.ProxyName] + + delayData := &Delay{ + Name: params.ProxyName, + } + + if proxy == nil { + delayData.Value = -1 + data, _ := json.Marshal(delayData) + bridge.SendToPort(i, string(data)) + return false, nil + } + + delay, err := proxy.URLTest(ctx, constant.DefaultTestURL, expectedStatus) + if err != nil || delay == 0 { + delayData.Value = -1 + data, _ := json.Marshal(delayData) + bridge.SendToPort(i, string(data)) + return false, nil + } + + delayData.Value = int32(delay) + data, _ := json.Marshal(delayData) + bridge.SendToPort(i, string(data)) + return false, nil + }) +} + +//export getVersionInfo +func getVersionInfo() *C.char { + versionInfo := map[string]string{ + "clashName": constant.Name, + "version": "1.18.5", + } + data, err := json.Marshal(versionInfo) + if err != nil { + fmt.Println("Error:", err) + return C.CString("") + } + return C.CString(string(data)) +} + +//export getConnections +func getConnections() *C.char { + snapshot := statistic.DefaultManager.Snapshot() + data, err := json.Marshal(snapshot) + if err != nil { + fmt.Println("Error:", err) + return C.CString("") + } + return C.CString(string(data)) +} + +//export closeConnections +func closeConnections() { + statistic.DefaultManager.Range(func(c statistic.Tracker) bool { + err := c.Close() + if err != nil { + return false + } + return true + }) +} + +//export closeConnection +func closeConnection(id *C.char) { + connectionId := C.GoString(id) + c := statistic.DefaultManager.Get(connectionId) + if c == nil { + return + } + _ = c.Close() +} + +//export getExternalProviders +func getExternalProviders() *C.char { + runLock.Lock() + defer runLock.Unlock() + externalProviders = getExternalProvidersRaw() + eps := make([]ExternalProvider, 0) + for _, p := range externalProviders { + externalProvider, err := toExternalProvider(p) + if err != nil { + continue + } + eps = append(eps, *externalProvider) + } + sort.Sort(ExternalProviders(eps)) + data, err := json.Marshal(eps) + if err != nil { + return C.CString("") + } + return C.CString(string(data)) +} + +//export getExternalProvider +func getExternalProvider(name *C.char) *C.char { + runLock.Lock() + defer runLock.Unlock() + externalProviderName := C.GoString(name) + externalProvider, exist := externalProviders[externalProviderName] + if !exist { + return C.CString("") + } + e, err := toExternalProvider(externalProvider) + if err != nil { + return C.CString("") + } + data, err := json.Marshal(e) + if err != nil { + return C.CString("") + } + return C.CString(string(data)) +} + +//export updateGeoData +func updateGeoData(geoType *C.char, geoName *C.char, port C.longlong) { + i := int64(port) + geoTypeString := C.GoString(geoType) + geoNameString := C.GoString(geoName) + go func() { + path := constant.Path.Resolve(geoNameString) + switch geoTypeString { + case "MMDB": + err := updater.UpdateMMDBWithPath(path) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + case "ASN": + err := updater.UpdateASNWithPath(path) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + case "GeoIp": + err := updater.UpdateGeoIpWithPath(path) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + case "GeoSite": + err := updater.UpdateGeoSiteWithPath(path) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + } + bridge.SendToPort(i, "") + }() +} + +//export updateExternalProvider +func updateExternalProvider(providerName *C.char, port C.longlong) { + i := int64(port) + providerNameString := C.GoString(providerName) + go func() { + externalProvider, exist := externalProviders[providerNameString] + if !exist { + bridge.SendToPort(i, "external provider is not exist") + return + } + err := externalProvider.Update() + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + bridge.SendToPort(i, "") + }() +} + +//export sideLoadExternalProvider +func sideLoadExternalProvider(providerName *C.char, data *C.char, port C.longlong) { + i := int64(port) + bytes := []byte(C.GoString(data)) + providerNameString := C.GoString(providerName) + go func() { + externalProvider, exist := externalProviders[providerNameString] + if !exist { + bridge.SendToPort(i, "external provider is not exist") + return + } + err := sideUpdateExternalProvider(externalProvider, bytes) + if err != nil { + bridge.SendToPort(i, err.Error()) + return + } + bridge.SendToPort(i, "") + }() +} + +//export initNativeApiBridge +func initNativeApiBridge(api unsafe.Pointer) { + bridge.InitDartApi(api) +} + +//export initMessage +func initMessage(port C.longlong) { + i := int64(port) + Port = i +} + +//export freeCString +func freeCString(s *C.char) { + C.free(unsafe.Pointer(s)) +} + +func init() { + provider.HealthcheckHook = func(name string, delay uint16) { + delayData := &Delay{ + Name: name, + } + if delay == 0 { + delayData.Value = -1 + } else { + delayData.Value = int32(delay) + } + SendMessage(Message{ + Type: DelayMessage, + Data: delayData, + }) + } + statistic.DefaultRequestNotify = func(c statistic.Tracker) { + SendMessage(Message{ + Type: RequestMessage, + Data: c, + }) + } + executor.DefaultProviderLoadedHook = func(providerName string) { + SendMessage(Message{ + Type: LoadedMessage, + Data: providerName, + }) + } +} diff --git a/core/state.go b/core/state.go index e39ce35..dcb22d6 100644 --- a/core/state.go +++ b/core/state.go @@ -25,6 +25,7 @@ func getAndroidVpnOptions() *C.char { AccessControl: state.CurrentState.AccessControl, SystemProxy: state.CurrentState.SystemProxy, AllowBypass: state.CurrentState.AllowBypass, + RouteAddress: state.CurrentState.RouteAddress, BypassDomain: state.CurrentState.BypassDomain, DnsServerAddress: state.GetDnsServerAddress(), } diff --git a/core/state/state.go b/core/state/state.go index adb6787..0cdf43c 100644 --- a/core/state/state.go +++ b/core/state/state.go @@ -15,6 +15,7 @@ type AndroidVpnOptions struct { AllowBypass bool `json:"allowBypass"` SystemProxy bool `json:"systemProxy"` BypassDomain []string `json:"bypassDomain"` + RouteAddress []string `json:"routeAddress"` Ipv4Address string `json:"ipv4Address"` Ipv6Address string `json:"ipv6Address"` DnsServerAddress string `json:"dnsServerAddress"` @@ -32,6 +33,7 @@ type AndroidVpnRawOptions struct { AccessControl *AccessControl `json:"accessControl"` AllowBypass bool `json:"allowBypass"` SystemProxy bool `json:"systemProxy"` + RouteAddress []string `json:"routeAddress"` Ipv6 bool `json:"ipv6"` BypassDomain []string `json:"bypassDomain"` } diff --git a/lib/application.dart b/lib/application.dart index 9cbc48f..ceea1d6 100644 --- a/lib/application.dart +++ b/lib/application.dart @@ -19,6 +19,7 @@ runAppWithPreferences( Widget child, { required AppState appState, required Config config, + required AppFlowingState appFlowingState, required ClashConfig clashConfig, }) { runApp(MultiProvider( @@ -30,7 +31,7 @@ runAppWithPreferences( create: (_) => config, ), ChangeNotifierProvider( - create: (_) => AppFlowingState(), + create: (_) => appFlowingState, ), ChangeNotifierProxyProvider2( create: (_) => appState, diff --git a/lib/clash/core.dart b/lib/clash/core.dart index e5dc287..6357cb3 100644 --- a/lib/clash/core.dart +++ b/lib/clash/core.dart @@ -8,6 +8,7 @@ import 'package:ffi/ffi.dart'; import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/models/models.dart'; + import 'generated/clash_ffi.dart'; class ClashCore { diff --git a/lib/clash/generated/clash_ffi.dart b/lib/clash/generated/clash_ffi.dart index 9449c62..cb345d2 100644 --- a/lib/clash/generated/clash_ffi.dart +++ b/lib/clash/generated/clash_ffi.dart @@ -18,271 +18,518 @@ class ClashFFI { lookup) : _lookup = lookup; - void __va_start( - ffi.Pointer arg0, + ffi.Pointer> signal( + int arg0, + ffi.Pointer> arg1, ) { - return ___va_start( + return _signal( + arg0, + arg1, + ); + } + + late final _signalPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer> Function( + ffi.Int, + ffi.Pointer< + ffi.NativeFunction>)>>('signal'); + late final _signal = _signalPtr.asFunction< + ffi.Pointer> Function( + int, ffi.Pointer>)>(); + + int getpriority( + int arg0, + int arg1, + ) { + return _getpriority( + arg0, + arg1, + ); + } + + late final _getpriorityPtr = + _lookup>( + 'getpriority'); + late final _getpriority = + _getpriorityPtr.asFunction(); + + int getiopolicy_np( + int arg0, + int arg1, + ) { + return _getiopolicy_np( + arg0, + arg1, + ); + } + + late final _getiopolicy_npPtr = + _lookup>( + 'getiopolicy_np'); + late final _getiopolicy_np = + _getiopolicy_npPtr.asFunction(); + + int getrlimit( + int arg0, + ffi.Pointer arg1, + ) { + return _getrlimit( + arg0, + arg1, + ); + } + + late final _getrlimitPtr = _lookup< + ffi.NativeFunction)>>( + 'getrlimit'); + late final _getrlimit = + _getrlimitPtr.asFunction)>(); + + int getrusage( + int arg0, + ffi.Pointer arg1, + ) { + return _getrusage( + arg0, + arg1, + ); + } + + late final _getrusagePtr = _lookup< + ffi.NativeFunction)>>( + 'getrusage'); + late final _getrusage = + _getrusagePtr.asFunction)>(); + + int setpriority( + int arg0, + int arg1, + int arg2, + ) { + return _setpriority( + arg0, + arg1, + arg2, + ); + } + + late final _setpriorityPtr = + _lookup>( + 'setpriority'); + late final _setpriority = + _setpriorityPtr.asFunction(); + + int setiopolicy_np( + int arg0, + int arg1, + int arg2, + ) { + return _setiopolicy_np( + arg0, + arg1, + arg2, + ); + } + + late final _setiopolicy_npPtr = + _lookup>( + 'setiopolicy_np'); + late final _setiopolicy_np = + _setiopolicy_npPtr.asFunction(); + + int setrlimit( + int arg0, + ffi.Pointer arg1, + ) { + return _setrlimit( + arg0, + arg1, + ); + } + + late final _setrlimitPtr = _lookup< + ffi.NativeFunction)>>( + 'setrlimit'); + late final _setrlimit = + _setrlimitPtr.asFunction)>(); + + int wait1( + ffi.Pointer arg0, + ) { + return _wait1( arg0, ); } - late final ___va_startPtr = - _lookup)>>( - '__va_start'); - late final ___va_start = - ___va_startPtr.asFunction)>(); + late final _wait1Ptr = + _lookup)>>('wait'); + late final _wait1 = + _wait1Ptr.asFunction)>(); - void __security_init_cookie() { - return ___security_init_cookie(); - } - - late final ___security_init_cookiePtr = - _lookup>( - '__security_init_cookie'); - late final ___security_init_cookie = - ___security_init_cookiePtr.asFunction(); - - void __security_check_cookie( - int _StackCookie, + int waitpid( + int arg0, + ffi.Pointer arg1, + int arg2, ) { - return ___security_check_cookie( - _StackCookie, + return _waitpid( + arg0, + arg1, + arg2, ); } - late final ___security_check_cookiePtr = - _lookup>( - '__security_check_cookie'); - late final ___security_check_cookie = - ___security_check_cookiePtr.asFunction(); - - void __report_gsfailure( - int _StackCookie, - ) { - return ___report_gsfailure( - _StackCookie, - ); - } - - late final ___report_gsfailurePtr = - _lookup>( - '__report_gsfailure'); - late final ___report_gsfailure = - ___report_gsfailurePtr.asFunction(); - - late final ffi.Pointer ___security_cookie = - _lookup('__security_cookie'); - - int get __security_cookie => ___security_cookie.value; - - set __security_cookie(int value) => ___security_cookie.value = value; - - void _invalid_parameter_noinfo() { - return __invalid_parameter_noinfo(); - } - - late final __invalid_parameter_noinfoPtr = - _lookup>( - '_invalid_parameter_noinfo'); - late final __invalid_parameter_noinfo = - __invalid_parameter_noinfoPtr.asFunction(); - - void _invalid_parameter_noinfo_noreturn() { - return __invalid_parameter_noinfo_noreturn(); - } - - late final __invalid_parameter_noinfo_noreturnPtr = - _lookup>( - '_invalid_parameter_noinfo_noreturn'); - late final __invalid_parameter_noinfo_noreturn = - __invalid_parameter_noinfo_noreturnPtr.asFunction(); - - void _invoke_watson( - ffi.Pointer _Expression, - ffi.Pointer _FunctionName, - ffi.Pointer _FileName, - int _LineNo, - int _Reserved, - ) { - return __invoke_watson( - _Expression, - _FunctionName, - _FileName, - _LineNo, - _Reserved, - ); - } - - late final __invoke_watsonPtr = _lookup< + late final _waitpidPtr = _lookup< ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UintPtr)>>('_invoke_watson'); - late final __invoke_watson = __invoke_watsonPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int, int)>(); + pid_t Function(pid_t, ffi.Pointer, ffi.Int)>>('waitpid'); + late final _waitpid = + _waitpidPtr.asFunction, int)>(); - ffi.Pointer _errno() { - return __errno(); - } - - late final __errnoPtr = - _lookup Function()>>('_errno'); - late final __errno = __errnoPtr.asFunction Function()>(); - - int _set_errno( - int _Value, + int waitid( + idtype_t arg0, + Dart__uint32_t arg1, + ffi.Pointer arg2, + int arg3, ) { - return __set_errno( - _Value, + return _waitid( + arg0.value, + arg1, + arg2, + arg3, ); } - late final __set_errnoPtr = - _lookup>('_set_errno'); - late final __set_errno = __set_errnoPtr.asFunction(); - - int _get_errno( - ffi.Pointer _Value, - ) { - return __get_errno( - _Value, - ); - } - - late final __get_errnoPtr = - _lookup)>>( - '_get_errno'); - late final __get_errno = - __get_errnoPtr.asFunction)>(); - - int __threadid() { - return ___threadid(); - } - - late final ___threadidPtr = - _lookup>('__threadid'); - late final ___threadid = ___threadidPtr.asFunction(); - - int __threadhandle() { - return ___threadhandle(); - } - - late final ___threadhandlePtr = - _lookup>('__threadhandle'); - late final ___threadhandle = ___threadhandlePtr.asFunction(); - - ffi.Pointer _calloc_base( - int _Count, - int _Size, - ) { - return __calloc_base( - _Count, - _Size, - ); - } - - late final __calloc_basePtr = _lookup< + late final _waitidPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Size, ffi.Size)>>('_calloc_base'); - late final __calloc_base = - __calloc_basePtr.asFunction Function(int, int)>(); + ffi.Int Function(ffi.UnsignedInt, id_t, ffi.Pointer, + ffi.Int)>>('waitid'); + late final _waitid = _waitidPtr + .asFunction, int)>(); - ffi.Pointer calloc( - int _Count, - int _Size, + int wait3( + ffi.Pointer arg0, + int arg1, + ffi.Pointer arg2, ) { - return _calloc( - _Count, - _Size, + return _wait3( + arg0, + arg1, + arg2, ); } - late final _callocPtr = _lookup< + late final _wait3Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function(ffi.Size, ffi.Size)>>('calloc'); - late final _calloc = - _callocPtr.asFunction Function(int, int)>(); + pid_t Function( + ffi.Pointer, ffi.Int, ffi.Pointer)>>('wait3'); + late final _wait3 = _wait3Ptr.asFunction< + int Function(ffi.Pointer, int, ffi.Pointer)>(); - int _callnewh( - int _Size, + int wait4( + int arg0, + ffi.Pointer arg1, + int arg2, + ffi.Pointer arg3, ) { - return __callnewh( - _Size, + return _wait4( + arg0, + arg1, + arg2, + arg3, ); } - late final __callnewhPtr = - _lookup>('_callnewh'); - late final __callnewh = __callnewhPtr.asFunction(); + late final _wait4Ptr = _lookup< + ffi.NativeFunction< + pid_t Function(pid_t, ffi.Pointer, ffi.Int, + ffi.Pointer)>>('wait4'); + late final _wait4 = _wait4Ptr.asFunction< + int Function(int, ffi.Pointer, int, ffi.Pointer)>(); - ffi.Pointer _expand( - ffi.Pointer _Block, - int _Size, + ffi.Pointer alloca( + int arg0, ) { - return __expand( - _Block, - _Size, + return _alloca( + arg0, ); } - late final __expandPtr = _lookup< + late final _allocaPtr = + _lookup Function(ffi.Size)>>( + 'alloca'); + late final _alloca = + _allocaPtr.asFunction Function(int)>(); + + late final ffi.Pointer ___mb_cur_max = + _lookup('__mb_cur_max'); + + int get __mb_cur_max => ___mb_cur_max.value; + + set __mb_cur_max(int value) => ___mb_cur_max.value = value; + + ffi.Pointer malloc_type_malloc( + int size, + int type_id, + ) { + return _malloc_type_malloc( + size, + type_id, + ); + } + + late final _malloc_type_mallocPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('_expand'); - late final __expand = __expandPtr - .asFunction Function(ffi.Pointer, int)>(); + ffi.Size, malloc_type_id_t)>>('malloc_type_malloc'); + late final _malloc_type_malloc = _malloc_type_mallocPtr + .asFunction Function(int, int)>(); - void _free_base( - ffi.Pointer _Block, + ffi.Pointer malloc_type_calloc( + int count, + int size, + int type_id, ) { - return __free_base( - _Block, + return _malloc_type_calloc( + count, + size, + type_id, ); } - late final __free_basePtr = - _lookup)>>( - '_free_base'); - late final __free_base = - __free_basePtr.asFunction)>(); + late final _malloc_type_callocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Size, ffi.Size, malloc_type_id_t)>>('malloc_type_calloc'); + late final _malloc_type_calloc = _malloc_type_callocPtr + .asFunction Function(int, int, int)>(); - void free( - ffi.Pointer _Block, + void malloc_type_free( + ffi.Pointer ptr, + int type_id, ) { - return _free( - _Block, + return _malloc_type_free( + ptr, + type_id, ); } - late final _freePtr = - _lookup)>>( - 'free'); - late final _free = - _freePtr.asFunction)>(); + late final _malloc_type_freePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, malloc_type_id_t)>>('malloc_type_free'); + late final _malloc_type_free = _malloc_type_freePtr + .asFunction, int)>(); - ffi.Pointer _malloc_base( - int _Size, + ffi.Pointer malloc_type_realloc( + ffi.Pointer ptr, + int size, + int type_id, ) { - return __malloc_base( - _Size, + return _malloc_type_realloc( + ptr, + size, + type_id, ); } - late final __malloc_basePtr = - _lookup Function(ffi.Size)>>( - '_malloc_base'); - late final __malloc_base = - __malloc_basePtr.asFunction Function(int)>(); + late final _malloc_type_reallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Size, + malloc_type_id_t)>>('malloc_type_realloc'); + late final _malloc_type_realloc = _malloc_type_reallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); + + ffi.Pointer malloc_type_valloc( + int size, + int type_id, + ) { + return _malloc_type_valloc( + size, + type_id, + ); + } + + late final _malloc_type_vallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Size, malloc_type_id_t)>>('malloc_type_valloc'); + late final _malloc_type_valloc = _malloc_type_vallocPtr + .asFunction Function(int, int)>(); + + ffi.Pointer malloc_type_aligned_alloc( + int alignment, + int size, + int type_id, + ) { + return _malloc_type_aligned_alloc( + alignment, + size, + type_id, + ); + } + + late final _malloc_type_aligned_allocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Size, ffi.Size, + malloc_type_id_t)>>('malloc_type_aligned_alloc'); + late final _malloc_type_aligned_alloc = _malloc_type_aligned_allocPtr + .asFunction Function(int, int, int)>(); + + int malloc_type_posix_memalign( + ffi.Pointer> memptr, + int alignment, + int size, + int type_id, + ) { + return _malloc_type_posix_memalign( + memptr, + alignment, + size, + type_id, + ); + } + + late final _malloc_type_posix_memalignPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer>, ffi.Size, + ffi.Size, malloc_type_id_t)>>('malloc_type_posix_memalign'); + late final _malloc_type_posix_memalign = + _malloc_type_posix_memalignPtr.asFunction< + int Function(ffi.Pointer>, int, int, int)>(); + + ffi.Pointer malloc_type_zone_malloc( + ffi.Pointer zone, + int size, + int type_id, + ) { + return _malloc_type_zone_malloc( + zone, + size, + type_id, + ); + } + + late final _malloc_type_zone_mallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Size, + malloc_type_id_t)>>('malloc_type_zone_malloc'); + late final _malloc_type_zone_malloc = _malloc_type_zone_mallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); + + ffi.Pointer malloc_type_zone_calloc( + ffi.Pointer zone, + int count, + int size, + int type_id, + ) { + return _malloc_type_zone_calloc( + zone, + count, + size, + type_id, + ); + } + + late final _malloc_type_zone_callocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Size, + ffi.Size, malloc_type_id_t)>>('malloc_type_zone_calloc'); + late final _malloc_type_zone_calloc = _malloc_type_zone_callocPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, int, int)>(); + + void malloc_type_zone_free( + ffi.Pointer zone, + ffi.Pointer ptr, + int type_id, + ) { + return _malloc_type_zone_free( + zone, + ptr, + type_id, + ); + } + + late final _malloc_type_zone_freePtr = _lookup< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Pointer, + malloc_type_id_t)>>('malloc_type_zone_free'); + late final _malloc_type_zone_free = _malloc_type_zone_freePtr.asFunction< + void Function(ffi.Pointer, ffi.Pointer, int)>(); + + ffi.Pointer malloc_type_zone_realloc( + ffi.Pointer zone, + ffi.Pointer ptr, + int size, + int type_id, + ) { + return _malloc_type_zone_realloc( + zone, + ptr, + size, + type_id, + ); + } + + late final _malloc_type_zone_reallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + malloc_type_id_t)>>('malloc_type_zone_realloc'); + late final _malloc_type_zone_realloc = + _malloc_type_zone_reallocPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int, int)>(); + + ffi.Pointer malloc_type_zone_valloc( + ffi.Pointer zone, + int size, + int type_id, + ) { + return _malloc_type_zone_valloc( + zone, + size, + type_id, + ); + } + + late final _malloc_type_zone_vallocPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Size, + malloc_type_id_t)>>('malloc_type_zone_valloc'); + late final _malloc_type_zone_valloc = _malloc_type_zone_vallocPtr.asFunction< + ffi.Pointer Function(ffi.Pointer, int, int)>(); + + ffi.Pointer malloc_type_zone_memalign( + ffi.Pointer zone, + int alignment, + int size, + int type_id, + ) { + return _malloc_type_zone_memalign( + zone, + alignment, + size, + type_id, + ); + } + + late final _malloc_type_zone_memalignPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, ffi.Size, + ffi.Size, malloc_type_id_t)>>('malloc_type_zone_memalign'); + late final _malloc_type_zone_memalign = + _malloc_type_zone_memalignPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, int, int, int)>(); ffi.Pointer malloc( - int _Size, + int __size, ) { return _malloc( - _Size, + __size, ); } @@ -292,58 +539,43 @@ class ClashFFI { late final _malloc = _mallocPtr.asFunction Function(int)>(); - int _msize_base( - ffi.Pointer _Block, + ffi.Pointer calloc( + int __count, + int __size, ) { - return __msize_base( - _Block, + return _calloc( + __count, + __size, ); } - late final __msize_basePtr = - _lookup)>>( - '_msize_base'); - late final __msize_base = - __msize_basePtr.asFunction)>(); - - int _msize( - ffi.Pointer _Block, - ) { - return __msize( - _Block, - ); - } - - late final __msizePtr = - _lookup)>>( - '_msize'); - late final __msize = - __msizePtr.asFunction)>(); - - ffi.Pointer _realloc_base( - ffi.Pointer _Block, - int _Size, - ) { - return __realloc_base( - _Block, - _Size, - ); - } - - late final __realloc_basePtr = _lookup< + late final _callocPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size)>>('_realloc_base'); - late final __realloc_base = __realloc_basePtr - .asFunction Function(ffi.Pointer, int)>(); + ffi.Pointer Function(ffi.Size, ffi.Size)>>('calloc'); + late final _calloc = + _callocPtr.asFunction Function(int, int)>(); + + void free( + ffi.Pointer arg0, + ) { + return _free( + arg0, + ); + } + + late final _freePtr = + _lookup)>>( + 'free'); + late final _free = + _freePtr.asFunction)>(); ffi.Pointer realloc( - ffi.Pointer _Block, - int _Size, + ffi.Pointer __ptr, + int __size, ) { return _realloc( - _Block, - _Size, + __ptr, + __size, ); } @@ -354,1606 +586,71 @@ class ClashFFI { late final _realloc = _reallocPtr .asFunction Function(ffi.Pointer, int)>(); - ffi.Pointer _recalloc_base( - ffi.Pointer _Block, - int _Count, - int _Size, + ffi.Pointer reallocf( + ffi.Pointer __ptr, + int __size, ) { - return __recalloc_base( - _Block, - _Count, - _Size, + return _reallocf( + __ptr, + __size, ); } - late final __recalloc_basePtr = _lookup< + late final _reallocfPtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('_recalloc_base'); - late final __recalloc_base = __recalloc_basePtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer, ffi.Size)>>('reallocf'); + late final _reallocf = _reallocfPtr + .asFunction Function(ffi.Pointer, int)>(); - ffi.Pointer _recalloc( - ffi.Pointer _Block, - int _Count, - int _Size, + ffi.Pointer valloc( + int __size, ) { - return __recalloc( - _Block, - _Count, - _Size, + return _valloc( + __size, ); } - late final __recallocPtr = _lookup< + late final _vallocPtr = + _lookup Function(ffi.Size)>>( + 'valloc'); + late final _valloc = + _vallocPtr.asFunction Function(int)>(); + + ffi.Pointer aligned_alloc( + int __alignment, + int __size, + ) { + return _aligned_alloc( + __alignment, + __size, + ); + } + + late final _aligned_allocPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('_recalloc'); - late final __recalloc = __recallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); + ffi.Pointer Function(ffi.Size, ffi.Size)>>('aligned_alloc'); + late final _aligned_alloc = + _aligned_allocPtr.asFunction Function(int, int)>(); - void _aligned_free( - ffi.Pointer _Block, + int posix_memalign( + ffi.Pointer> __memptr, + int __alignment, + int __size, ) { - return __aligned_free( - _Block, + return _posix_memalign( + __memptr, + __alignment, + __size, ); } - late final __aligned_freePtr = - _lookup)>>( - '_aligned_free'); - late final __aligned_free = - __aligned_freePtr.asFunction)>(); - - ffi.Pointer _aligned_malloc( - int _Size, - int _Alignment, - ) { - return __aligned_malloc( - _Size, - _Alignment, - ); - } - - late final __aligned_mallocPtr = _lookup< - ffi - .NativeFunction Function(ffi.Size, ffi.Size)>>( - '_aligned_malloc'); - late final __aligned_malloc = __aligned_mallocPtr - .asFunction Function(int, int)>(); - - ffi.Pointer _aligned_offset_malloc( - int _Size, - int _Alignment, - int _Offset, - ) { - return __aligned_offset_malloc( - _Size, - _Alignment, - _Offset, - ); - } - - late final __aligned_offset_mallocPtr = _lookup< + late final _posix_memalignPtr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Size, ffi.Size, ffi.Size)>>('_aligned_offset_malloc'); - late final __aligned_offset_malloc = __aligned_offset_mallocPtr - .asFunction Function(int, int, int)>(); - - int _aligned_msize( - ffi.Pointer _Block, - int _Alignment, - int _Offset, - ) { - return __aligned_msize( - _Block, - _Alignment, - _Offset, - ); - } - - late final __aligned_msizePtr = _lookup< - ffi.NativeFunction< - ffi.Size Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('_aligned_msize'); - late final __aligned_msize = __aligned_msizePtr - .asFunction, int, int)>(); - - ffi.Pointer _aligned_offset_realloc( - ffi.Pointer _Block, - int _Size, - int _Alignment, - int _Offset, - ) { - return __aligned_offset_realloc( - _Block, - _Size, - _Alignment, - _Offset, - ); - } - - late final __aligned_offset_reallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, - ffi.Size, ffi.Size)>>('_aligned_offset_realloc'); - late final __aligned_offset_realloc = __aligned_offset_reallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int, int)>(); - - ffi.Pointer _aligned_offset_recalloc( - ffi.Pointer _Block, - int _Count, - int _Size, - int _Alignment, - int _Offset, - ) { - return __aligned_offset_recalloc( - _Block, - _Count, - _Size, - _Alignment, - _Offset, - ); - } - - late final __aligned_offset_recallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, - ffi.Size, ffi.Size, ffi.Size)>>('_aligned_offset_recalloc'); - late final __aligned_offset_recalloc = - __aligned_offset_recallocPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, int, int, int, int)>(); - - ffi.Pointer _aligned_realloc( - ffi.Pointer _Block, - int _Size, - int _Alignment, - ) { - return __aligned_realloc( - _Block, - _Size, - _Alignment, - ); - } - - late final __aligned_reallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Size, ffi.Size)>>('_aligned_realloc'); - late final __aligned_realloc = __aligned_reallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int)>(); - - ffi.Pointer _aligned_recalloc( - ffi.Pointer _Block, - int _Count, - int _Size, - int _Alignment, - ) { - return __aligned_recalloc( - _Block, - _Count, - _Size, - _Alignment, - ); - } - - late final __aligned_recallocPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, ffi.Size, - ffi.Size, ffi.Size)>>('_aligned_recalloc'); - late final __aligned_recalloc = __aligned_recallocPtr.asFunction< - ffi.Pointer Function(ffi.Pointer, int, int, int)>(); - - ffi.Pointer bsearch_s( - ffi.Pointer _Key, - ffi.Pointer _Base, - int _NumOfElements, - int _SizeOfElements, - _CoreCrtSecureSearchSortCompareFunction _CompareFunction, - ffi.Pointer _Context, - ) { - return _bsearch_s( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - _Context, - ); - } - - late final _bsearch_sPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - rsize_t, - rsize_t, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>>('bsearch_s'); - late final _bsearch_s = _bsearch_sPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>(); - - void qsort_s( - ffi.Pointer _Base, - int _NumOfElements, - int _SizeOfElements, - _CoreCrtSecureSearchSortCompareFunction _CompareFunction, - ffi.Pointer _Context, - ) { - return _qsort_s( - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - _Context, - ); - } - - late final _qsort_sPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - rsize_t, - rsize_t, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>>('qsort_s'); - late final _qsort_s = _qsort_sPtr.asFunction< - void Function(ffi.Pointer, int, int, - _CoreCrtSecureSearchSortCompareFunction, ffi.Pointer)>(); - - ffi.Pointer bsearch( - ffi.Pointer _Key, - ffi.Pointer _Base, - int _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return _bsearch( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final _bsearchPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Size, - _CoreCrtNonSecureSearchSortCompareFunction)>>('bsearch'); - late final _bsearch = _bsearchPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - int, - int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - void qsort( - ffi.Pointer _Base, - int _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return _qsort( - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final _qsortPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Size, ffi.Size, - _CoreCrtNonSecureSearchSortCompareFunction)>>('qsort'); - late final _qsort = _qsortPtr.asFunction< - void Function(ffi.Pointer, int, int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - ffi.Pointer _lfind_s( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtSecureSearchSortCompareFunction _CompareFunction, - ffi.Pointer _Context, - ) { - return __lfind_s( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - _Context, - ); - } - - late final __lfind_sPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>>('_lfind_s'); - late final __lfind_s = __lfind_sPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>(); - - ffi.Pointer _lfind( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return __lfind( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final __lfindPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - _CoreCrtNonSecureSearchSortCompareFunction)>>('_lfind'); - late final __lfind = __lfindPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - ffi.Pointer _lsearch_s( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtSecureSearchSortCompareFunction _CompareFunction, - ffi.Pointer _Context, - ) { - return __lsearch_s( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - _Context, - ); - } - - late final __lsearch_sPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Size, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>>('_lsearch_s'); - late final __lsearch_s = __lsearch_sPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtSecureSearchSortCompareFunction, - ffi.Pointer)>(); - - ffi.Pointer _lsearch( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return __lsearch( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final __lsearchPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - _CoreCrtNonSecureSearchSortCompareFunction)>>('_lsearch'); - late final __lsearch = __lsearchPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - ffi.Pointer lfind( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return _lfind1( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final _lfindPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - _CoreCrtNonSecureSearchSortCompareFunction)>>('lfind'); - late final _lfind1 = _lfindPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - ffi.Pointer lsearch( - ffi.Pointer _Key, - ffi.Pointer _Base, - ffi.Pointer _NumOfElements, - int _SizeOfElements, - _CoreCrtNonSecureSearchSortCompareFunction _CompareFunction, - ) { - return _lsearch1( - _Key, - _Base, - _NumOfElements, - _SizeOfElements, - _CompareFunction, - ); - } - - late final _lsearchPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - _CoreCrtNonSecureSearchSortCompareFunction)>>('lsearch'); - late final _lsearch1 = _lsearchPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - _CoreCrtNonSecureSearchSortCompareFunction)>(); - - int _itow_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __itow_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __itow_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Int, ffi.Pointer, ffi.Size, ffi.Int)>>('_itow_s'); - late final __itow_s = __itow_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _itow( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __itow( - _Value, - _Buffer, - _Radix, - ); - } - - late final __itowPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer, ffi.Int)>>('_itow'); - late final __itow = __itowPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ltow_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ltow_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ltow_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Long, ffi.Pointer, ffi.Size, ffi.Int)>>('_ltow_s'); - late final __ltow_s = __ltow_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ltow( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ltow( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ltowPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Long, ffi.Pointer, ffi.Int)>>('_ltow'); - late final __ltow = __ltowPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ultow_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ultow_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ultow_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.UnsignedLong, ffi.Pointer, ffi.Size, - ffi.Int)>>('_ultow_s'); - late final __ultow_s = __ultow_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ultow( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ultow( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ultowPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedLong, ffi.Pointer, ffi.Int)>>('_ultow'); - late final __ultow = __ultowPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - double wcstod( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - ) { - return _wcstod( - _String, - _EndPtr, - ); - } - - late final _wcstodPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer>)>>('wcstod'); - late final _wcstod = _wcstodPtr.asFunction< - double Function( - ffi.Pointer, ffi.Pointer>)>(); - - double _wcstod_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - _locale_t _Locale, - ) { - return __wcstod_l( - _String, - _EndPtr, - _Locale, - ); - } - - late final __wcstod_lPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>>('_wcstod_l'); - late final __wcstod_l = __wcstod_lPtr.asFunction< - double Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>(); - - int wcstol( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return _wcstol( - _String, - _EndPtr, - _Radix, - ); - } - - late final _wcstolPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstol'); - late final _wcstol = _wcstolPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstol_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstol_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstol_lPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstol_l'); - late final __wcstol_l = __wcstol_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int wcstoll( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return _wcstoll( - _String, - _EndPtr, - _Radix, - ); - } - - late final _wcstollPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstoll'); - late final _wcstoll = _wcstollPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstoll_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstoll_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstoll_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstoll_l'); - late final __wcstoll_l = __wcstoll_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int wcstoul( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return _wcstoul( - _String, - _EndPtr, - _Radix, - ); - } - - late final _wcstoulPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstoul'); - late final _wcstoul = _wcstoulPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstoul_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstoul_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstoul_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstoul_l'); - late final __wcstoul_l = __wcstoul_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int wcstoull( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return _wcstoull( - _String, - _EndPtr, - _Radix, - ); - } - - late final _wcstoullPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('wcstoull'); - late final _wcstoull = _wcstoullPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstoull_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstoull_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstoull_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstoull_l'); - late final __wcstoull_l = __wcstoull_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - double wcstof( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - ) { - return _wcstof( - _String, - _EndPtr, - ); - } - - late final _wcstofPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer>)>>('wcstof'); - late final _wcstof = _wcstofPtr.asFunction< - double Function( - ffi.Pointer, ffi.Pointer>)>(); - - double _wcstof_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - _locale_t _Locale, - ) { - return __wcstof_l( - _String, - _EndPtr, - _Locale, - ); - } - - late final __wcstof_lPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>>('_wcstof_l'); - late final __wcstof_l = __wcstof_lPtr.asFunction< - double Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>(); - - double _wtof( - ffi.Pointer _String, - ) { - return __wtof( - _String, - ); - } - - late final __wtofPtr = - _lookup)>>( - '_wtof'); - late final __wtof = - __wtofPtr.asFunction)>(); - - double _wtof_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __wtof_l( - _String, - _Locale, - ); - } - - late final __wtof_lPtr = _lookup< - ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, _locale_t)>>('_wtof_l'); - late final __wtof_l = __wtof_lPtr - .asFunction, _locale_t)>(); - - int _wtoi( - ffi.Pointer _String, - ) { - return __wtoi( - _String, - ); - } - - late final __wtoiPtr = - _lookup)>>( - '_wtoi'); - late final __wtoi = - __wtoiPtr.asFunction)>(); - - int _wtoi_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __wtoi_l( - _String, - _Locale, - ); - } - - late final __wtoi_lPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, _locale_t)>>('_wtoi_l'); - late final __wtoi_l = - __wtoi_lPtr.asFunction, _locale_t)>(); - - int _wtol( - ffi.Pointer _String, - ) { - return __wtol( - _String, - ); - } - - late final __wtolPtr = - _lookup)>>( - '_wtol'); - late final __wtol = - __wtolPtr.asFunction)>(); - - int _wtol_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __wtol_l( - _String, - _Locale, - ); - } - - late final __wtol_lPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, _locale_t)>>('_wtol_l'); - late final __wtol_l = - __wtol_lPtr.asFunction, _locale_t)>(); - - int _wtoll( - ffi.Pointer _String, - ) { - return __wtoll( - _String, - ); - } - - late final __wtollPtr = _lookup< - ffi - .NativeFunction)>>('_wtoll'); - late final __wtoll = - __wtollPtr.asFunction)>(); - - int _wtoll_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __wtoll_l( - _String, - _Locale, - ); - } - - late final __wtoll_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, _locale_t)>>('_wtoll_l'); - late final __wtoll_l = __wtoll_lPtr - .asFunction, _locale_t)>(); - - int _i64tow_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __i64tow_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __i64tow_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.LongLong, ffi.Pointer, ffi.Size, - ffi.Int)>>('_i64tow_s'); - late final __i64tow_s = __i64tow_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _i64tow( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __i64tow( - _Value, - _Buffer, - _Radix, - ); - } - - late final __i64towPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.LongLong, ffi.Pointer, ffi.Int)>>('_i64tow'); - late final __i64tow = __i64towPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ui64tow_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ui64tow_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ui64tow_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.UnsignedLongLong, ffi.Pointer, - ffi.Size, ffi.Int)>>('_ui64tow_s'); - late final __ui64tow_s = __ui64tow_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ui64tow( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ui64tow( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ui64towPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.UnsignedLongLong, - ffi.Pointer, ffi.Int)>>('_ui64tow'); - late final __ui64tow = __ui64towPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _wtoi64( - ffi.Pointer _String, - ) { - return __wtoi64( - _String, - ); - } - - late final __wtoi64Ptr = _lookup< - ffi.NativeFunction)>>( - '_wtoi64'); - late final __wtoi64 = - __wtoi64Ptr.asFunction)>(); - - int _wtoi64_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __wtoi64_l( - _String, - _Locale, - ); - } - - late final __wtoi64_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, _locale_t)>>('_wtoi64_l'); - late final __wtoi64_l = __wtoi64_lPtr - .asFunction, _locale_t)>(); - - int _wcstoi64( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return __wcstoi64( - _String, - _EndPtr, - _Radix, - ); - } - - late final __wcstoi64Ptr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('_wcstoi64'); - late final __wcstoi64 = __wcstoi64Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstoi64_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstoi64_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstoi64_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstoi64_l'); - late final __wcstoi64_l = __wcstoi64_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int _wcstoui64( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return __wcstoui64( - _String, - _EndPtr, - _Radix, - ); - } - - late final __wcstoui64Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('_wcstoui64'); - late final __wcstoui64 = __wcstoui64Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _wcstoui64_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __wcstoui64_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __wcstoui64_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_wcstoui64_l'); - late final __wcstoui64_l = __wcstoui64_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - ffi.Pointer _wfullpath( - ffi.Pointer _Buffer, - ffi.Pointer _Path, - int _BufferCount, - ) { - return __wfullpath( - _Buffer, - _Path, - _BufferCount, - ); - } - - late final __wfullpathPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('_wfullpath'); - late final __wfullpath = __wfullpathPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); - - int _wmakepath_s( - ffi.Pointer _Buffer, - int _BufferCount, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __wmakepath_s( - _Buffer, - _BufferCount, - _Drive, - _Dir, - _Filename, - _Ext, - ); - } - - late final __wmakepath_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_wmakepath_s'); - late final __wmakepath_s = __wmakepath_sPtr.asFunction< - int Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void _wmakepath( - ffi.Pointer _Buffer, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __wmakepath( - _Buffer, - _Drive, - _Dir, - _Filename, - _Ext, - ); - } - - late final __wmakepathPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_wmakepath'); - late final __wmakepath = __wmakepathPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void _wperror( - ffi.Pointer _ErrorMessage, - ) { - return __wperror( - _ErrorMessage, - ); - } - - late final __wperrorPtr = - _lookup)>>( - '_wperror'); - late final __wperror = - __wperrorPtr.asFunction)>(); - - void _wsplitpath( - ffi.Pointer _FullPath, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __wsplitpath( - _FullPath, - _Drive, - _Dir, - _Filename, - _Ext, - ); - } - - late final __wsplitpathPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_wsplitpath'); - late final __wsplitpath = __wsplitpathPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - int _wsplitpath_s( - ffi.Pointer _FullPath, - ffi.Pointer _Drive, - int _DriveCount, - ffi.Pointer _Dir, - int _DirCount, - ffi.Pointer _Filename, - int _FilenameCount, - ffi.Pointer _Ext, - int _ExtCount, - ) { - return __wsplitpath_s( - _FullPath, - _Drive, - _DriveCount, - _Dir, - _DirCount, - _Filename, - _FilenameCount, - _Ext, - _ExtCount, - ); - } - - late final __wsplitpath_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size)>>('_wsplitpath_s'); - late final __wsplitpath_s = __wsplitpath_sPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); - - int _wdupenv_s( - ffi.Pointer> _Buffer, - ffi.Pointer _BufferCount, - ffi.Pointer _VarName, - ) { - return __wdupenv_s( - _Buffer, - _BufferCount, - _VarName, - ); - } - - late final __wdupenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>>('_wdupenv_s'); - late final __wdupenv_s = __wdupenv_sPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); - - ffi.Pointer _wgetenv( - ffi.Pointer _VarName, - ) { - return __wgetenv( - _VarName, - ); - } - - late final __wgetenvPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('_wgetenv'); - late final __wgetenv = __wgetenvPtr - .asFunction Function(ffi.Pointer)>(); - - int _wgetenv_s( - ffi.Pointer _RequiredCount, - ffi.Pointer _Buffer, - int _BufferCount, - ffi.Pointer _VarName, - ) { - return __wgetenv_s( - _RequiredCount, - _Buffer, - _BufferCount, - _VarName, - ); - } - - late final __wgetenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer)>>('_wgetenv_s'); - late final __wgetenv_s = __wgetenv_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - int _wputenv( - ffi.Pointer _EnvString, - ) { - return __wputenv( - _EnvString, - ); - } - - late final __wputenvPtr = - _lookup)>>( - '_wputenv'); - late final __wputenv = - __wputenvPtr.asFunction)>(); - - int _wputenv_s( - ffi.Pointer _Name, - ffi.Pointer _Value, - ) { - return __wputenv_s( - _Name, - _Value, - ); - } - - late final __wputenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, ffi.Pointer)>>('_wputenv_s'); - late final __wputenv_s = __wputenv_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer)>(); - - int _wsearchenv_s( - ffi.Pointer _Filename, - ffi.Pointer _VarName, - ffi.Pointer _Buffer, - int _BufferCount, - ) { - return __wsearchenv_s( - _Filename, - _VarName, - _Buffer, - _BufferCount, - ); - } - - late final __wsearchenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('_wsearchenv_s'); - late final __wsearchenv_s = __wsearchenv_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _wsearchenv( - ffi.Pointer _Filename, - ffi.Pointer _VarName, - ffi.Pointer _ResultPath, - ) { - return __wsearchenv( - _Filename, - _VarName, - _ResultPath, - ); - } - - late final __wsearchenvPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_wsearchenv'); - late final __wsearchenv = __wsearchenvPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - int _wsystem( - ffi.Pointer _Command, - ) { - return __wsystem( - _Command, - ); - } - - late final __wsystemPtr = - _lookup)>>( - '_wsystem'); - late final __wsystem = - __wsystemPtr.asFunction)>(); - - void _swab( - ffi.Pointer _Buf1, - ffi.Pointer _Buf2, - int _SizeInBytes, - ) { - return __swab( - _Buf1, - _Buf2, - _SizeInBytes, - ); - } - - late final __swabPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>('_swab'); - late final __swab = __swabPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); - - void exit( - int _Code, - ) { - return _exit1( - _Code, - ); - } - - late final _exitPtr = - _lookup>('exit'); - late final _exit1 = _exitPtr.asFunction(); - - void _exit( - int _Code, - ) { - return __exit( - _Code, - ); - } - - late final __exitPtr = - _lookup>('_exit'); - late final __exit = __exitPtr.asFunction(); - - void _Exit( - int _Code, - ) { - return __Exit( - _Code, - ); - } - - late final __ExitPtr = - _lookup>('_Exit'); - late final __Exit = __ExitPtr.asFunction(); - - void quick_exit( - int _Code, - ) { - return _quick_exit( - _Code, - ); - } - - late final _quick_exitPtr = - _lookup>('quick_exit'); - late final _quick_exit = _quick_exitPtr.asFunction(); + ffi.Int Function(ffi.Pointer>, ffi.Size, + ffi.Size)>>('posix_memalign'); + late final _posix_memalign = _posix_memalignPtr + .asFunction>, int, int)>(); void abort() { return _abort(); @@ -1963,22 +660,17 @@ class ClashFFI { _lookup>('abort'); late final _abort = _abortPtr.asFunction(); - int _set_abort_behavior( - int _Flags, - int _Mask, + int abs( + int arg0, ) { - return __set_abort_behavior( - _Flags, - _Mask, + return _abs( + arg0, ); } - late final __set_abort_behaviorPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function( - ffi.UnsignedInt, ffi.UnsignedInt)>>('_set_abort_behavior'); - late final __set_abort_behavior = - __set_abort_behaviorPtr.asFunction(); + late final _absPtr = + _lookup>('abs'); + late final _abs = _absPtr.asFunction(); int atexit( ffi.Pointer> arg0, @@ -1995,18 +687,6 @@ class ClashFFI { late final _atexit = _atexitPtr.asFunction< int Function(ffi.Pointer>)>(); - _onexit_t _onexit( - _onexit_t _Func, - ) { - return __onexit( - _Func, - ); - } - - late final __onexitPtr = - _lookup>('_onexit'); - late final __onexit = __onexitPtr.asFunction<_onexit_t Function(_onexit_t)>(); - int at_quick_exit( ffi.Pointer> arg0, ) { @@ -2023,504 +703,11 @@ class ClashFFI { late final _at_quick_exit = _at_quick_exitPtr.asFunction< int Function(ffi.Pointer>)>(); - _purecall_handler _set_purecall_handler( - _purecall_handler _Handler, - ) { - return __set_purecall_handler( - _Handler, - ); - } - - late final __set_purecall_handlerPtr = _lookup< - ffi.NativeFunction<_purecall_handler Function(_purecall_handler)>>( - '_set_purecall_handler'); - late final __set_purecall_handler = __set_purecall_handlerPtr - .asFunction<_purecall_handler Function(_purecall_handler)>(); - - _purecall_handler _get_purecall_handler() { - return __get_purecall_handler(); - } - - late final __get_purecall_handlerPtr = - _lookup>( - '_get_purecall_handler'); - late final __get_purecall_handler = - __get_purecall_handlerPtr.asFunction<_purecall_handler Function()>(); - - _invalid_parameter_handler _set_invalid_parameter_handler( - _invalid_parameter_handler _Handler, - ) { - return __set_invalid_parameter_handler( - _Handler, - ); - } - - late final __set_invalid_parameter_handlerPtr = _lookup< - ffi.NativeFunction< - _invalid_parameter_handler Function( - _invalid_parameter_handler)>>('_set_invalid_parameter_handler'); - late final __set_invalid_parameter_handler = - __set_invalid_parameter_handlerPtr.asFunction< - _invalid_parameter_handler Function(_invalid_parameter_handler)>(); - - _invalid_parameter_handler _get_invalid_parameter_handler() { - return __get_invalid_parameter_handler(); - } - - late final __get_invalid_parameter_handlerPtr = - _lookup>( - '_get_invalid_parameter_handler'); - late final __get_invalid_parameter_handler = - __get_invalid_parameter_handlerPtr - .asFunction<_invalid_parameter_handler Function()>(); - - _invalid_parameter_handler _set_thread_local_invalid_parameter_handler( - _invalid_parameter_handler _Handler, - ) { - return __set_thread_local_invalid_parameter_handler( - _Handler, - ); - } - - late final __set_thread_local_invalid_parameter_handlerPtr = _lookup< - ffi.NativeFunction< - _invalid_parameter_handler Function(_invalid_parameter_handler)>>( - '_set_thread_local_invalid_parameter_handler'); - late final __set_thread_local_invalid_parameter_handler = - __set_thread_local_invalid_parameter_handlerPtr.asFunction< - _invalid_parameter_handler Function(_invalid_parameter_handler)>(); - - _invalid_parameter_handler _get_thread_local_invalid_parameter_handler() { - return __get_thread_local_invalid_parameter_handler(); - } - - late final __get_thread_local_invalid_parameter_handlerPtr = - _lookup>( - '_get_thread_local_invalid_parameter_handler'); - late final __get_thread_local_invalid_parameter_handler = - __get_thread_local_invalid_parameter_handlerPtr - .asFunction<_invalid_parameter_handler Function()>(); - - int _set_error_mode( - int _Mode, - ) { - return __set_error_mode( - _Mode, - ); - } - - late final __set_error_modePtr = - _lookup>('_set_error_mode'); - late final __set_error_mode = - __set_error_modePtr.asFunction(); - - ffi.Pointer __doserrno() { - return ___doserrno(); - } - - late final ___doserrnoPtr = - _lookup Function()>>( - '__doserrno'); - late final ___doserrno = - ___doserrnoPtr.asFunction Function()>(); - - int _set_doserrno( - int _Value, - ) { - return __set_doserrno( - _Value, - ); - } - - late final __set_doserrnoPtr = - _lookup>( - '_set_doserrno'); - late final __set_doserrno = __set_doserrnoPtr.asFunction(); - - int _get_doserrno( - ffi.Pointer _Value, - ) { - return __get_doserrno( - _Value, - ); - } - - late final __get_doserrnoPtr = _lookup< - ffi.NativeFunction)>>( - '_get_doserrno'); - late final __get_doserrno = __get_doserrnoPtr - .asFunction)>(); - - ffi.Pointer> __sys_errlist() { - return ___sys_errlist(); - } - - late final ___sys_errlistPtr = _lookup< - ffi.NativeFunction> Function()>>( - '__sys_errlist'); - late final ___sys_errlist = ___sys_errlistPtr - .asFunction> Function()>(); - - ffi.Pointer __sys_nerr() { - return ___sys_nerr(); - } - - late final ___sys_nerrPtr = - _lookup Function()>>( - '__sys_nerr'); - late final ___sys_nerr = - ___sys_nerrPtr.asFunction Function()>(); - - void perror( - ffi.Pointer _ErrMsg, - ) { - return _perror( - _ErrMsg, - ); - } - - late final _perrorPtr = - _lookup)>>( - 'perror'); - late final _perror = - _perrorPtr.asFunction)>(); - - ffi.Pointer> __p__pgmptr() { - return ___p__pgmptr(); - } - - late final ___p__pgmptrPtr = _lookup< - ffi.NativeFunction> Function()>>( - '__p__pgmptr'); - late final ___p__pgmptr = ___p__pgmptrPtr - .asFunction> Function()>(); - - ffi.Pointer> __p__wpgmptr() { - return ___p__wpgmptr(); - } - - late final ___p__wpgmptrPtr = _lookup< - ffi.NativeFunction> Function()>>( - '__p__wpgmptr'); - late final ___p__wpgmptr = ___p__wpgmptrPtr - .asFunction> Function()>(); - - ffi.Pointer __p__fmode() { - return ___p__fmode(); - } - - late final ___p__fmodePtr = - _lookup Function()>>( - '__p__fmode'); - late final ___p__fmode = - ___p__fmodePtr.asFunction Function()>(); - - int _get_pgmptr( - ffi.Pointer> _Value, - ) { - return __get_pgmptr( - _Value, - ); - } - - late final __get_pgmptrPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer>)>>('_get_pgmptr'); - late final __get_pgmptr = __get_pgmptrPtr - .asFunction>)>(); - - int _get_wpgmptr( - ffi.Pointer> _Value, - ) { - return __get_wpgmptr( - _Value, - ); - } - - late final __get_wpgmptrPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer>)>>('_get_wpgmptr'); - late final __get_wpgmptr = __get_wpgmptrPtr - .asFunction>)>(); - - int _set_fmode( - int _Mode, - ) { - return __set_fmode( - _Mode, - ); - } - - late final __set_fmodePtr = - _lookup>('_set_fmode'); - late final __set_fmode = __set_fmodePtr.asFunction(); - - int _get_fmode( - ffi.Pointer _PMode, - ) { - return __get_fmode( - _PMode, - ); - } - - late final __get_fmodePtr = - _lookup)>>( - '_get_fmode'); - late final __get_fmode = - __get_fmodePtr.asFunction)>(); - - int abs( - int _Number, - ) { - return _abs( - _Number, - ); - } - - late final _absPtr = - _lookup>('abs'); - late final _abs = _absPtr.asFunction(); - - int labs( - int _Number, - ) { - return _labs( - _Number, - ); - } - - late final _labsPtr = - _lookup>('labs'); - late final _labs = _labsPtr.asFunction(); - - int llabs( - int _Number, - ) { - return _llabs( - _Number, - ); - } - - late final _llabsPtr = - _lookup>('llabs'); - late final _llabs = _llabsPtr.asFunction(); - - int _abs64( - int _Number, - ) { - return __abs64( - _Number, - ); - } - - late final __abs64Ptr = - _lookup>( - '_abs64'); - late final __abs64 = __abs64Ptr.asFunction(); - - int _byteswap_ushort( - int _Number, - ) { - return __byteswap_ushort( - _Number, - ); - } - - late final __byteswap_ushortPtr = _lookup< - ffi.NativeFunction>( - '_byteswap_ushort'); - late final __byteswap_ushort = - __byteswap_ushortPtr.asFunction(); - - int _byteswap_ulong( - int _Number, - ) { - return __byteswap_ulong( - _Number, - ); - } - - late final __byteswap_ulongPtr = - _lookup>( - '_byteswap_ulong'); - late final __byteswap_ulong = - __byteswap_ulongPtr.asFunction(); - - int _byteswap_uint64( - int _Number, - ) { - return __byteswap_uint64( - _Number, - ); - } - - late final __byteswap_uint64Ptr = _lookup< - ffi - .NativeFunction>( - '_byteswap_uint64'); - late final __byteswap_uint64 = - __byteswap_uint64Ptr.asFunction(); - - div_t div( - int _Numerator, - int _Denominator, - ) { - return _div( - _Numerator, - _Denominator, - ); - } - - late final _divPtr = - _lookup>('div'); - late final _div = _divPtr.asFunction(); - - ldiv_t ldiv( - int _Numerator, - int _Denominator, - ) { - return _ldiv( - _Numerator, - _Denominator, - ); - } - - late final _ldivPtr = - _lookup>('ldiv'); - late final _ldiv = _ldivPtr.asFunction(); - - lldiv_t lldiv( - int _Numerator, - int _Denominator, - ) { - return _lldiv( - _Numerator, - _Denominator, - ); - } - - late final _lldivPtr = - _lookup>( - 'lldiv'); - late final _lldiv = _lldivPtr.asFunction(); - - int _rotl( - int _Value, - int _Shift, - ) { - return __rotl( - _Value, - _Shift, - ); - } - - late final __rotlPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.UnsignedInt, ffi.Int)>>('_rotl'); - late final __rotl = __rotlPtr.asFunction(); - - int _lrotl( - int _Value, - int _Shift, - ) { - return __lrotl( - _Value, - _Shift, - ); - } - - late final __lrotlPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.UnsignedLong, ffi.Int)>>('_lrotl'); - late final __lrotl = __lrotlPtr.asFunction(); - - int _rotl64( - int _Value, - int _Shift, - ) { - return __rotl64( - _Value, - _Shift, - ); - } - - late final __rotl64Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.UnsignedLongLong, ffi.Int)>>('_rotl64'); - late final __rotl64 = __rotl64Ptr.asFunction(); - - int _rotr( - int _Value, - int _Shift, - ) { - return __rotr( - _Value, - _Shift, - ); - } - - late final __rotrPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedInt Function(ffi.UnsignedInt, ffi.Int)>>('_rotr'); - late final __rotr = __rotrPtr.asFunction(); - - int _lrotr( - int _Value, - int _Shift, - ) { - return __lrotr( - _Value, - _Shift, - ); - } - - late final __lrotrPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function(ffi.UnsignedLong, ffi.Int)>>('_lrotr'); - late final __lrotr = __lrotrPtr.asFunction(); - - int _rotr64( - int _Value, - int _Shift, - ) { - return __rotr64( - _Value, - _Shift, - ); - } - - late final __rotr64Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.UnsignedLongLong, ffi.Int)>>('_rotr64'); - late final __rotr64 = __rotr64Ptr.asFunction(); - - void srand( - int _Seed, - ) { - return _srand( - _Seed, - ); - } - - late final _srandPtr = - _lookup>('srand'); - late final _srand = _srandPtr.asFunction(); - - int rand() { - return _rand(); - } - - late final _randPtr = _lookup>('rand'); - late final _rand = _randPtr.asFunction(); - double atof( - ffi.Pointer _String, + ffi.Pointer arg0, ) { return _atof( - _String, + arg0, ); } @@ -2531,10 +718,10 @@ class ClashFFI { _atofPtr.asFunction)>(); int atoi( - ffi.Pointer _String, + ffi.Pointer arg0, ) { return _atoi( - _String, + arg0, ); } @@ -2544,10 +731,10 @@ class ClashFFI { late final _atoi = _atoiPtr.asFunction)>(); int atol( - ffi.Pointer _String, + ffi.Pointer arg0, ) { return _atol( - _String, + arg0, ); } @@ -2557,10 +744,10 @@ class ClashFFI { late final _atol = _atolPtr.asFunction)>(); int atoll( - ffi.Pointer _String, + ffi.Pointer arg0, ) { return _atoll( - _String, + arg0, ); } @@ -2570,256 +757,269 @@ class ClashFFI { late final _atoll = _atollPtr.asFunction)>(); - int _atoi64( - ffi.Pointer _String, + ffi.Pointer bsearch( + ffi.Pointer __key, + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + __compar, ) { - return __atoi64( - _String, + return _bsearch( + __key, + __base, + __nel, + __width, + __compar, ); } - late final __atoi64Ptr = - _lookup)>>( - '_atoi64'); - late final __atoi64 = - __atoi64Ptr.asFunction)>(); - - double _atof_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __atof_l( - _String, - _Locale, - ); - } - - late final __atof_lPtr = _lookup< + late final _bsearchPtr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, _locale_t)>>('_atof_l'); - late final __atof_l = __atof_lPtr - .asFunction, _locale_t)>(); + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>)>>('bsearch'); + late final _bsearch = _bsearchPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, + ffi.Pointer, + int, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>)>(); - int _atoi_l( - ffi.Pointer _String, - _locale_t _Locale, + div_t div( + int arg0, + int arg1, ) { - return __atoi_l( - _String, - _Locale, + return _div( + arg0, + arg1, ); } - late final __atoi_lPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, _locale_t)>>('_atoi_l'); - late final __atoi_l = - __atoi_lPtr.asFunction, _locale_t)>(); + late final _divPtr = + _lookup>('div'); + late final _div = _divPtr.asFunction(); - int _atol_l( - ffi.Pointer _String, - _locale_t _Locale, + void exit( + int arg0, ) { - return __atol_l( - _String, - _Locale, + return _exit( + arg0, ); } - late final __atol_lPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function(ffi.Pointer, _locale_t)>>('_atol_l'); - late final __atol_l = - __atol_lPtr.asFunction, _locale_t)>(); + late final _exitPtr = + _lookup>('exit'); + late final _exit = _exitPtr.asFunction(); - int _atoll_l( - ffi.Pointer _String, - _locale_t _Locale, + ffi.Pointer getenv( + ffi.Pointer arg0, ) { - return __atoll_l( - _String, - _Locale, + return _getenv( + arg0, ); } - late final __atoll_lPtr = _lookup< + late final _getenvPtr = _lookup< ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, _locale_t)>>('_atoll_l'); - late final __atoll_l = - __atoll_lPtr.asFunction, _locale_t)>(); + ffi.Pointer Function(ffi.Pointer)>>('getenv'); + late final _getenv = _getenvPtr + .asFunction Function(ffi.Pointer)>(); - int _atoi64_l( - ffi.Pointer _String, - _locale_t _Locale, + int labs( + int arg0, ) { - return __atoi64_l( - _String, - _Locale, + return _labs( + arg0, ); } - late final __atoi64_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, _locale_t)>>('_atoi64_l'); - late final __atoi64_l = __atoi64_lPtr - .asFunction, _locale_t)>(); + late final _labsPtr = + _lookup>('labs'); + late final _labs = _labsPtr.asFunction(); - int _atoflt( - ffi.Pointer<_CRT_FLOAT> _Result, - ffi.Pointer _String, + ldiv_t ldiv( + int arg0, + int arg1, ) { - return __atoflt( - _Result, - _String, + return _ldiv( + arg0, + arg1, ); } - late final __atofltPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_CRT_FLOAT>, ffi.Pointer)>>('_atoflt'); - late final __atoflt = __atofltPtr.asFunction< - int Function(ffi.Pointer<_CRT_FLOAT>, ffi.Pointer)>(); + late final _ldivPtr = + _lookup>('ldiv'); + late final _ldiv = _ldivPtr.asFunction(); - int _atodbl( - ffi.Pointer<_CRT_DOUBLE> _Result, - ffi.Pointer _String, + int llabs( + int arg0, ) { - return __atodbl( - _Result, - _String, + return _llabs( + arg0, ); } - late final __atodblPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_CRT_DOUBLE>, ffi.Pointer)>>('_atodbl'); - late final __atodbl = __atodblPtr.asFunction< - int Function(ffi.Pointer<_CRT_DOUBLE>, ffi.Pointer)>(); + late final _llabsPtr = + _lookup>('llabs'); + late final _llabs = _llabsPtr.asFunction(); - int _atoldbl( - ffi.Pointer<_LDOUBLE> _Result, - ffi.Pointer _String, + lldiv_t lldiv( + int arg0, + int arg1, ) { - return __atoldbl( - _Result, - _String, + return _lldiv( + arg0, + arg1, ); } - late final __atoldblPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer<_LDOUBLE>, ffi.Pointer)>>('_atoldbl'); - late final __atoldbl = __atoldblPtr - .asFunction, ffi.Pointer)>(); + late final _lldivPtr = + _lookup>( + 'lldiv'); + late final _lldiv = _lldivPtr.asFunction(); - int _atoflt_l( - ffi.Pointer<_CRT_FLOAT> _Result, - ffi.Pointer _String, - _locale_t _Locale, + int mblen( + ffi.Pointer __s, + int __n, ) { - return __atoflt_l( - _Result, - _String, - _Locale, + return _mblen( + __s, + __n, ); } - late final __atoflt_lPtr = _lookup< + late final _mblenPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_CRT_FLOAT>, ffi.Pointer, - _locale_t)>>('_atoflt_l'); - late final __atoflt_l = __atoflt_lPtr.asFunction< - int Function( - ffi.Pointer<_CRT_FLOAT>, ffi.Pointer, _locale_t)>(); + ffi.Int Function(ffi.Pointer, ffi.Size)>>('mblen'); + late final _mblen = + _mblenPtr.asFunction, int)>(); - int _atodbl_l( - ffi.Pointer<_CRT_DOUBLE> _Result, - ffi.Pointer _String, - _locale_t _Locale, + int mbstowcs( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __atodbl_l( - _Result, - _String, - _Locale, + return _mbstowcs( + arg0, + arg1, + arg2, ); } - late final __atodbl_lPtr = _lookup< + late final _mbstowcsPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_CRT_DOUBLE>, ffi.Pointer, - _locale_t)>>('_atodbl_l'); - late final __atodbl_l = __atodbl_lPtr.asFunction< - int Function( - ffi.Pointer<_CRT_DOUBLE>, ffi.Pointer, _locale_t)>(); + ffi.Size Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('mbstowcs'); + late final _mbstowcs = _mbstowcsPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _atoldbl_l( - ffi.Pointer<_LDOUBLE> _Result, - ffi.Pointer _String, - _locale_t _Locale, + int mbtowc( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return __atoldbl_l( - _Result, - _String, - _Locale, + return _mbtowc( + arg0, + arg1, + arg2, ); } - late final __atoldbl_lPtr = _lookup< + late final _mbtowcPtr = _lookup< ffi.NativeFunction< - ffi.Int Function(ffi.Pointer<_LDOUBLE>, ffi.Pointer, - _locale_t)>>('_atoldbl_l'); - late final __atoldbl_l = __atoldbl_lPtr.asFunction< - int Function(ffi.Pointer<_LDOUBLE>, ffi.Pointer, _locale_t)>(); + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Size)>>('mbtowc'); + late final _mbtowc = _mbtowcPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - double strtof( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, + void qsort( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + __compar, ) { - return _strtof( - _String, - _EndPtr, + return _qsort( + __base, + __nel, + __width, + __compar, ); } - late final _strtofPtr = _lookup< + late final _qsortPtr = _lookup< ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer>)>>('strtof'); - late final _strtof = _strtofPtr.asFunction< - double Function( - ffi.Pointer, ffi.Pointer>)>(); + ffi.Void Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>)>>('qsort'); + late final _qsort = _qsortPtr.asFunction< + void Function( + ffi.Pointer, + int, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>)>(); - double _strtof_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - _locale_t _Locale, + void quick_exit( + int arg0, ) { - return __strtof_l( - _String, - _EndPtr, - _Locale, + return _quick_exit( + arg0, ); } - late final __strtof_lPtr = _lookup< - ffi.NativeFunction< - ffi.Float Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>>('_strtof_l'); - late final __strtof_l = __strtof_lPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer>, - _locale_t)>(); + late final _quick_exitPtr = + _lookup>('quick_exit'); + late final _quick_exit = _quick_exitPtr.asFunction(); + + int rand() { + return _rand(); + } + + late final _randPtr = _lookup>('rand'); + late final _rand = _randPtr.asFunction(); + + void srand( + int arg0, + ) { + return _srand( + arg0, + ); + } + + late final _srandPtr = + _lookup>('srand'); + late final _srand = _srandPtr.asFunction(); double strtod( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, + ffi.Pointer arg0, + ffi.Pointer> arg1, ) { return _strtod( - _String, - _EndPtr, + arg0, + arg1, ); } @@ -2831,35 +1031,33 @@ class ClashFFI { double Function( ffi.Pointer, ffi.Pointer>)>(); - double _strtod_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - _locale_t _Locale, + double strtof( + ffi.Pointer arg0, + ffi.Pointer> arg1, ) { - return __strtod_l( - _String, - _EndPtr, - _Locale, + return _strtof( + arg0, + arg1, ); } - late final __strtod_lPtr = _lookup< + late final _strtofPtr = _lookup< ffi.NativeFunction< - ffi.Double Function(ffi.Pointer, - ffi.Pointer>, _locale_t)>>('_strtod_l'); - late final __strtod_l = __strtod_lPtr.asFunction< - double Function(ffi.Pointer, ffi.Pointer>, - _locale_t)>(); + ffi.Float Function(ffi.Pointer, + ffi.Pointer>)>>('strtof'); + late final _strtof = _strtofPtr.asFunction< + double Function( + ffi.Pointer, ffi.Pointer>)>(); int strtol( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { return _strtol( - _String, - _EndPtr, - _Radix, + __str, + __endptr, + __base, ); } @@ -2871,40 +1069,15 @@ class ClashFFI { int Function( ffi.Pointer, ffi.Pointer>, int)>(); - int _strtol_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __strtol_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __strtol_lPtr = _lookup< - ffi.NativeFunction< - ffi.Long Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtol_l'); - late final __strtol_l = __strtol_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - int strtoll( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { return _strtoll( - _String, - _EndPtr, - _Radix, + __str, + __endptr, + __base, ); } @@ -2916,40 +1089,15 @@ class ClashFFI { int Function( ffi.Pointer, ffi.Pointer>, int)>(); - int _strtoll_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __strtoll_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __strtoll_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtoll_l'); - late final __strtoll_l = __strtoll_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - int strtoul( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { return _strtoul( - _String, - _EndPtr, - _Radix, + __str, + __endptr, + __base, ); } @@ -2961,40 +1109,15 @@ class ClashFFI { int Function( ffi.Pointer, ffi.Pointer>, int)>(); - int _strtoul_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __strtoul_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __strtoul_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtoul_l'); - late final __strtoul_l = __strtoul_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - int strtoull( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { return _strtoull( - _String, - _EndPtr, - _Radix, + __str, + __endptr, + __base, ); } @@ -3006,830 +1129,29 @@ class ClashFFI { int Function( ffi.Pointer, ffi.Pointer>, int)>(); - int _strtoull_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, + int system( + ffi.Pointer arg0, ) { - return __strtoull_l( - _String, - _EndPtr, - _Radix, - _Locale, + return _system( + arg0, ); } - late final __strtoull_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtoull_l'); - late final __strtoull_l = __strtoull_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int _strtoi64( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return __strtoi64( - _String, - _EndPtr, - _Radix, - ); - } - - late final __strtoi64Ptr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('_strtoi64'); - late final __strtoi64 = __strtoi64Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _strtoi64_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __strtoi64_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __strtoi64_lPtr = _lookup< - ffi.NativeFunction< - ffi.LongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtoi64_l'); - late final __strtoi64_l = __strtoi64_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int _strtoui64( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - ) { - return __strtoui64( - _String, - _EndPtr, - _Radix, - ); - } - - late final __strtoui64Ptr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function(ffi.Pointer, - ffi.Pointer>, ffi.Int)>>('_strtoui64'); - late final __strtoui64 = __strtoui64Ptr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer>, int)>(); - - int _strtoui64_l( - ffi.Pointer _String, - ffi.Pointer> _EndPtr, - int _Radix, - _locale_t _Locale, - ) { - return __strtoui64_l( - _String, - _EndPtr, - _Radix, - _Locale, - ); - } - - late final __strtoui64_lPtr = _lookup< - ffi.NativeFunction< - ffi.UnsignedLongLong Function( - ffi.Pointer, - ffi.Pointer>, - ffi.Int, - _locale_t)>>('_strtoui64_l'); - late final __strtoui64_l = __strtoui64_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer>, - int, _locale_t)>(); - - int _itoa_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __itoa_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __itoa_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Int, ffi.Pointer, ffi.Size, ffi.Int)>>('_itoa_s'); - late final __itoa_s = __itoa_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _itoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __itoa( - _Value, - _Buffer, - _Radix, - ); - } - - late final __itoaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Int, ffi.Pointer, ffi.Int)>>('_itoa'); - late final __itoa = __itoaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ltoa_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ltoa_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ltoa_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Long, ffi.Pointer, ffi.Size, ffi.Int)>>('_ltoa_s'); - late final __ltoa_s = __ltoa_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ltoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ltoa( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ltoaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Long, ffi.Pointer, ffi.Int)>>('_ltoa'); - late final __ltoa = __ltoaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ultoa_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ultoa_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ultoa_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.UnsignedLong, ffi.Pointer, ffi.Size, - ffi.Int)>>('_ultoa_s'); - late final __ultoa_s = __ultoa_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ultoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ultoa( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ultoaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedLong, ffi.Pointer, ffi.Int)>>('_ultoa'); - late final __ultoa = __ultoaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _i64toa_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __i64toa_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __i64toa_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.LongLong, ffi.Pointer, ffi.Size, - ffi.Int)>>('_i64toa_s'); - late final __i64toa_s = __i64toa_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _i64toa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __i64toa( - _Value, - _Buffer, - _Radix, - ); - } - - late final __i64toaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.LongLong, ffi.Pointer, ffi.Int)>>('_i64toa'); - late final __i64toa = __i64toaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ui64toa_s( - int _Value, - ffi.Pointer _Buffer, - int _BufferCount, - int _Radix, - ) { - return __ui64toa_s( - _Value, - _Buffer, - _BufferCount, - _Radix, - ); - } - - late final __ui64toa_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.UnsignedLongLong, ffi.Pointer, - ffi.Size, ffi.Int)>>('_ui64toa_s'); - late final __ui64toa_s = __ui64toa_sPtr - .asFunction, int, int)>(); - - ffi.Pointer _ui64toa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, - ) { - return __ui64toa( - _Value, - _Buffer, - _Radix, - ); - } - - late final __ui64toaPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.UnsignedLongLong, - ffi.Pointer, ffi.Int)>>('_ui64toa'); - late final __ui64toa = __ui64toaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); - - int _ecvt_s( - ffi.Pointer _Buffer, - int _BufferCount, - double _Value, - int _DigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, - ) { - return __ecvt_s( - _Buffer, - _BufferCount, - _Value, - _DigitCount, - _PtDec, - _PtSign, - ); - } - - late final __ecvt_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Size, ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('_ecvt_s'); - late final __ecvt_s = __ecvt_sPtr.asFunction< - int Function(ffi.Pointer, int, double, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _ecvt( - double _Value, - int _DigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, - ) { - return __ecvt( - _Value, - _DigitCount, - _PtDec, - _PtSign, - ); - } - - late final __ecvtPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('_ecvt'); - late final __ecvt = __ecvtPtr.asFunction< - ffi.Pointer Function( - double, int, ffi.Pointer, ffi.Pointer)>(); - - int _fcvt_s( - ffi.Pointer _Buffer, - int _BufferCount, - double _Value, - int _FractionalDigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, - ) { - return __fcvt_s( - _Buffer, - _BufferCount, - _Value, - _FractionalDigitCount, - _PtDec, - _PtSign, - ); - } - - late final __fcvt_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Size, ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('_fcvt_s'); - late final __fcvt_s = __fcvt_sPtr.asFunction< - int Function(ffi.Pointer, int, double, int, - ffi.Pointer, ffi.Pointer)>(); - - ffi.Pointer _fcvt( - double _Value, - int _FractionalDigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, - ) { - return __fcvt( - _Value, - _FractionalDigitCount, - _PtDec, - _PtSign, - ); - } - - late final __fcvtPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Double, ffi.Int, - ffi.Pointer, ffi.Pointer)>>('_fcvt'); - late final __fcvt = __fcvtPtr.asFunction< - ffi.Pointer Function( - double, int, ffi.Pointer, ffi.Pointer)>(); - - int _gcvt_s( - ffi.Pointer _Buffer, - int _BufferCount, - double _Value, - int _DigitCount, - ) { - return __gcvt_s( - _Buffer, - _BufferCount, - _Value, - _DigitCount, - ); - } - - late final __gcvt_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Size, ffi.Double, - ffi.Int)>>('_gcvt_s'); - late final __gcvt_s = __gcvt_sPtr - .asFunction, int, double, int)>(); - - ffi.Pointer _gcvt( - double _Value, - int _DigitCount, - ffi.Pointer _Buffer, - ) { - return __gcvt( - _Value, - _DigitCount, - _Buffer, - ); - } - - late final __gcvtPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Double, ffi.Int, ffi.Pointer)>>('_gcvt'); - late final __gcvt = __gcvtPtr.asFunction< - ffi.Pointer Function(double, int, ffi.Pointer)>(); - - int ___mb_cur_max_func() { - return ____mb_cur_max_func(); - } - - late final ____mb_cur_max_funcPtr = - _lookup>('___mb_cur_max_func'); - late final ____mb_cur_max_func = - ____mb_cur_max_funcPtr.asFunction(); - - int ___mb_cur_max_l_func( - _locale_t _Locale, - ) { - return ____mb_cur_max_l_func( - _Locale, - ); - } - - late final ____mb_cur_max_l_funcPtr = - _lookup>( - '___mb_cur_max_l_func'); - late final ____mb_cur_max_l_func = - ____mb_cur_max_l_funcPtr.asFunction(); - - int mblen( - ffi.Pointer _Ch, - int _MaxCount, - ) { - return _mblen( - _Ch, - _MaxCount, - ); - } - - late final _mblenPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Size)>>('mblen'); - late final _mblen = - _mblenPtr.asFunction, int)>(); - - int _mblen_l( - ffi.Pointer _Ch, - int _MaxCount, - _locale_t _Locale, - ) { - return __mblen_l( - _Ch, - _MaxCount, - _Locale, - ); - } - - late final __mblen_lPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.Size, _locale_t)>>('_mblen_l'); - late final __mblen_l = __mblen_lPtr - .asFunction, int, _locale_t)>(); - - int _mbstrlen( - ffi.Pointer _String, - ) { - return __mbstrlen( - _String, - ); - } - - late final __mbstrlenPtr = - _lookup)>>( - '_mbstrlen'); - late final __mbstrlen = - __mbstrlenPtr.asFunction)>(); - - int _mbstrlen_l( - ffi.Pointer _String, - _locale_t _Locale, - ) { - return __mbstrlen_l( - _String, - _Locale, - ); - } - - late final __mbstrlen_lPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, _locale_t)>>('_mbstrlen_l'); - late final __mbstrlen_l = __mbstrlen_lPtr - .asFunction, _locale_t)>(); - - int _mbstrnlen( - ffi.Pointer _String, - int _MaxCount, - ) { - return __mbstrnlen( - _String, - _MaxCount, - ); - } - - late final __mbstrnlenPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Size)>>('_mbstrnlen'); - late final __mbstrnlen = - __mbstrnlenPtr.asFunction, int)>(); - - int _mbstrnlen_l( - ffi.Pointer _String, - int _MaxCount, - _locale_t _Locale, - ) { - return __mbstrnlen_l( - _String, - _MaxCount, - _Locale, - ); - } - - late final __mbstrnlen_lPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function( - ffi.Pointer, ffi.Size, _locale_t)>>('_mbstrnlen_l'); - late final __mbstrnlen_l = __mbstrnlen_lPtr - .asFunction, int, _locale_t)>(); - - int mbtowc( - ffi.Pointer _DstCh, - ffi.Pointer _SrcCh, - int _SrcSizeInBytes, - ) { - return _mbtowc( - _DstCh, - _SrcCh, - _SrcSizeInBytes, - ); - } - - late final _mbtowcPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('mbtowc'); - late final _mbtowc = _mbtowcPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _mbtowc_l( - ffi.Pointer _DstCh, - ffi.Pointer _SrcCh, - int _SrcSizeInBytes, - _locale_t _Locale, - ) { - return __mbtowc_l( - _DstCh, - _SrcCh, - _SrcSizeInBytes, - _Locale, - ); - } - - late final __mbtowc_lPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.Pointer, - ffi.Size, _locale_t)>>('_mbtowc_l'); - late final __mbtowc_l = __mbtowc_lPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, _locale_t)>(); - - int mbstowcs_s( - ffi.Pointer _PtNumOfCharConverted, - ffi.Pointer _DstBuf, - int _SizeInWords, - ffi.Pointer _SrcBuf, - int _MaxCount, - ) { - return _mbstowcs_s( - _PtNumOfCharConverted, - _DstBuf, - _SizeInWords, - _SrcBuf, - _MaxCount, - ); - } - - late final _mbstowcs_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer, ffi.Size)>>('mbstowcs_s'); - late final _mbstowcs_s = _mbstowcs_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, int)>(); - - int mbstowcs( - ffi.Pointer _Dest, - ffi.Pointer _Source, - int _MaxCount, - ) { - return _mbstowcs( - _Dest, - _Source, - _MaxCount, - ); - } - - late final _mbstowcsPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Pointer, - ffi.Size)>>('mbstowcs'); - late final _mbstowcs = _mbstowcsPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int)>(); - - int _mbstowcs_s_l( - ffi.Pointer _PtNumOfCharConverted, - ffi.Pointer _DstBuf, - int _SizeInWords, - ffi.Pointer _SrcBuf, - int _MaxCount, - _locale_t _Locale, - ) { - return __mbstowcs_s_l( - _PtNumOfCharConverted, - _DstBuf, - _SizeInWords, - _SrcBuf, - _MaxCount, - _Locale, - ); - } - - late final __mbstowcs_s_lPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - _locale_t)>>('_mbstowcs_s_l'); - late final __mbstowcs_s_l = __mbstowcs_s_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, int, _locale_t)>(); - - int _mbstowcs_l( - ffi.Pointer _Dest, - ffi.Pointer _Source, - int _MaxCount, - _locale_t _Locale, - ) { - return __mbstowcs_l( - _Dest, - _Source, - _MaxCount, - _Locale, - ); - } - - late final __mbstowcs_lPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Pointer, - ffi.Size, _locale_t)>>('_mbstowcs_l'); - late final __mbstowcs_l = __mbstowcs_lPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, _locale_t)>(); - - int wctomb( - ffi.Pointer _MbCh, - int _WCh, - ) { - return _wctomb( - _MbCh, - _WCh, - ); - } - - late final _wctombPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function(ffi.Pointer, ffi.WChar)>>('wctomb'); - late final _wctomb = - _wctombPtr.asFunction, int)>(); - - int _wctomb_l( - ffi.Pointer _MbCh, - int _WCh, - _locale_t _Locale, - ) { - return __wctomb_l( - _MbCh, - _WCh, - _Locale, - ); - } - - late final __wctomb_lPtr = _lookup< - ffi.NativeFunction< - ffi.Int Function( - ffi.Pointer, ffi.WChar, _locale_t)>>('_wctomb_l'); - late final __wctomb_l = __wctomb_lPtr - .asFunction, int, _locale_t)>(); - - int wctomb_s( - ffi.Pointer _SizeConverted, - ffi.Pointer _MbCh, - int _SizeInBytes, - int _WCh, - ) { - return _wctomb_s( - _SizeConverted, - _MbCh, - _SizeInBytes, - _WCh, - ); - } - - late final _wctomb_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, rsize_t, - ffi.WChar)>>('wctomb_s'); - late final _wctomb_s = _wctomb_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, int)>(); - - int _wctomb_s_l( - ffi.Pointer _SizeConverted, - ffi.Pointer _MbCh, - int _SizeInBytes, - int _WCh, - _locale_t _Locale, - ) { - return __wctomb_s_l( - _SizeConverted, - _MbCh, - _SizeInBytes, - _WCh, - _Locale, - ); - } - - late final __wctomb_s_lPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.WChar, _locale_t)>>('_wctomb_s_l'); - late final __wctomb_s_l = __wctomb_s_lPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, int, _locale_t)>(); - - int wcstombs_s( - ffi.Pointer _PtNumOfCharConverted, - ffi.Pointer _Dst, - int _DstSizeInBytes, - ffi.Pointer _Src, - int _MaxCountInBytes, - ) { - return _wcstombs_s( - _PtNumOfCharConverted, - _Dst, - _DstSizeInBytes, - _Src, - _MaxCountInBytes, - ); - } - - late final _wcstombs_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Size, ffi.Pointer, ffi.Size)>>('wcstombs_s'); - late final _wcstombs_s = _wcstombs_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, int)>(); + late final _systemPtr = + _lookup)>>( + 'system'); + late final _system = + _systemPtr.asFunction)>(); int wcstombs( - ffi.Pointer _Dest, - ffi.Pointer _Source, - int _MaxCount, + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { return _wcstombs( - _Dest, - _Source, - _MaxCount, + arg0, + arg1, + arg2, ); } @@ -3840,476 +1162,66 @@ class ClashFFI { late final _wcstombs = _wcstombsPtr.asFunction< int Function(ffi.Pointer, ffi.Pointer, int)>(); - int _wcstombs_s_l( - ffi.Pointer _PtNumOfCharConverted, - ffi.Pointer _Dst, - int _DstSizeInBytes, - ffi.Pointer _Src, - int _MaxCountInBytes, - _locale_t _Locale, + int wctomb( + ffi.Pointer arg0, + int arg1, ) { - return __wcstombs_s_l( - _PtNumOfCharConverted, - _Dst, - _DstSizeInBytes, - _Src, - _MaxCountInBytes, - _Locale, + return _wctomb( + arg0, + arg1, ); } - late final __wcstombs_s_lPtr = _lookup< + late final _wctombPtr = _lookup< ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - _locale_t)>>('_wcstombs_s_l'); - late final __wcstombs_s_l = __wcstombs_s_lPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer, int, _locale_t)>(); + ffi.Int Function(ffi.Pointer, ffi.WChar)>>('wctomb'); + late final _wctomb = + _wctombPtr.asFunction, int)>(); - int _wcstombs_l( - ffi.Pointer _Dest, - ffi.Pointer _Source, - int _MaxCount, - _locale_t _Locale, + void _Exit( + int arg0, ) { - return __wcstombs_l( - _Dest, - _Source, - _MaxCount, - _Locale, + return __Exit( + arg0, ); } - late final __wcstombs_lPtr = _lookup< - ffi.NativeFunction< - ffi.Size Function(ffi.Pointer, ffi.Pointer, - ffi.Size, _locale_t)>>('_wcstombs_l'); - late final __wcstombs_l = __wcstombs_lPtr.asFunction< - int Function( - ffi.Pointer, ffi.Pointer, int, _locale_t)>(); + late final __ExitPtr = + _lookup>('_Exit'); + late final __Exit = __ExitPtr.asFunction(); - ffi.Pointer _fullpath( - ffi.Pointer _Buffer, - ffi.Pointer _Path, - int _BufferCount, + int a64l( + ffi.Pointer arg0, ) { - return __fullpath( - _Buffer, - _Path, - _BufferCount, + return _a64l( + arg0, ); } - late final __fullpathPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer, - ffi.Pointer, ffi.Size)>>('_fullpath'); - late final __fullpath = __fullpathPtr.asFunction< - ffi.Pointer Function( - ffi.Pointer, ffi.Pointer, int)>(); + late final _a64lPtr = + _lookup)>>( + 'a64l'); + late final _a64l = _a64lPtr.asFunction)>(); - int _makepath_s( - ffi.Pointer _Buffer, - int _BufferCount, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __makepath_s( - _Buffer, - _BufferCount, - _Drive, - _Dir, - _Filename, - _Ext, - ); + double drand48() { + return _drand48(); } - late final __makepath_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_makepath_s'); - late final __makepath_s = __makepath_sPtr.asFunction< - int Function( - ffi.Pointer, - int, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void _makepath( - ffi.Pointer _Buffer, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __makepath( - _Buffer, - _Drive, - _Dir, - _Filename, - _Ext, - ); - } - - late final __makepathPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_makepath'); - late final __makepath = __makepathPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - void _splitpath( - ffi.Pointer _FullPath, - ffi.Pointer _Drive, - ffi.Pointer _Dir, - ffi.Pointer _Filename, - ffi.Pointer _Ext, - ) { - return __splitpath( - _FullPath, - _Drive, - _Dir, - _Filename, - _Ext, - ); - } - - late final __splitpathPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>>('_splitpath'); - late final __splitpath = __splitpathPtr.asFunction< - void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.Pointer)>(); - - int _splitpath_s( - ffi.Pointer _FullPath, - ffi.Pointer _Drive, - int _DriveCount, - ffi.Pointer _Dir, - int _DirCount, - ffi.Pointer _Filename, - int _FilenameCount, - ffi.Pointer _Ext, - int _ExtCount, - ) { - return __splitpath_s( - _FullPath, - _Drive, - _DriveCount, - _Dir, - _DirCount, - _Filename, - _FilenameCount, - _Ext, - _ExtCount, - ); - } - - late final __splitpath_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size, - ffi.Pointer, - ffi.Size)>>('_splitpath_s'); - late final __splitpath_s = __splitpath_sPtr.asFunction< - int Function( - ffi.Pointer, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer, - int, - ffi.Pointer, - int)>(); - - int getenv_s( - ffi.Pointer _RequiredCount, - ffi.Pointer _Buffer, - int _BufferCount, - ffi.Pointer _VarName, - ) { - return _getenv_s( - _RequiredCount, - _Buffer, - _BufferCount, - _VarName, - ); - } - - late final _getenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - rsize_t, ffi.Pointer)>>('getenv_s'); - late final _getenv_s = _getenv_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, int, - ffi.Pointer)>(); - - ffi.Pointer __p___argc() { - return ___p___argc(); - } - - late final ___p___argcPtr = - _lookup Function()>>( - '__p___argc'); - late final ___p___argc = - ___p___argcPtr.asFunction Function()>(); - - ffi.Pointer>> __p___argv() { - return ___p___argv(); - } - - late final ___p___argvPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer>> - Function()>>('__p___argv'); - late final ___p___argv = ___p___argvPtr - .asFunction>> Function()>(); - - ffi.Pointer>> __p___wargv() { - return ___p___wargv(); - } - - late final ___p___wargvPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer>> - Function()>>('__p___wargv'); - late final ___p___wargv = ___p___wargvPtr.asFunction< - ffi.Pointer>> Function()>(); - - ffi.Pointer>> __p__environ() { - return ___p__environ(); - } - - late final ___p__environPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer>> - Function()>>('__p__environ'); - late final ___p__environ = ___p__environPtr - .asFunction>> Function()>(); - - ffi.Pointer>> __p__wenviron() { - return ___p__wenviron(); - } - - late final ___p__wenvironPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer>> - Function()>>('__p__wenviron'); - late final ___p__wenviron = ___p__wenvironPtr.asFunction< - ffi.Pointer>> Function()>(); - - ffi.Pointer getenv( - ffi.Pointer _VarName, - ) { - return _getenv( - _VarName, - ); - } - - late final _getenvPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function(ffi.Pointer)>>('getenv'); - late final _getenv = _getenvPtr - .asFunction Function(ffi.Pointer)>(); - - int _dupenv_s( - ffi.Pointer> _Buffer, - ffi.Pointer _BufferCount, - ffi.Pointer _VarName, - ) { - return __dupenv_s( - _Buffer, - _BufferCount, - _VarName, - ); - } - - late final __dupenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer>, - ffi.Pointer, ffi.Pointer)>>('_dupenv_s'); - late final __dupenv_s = __dupenv_sPtr.asFunction< - int Function(ffi.Pointer>, ffi.Pointer, - ffi.Pointer)>(); - - int system( - ffi.Pointer _Command, - ) { - return _system( - _Command, - ); - } - - late final _systemPtr = - _lookup)>>( - 'system'); - late final _system = - _systemPtr.asFunction)>(); - - int _putenv( - ffi.Pointer _EnvString, - ) { - return __putenv( - _EnvString, - ); - } - - late final __putenvPtr = - _lookup)>>( - '_putenv'); - late final __putenv = - __putenvPtr.asFunction)>(); - - int _putenv_s( - ffi.Pointer _Name, - ffi.Pointer _Value, - ) { - return __putenv_s( - _Name, - _Value, - ); - } - - late final __putenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function( - ffi.Pointer, ffi.Pointer)>>('_putenv_s'); - late final __putenv_s = __putenv_sPtr - .asFunction, ffi.Pointer)>(); - - int _searchenv_s( - ffi.Pointer _Filename, - ffi.Pointer _VarName, - ffi.Pointer _Buffer, - int _BufferCount, - ) { - return __searchenv_s( - _Filename, - _VarName, - _Buffer, - _BufferCount, - ); - } - - late final __searchenv_sPtr = _lookup< - ffi.NativeFunction< - errno_t Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, ffi.Size)>>('_searchenv_s'); - late final __searchenv_s = __searchenv_sPtr.asFunction< - int Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer, int)>(); - - void _searchenv( - ffi.Pointer _Filename, - ffi.Pointer _VarName, - ffi.Pointer _Buffer, - ) { - return __searchenv( - _Filename, - _VarName, - _Buffer, - ); - } - - late final __searchenvPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>>('_searchenv'); - late final __searchenv = __searchenvPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, - ffi.Pointer)>(); - - void _seterrormode( - int _Mode, - ) { - return __seterrormode( - _Mode, - ); - } - - late final __seterrormodePtr = - _lookup>('_seterrormode'); - late final __seterrormode = - __seterrormodePtr.asFunction(); - - void _beep( - int _Frequency, - int _Duration, - ) { - return __beep( - _Frequency, - _Duration, - ); - } - - late final __beepPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function(ffi.UnsignedInt, ffi.UnsignedInt)>>('_beep'); - late final __beep = __beepPtr.asFunction(); - - void _sleep( - int _Duration, - ) { - return __sleep( - _Duration, - ); - } - - late final __sleepPtr = - _lookup>( - '_sleep'); - late final __sleep = __sleepPtr.asFunction(); + late final _drand48Ptr = + _lookup>('drand48'); + late final _drand48 = _drand48Ptr.asFunction(); ffi.Pointer ecvt( - double _Value, - int _DigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, + double arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, ) { - return _ecvt1( - _Value, - _DigitCount, - _PtDec, - _PtSign, + return _ecvt( + arg0, + arg1, + arg2, + arg3, ); } @@ -4317,21 +1229,35 @@ class ClashFFI { ffi.NativeFunction< ffi.Pointer Function(ffi.Double, ffi.Int, ffi.Pointer, ffi.Pointer)>>('ecvt'); - late final _ecvt1 = _ecvtPtr.asFunction< + late final _ecvt = _ecvtPtr.asFunction< ffi.Pointer Function( double, int, ffi.Pointer, ffi.Pointer)>(); - ffi.Pointer fcvt( - double _Value, - int _FractionalDigitCount, - ffi.Pointer _PtDec, - ffi.Pointer _PtSign, + double erand48( + ffi.Pointer arg0, ) { - return _fcvt1( - _Value, - _FractionalDigitCount, - _PtDec, - _PtSign, + return _erand48( + arg0, + ); + } + + late final _erand48Ptr = _lookup< + ffi.NativeFunction< + ffi.Double Function(ffi.Pointer)>>('erand48'); + late final _erand48 = + _erand48Ptr.asFunction)>(); + + ffi.Pointer fcvt( + double arg0, + int arg1, + ffi.Pointer arg2, + ffi.Pointer arg3, + ) { + return _fcvt( + arg0, + arg1, + arg2, + arg3, ); } @@ -4339,19 +1265,19 @@ class ClashFFI { ffi.NativeFunction< ffi.Pointer Function(ffi.Double, ffi.Int, ffi.Pointer, ffi.Pointer)>>('fcvt'); - late final _fcvt1 = _fcvtPtr.asFunction< + late final _fcvt = _fcvtPtr.asFunction< ffi.Pointer Function( double, int, ffi.Pointer, ffi.Pointer)>(); ffi.Pointer gcvt( - double _Value, - int _DigitCount, - ffi.Pointer _DstBuf, + double arg0, + int arg1, + ffi.Pointer arg2, ) { - return _gcvt1( - _Value, - _DigitCount, - _DstBuf, + return _gcvt( + arg0, + arg1, + arg2, ); } @@ -4359,790 +1285,1068 @@ class ClashFFI { ffi.NativeFunction< ffi.Pointer Function( ffi.Double, ffi.Int, ffi.Pointer)>>('gcvt'); - late final _gcvt1 = _gcvtPtr.asFunction< + late final _gcvt = _gcvtPtr.asFunction< ffi.Pointer Function(double, int, ffi.Pointer)>(); - ffi.Pointer itoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, + int getsubopt( + ffi.Pointer> arg0, + ffi.Pointer> arg1, + ffi.Pointer> arg2, ) { - return _itoa1( - _Value, - _Buffer, - _Radix, + return _getsubopt( + arg0, + arg1, + arg2, ); } - late final _itoaPtr = _lookup< + late final _getsuboptPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>>('getsubopt'); + late final _getsubopt = _getsuboptPtr.asFunction< + int Function( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer>)>(); + + int grantpt( + int arg0, + ) { + return _grantpt( + arg0, + ); + } + + late final _grantptPtr = + _lookup>('grantpt'); + late final _grantpt = _grantptPtr.asFunction(); + + ffi.Pointer initstate( + int arg0, + ffi.Pointer arg1, + int arg2, + ) { + return _initstate( + arg0, + arg1, + arg2, + ); + } + + late final _initstatePtr = _lookup< ffi.NativeFunction< ffi.Pointer Function( - ffi.Int, ffi.Pointer, ffi.Int)>>('itoa'); - late final _itoa1 = _itoaPtr.asFunction< + ffi.UnsignedInt, ffi.Pointer, ffi.Size)>>('initstate'); + late final _initstate = _initstatePtr.asFunction< ffi.Pointer Function(int, ffi.Pointer, int)>(); - ffi.Pointer ltoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, + int jrand48( + ffi.Pointer arg0, ) { - return _ltoa1( - _Value, - _Buffer, - _Radix, + return _jrand48( + arg0, ); } - late final _ltoaPtr = _lookup< + late final _jrand48Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.Long, ffi.Pointer, ffi.Int)>>('ltoa'); - late final _ltoa1 = _ltoaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); + ffi.Long Function(ffi.Pointer)>>('jrand48'); + late final _jrand48 = + _jrand48Ptr.asFunction)>(); - void swab( - ffi.Pointer _Buf1, - ffi.Pointer _Buf2, - int _SizeInBytes, + ffi.Pointer l64a( + int arg0, ) { - return _swab1( - _Buf1, - _Buf2, - _SizeInBytes, + return _l64a( + arg0, ); } - late final _swabPtr = _lookup< - ffi.NativeFunction< - ffi.Void Function( - ffi.Pointer, ffi.Pointer, ffi.Int)>>('swab'); - late final _swab1 = _swabPtr.asFunction< - void Function(ffi.Pointer, ffi.Pointer, int)>(); + late final _l64aPtr = + _lookup Function(ffi.Long)>>( + 'l64a'); + late final _l64a = _l64aPtr.asFunction Function(int)>(); - ffi.Pointer ultoa( - int _Value, - ffi.Pointer _Buffer, - int _Radix, + void lcong48( + ffi.Pointer arg0, ) { - return _ultoa1( - _Value, - _Buffer, - _Radix, + return _lcong48( + arg0, ); } - late final _ultoaPtr = _lookup< + late final _lcong48Ptr = _lookup< ffi.NativeFunction< - ffi.Pointer Function( - ffi.UnsignedLong, ffi.Pointer, ffi.Int)>>('ultoa'); - late final _ultoa1 = _ultoaPtr.asFunction< - ffi.Pointer Function(int, ffi.Pointer, int)>(); + ffi.Void Function(ffi.Pointer)>>('lcong48'); + late final _lcong48 = + _lcong48Ptr.asFunction)>(); + + int lrand48() { + return _lrand48(); + } + + late final _lrand48Ptr = + _lookup>('lrand48'); + late final _lrand48 = _lrand48Ptr.asFunction(); + + ffi.Pointer mktemp( + ffi.Pointer arg0, + ) { + return _mktemp( + arg0, + ); + } + + late final _mktempPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('mktemp'); + late final _mktemp = _mktempPtr + .asFunction Function(ffi.Pointer)>(); + + int mkstemp( + ffi.Pointer arg0, + ) { + return _mkstemp( + arg0, + ); + } + + late final _mkstempPtr = + _lookup)>>( + 'mkstemp'); + late final _mkstemp = + _mkstempPtr.asFunction)>(); + + int mrand48() { + return _mrand48(); + } + + late final _mrand48Ptr = + _lookup>('mrand48'); + late final _mrand48 = _mrand48Ptr.asFunction(); + + int nrand48( + ffi.Pointer arg0, + ) { + return _nrand48( + arg0, + ); + } + + late final _nrand48Ptr = _lookup< + ffi.NativeFunction< + ffi.Long Function(ffi.Pointer)>>('nrand48'); + late final _nrand48 = + _nrand48Ptr.asFunction)>(); + + int posix_openpt( + int arg0, + ) { + return _posix_openpt( + arg0, + ); + } + + late final _posix_openptPtr = + _lookup>('posix_openpt'); + late final _posix_openpt = _posix_openptPtr.asFunction(); + + ffi.Pointer ptsname( + int arg0, + ) { + return _ptsname( + arg0, + ); + } + + late final _ptsnamePtr = + _lookup Function(ffi.Int)>>( + 'ptsname'); + late final _ptsname = + _ptsnamePtr.asFunction Function(int)>(); + + int ptsname_r( + int fildes, + ffi.Pointer buffer, + int buflen, + ) { + return _ptsname_r( + fildes, + buffer, + buflen, + ); + } + + late final _ptsname_rPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Int, ffi.Pointer, ffi.Size)>>('ptsname_r'); + late final _ptsname_r = + _ptsname_rPtr.asFunction, int)>(); int putenv( - ffi.Pointer _EnvString, + ffi.Pointer arg0, ) { - return _putenv1( - _EnvString, + return _putenv( + arg0, ); } late final _putenvPtr = _lookup)>>( 'putenv'); - late final _putenv1 = + late final _putenv = _putenvPtr.asFunction)>(); - _onexit_t onexit( - _onexit_t _Func, + int random() { + return _random(); + } + + late final _randomPtr = + _lookup>('random'); + late final _random = _randomPtr.asFunction(); + + int rand_r( + ffi.Pointer arg0, ) { - return _onexit1( - _Func, + return _rand_r( + arg0, ); } - late final _onexitPtr = - _lookup>('onexit'); - late final _onexit1 = _onexitPtr.asFunction<_onexit_t Function(_onexit_t)>(); + late final _rand_rPtr = _lookup< + ffi.NativeFunction)>>( + 'rand_r'); + late final _rand_r = + _rand_rPtr.asFunction)>(); - double cabs( - _Dcomplex _Z, + ffi.Pointer realpath( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _cabs( - _Z, + return _realpath( + arg0, + arg1, ); } - late final _cabsPtr = - _lookup>('cabs'); - late final _cabs = _cabsPtr.asFunction(); + late final _realpathPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('realpath'); + late final _realpath = _realpathPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - _Dcomplex cacos( - _Dcomplex _Z, + ffi.Pointer seed48( + ffi.Pointer arg0, ) { - return _cacos( - _Z, + return _seed48( + arg0, ); } - late final _cacosPtr = - _lookup>('cacos'); - late final _cacos = _cacosPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _seed48Ptr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer)>>('seed48'); + late final _seed48 = _seed48Ptr.asFunction< + ffi.Pointer Function( + ffi.Pointer)>(); - _Dcomplex cacosh( - _Dcomplex _Z, + int setenv( + ffi.Pointer __name, + ffi.Pointer __value, + int __overwrite, ) { - return _cacosh( - _Z, + return _setenv( + __name, + __value, + __overwrite, ); } - late final _cacoshPtr = - _lookup>('cacosh'); - late final _cacosh = _cacoshPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _setenvPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Int)>>('setenv'); + late final _setenv = _setenvPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, int)>(); - double carg( - _Dcomplex _Z, + void setkey( + ffi.Pointer arg0, ) { - return _carg( - _Z, + return _setkey( + arg0, ); } - late final _cargPtr = - _lookup>('carg'); - late final _carg = _cargPtr.asFunction(); + late final _setkeyPtr = + _lookup)>>( + 'setkey'); + late final _setkey = + _setkeyPtr.asFunction)>(); - _Dcomplex casin( - _Dcomplex _Z, + ffi.Pointer setstate( + ffi.Pointer arg0, ) { - return _casin( - _Z, + return _setstate( + arg0, ); } - late final _casinPtr = - _lookup>('casin'); - late final _casin = _casinPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _setstatePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer)>>('setstate'); + late final _setstate = _setstatePtr + .asFunction Function(ffi.Pointer)>(); - _Dcomplex casinh( - _Dcomplex _Z, + void srand48( + int arg0, ) { - return _casinh( - _Z, + return _srand48( + arg0, ); } - late final _casinhPtr = - _lookup>('casinh'); - late final _casinh = _casinhPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _srand48Ptr = + _lookup>('srand48'); + late final _srand48 = _srand48Ptr.asFunction(); - _Dcomplex catan( - _Dcomplex _Z, + void srandom( + int arg0, ) { - return _catan( - _Z, + return _srandom( + arg0, ); } - late final _catanPtr = - _lookup>('catan'); - late final _catan = _catanPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _srandomPtr = + _lookup>( + 'srandom'); + late final _srandom = _srandomPtr.asFunction(); - _Dcomplex catanh( - _Dcomplex _Z, + int unlockpt( + int arg0, ) { - return _catanh( - _Z, + return _unlockpt( + arg0, ); } - late final _catanhPtr = - _lookup>('catanh'); - late final _catanh = _catanhPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _unlockptPtr = + _lookup>('unlockpt'); + late final _unlockpt = _unlockptPtr.asFunction(); - _Dcomplex ccos( - _Dcomplex _Z, + int unsetenv( + ffi.Pointer arg0, ) { - return _ccos( - _Z, + return _unsetenv( + arg0, ); } - late final _ccosPtr = - _lookup>('ccos'); - late final _ccos = _ccosPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _unsetenvPtr = + _lookup)>>( + 'unsetenv'); + late final _unsetenv = + _unsetenvPtr.asFunction)>(); - _Dcomplex ccosh( - _Dcomplex _Z, + int arc4random() { + return _arc4random(); + } + + late final _arc4randomPtr = + _lookup>('arc4random'); + late final _arc4random = _arc4randomPtr.asFunction(); + + void arc4random_addrandom( + ffi.Pointer arg0, + int arg1, ) { - return _ccosh( - _Z, + return _arc4random_addrandom( + arg0, + arg1, ); } - late final _ccoshPtr = - _lookup>('ccosh'); - late final _ccosh = _ccoshPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _arc4random_addrandomPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, ffi.Int)>>('arc4random_addrandom'); + late final _arc4random_addrandom = _arc4random_addrandomPtr + .asFunction, int)>(); - _Dcomplex cexp( - _Dcomplex _Z, + void arc4random_buf( + ffi.Pointer __buf, + int __nbytes, ) { - return _cexp( - _Z, + return _arc4random_buf( + __buf, + __nbytes, ); } - late final _cexpPtr = - _lookup>('cexp'); - late final _cexp = _cexpPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _arc4random_bufPtr = _lookup< + ffi + .NativeFunction, ffi.Size)>>( + 'arc4random_buf'); + late final _arc4random_buf = _arc4random_bufPtr + .asFunction, int)>(); - double cimag( - _Dcomplex _Z, + void arc4random_stir() { + return _arc4random_stir(); + } + + late final _arc4random_stirPtr = + _lookup>('arc4random_stir'); + late final _arc4random_stir = + _arc4random_stirPtr.asFunction(); + + int arc4random_uniform( + int __upper_bound, ) { - return _cimag( - _Z, + return _arc4random_uniform( + __upper_bound, ); } - late final _cimagPtr = - _lookup>('cimag'); - late final _cimag = _cimagPtr.asFunction(); + late final _arc4random_uniformPtr = + _lookup>( + 'arc4random_uniform'); + late final _arc4random_uniform = + _arc4random_uniformPtr.asFunction(); - _Dcomplex clog( - _Dcomplex _Z, + ffi.Pointer cgetcap( + ffi.Pointer arg0, + ffi.Pointer arg1, + int arg2, ) { - return _clog( - _Z, + return _cgetcap( + arg0, + arg1, + arg2, ); } - late final _clogPtr = - _lookup>('clog'); - late final _clog = _clogPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetcapPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function(ffi.Pointer, + ffi.Pointer, ffi.Int)>>('cgetcap'); + late final _cgetcap = _cgetcapPtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer, int)>(); - _Dcomplex clog10( - _Dcomplex _Z, + int cgetclose() { + return _cgetclose(); + } + + late final _cgetclosePtr = + _lookup>('cgetclose'); + late final _cgetclose = _cgetclosePtr.asFunction(); + + int cgetent( + ffi.Pointer> arg0, + ffi.Pointer> arg1, + ffi.Pointer arg2, ) { - return _clog10( - _Z, + return _cgetent( + arg0, + arg1, + arg2, ); } - late final _clog10Ptr = - _lookup>('clog10'); - late final _clog10 = _clog10Ptr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetentPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer>, + ffi.Pointer>, + ffi.Pointer)>>('cgetent'); + late final _cgetent = _cgetentPtr.asFunction< + int Function(ffi.Pointer>, + ffi.Pointer>, ffi.Pointer)>(); - _Dcomplex conj( - _Dcomplex _Z, + int cgetfirst( + ffi.Pointer> arg0, + ffi.Pointer> arg1, ) { - return _conj( - _Z, + return _cgetfirst( + arg0, + arg1, ); } - late final _conjPtr = - _lookup>('conj'); - late final _conj = _conjPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetfirstPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer>, + ffi.Pointer>)>>('cgetfirst'); + late final _cgetfirst = _cgetfirstPtr.asFunction< + int Function(ffi.Pointer>, + ffi.Pointer>)>(); - _Dcomplex cpow( - _Dcomplex _X, - _Dcomplex _Y, + int cgetmatch( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _cpow( - _X, - _Y, + return _cgetmatch( + arg0, + arg1, ); } - late final _cpowPtr = - _lookup>( - 'cpow'); - late final _cpow = - _cpowPtr.asFunction<_Dcomplex Function(_Dcomplex, _Dcomplex)>(); + late final _cgetmatchPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>('cgetmatch'); + late final _cgetmatch = _cgetmatchPtr + .asFunction, ffi.Pointer)>(); - _Dcomplex cproj( - _Dcomplex _Z, + int cgetnext( + ffi.Pointer> arg0, + ffi.Pointer> arg1, ) { - return _cproj( - _Z, + return _cgetnext( + arg0, + arg1, ); } - late final _cprojPtr = - _lookup>('cproj'); - late final _cproj = _cprojPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetnextPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer>, + ffi.Pointer>)>>('cgetnext'); + late final _cgetnext = _cgetnextPtr.asFunction< + int Function(ffi.Pointer>, + ffi.Pointer>)>(); - double creal( - _Dcomplex _Z, + int cgetnum( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer arg2, ) { - return _creal( - _Z, + return _cgetnum( + arg0, + arg1, + arg2, ); } - late final _crealPtr = - _lookup>('creal'); - late final _creal = _crealPtr.asFunction(); + late final _cgetnumPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>('cgetnum'); + late final _cgetnum = _cgetnumPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>(); - _Dcomplex csin( - _Dcomplex _Z, + int cgetset( + ffi.Pointer arg0, ) { - return _csin( - _Z, + return _cgetset( + arg0, ); } - late final _csinPtr = - _lookup>('csin'); - late final _csin = _csinPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetsetPtr = + _lookup)>>( + 'cgetset'); + late final _cgetset = + _cgetsetPtr.asFunction)>(); - _Dcomplex csinh( - _Dcomplex _Z, + int cgetstr( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, ) { - return _csinh( - _Z, + return _cgetstr( + arg0, + arg1, + arg2, ); } - late final _csinhPtr = - _lookup>('csinh'); - late final _csinh = _csinhPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetstrPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('cgetstr'); + late final _cgetstr = _cgetstrPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); - _Dcomplex csqrt( - _Dcomplex _Z, + int cgetustr( + ffi.Pointer arg0, + ffi.Pointer arg1, + ffi.Pointer> arg2, ) { - return _csqrt( - _Z, + return _cgetustr( + arg0, + arg1, + arg2, ); } - late final _csqrtPtr = - _lookup>('csqrt'); - late final _csqrt = _csqrtPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _cgetustrPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>>('cgetustr'); + late final _cgetustr = _cgetustrPtr.asFunction< + int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer>)>(); - _Dcomplex ctan( - _Dcomplex _Z, + int daemon( + int arg0, + int arg1, ) { - return _ctan( - _Z, + return _daemon( + arg0, + arg1, ); } - late final _ctanPtr = - _lookup>('ctan'); - late final _ctan = _ctanPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _daemonPtr = + _lookup>('daemon'); + late final _daemon = _daemonPtr.asFunction(); - _Dcomplex ctanh( - _Dcomplex _Z, + ffi.Pointer devname( + int arg0, + int arg1, ) { - return _ctanh( - _Z, + return _devname( + arg0, + arg1, ); } - late final _ctanhPtr = - _lookup>('ctanh'); - late final _ctanh = _ctanhPtr.asFunction<_Dcomplex Function(_Dcomplex)>(); + late final _devnamePtr = _lookup< + ffi.NativeFunction Function(dev_t, mode_t)>>( + 'devname'); + late final _devname = + _devnamePtr.asFunction Function(int, int)>(); - double norm( - _Dcomplex _Z, + ffi.Pointer devname_r( + int arg0, + int arg1, + ffi.Pointer buf, + int len, ) { - return _norm( - _Z, + return _devname_r( + arg0, + arg1, + buf, + len, ); } - late final _normPtr = - _lookup>('norm'); - late final _norm = _normPtr.asFunction(); + late final _devname_rPtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + dev_t, mode_t, ffi.Pointer, ffi.Int)>>('devname_r'); + late final _devname_r = _devname_rPtr.asFunction< + ffi.Pointer Function(int, int, ffi.Pointer, int)>(); - double cabsf( - _Fcomplex _Z, + ffi.Pointer getbsize( + ffi.Pointer arg0, + ffi.Pointer arg1, ) { - return _cabsf( - _Z, + return _getbsize( + arg0, + arg1, ); } - late final _cabsfPtr = - _lookup>('cabsf'); - late final _cabsf = _cabsfPtr.asFunction(); + late final _getbsizePtr = _lookup< + ffi.NativeFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>>('getbsize'); + late final _getbsize = _getbsizePtr.asFunction< + ffi.Pointer Function( + ffi.Pointer, ffi.Pointer)>(); - _Fcomplex cacosf( - _Fcomplex _Z, + int getloadavg( + ffi.Pointer arg0, + int arg1, ) { - return _cacosf( - _Z, + return _getloadavg( + arg0, + arg1, ); } - late final _cacosfPtr = - _lookup>('cacosf'); - late final _cacosf = _cacosfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _getloadavgPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Int)>>('getloadavg'); + late final _getloadavg = + _getloadavgPtr.asFunction, int)>(); - _Fcomplex cacoshf( - _Fcomplex _Z, + ffi.Pointer getprogname() { + return _getprogname(); + } + + late final _getprognamePtr = + _lookup Function()>>( + 'getprogname'); + late final _getprogname = + _getprognamePtr.asFunction Function()>(); + + void setprogname( + ffi.Pointer arg0, ) { - return _cacoshf( - _Z, + return _setprogname( + arg0, ); } - late final _cacoshfPtr = - _lookup>('cacoshf'); - late final _cacoshf = _cacoshfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _setprognamePtr = + _lookup)>>( + 'setprogname'); + late final _setprogname = + _setprognamePtr.asFunction)>(); - double cargf( - _Fcomplex _Z, + int heapsort( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + __compar, ) { - return _cargf( - _Z, + return _heapsort( + __base, + __nel, + __width, + __compar, ); } - late final _cargfPtr = - _lookup>('cargf'); - late final _cargf = _cargfPtr.asFunction(); + late final _heapsortPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>)>>('heapsort'); + late final _heapsort = _heapsortPtr.asFunction< + int Function( + ffi.Pointer, + int, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>)>(); - _Fcomplex casinf( - _Fcomplex _Z, + int mergesort( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + __compar, ) { - return _casinf( - _Z, + return _mergesort( + __base, + __nel, + __width, + __compar, ); } - late final _casinfPtr = - _lookup>('casinf'); - late final _casinf = _casinfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _mergesortPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>)>>('mergesort'); + late final _mergesort = _mergesortPtr.asFunction< + int Function( + ffi.Pointer, + int, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>)>(); - _Fcomplex casinhf( - _Fcomplex _Z, + void psort( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer)>> + __compar, ) { - return _casinhf( - _Z, + return _psort( + __base, + __nel, + __width, + __compar, ); } - late final _casinhfPtr = - _lookup>('casinhf'); - late final _casinhf = _casinhfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _psortPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, + ffi.Pointer)>>)>>('psort'); + late final _psort = _psortPtr.asFunction< + void Function( + ffi.Pointer, + int, + int, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, ffi.Pointer)>>)>(); - _Fcomplex catanf( - _Fcomplex _Z, + void psort_r( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer arg3, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>> + __compar, ) { - return _catanf( - _Z, + return _psort_r( + __base, + __nel, + __width, + arg3, + __compar, ); } - late final _catanfPtr = - _lookup>('catanf'); - late final _catanf = _catanfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _psort_rPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>)>>('psort_r'); + late final _psort_r = _psort_rPtr.asFunction< + void Function( + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>)>(); - _Fcomplex catanhf( - _Fcomplex _Z, + void qsort_r( + ffi.Pointer __base, + int __nel, + int __width, + ffi.Pointer arg3, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>> + __compar, ) { - return _catanhf( - _Z, + return _qsort_r( + __base, + __nel, + __width, + arg3, + __compar, ); } - late final _catanhfPtr = - _lookup>('catanhf'); - late final _catanhf = _catanhfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _qsort_rPtr = _lookup< + ffi.NativeFunction< + ffi.Void Function( + ffi.Pointer, + ffi.Size, + ffi.Size, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function( + ffi.Pointer, + ffi.Pointer, + ffi.Pointer)>>)>>('qsort_r'); + late final _qsort_r = _qsort_rPtr.asFunction< + void Function( + ffi.Pointer, + int, + int, + ffi.Pointer, + ffi.Pointer< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer, ffi.Pointer, + ffi.Pointer)>>)>(); - _Fcomplex ccosf( - _Fcomplex _Z, + int radixsort( + ffi.Pointer> __base, + int __nel, + ffi.Pointer __table, + int __endbyte, ) { - return _ccosf( - _Z, + return _radixsort( + __base, + __nel, + __table, + __endbyte, ); } - late final _ccosfPtr = - _lookup>('ccosf'); - late final _ccosf = _ccosfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _radixsortPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer>, ffi.Int, + ffi.Pointer, ffi.UnsignedInt)>>('radixsort'); + late final _radixsort = _radixsortPtr.asFunction< + int Function(ffi.Pointer>, int, + ffi.Pointer, int)>(); - _Fcomplex ccoshf( - _Fcomplex _Z, + int rpmatch( + ffi.Pointer arg0, ) { - return _ccoshf( - _Z, + return _rpmatch( + arg0, ); } - late final _ccoshfPtr = - _lookup>('ccoshf'); - late final _ccoshf = _ccoshfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _rpmatchPtr = + _lookup)>>( + 'rpmatch'); + late final _rpmatch = + _rpmatchPtr.asFunction)>(); - _Fcomplex cexpf( - _Fcomplex _Z, + int sradixsort( + ffi.Pointer> __base, + int __nel, + ffi.Pointer __table, + int __endbyte, ) { - return _cexpf( - _Z, + return _sradixsort( + __base, + __nel, + __table, + __endbyte, ); } - late final _cexpfPtr = - _lookup>('cexpf'); - late final _cexpf = _cexpfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _sradixsortPtr = _lookup< + ffi.NativeFunction< + ffi.Int Function(ffi.Pointer>, ffi.Int, + ffi.Pointer, ffi.UnsignedInt)>>('sradixsort'); + late final _sradixsort = _sradixsortPtr.asFunction< + int Function(ffi.Pointer>, int, + ffi.Pointer, int)>(); - double cimagf( - _Fcomplex _Z, + void sranddev() { + return _sranddev(); + } + + late final _sranddevPtr = + _lookup>('sranddev'); + late final _sranddev = _sranddevPtr.asFunction(); + + void srandomdev() { + return _srandomdev(); + } + + late final _srandomdevPtr = + _lookup>('srandomdev'); + late final _srandomdev = _srandomdevPtr.asFunction(); + + int strtonum( + ffi.Pointer __numstr, + int __minval, + int __maxval, + ffi.Pointer> __errstrp, ) { - return _cimagf( - _Z, + return _strtonum( + __numstr, + __minval, + __maxval, + __errstrp, ); } - late final _cimagfPtr = - _lookup>('cimagf'); - late final _cimagf = _cimagfPtr.asFunction(); + late final _strtonumPtr = _lookup< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, ffi.LongLong, + ffi.LongLong, ffi.Pointer>)>>('strtonum'); + late final _strtonum = _strtonumPtr.asFunction< + int Function(ffi.Pointer, int, int, + ffi.Pointer>)>(); - _Fcomplex clogf( - _Fcomplex _Z, + int strtoq( + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { - return _clogf( - _Z, + return _strtoq( + __str, + __endptr, + __base, ); } - late final _clogfPtr = - _lookup>('clogf'); - late final _clogf = _clogfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _strtoqPtr = _lookup< + ffi.NativeFunction< + ffi.LongLong Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('strtoq'); + late final _strtoq = _strtoqPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - _Fcomplex clog10f( - _Fcomplex _Z, + int strtouq( + ffi.Pointer __str, + ffi.Pointer> __endptr, + int __base, ) { - return _clog10f( - _Z, + return _strtouq( + __str, + __endptr, + __base, ); } - late final _clog10fPtr = - _lookup>('clog10f'); - late final _clog10f = _clog10fPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + late final _strtouqPtr = _lookup< + ffi.NativeFunction< + ffi.UnsignedLongLong Function(ffi.Pointer, + ffi.Pointer>, ffi.Int)>>('strtouq'); + late final _strtouq = _strtouqPtr.asFunction< + int Function( + ffi.Pointer, ffi.Pointer>, int)>(); - _Fcomplex conjf( - _Fcomplex _Z, - ) { - return _conjf( - _Z, - ); - } + late final ffi.Pointer> _suboptarg = + _lookup>('suboptarg'); - late final _conjfPtr = - _lookup>('conjf'); - late final _conjf = _conjfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); + ffi.Pointer get suboptarg => _suboptarg.value; - _Fcomplex cpowf( - _Fcomplex _X, - _Fcomplex _Y, - ) { - return _cpowf( - _X, - _Y, - ); - } - - late final _cpowfPtr = - _lookup>( - 'cpowf'); - late final _cpowf = - _cpowfPtr.asFunction<_Fcomplex Function(_Fcomplex, _Fcomplex)>(); - - _Fcomplex cprojf( - _Fcomplex _Z, - ) { - return _cprojf( - _Z, - ); - } - - late final _cprojfPtr = - _lookup>('cprojf'); - late final _cprojf = _cprojfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - double crealf( - _Fcomplex _Z, - ) { - return _crealf( - _Z, - ); - } - - late final _crealfPtr = - _lookup>('crealf'); - late final _crealf = _crealfPtr.asFunction(); - - _Fcomplex csinf( - _Fcomplex _Z, - ) { - return _csinf( - _Z, - ); - } - - late final _csinfPtr = - _lookup>('csinf'); - late final _csinf = _csinfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - _Fcomplex csinhf( - _Fcomplex _Z, - ) { - return _csinhf( - _Z, - ); - } - - late final _csinhfPtr = - _lookup>('csinhf'); - late final _csinhf = _csinhfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - _Fcomplex csqrtf( - _Fcomplex _Z, - ) { - return _csqrtf( - _Z, - ); - } - - late final _csqrtfPtr = - _lookup>('csqrtf'); - late final _csqrtf = _csqrtfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - _Fcomplex ctanf( - _Fcomplex _Z, - ) { - return _ctanf( - _Z, - ); - } - - late final _ctanfPtr = - _lookup>('ctanf'); - late final _ctanf = _ctanfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - _Fcomplex ctanhf( - _Fcomplex _Z, - ) { - return _ctanhf( - _Z, - ); - } - - late final _ctanhfPtr = - _lookup>('ctanhf'); - late final _ctanhf = _ctanhfPtr.asFunction<_Fcomplex Function(_Fcomplex)>(); - - double normf( - _Fcomplex _Z, - ) { - return _normf( - _Z, - ); - } - - late final _normfPtr = - _lookup>('normf'); - late final _normf = _normfPtr.asFunction(); - - _Dcomplex _Cbuild( - double _Re, - double _Im, - ) { - return __Cbuild( - _Re, - _Im, - ); - } - - late final __CbuildPtr = - _lookup>( - '_Cbuild'); - late final __Cbuild = - __CbuildPtr.asFunction<_Dcomplex Function(double, double)>(); - - _Dcomplex _Cmulcc( - _Dcomplex _X, - _Dcomplex _Y, - ) { - return __Cmulcc( - _X, - _Y, - ); - } - - late final __CmulccPtr = - _lookup>( - '_Cmulcc'); - late final __Cmulcc = - __CmulccPtr.asFunction<_Dcomplex Function(_Dcomplex, _Dcomplex)>(); - - _Dcomplex _Cmulcr( - _Dcomplex _X, - double _Y, - ) { - return __Cmulcr( - _X, - _Y, - ); - } - - late final __CmulcrPtr = - _lookup>( - '_Cmulcr'); - late final __Cmulcr = - __CmulcrPtr.asFunction<_Dcomplex Function(_Dcomplex, double)>(); - - _Fcomplex _FCbuild( - double _Re, - double _Im, - ) { - return __FCbuild( - _Re, - _Im, - ); - } - - late final __FCbuildPtr = - _lookup>( - '_FCbuild'); - late final __FCbuild = - __FCbuildPtr.asFunction<_Fcomplex Function(double, double)>(); - - _Fcomplex _FCmulcc( - _Fcomplex _X, - _Fcomplex _Y, - ) { - return __FCmulcc( - _X, - _Y, - ); - } - - late final __FCmulccPtr = - _lookup>( - '_FCmulcc'); - late final __FCmulcc = - __FCmulccPtr.asFunction<_Fcomplex Function(_Fcomplex, _Fcomplex)>(); - - _Fcomplex _FCmulcr( - _Fcomplex _X, - double _Y, - ) { - return __FCmulcr( - _X, - _Y, - ); - } - - late final __FCmulcrPtr = - _lookup>( - '_FCmulcr'); - late final __FCmulcr = - __FCmulcrPtr.asFunction<_Fcomplex Function(_Fcomplex, double)>(); + set suboptarg(ffi.Pointer value) => _suboptarg.value = value; void updateDns( ffi.Pointer s, @@ -5380,31 +2584,6 @@ class ClashFFI { late final _closeConnection = _closeConnectionPtr.asFunction)>(); - ffi.Pointer getProviders() { - return _getProviders(); - } - - late final _getProvidersPtr = - _lookup Function()>>( - 'getProviders'); - late final _getProviders = - _getProvidersPtr.asFunction Function()>(); - - ffi.Pointer getProvider( - ffi.Pointer name, - ) { - return _getProvider( - name, - ); - } - - late final _getProviderPtr = _lookup< - ffi.NativeFunction< - ffi.Pointer Function( - ffi.Pointer)>>('getProvider'); - late final _getProvider = _getProviderPtr - .asFunction Function(ffi.Pointer)>(); - ffi.Pointer getExternalProviders() { return _getExternalProviders(); } @@ -5637,41 +2816,97 @@ class ClashFFI { late final _setFdMap = _setFdMapPtr.asFunction(); } -typedef va_list = ffi.Pointer; +final class __mbstate_t extends ffi.Union { + @ffi.Array.multi([128]) + external ffi.Array __mbstate8; -final class __crt_locale_data_public extends ffi.Struct { - external ffi.Pointer _locale_pctype; - - @ffi.Int() - external int _locale_mb_cur_max; - - @ffi.UnsignedInt() - external int _locale_lc_codepage; + @ffi.LongLong() + external int _mbstateL; } -final class __crt_locale_pointers extends ffi.Struct { - external ffi.Pointer<__crt_locale_data> locinfo; +final class __darwin_pthread_handler_rec extends ffi.Struct { + external ffi + .Pointer)>> + __routine; - external ffi.Pointer<__crt_multibyte_data> mbcinfo; + external ffi.Pointer __arg; + + external ffi.Pointer<__darwin_pthread_handler_rec> __next; } -final class __crt_locale_data extends ffi.Opaque {} +final class _opaque_pthread_attr_t extends ffi.Struct { + @ffi.Long() + external int __sig; -final class __crt_multibyte_data extends ffi.Opaque {} - -final class _Mbstatet extends ffi.Struct { - @ffi.UnsignedLong() - external int _Wchar; - - @ffi.UnsignedShort() - external int _Byte; - - @ffi.UnsignedShort() - external int _State; + @ffi.Array.multi([56]) + external ffi.Array __opaque; } -typedef errno_t = ffi.Int; -typedef Darterrno_t = int; +final class _opaque_pthread_cond_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([40]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_condattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_mutex_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([56]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_mutexattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_once_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([8]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_rwlock_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([192]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_rwlockattr_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + @ffi.Array.multi([16]) + external ffi.Array __opaque; +} + +final class _opaque_pthread_t extends ffi.Struct { + @ffi.Long() + external int __sig; + + external ffi.Pointer<__darwin_pthread_handler_rec> __cleanup_stack; + + @ffi.Array.multi([8176]) + external ffi.Array __opaque; +} final class _GoString_ extends ffi.Struct { external ffi.Pointer p; @@ -5680,46 +2915,1022 @@ final class _GoString_ extends ffi.Struct { external int n; } -typedef ptrdiff_t = ffi.LongLong; -typedef Dartptrdiff_t = int; -typedef rsize_t = ffi.Size; -typedef Dartrsize_t = int; -typedef _CoreCrtSecureSearchSortCompareFunction = ffi.Pointer< - ffi.NativeFunction<_CoreCrtSecureSearchSortCompareFunctionFunction>>; -typedef _CoreCrtSecureSearchSortCompareFunctionFunction = ffi.Int Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer); -typedef Dart_CoreCrtSecureSearchSortCompareFunctionFunction = int Function( - ffi.Pointer, ffi.Pointer, ffi.Pointer); -typedef _CoreCrtNonSecureSearchSortCompareFunction = ffi.Pointer< - ffi.NativeFunction<_CoreCrtNonSecureSearchSortCompareFunctionFunction>>; -typedef _CoreCrtNonSecureSearchSortCompareFunctionFunction = ffi.Int Function( - ffi.Pointer, ffi.Pointer); -typedef Dart_CoreCrtNonSecureSearchSortCompareFunctionFunction = int Function( - ffi.Pointer, ffi.Pointer); -typedef _locale_t = ffi.Pointer<__crt_locale_pointers>; -typedef _onexit_t = ffi.Pointer>; -typedef _onexit_tFunction = ffi.Int Function(); -typedef Dart_onexit_tFunction = int Function(); -typedef _purecall_handler - = ffi.Pointer>; -typedef _purecall_handlerFunction = ffi.Void Function(); -typedef Dart_purecall_handlerFunction = void Function(); -typedef _invalid_parameter_handler - = ffi.Pointer>; -typedef _invalid_parameter_handlerFunction = ffi.Void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - ffi.UnsignedInt, - ffi.UintPtr); -typedef Dart_invalid_parameter_handlerFunction = void Function( - ffi.Pointer, - ffi.Pointer, - ffi.Pointer, - int, - int); +typedef ptrdiff_t = __darwin_ptrdiff_t; +typedef __darwin_ptrdiff_t = ffi.Long; +typedef Dart__darwin_ptrdiff_t = int; -final class _div_t extends ffi.Struct { +enum idtype_t { + P_ALL(0), + P_PID(1), + P_PGID(2); + + final int value; + const idtype_t(this.value); + + static idtype_t fromValue(int value) => switch (value) { + 0 => P_ALL, + 1 => P_PID, + 2 => P_PGID, + _ => throw ArgumentError("Unknown value for idtype_t: $value"), + }; +} + +final class __darwin_arm_exception_state extends ffi.Struct { + @__uint32_t() + external int __exception; + + @__uint32_t() + external int __fsr; + + @__uint32_t() + external int __far; +} + +typedef __uint32_t = ffi.UnsignedInt; +typedef Dart__uint32_t = int; + +final class __darwin_arm_exception_state64 extends ffi.Struct { + @__uint64_t() + external int __far; + + @__uint32_t() + external int __esr; + + @__uint32_t() + external int __exception; +} + +typedef __uint64_t = ffi.UnsignedLongLong; +typedef Dart__uint64_t = int; + +final class __darwin_arm_exception_state64_v2 extends ffi.Struct { + @__uint64_t() + external int __far; + + @__uint64_t() + external int __esr; +} + +final class __darwin_arm_thread_state extends ffi.Struct { + @ffi.Array.multi([13]) + external ffi.Array<__uint32_t> __r; + + @__uint32_t() + external int __sp; + + @__uint32_t() + external int __lr; + + @__uint32_t() + external int __pc; + + @__uint32_t() + external int __cpsr; +} + +final class __darwin_arm_thread_state64 extends ffi.Struct { + @ffi.Array.multi([29]) + external ffi.Array<__uint64_t> __x; + + @__uint64_t() + external int __fp; + + @__uint64_t() + external int __lr; + + @__uint64_t() + external int __sp; + + @__uint64_t() + external int __pc; + + @__uint32_t() + external int __cpsr; + + @__uint32_t() + external int __pad; +} + +final class __darwin_arm_vfp_state extends ffi.Struct { + @ffi.Array.multi([64]) + external ffi.Array<__uint32_t> __r; + + @__uint32_t() + external int __fpscr; +} + +final class __darwin_arm_neon_state64 extends ffi.Opaque {} + +final class __darwin_arm_neon_state extends ffi.Opaque {} + +final class __arm_pagein_state extends ffi.Struct { + @ffi.Int() + external int __pagein_error; +} + +final class __arm_legacy_debug_state extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bcr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wcr; +} + +final class __darwin_arm_debug_state32 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __bcr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint32_t> __wcr; + + @__uint64_t() + external int __mdscr_el1; +} + +final class __darwin_arm_debug_state64 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __bvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __bcr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __wvr; + + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __wcr; + + @__uint64_t() + external int __mdscr_el1; +} + +final class __darwin_arm_cpmu_state64 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array<__uint64_t> __ctrs; +} + +final class __darwin_mcontext32 extends ffi.Struct { + external __darwin_arm_exception_state __es; + + external __darwin_arm_thread_state __ss; + + external __darwin_arm_vfp_state __fs; +} + +final class __darwin_mcontext64 extends ffi.Opaque {} + +final class __darwin_sigaltstack extends ffi.Struct { + external ffi.Pointer ss_sp; + + @__darwin_size_t() + external int ss_size; + + @ffi.Int() + external int ss_flags; +} + +typedef __darwin_size_t = ffi.UnsignedLong; +typedef Dart__darwin_size_t = int; + +final class __darwin_ucontext extends ffi.Struct { + @ffi.Int() + external int uc_onstack; + + @__darwin_sigset_t() + external int uc_sigmask; + + external __darwin_sigaltstack uc_stack; + + external ffi.Pointer<__darwin_ucontext> uc_link; + + @__darwin_size_t() + external int uc_mcsize; + + external ffi.Pointer<__darwin_mcontext64> uc_mcontext; +} + +typedef __darwin_sigset_t = __uint32_t; + +final class sigval extends ffi.Union { + @ffi.Int() + external int sival_int; + + external ffi.Pointer sival_ptr; +} + +final class sigevent extends ffi.Struct { + @ffi.Int() + external int sigev_notify; + + @ffi.Int() + external int sigev_signo; + + external sigval sigev_value; + + external ffi.Pointer> + sigev_notify_function; + + external ffi.Pointer sigev_notify_attributes; +} + +typedef pthread_attr_t = __darwin_pthread_attr_t; +typedef __darwin_pthread_attr_t = _opaque_pthread_attr_t; + +final class __siginfo extends ffi.Struct { + @ffi.Int() + external int si_signo; + + @ffi.Int() + external int si_errno; + + @ffi.Int() + external int si_code; + + @pid_t() + external int si_pid; + + @uid_t() + external int si_uid; + + @ffi.Int() + external int si_status; + + external ffi.Pointer si_addr; + + external sigval si_value; + + @ffi.Long() + external int si_band; + + @ffi.Array.multi([7]) + external ffi.Array __pad; +} + +typedef pid_t = __darwin_pid_t; +typedef __darwin_pid_t = __int32_t; +typedef __int32_t = ffi.Int; +typedef Dart__int32_t = int; +typedef uid_t = __darwin_uid_t; +typedef __darwin_uid_t = __uint32_t; + +final class __sigaction_u extends ffi.Union { + external ffi.Pointer> + __sa_handler; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function( + ffi.Int, ffi.Pointer<__siginfo>, ffi.Pointer)>> + __sa_sigaction; +} + +final class __sigaction extends ffi.Struct { + external __sigaction_u __sigaction_u1; + + external ffi.Pointer< + ffi.NativeFunction< + ffi.Void Function(ffi.Pointer, ffi.Int, ffi.Int, + ffi.Pointer, ffi.Pointer)>> sa_tramp; + + @sigset_t() + external int sa_mask; + + @ffi.Int() + external int sa_flags; +} + +typedef siginfo_t = __siginfo; +typedef sigset_t = __darwin_sigset_t; + +final class sigaction extends ffi.Struct { + external __sigaction_u __sigaction_u1; + + @sigset_t() + external int sa_mask; + + @ffi.Int() + external int sa_flags; +} + +final class sigvec extends ffi.Struct { + external ffi.Pointer> + sv_handler; + + @ffi.Int() + external int sv_mask; + + @ffi.Int() + external int sv_flags; +} + +final class sigstack extends ffi.Struct { + external ffi.Pointer ss_sp; + + @ffi.Int() + external int ss_onstack; +} + +final class timeval extends ffi.Struct { + @__darwin_time_t() + external int tv_sec; + + @__darwin_suseconds_t() + external int tv_usec; +} + +typedef __darwin_time_t = ffi.Long; +typedef Dart__darwin_time_t = int; +typedef __darwin_suseconds_t = __int32_t; + +final class rusage extends ffi.Struct { + external timeval ru_utime; + + external timeval ru_stime; + + @ffi.Long() + external int ru_maxrss; + + @ffi.Long() + external int ru_ixrss; + + @ffi.Long() + external int ru_idrss; + + @ffi.Long() + external int ru_isrss; + + @ffi.Long() + external int ru_minflt; + + @ffi.Long() + external int ru_majflt; + + @ffi.Long() + external int ru_nswap; + + @ffi.Long() + external int ru_inblock; + + @ffi.Long() + external int ru_oublock; + + @ffi.Long() + external int ru_msgsnd; + + @ffi.Long() + external int ru_msgrcv; + + @ffi.Long() + external int ru_nsignals; + + @ffi.Long() + external int ru_nvcsw; + + @ffi.Long() + external int ru_nivcsw; +} + +final class rusage_info_v0 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; +} + +final class rusage_info_v1 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; +} + +final class rusage_info_v2 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; + + @ffi.Uint64() + external int ri_diskio_bytesread; + + @ffi.Uint64() + external int ri_diskio_byteswritten; +} + +final class rusage_info_v3 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; + + @ffi.Uint64() + external int ri_diskio_bytesread; + + @ffi.Uint64() + external int ri_diskio_byteswritten; + + @ffi.Uint64() + external int ri_cpu_time_qos_default; + + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; + + @ffi.Uint64() + external int ri_cpu_time_qos_background; + + @ffi.Uint64() + external int ri_cpu_time_qos_utility; + + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; + + @ffi.Uint64() + external int ri_billed_system_time; + + @ffi.Uint64() + external int ri_serviced_system_time; +} + +final class rusage_info_v4 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; + + @ffi.Uint64() + external int ri_diskio_bytesread; + + @ffi.Uint64() + external int ri_diskio_byteswritten; + + @ffi.Uint64() + external int ri_cpu_time_qos_default; + + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; + + @ffi.Uint64() + external int ri_cpu_time_qos_background; + + @ffi.Uint64() + external int ri_cpu_time_qos_utility; + + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; + + @ffi.Uint64() + external int ri_billed_system_time; + + @ffi.Uint64() + external int ri_serviced_system_time; + + @ffi.Uint64() + external int ri_logical_writes; + + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; + + @ffi.Uint64() + external int ri_instructions; + + @ffi.Uint64() + external int ri_cycles; + + @ffi.Uint64() + external int ri_billed_energy; + + @ffi.Uint64() + external int ri_serviced_energy; + + @ffi.Uint64() + external int ri_interval_max_phys_footprint; + + @ffi.Uint64() + external int ri_runnable_time; +} + +final class rusage_info_v5 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; + + @ffi.Uint64() + external int ri_diskio_bytesread; + + @ffi.Uint64() + external int ri_diskio_byteswritten; + + @ffi.Uint64() + external int ri_cpu_time_qos_default; + + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; + + @ffi.Uint64() + external int ri_cpu_time_qos_background; + + @ffi.Uint64() + external int ri_cpu_time_qos_utility; + + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; + + @ffi.Uint64() + external int ri_billed_system_time; + + @ffi.Uint64() + external int ri_serviced_system_time; + + @ffi.Uint64() + external int ri_logical_writes; + + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; + + @ffi.Uint64() + external int ri_instructions; + + @ffi.Uint64() + external int ri_cycles; + + @ffi.Uint64() + external int ri_billed_energy; + + @ffi.Uint64() + external int ri_serviced_energy; + + @ffi.Uint64() + external int ri_interval_max_phys_footprint; + + @ffi.Uint64() + external int ri_runnable_time; + + @ffi.Uint64() + external int ri_flags; +} + +final class rusage_info_v6 extends ffi.Struct { + @ffi.Array.multi([16]) + external ffi.Array ri_uuid; + + @ffi.Uint64() + external int ri_user_time; + + @ffi.Uint64() + external int ri_system_time; + + @ffi.Uint64() + external int ri_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_interrupt_wkups; + + @ffi.Uint64() + external int ri_pageins; + + @ffi.Uint64() + external int ri_wired_size; + + @ffi.Uint64() + external int ri_resident_size; + + @ffi.Uint64() + external int ri_phys_footprint; + + @ffi.Uint64() + external int ri_proc_start_abstime; + + @ffi.Uint64() + external int ri_proc_exit_abstime; + + @ffi.Uint64() + external int ri_child_user_time; + + @ffi.Uint64() + external int ri_child_system_time; + + @ffi.Uint64() + external int ri_child_pkg_idle_wkups; + + @ffi.Uint64() + external int ri_child_interrupt_wkups; + + @ffi.Uint64() + external int ri_child_pageins; + + @ffi.Uint64() + external int ri_child_elapsed_abstime; + + @ffi.Uint64() + external int ri_diskio_bytesread; + + @ffi.Uint64() + external int ri_diskio_byteswritten; + + @ffi.Uint64() + external int ri_cpu_time_qos_default; + + @ffi.Uint64() + external int ri_cpu_time_qos_maintenance; + + @ffi.Uint64() + external int ri_cpu_time_qos_background; + + @ffi.Uint64() + external int ri_cpu_time_qos_utility; + + @ffi.Uint64() + external int ri_cpu_time_qos_legacy; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_initiated; + + @ffi.Uint64() + external int ri_cpu_time_qos_user_interactive; + + @ffi.Uint64() + external int ri_billed_system_time; + + @ffi.Uint64() + external int ri_serviced_system_time; + + @ffi.Uint64() + external int ri_logical_writes; + + @ffi.Uint64() + external int ri_lifetime_max_phys_footprint; + + @ffi.Uint64() + external int ri_instructions; + + @ffi.Uint64() + external int ri_cycles; + + @ffi.Uint64() + external int ri_billed_energy; + + @ffi.Uint64() + external int ri_serviced_energy; + + @ffi.Uint64() + external int ri_interval_max_phys_footprint; + + @ffi.Uint64() + external int ri_runnable_time; + + @ffi.Uint64() + external int ri_flags; + + @ffi.Uint64() + external int ri_user_ptime; + + @ffi.Uint64() + external int ri_system_ptime; + + @ffi.Uint64() + external int ri_pinstructions; + + @ffi.Uint64() + external int ri_pcycles; + + @ffi.Uint64() + external int ri_energy_nj; + + @ffi.Uint64() + external int ri_penergy_nj; + + @ffi.Uint64() + external int ri_secure_time_in_system; + + @ffi.Uint64() + external int ri_secure_ptime_in_system; + + @ffi.Uint64() + external int ri_neural_footprint; + + @ffi.Uint64() + external int ri_lifetime_max_neural_footprint; + + @ffi.Uint64() + external int ri_interval_max_neural_footprint; + + @ffi.Array.multi([9]) + external ffi.Array ri_reserved; +} + +final class rlimit extends ffi.Struct { + @rlim_t() + external int rlim_cur; + + @rlim_t() + external int rlim_max; +} + +typedef rlim_t = __uint64_t; + +final class proc_rlimit_control_wakeupmon extends ffi.Struct { + @ffi.Uint32() + external int wm_flags; + + @ffi.Int32() + external int wm_rate; +} + +typedef id_t = __darwin_id_t; +typedef __darwin_id_t = __uint32_t; + +final class wait extends ffi.Opaque {} + +final class div_t extends ffi.Struct { @ffi.Int() external int quot; @@ -5727,7 +3938,7 @@ final class _div_t extends ffi.Struct { external int rem; } -final class _ldiv_t extends ffi.Struct { +final class ldiv_t extends ffi.Struct { @ffi.Long() external int quot; @@ -5735,7 +3946,7 @@ final class _ldiv_t extends ffi.Struct { external int rem; } -final class _lldiv_t extends ffi.Struct { +final class lldiv_t extends ffi.Struct { @ffi.LongLong() external int quot; @@ -5743,46 +3954,18 @@ final class _lldiv_t extends ffi.Struct { external int rem; } -typedef div_t = _div_t; -typedef ldiv_t = _ldiv_t; -typedef lldiv_t = _lldiv_t; +typedef malloc_type_id_t = ffi.UnsignedLongLong; +typedef Dartmalloc_type_id_t = int; -final class _LDOUBLE extends ffi.Struct { - @ffi.Array.multi([10]) - external ffi.Array ld; -} +final class _malloc_zone_t extends ffi.Opaque {} -final class _CRT_DOUBLE extends ffi.Struct { - @ffi.Double() - external double x; -} - -final class _CRT_FLOAT extends ffi.Struct { - @ffi.Float() - external double f; -} - -final class _LONGDOUBLE extends ffi.Opaque {} - -final class _LDBL12 extends ffi.Struct { - @ffi.Array.multi([12]) - external ffi.Array ld12; -} - -final class _C_double_complex extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array _Val; -} - -final class _C_float_complex extends ffi.Struct { - @ffi.Array.multi([2]) - external ffi.Array _Val; -} - -final class _C_ldouble_complex extends ffi.Opaque {} - -typedef _Dcomplex = _C_double_complex; -typedef _Fcomplex = _C_float_complex; +typedef malloc_zone_t = _malloc_zone_t; +typedef dev_t = __darwin_dev_t; +typedef __darwin_dev_t = __int32_t; +typedef mode_t = __darwin_mode_t; +typedef __darwin_mode_t = __uint16_t; +typedef __uint16_t = ffi.UnsignedShort; +typedef Dart__uint16_t = int; final class GoInterface extends ffi.Struct { external ffi.Pointer t; @@ -5806,210 +3989,1346 @@ typedef DartGoInt64 = int; typedef GoUint8 = ffi.UnsignedChar; typedef DartGoUint8 = int; -const int _VCRT_COMPILER_PREPROCESSOR = 1; +const int __has_safe_buffers = 1; -const int _SAL_VERSION = 20; +const int __DARWIN_ONLY_64_BIT_INO_T = 1; -const int __SAL_H_VERSION = 180000000; +const int __DARWIN_ONLY_UNIX_CONFORMANCE = 1; -const int _USE_DECLSPECS_FOR_SAL = 0; +const int __DARWIN_ONLY_VERS_1050 = 1; -const int _USE_ATTRIBUTES_FOR_SAL = 0; +const int __DARWIN_UNIX03 = 1; -const int _CRT_PACKING = 8; +const int __DARWIN_64_BIT_INO_T = 1; -const int _VCRUNTIME_DISABLED_WARNINGS = 4514; +const int __DARWIN_VERS_1050 = 1; -const int _HAS_EXCEPTIONS = 1; +const int __DARWIN_NON_CANCELABLE = 0; -const int _WCHAR_T_DEFINED = 1; +const String __DARWIN_SUF_EXTSN = '\$DARWIN_EXTSN'; + +const int __DARWIN_C_ANSI = 4096; + +const int __DARWIN_C_FULL = 900000; + +const int __DARWIN_C_LEVEL = 900000; + +const int __STDC_WANT_LIB_EXT1__ = 1; + +const int __DARWIN_NO_LONG_LONG = 0; + +const int _DARWIN_FEATURE_64_BIT_INODE = 1; + +const int _DARWIN_FEATURE_ONLY_64_BIT_INODE = 1; + +const int _DARWIN_FEATURE_ONLY_VERS_1050 = 1; + +const int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = 1; + +const int _DARWIN_FEATURE_UNIX_CONFORMANCE = 3; + +const int __has_ptrcheck = 0; + +const int __DARWIN_NULL = 0; + +const int __PTHREAD_SIZE__ = 8176; + +const int __PTHREAD_ATTR_SIZE__ = 56; + +const int __PTHREAD_MUTEXATTR_SIZE__ = 8; + +const int __PTHREAD_MUTEX_SIZE__ = 56; + +const int __PTHREAD_CONDATTR_SIZE__ = 8; + +const int __PTHREAD_COND_SIZE__ = 40; + +const int __PTHREAD_ONCE_SIZE__ = 8; + +const int __PTHREAD_RWLOCK_SIZE__ = 192; + +const int __PTHREAD_RWLOCKATTR_SIZE__ = 16; + +const int __DARWIN_WCHAR_MAX = 2147483647; + +const int __DARWIN_WCHAR_MIN = -2147483648; + +const int __DARWIN_WEOF = -1; + +const int _FORTIFY_SOURCE = 2; const int NULL = 0; -const int _HAS_CXX17 = 0; +const int USER_ADDR_NULL = 0; -const int _HAS_CXX20 = 0; +const int __API_TO_BE_DEPRECATED = 100000; -const int _HAS_CXX23 = 0; +const int __API_TO_BE_DEPRECATED_MACOS = 100000; -const int _HAS_NODISCARD = 1; +const int __API_TO_BE_DEPRECATED_IOS = 100000; -const int _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE = 1; +const int __API_TO_BE_DEPRECATED_MACCATALYST = 100000; -const int _CRT_BUILD_DESKTOP_APP = 1; +const int __API_TO_BE_DEPRECATED_WATCHOS = 100000; -const int _UCRT_DISABLED_WARNINGS = 4324; +const int __API_TO_BE_DEPRECATED_TVOS = 100000; -const int _ARGMAX = 100; +const int __API_TO_BE_DEPRECATED_DRIVERKIT = 100000; -const int _TRUNCATE = -1; +const int __API_TO_BE_DEPRECATED_VISIONOS = 100000; -const int _CRT_INT_MAX = 2147483647; +const int __MAC_10_0 = 1000; -const int _CRT_SIZE_MAX = -1; +const int __MAC_10_1 = 1010; -const String __FILEW__ = 'C'; +const int __MAC_10_2 = 1020; -const int _CRT_FUNCTIONS_REQUIRED = 1; +const int __MAC_10_3 = 1030; -const int _CRT_HAS_CXX17 = 0; +const int __MAC_10_4 = 1040; -const int _CRT_HAS_C11 = 0; +const int __MAC_10_5 = 1050; -const int _CRT_INTERNAL_NONSTDC_NAMES = 1; +const int __MAC_10_6 = 1060; -const int __STDC_SECURE_LIB__ = 200411; +const int __MAC_10_7 = 1070; -const int __GOT_SECURE_LIB__ = 200411; +const int __MAC_10_8 = 1080; -const int __STDC_WANT_SECURE_LIB__ = 1; +const int __MAC_10_9 = 1090; -const int _SECURECRT_FILL_BUFFER_PATTERN = 254; +const int __MAC_10_10 = 101000; -const int _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES = 0; +const int __MAC_10_10_2 = 101002; -const int _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_COUNT = 0; +const int __MAC_10_10_3 = 101003; -const int _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES = 1; +const int __MAC_10_11 = 101100; -const int _CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES_MEMORY = 0; +const int __MAC_10_11_2 = 101102; -const int _CRT_SECURE_CPP_OVERLOAD_SECURE_NAMES_MEMORY = 0; +const int __MAC_10_11_3 = 101103; -const int _MAX_ITOSTR_BASE16_COUNT = 9; +const int __MAC_10_11_4 = 101104; -const int _MAX_ITOSTR_BASE10_COUNT = 12; +const int __MAC_10_12 = 101200; -const int _MAX_ITOSTR_BASE8_COUNT = 12; +const int __MAC_10_12_1 = 101201; -const int _MAX_ITOSTR_BASE2_COUNT = 33; +const int __MAC_10_12_2 = 101202; -const int _MAX_LTOSTR_BASE16_COUNT = 9; +const int __MAC_10_12_4 = 101204; -const int _MAX_LTOSTR_BASE10_COUNT = 12; +const int __MAC_10_13 = 101300; -const int _MAX_LTOSTR_BASE8_COUNT = 12; +const int __MAC_10_13_1 = 101301; -const int _MAX_LTOSTR_BASE2_COUNT = 33; +const int __MAC_10_13_2 = 101302; -const int _MAX_ULTOSTR_BASE16_COUNT = 9; +const int __MAC_10_13_4 = 101304; -const int _MAX_ULTOSTR_BASE10_COUNT = 11; +const int __MAC_10_14 = 101400; -const int _MAX_ULTOSTR_BASE8_COUNT = 12; +const int __MAC_10_14_1 = 101401; -const int _MAX_ULTOSTR_BASE2_COUNT = 33; +const int __MAC_10_14_4 = 101404; -const int _MAX_I64TOSTR_BASE16_COUNT = 17; +const int __MAC_10_14_5 = 101405; -const int _MAX_I64TOSTR_BASE10_COUNT = 21; +const int __MAC_10_14_6 = 101406; -const int _MAX_I64TOSTR_BASE8_COUNT = 23; +const int __MAC_10_15 = 101500; -const int _MAX_I64TOSTR_BASE2_COUNT = 65; +const int __MAC_10_15_1 = 101501; -const int _MAX_U64TOSTR_BASE16_COUNT = 17; +const int __MAC_10_15_4 = 101504; -const int _MAX_U64TOSTR_BASE10_COUNT = 21; +const int __MAC_10_16 = 101600; -const int _MAX_U64TOSTR_BASE8_COUNT = 23; +const int __MAC_11_0 = 110000; -const int _MAX_U64TOSTR_BASE2_COUNT = 65; +const int __MAC_11_1 = 110100; -const int CHAR_BIT = 8; +const int __MAC_11_3 = 110300; -const int SCHAR_MIN = -128; +const int __MAC_11_4 = 110400; -const int SCHAR_MAX = 127; +const int __MAC_11_5 = 110500; -const int UCHAR_MAX = 255; +const int __MAC_11_6 = 110600; -const int CHAR_MIN = -128; +const int __MAC_12_0 = 120000; -const int CHAR_MAX = 127; +const int __MAC_12_1 = 120100; -const int MB_LEN_MAX = 5; +const int __MAC_12_2 = 120200; -const int SHRT_MIN = -32768; +const int __MAC_12_3 = 120300; -const int SHRT_MAX = 32767; +const int __MAC_12_4 = 120400; -const int USHRT_MAX = 65535; +const int __MAC_12_5 = 120500; -const int INT_MIN = -2147483648; +const int __MAC_12_6 = 120600; -const int INT_MAX = 2147483647; +const int __MAC_12_7 = 120700; -const int UINT_MAX = 4294967295; +const int __MAC_13_0 = 130000; -const int LONG_MIN = -2147483648; +const int __MAC_13_1 = 130100; -const int LONG_MAX = 2147483647; +const int __MAC_13_2 = 130200; -const int ULONG_MAX = 4294967295; +const int __MAC_13_3 = 130300; -const int LLONG_MAX = 9223372036854775807; +const int __MAC_13_4 = 130400; -const int LLONG_MIN = -9223372036854775808; +const int __MAC_13_5 = 130500; -const int ULLONG_MAX = -1; +const int __MAC_13_6 = 130600; -const int _I8_MIN = -128; +const int __MAC_14_0 = 140000; -const int _I8_MAX = 127; +const int __MAC_14_1 = 140100; -const int _UI8_MAX = 255; +const int __MAC_14_2 = 140200; -const int _I16_MIN = -32768; +const int __MAC_14_3 = 140300; -const int _I16_MAX = 32767; +const int __MAC_14_4 = 140400; -const int _UI16_MAX = 65535; +const int __MAC_14_5 = 140500; -const int _I32_MIN = -2147483648; +const int __MAC_15_0 = 150000; -const int _I32_MAX = 2147483647; +const int __MAC_15_1 = 150100; -const int _UI32_MAX = 4294967295; +const int __IPHONE_2_0 = 20000; -const int _I64_MIN = -9223372036854775808; +const int __IPHONE_2_1 = 20100; -const int _I64_MAX = 9223372036854775807; +const int __IPHONE_2_2 = 20200; -const int _UI64_MAX = -1; +const int __IPHONE_3_0 = 30000; + +const int __IPHONE_3_1 = 30100; + +const int __IPHONE_3_2 = 30200; + +const int __IPHONE_4_0 = 40000; + +const int __IPHONE_4_1 = 40100; + +const int __IPHONE_4_2 = 40200; + +const int __IPHONE_4_3 = 40300; + +const int __IPHONE_5_0 = 50000; + +const int __IPHONE_5_1 = 50100; + +const int __IPHONE_6_0 = 60000; + +const int __IPHONE_6_1 = 60100; + +const int __IPHONE_7_0 = 70000; + +const int __IPHONE_7_1 = 70100; + +const int __IPHONE_8_0 = 80000; + +const int __IPHONE_8_1 = 80100; + +const int __IPHONE_8_2 = 80200; + +const int __IPHONE_8_3 = 80300; + +const int __IPHONE_8_4 = 80400; + +const int __IPHONE_9_0 = 90000; + +const int __IPHONE_9_1 = 90100; + +const int __IPHONE_9_2 = 90200; + +const int __IPHONE_9_3 = 90300; + +const int __IPHONE_10_0 = 100000; + +const int __IPHONE_10_1 = 100100; + +const int __IPHONE_10_2 = 100200; + +const int __IPHONE_10_3 = 100300; + +const int __IPHONE_11_0 = 110000; + +const int __IPHONE_11_1 = 110100; + +const int __IPHONE_11_2 = 110200; + +const int __IPHONE_11_3 = 110300; + +const int __IPHONE_11_4 = 110400; + +const int __IPHONE_12_0 = 120000; + +const int __IPHONE_12_1 = 120100; + +const int __IPHONE_12_2 = 120200; + +const int __IPHONE_12_3 = 120300; + +const int __IPHONE_12_4 = 120400; + +const int __IPHONE_13_0 = 130000; + +const int __IPHONE_13_1 = 130100; + +const int __IPHONE_13_2 = 130200; + +const int __IPHONE_13_3 = 130300; + +const int __IPHONE_13_4 = 130400; + +const int __IPHONE_13_5 = 130500; + +const int __IPHONE_13_6 = 130600; + +const int __IPHONE_13_7 = 130700; + +const int __IPHONE_14_0 = 140000; + +const int __IPHONE_14_1 = 140100; + +const int __IPHONE_14_2 = 140200; + +const int __IPHONE_14_3 = 140300; + +const int __IPHONE_14_5 = 140500; + +const int __IPHONE_14_4 = 140400; + +const int __IPHONE_14_6 = 140600; + +const int __IPHONE_14_7 = 140700; + +const int __IPHONE_14_8 = 140800; + +const int __IPHONE_15_0 = 150000; + +const int __IPHONE_15_1 = 150100; + +const int __IPHONE_15_2 = 150200; + +const int __IPHONE_15_3 = 150300; + +const int __IPHONE_15_4 = 150400; + +const int __IPHONE_15_5 = 150500; + +const int __IPHONE_15_6 = 150600; + +const int __IPHONE_15_7 = 150700; + +const int __IPHONE_15_8 = 150800; + +const int __IPHONE_16_0 = 160000; + +const int __IPHONE_16_1 = 160100; + +const int __IPHONE_16_2 = 160200; + +const int __IPHONE_16_3 = 160300; + +const int __IPHONE_16_4 = 160400; + +const int __IPHONE_16_5 = 160500; + +const int __IPHONE_16_6 = 160600; + +const int __IPHONE_16_7 = 160700; + +const int __IPHONE_17_0 = 170000; + +const int __IPHONE_17_1 = 170100; + +const int __IPHONE_17_2 = 170200; + +const int __IPHONE_17_3 = 170300; + +const int __IPHONE_17_4 = 170400; + +const int __IPHONE_17_5 = 170500; + +const int __IPHONE_18_0 = 180000; + +const int __IPHONE_18_1 = 180100; + +const int __WATCHOS_1_0 = 10000; + +const int __WATCHOS_2_0 = 20000; + +const int __WATCHOS_2_1 = 20100; + +const int __WATCHOS_2_2 = 20200; + +const int __WATCHOS_3_0 = 30000; + +const int __WATCHOS_3_1 = 30100; + +const int __WATCHOS_3_1_1 = 30101; + +const int __WATCHOS_3_2 = 30200; + +const int __WATCHOS_4_0 = 40000; + +const int __WATCHOS_4_1 = 40100; + +const int __WATCHOS_4_2 = 40200; + +const int __WATCHOS_4_3 = 40300; + +const int __WATCHOS_5_0 = 50000; + +const int __WATCHOS_5_1 = 50100; + +const int __WATCHOS_5_2 = 50200; + +const int __WATCHOS_5_3 = 50300; + +const int __WATCHOS_6_0 = 60000; + +const int __WATCHOS_6_1 = 60100; + +const int __WATCHOS_6_2 = 60200; + +const int __WATCHOS_7_0 = 70000; + +const int __WATCHOS_7_1 = 70100; + +const int __WATCHOS_7_2 = 70200; + +const int __WATCHOS_7_3 = 70300; + +const int __WATCHOS_7_4 = 70400; + +const int __WATCHOS_7_5 = 70500; + +const int __WATCHOS_7_6 = 70600; + +const int __WATCHOS_8_0 = 80000; + +const int __WATCHOS_8_1 = 80100; + +const int __WATCHOS_8_3 = 80300; + +const int __WATCHOS_8_4 = 80400; + +const int __WATCHOS_8_5 = 80500; + +const int __WATCHOS_8_6 = 80600; + +const int __WATCHOS_8_7 = 80700; + +const int __WATCHOS_8_8 = 80800; + +const int __WATCHOS_9_0 = 90000; + +const int __WATCHOS_9_1 = 90100; + +const int __WATCHOS_9_2 = 90200; + +const int __WATCHOS_9_3 = 90300; + +const int __WATCHOS_9_4 = 90400; + +const int __WATCHOS_9_5 = 90500; + +const int __WATCHOS_9_6 = 90600; + +const int __WATCHOS_10_0 = 100000; + +const int __WATCHOS_10_1 = 100100; + +const int __WATCHOS_10_2 = 100200; + +const int __WATCHOS_10_3 = 100300; + +const int __WATCHOS_10_4 = 100400; + +const int __WATCHOS_10_5 = 100500; + +const int __WATCHOS_11_0 = 110000; + +const int __WATCHOS_11_1 = 110100; + +const int __TVOS_9_0 = 90000; + +const int __TVOS_9_1 = 90100; + +const int __TVOS_9_2 = 90200; + +const int __TVOS_10_0 = 100000; + +const int __TVOS_10_0_1 = 100001; + +const int __TVOS_10_1 = 100100; + +const int __TVOS_10_2 = 100200; + +const int __TVOS_11_0 = 110000; + +const int __TVOS_11_1 = 110100; + +const int __TVOS_11_2 = 110200; + +const int __TVOS_11_3 = 110300; + +const int __TVOS_11_4 = 110400; + +const int __TVOS_12_0 = 120000; + +const int __TVOS_12_1 = 120100; + +const int __TVOS_12_2 = 120200; + +const int __TVOS_12_3 = 120300; + +const int __TVOS_12_4 = 120400; + +const int __TVOS_13_0 = 130000; + +const int __TVOS_13_2 = 130200; + +const int __TVOS_13_3 = 130300; + +const int __TVOS_13_4 = 130400; + +const int __TVOS_14_0 = 140000; + +const int __TVOS_14_1 = 140100; + +const int __TVOS_14_2 = 140200; + +const int __TVOS_14_3 = 140300; + +const int __TVOS_14_5 = 140500; + +const int __TVOS_14_6 = 140600; + +const int __TVOS_14_7 = 140700; + +const int __TVOS_15_0 = 150000; + +const int __TVOS_15_1 = 150100; + +const int __TVOS_15_2 = 150200; + +const int __TVOS_15_3 = 150300; + +const int __TVOS_15_4 = 150400; + +const int __TVOS_15_5 = 150500; + +const int __TVOS_15_6 = 150600; + +const int __TVOS_16_0 = 160000; + +const int __TVOS_16_1 = 160100; + +const int __TVOS_16_2 = 160200; + +const int __TVOS_16_3 = 160300; + +const int __TVOS_16_4 = 160400; + +const int __TVOS_16_5 = 160500; + +const int __TVOS_16_6 = 160600; + +const int __TVOS_17_0 = 170000; + +const int __TVOS_17_1 = 170100; + +const int __TVOS_17_2 = 170200; + +const int __TVOS_17_3 = 170300; + +const int __TVOS_17_4 = 170400; + +const int __TVOS_17_5 = 170500; + +const int __TVOS_18_0 = 180000; + +const int __TVOS_18_1 = 180100; + +const int __BRIDGEOS_2_0 = 20000; + +const int __BRIDGEOS_3_0 = 30000; + +const int __BRIDGEOS_3_1 = 30100; + +const int __BRIDGEOS_3_4 = 30400; + +const int __BRIDGEOS_4_0 = 40000; + +const int __BRIDGEOS_4_1 = 40100; + +const int __BRIDGEOS_5_0 = 50000; + +const int __BRIDGEOS_5_1 = 50100; + +const int __BRIDGEOS_5_3 = 50300; + +const int __BRIDGEOS_6_0 = 60000; + +const int __BRIDGEOS_6_2 = 60200; + +const int __BRIDGEOS_6_4 = 60400; + +const int __BRIDGEOS_6_5 = 60500; + +const int __BRIDGEOS_6_6 = 60600; + +const int __BRIDGEOS_7_0 = 70000; + +const int __BRIDGEOS_7_1 = 70100; + +const int __BRIDGEOS_7_2 = 70200; + +const int __BRIDGEOS_7_3 = 70300; + +const int __BRIDGEOS_7_4 = 70400; + +const int __BRIDGEOS_7_6 = 70600; + +const int __BRIDGEOS_8_0 = 80000; + +const int __BRIDGEOS_8_1 = 80100; + +const int __BRIDGEOS_8_2 = 80200; + +const int __BRIDGEOS_8_3 = 80300; + +const int __BRIDGEOS_8_4 = 80400; + +const int __BRIDGEOS_8_5 = 80500; + +const int __BRIDGEOS_9_0 = 90000; + +const int __BRIDGEOS_9_1 = 90100; + +const int __DRIVERKIT_19_0 = 190000; + +const int __DRIVERKIT_20_0 = 200000; + +const int __DRIVERKIT_21_0 = 210000; + +const int __DRIVERKIT_22_0 = 220000; + +const int __DRIVERKIT_22_4 = 220400; + +const int __DRIVERKIT_22_5 = 220500; + +const int __DRIVERKIT_22_6 = 220600; + +const int __DRIVERKIT_23_0 = 230000; + +const int __DRIVERKIT_23_1 = 230100; + +const int __DRIVERKIT_23_2 = 230200; + +const int __DRIVERKIT_23_3 = 230300; + +const int __DRIVERKIT_23_4 = 230400; + +const int __DRIVERKIT_23_5 = 230500; + +const int __DRIVERKIT_24_0 = 240000; + +const int __DRIVERKIT_24_1 = 240100; + +const int __VISIONOS_1_0 = 10000; + +const int __VISIONOS_1_1 = 10100; + +const int __VISIONOS_1_2 = 10200; + +const int __VISIONOS_2_0 = 20000; + +const int __VISIONOS_2_1 = 20100; + +const int MAC_OS_X_VERSION_10_0 = 1000; + +const int MAC_OS_X_VERSION_10_1 = 1010; + +const int MAC_OS_X_VERSION_10_2 = 1020; + +const int MAC_OS_X_VERSION_10_3 = 1030; + +const int MAC_OS_X_VERSION_10_4 = 1040; + +const int MAC_OS_X_VERSION_10_5 = 1050; + +const int MAC_OS_X_VERSION_10_6 = 1060; + +const int MAC_OS_X_VERSION_10_7 = 1070; + +const int MAC_OS_X_VERSION_10_8 = 1080; + +const int MAC_OS_X_VERSION_10_9 = 1090; + +const int MAC_OS_X_VERSION_10_10 = 101000; + +const int MAC_OS_X_VERSION_10_10_2 = 101002; + +const int MAC_OS_X_VERSION_10_10_3 = 101003; + +const int MAC_OS_X_VERSION_10_11 = 101100; + +const int MAC_OS_X_VERSION_10_11_2 = 101102; + +const int MAC_OS_X_VERSION_10_11_3 = 101103; + +const int MAC_OS_X_VERSION_10_11_4 = 101104; + +const int MAC_OS_X_VERSION_10_12 = 101200; + +const int MAC_OS_X_VERSION_10_12_1 = 101201; + +const int MAC_OS_X_VERSION_10_12_2 = 101202; + +const int MAC_OS_X_VERSION_10_12_4 = 101204; + +const int MAC_OS_X_VERSION_10_13 = 101300; + +const int MAC_OS_X_VERSION_10_13_1 = 101301; + +const int MAC_OS_X_VERSION_10_13_2 = 101302; + +const int MAC_OS_X_VERSION_10_13_4 = 101304; + +const int MAC_OS_X_VERSION_10_14 = 101400; + +const int MAC_OS_X_VERSION_10_14_1 = 101401; + +const int MAC_OS_X_VERSION_10_14_4 = 101404; + +const int MAC_OS_X_VERSION_10_14_5 = 101405; + +const int MAC_OS_X_VERSION_10_14_6 = 101406; + +const int MAC_OS_X_VERSION_10_15 = 101500; + +const int MAC_OS_X_VERSION_10_15_1 = 101501; + +const int MAC_OS_X_VERSION_10_15_4 = 101504; + +const int MAC_OS_X_VERSION_10_16 = 101600; + +const int MAC_OS_VERSION_11_0 = 110000; + +const int MAC_OS_VERSION_11_1 = 110100; + +const int MAC_OS_VERSION_11_3 = 110300; + +const int MAC_OS_VERSION_11_4 = 110400; + +const int MAC_OS_VERSION_11_5 = 110500; + +const int MAC_OS_VERSION_11_6 = 110600; + +const int MAC_OS_VERSION_12_0 = 120000; + +const int MAC_OS_VERSION_12_1 = 120100; + +const int MAC_OS_VERSION_12_2 = 120200; + +const int MAC_OS_VERSION_12_3 = 120300; + +const int MAC_OS_VERSION_12_4 = 120400; + +const int MAC_OS_VERSION_12_5 = 120500; + +const int MAC_OS_VERSION_12_6 = 120600; + +const int MAC_OS_VERSION_12_7 = 120700; + +const int MAC_OS_VERSION_13_0 = 130000; + +const int MAC_OS_VERSION_13_1 = 130100; + +const int MAC_OS_VERSION_13_2 = 130200; + +const int MAC_OS_VERSION_13_3 = 130300; + +const int MAC_OS_VERSION_13_4 = 130400; + +const int MAC_OS_VERSION_13_5 = 130500; + +const int MAC_OS_VERSION_13_6 = 130600; + +const int MAC_OS_VERSION_14_0 = 140000; + +const int MAC_OS_VERSION_14_1 = 140100; + +const int MAC_OS_VERSION_14_2 = 140200; + +const int MAC_OS_VERSION_14_3 = 140300; + +const int MAC_OS_VERSION_14_4 = 140400; + +const int MAC_OS_VERSION_14_5 = 140500; + +const int MAC_OS_VERSION_15_0 = 150000; + +const int MAC_OS_VERSION_15_1 = 150100; + +const int __MAC_OS_X_VERSION_MIN_REQUIRED = 150000; + +const int __MAC_OS_X_VERSION_MAX_ALLOWED = 150100; + +const int __ENABLE_LEGACY_MAC_AVAILABILITY = 1; + +const int __DARWIN_NSIG = 32; + +const int NSIG = 32; + +const int _ARM_SIGNAL_ = 1; + +const int SIGHUP = 1; + +const int SIGINT = 2; + +const int SIGQUIT = 3; + +const int SIGILL = 4; + +const int SIGTRAP = 5; + +const int SIGABRT = 6; + +const int SIGIOT = 6; + +const int SIGEMT = 7; + +const int SIGFPE = 8; + +const int SIGKILL = 9; + +const int SIGBUS = 10; + +const int SIGSEGV = 11; + +const int SIGSYS = 12; + +const int SIGPIPE = 13; + +const int SIGALRM = 14; + +const int SIGTERM = 15; + +const int SIGURG = 16; + +const int SIGSTOP = 17; + +const int SIGTSTP = 18; + +const int SIGCONT = 19; + +const int SIGCHLD = 20; + +const int SIGTTIN = 21; + +const int SIGTTOU = 22; + +const int SIGIO = 23; + +const int SIGXCPU = 24; + +const int SIGXFSZ = 25; + +const int SIGVTALRM = 26; + +const int SIGPROF = 27; + +const int SIGWINCH = 28; + +const int SIGINFO = 29; + +const int SIGUSR1 = 30; + +const int SIGUSR2 = 31; + +const int __DARWIN_OPAQUE_ARM_THREAD_STATE64 = 0; + +const int SIGEV_NONE = 0; + +const int SIGEV_SIGNAL = 1; + +const int SIGEV_THREAD = 3; + +const int ILL_NOOP = 0; + +const int ILL_ILLOPC = 1; + +const int ILL_ILLTRP = 2; + +const int ILL_PRVOPC = 3; + +const int ILL_ILLOPN = 4; + +const int ILL_ILLADR = 5; + +const int ILL_PRVREG = 6; + +const int ILL_COPROC = 7; + +const int ILL_BADSTK = 8; + +const int FPE_NOOP = 0; + +const int FPE_FLTDIV = 1; + +const int FPE_FLTOVF = 2; + +const int FPE_FLTUND = 3; + +const int FPE_FLTRES = 4; + +const int FPE_FLTINV = 5; + +const int FPE_FLTSUB = 6; + +const int FPE_INTDIV = 7; + +const int FPE_INTOVF = 8; + +const int SEGV_NOOP = 0; + +const int SEGV_MAPERR = 1; + +const int SEGV_ACCERR = 2; + +const int BUS_NOOP = 0; + +const int BUS_ADRALN = 1; + +const int BUS_ADRERR = 2; + +const int BUS_OBJERR = 3; + +const int TRAP_BRKPT = 1; + +const int TRAP_TRACE = 2; + +const int CLD_NOOP = 0; + +const int CLD_EXITED = 1; + +const int CLD_KILLED = 2; + +const int CLD_DUMPED = 3; + +const int CLD_TRAPPED = 4; + +const int CLD_STOPPED = 5; + +const int CLD_CONTINUED = 6; + +const int POLL_IN = 1; + +const int POLL_OUT = 2; + +const int POLL_MSG = 3; + +const int POLL_ERR = 4; + +const int POLL_PRI = 5; + +const int POLL_HUP = 6; + +const int SA_ONSTACK = 1; + +const int SA_RESTART = 2; + +const int SA_RESETHAND = 4; + +const int SA_NOCLDSTOP = 8; + +const int SA_NODEFER = 16; + +const int SA_NOCLDWAIT = 32; + +const int SA_SIGINFO = 64; + +const int SA_USERTRAMP = 256; + +const int SA_64REGSET = 512; + +const int SA_USERSPACE_MASK = 127; + +const int SIG_BLOCK = 1; + +const int SIG_UNBLOCK = 2; + +const int SIG_SETMASK = 3; + +const int SI_USER = 65537; + +const int SI_QUEUE = 65538; + +const int SI_TIMER = 65539; + +const int SI_ASYNCIO = 65540; + +const int SI_MESGQ = 65541; + +const int SS_ONSTACK = 1; + +const int SS_DISABLE = 4; + +const int MINSIGSTKSZ = 32768; + +const int SIGSTKSZ = 131072; + +const int SV_ONSTACK = 1; + +const int SV_INTERRUPT = 2; + +const int SV_RESETHAND = 4; + +const int SV_NODEFER = 16; + +const int SV_NOCLDSTOP = 8; + +const int SV_SIGINFO = 64; + +const int __WORDSIZE = 64; + +const int INT8_MAX = 127; + +const int INT16_MAX = 32767; + +const int INT32_MAX = 2147483647; + +const int INT64_MAX = 9223372036854775807; + +const int INT8_MIN = -128; + +const int INT16_MIN = -32768; + +const int INT32_MIN = -2147483648; + +const int INT64_MIN = -9223372036854775808; + +const int UINT8_MAX = 255; + +const int UINT16_MAX = 65535; + +const int UINT32_MAX = 4294967295; + +const int UINT64_MAX = -1; + +const int INT_LEAST8_MIN = -128; + +const int INT_LEAST16_MIN = -32768; + +const int INT_LEAST32_MIN = -2147483648; + +const int INT_LEAST64_MIN = -9223372036854775808; + +const int INT_LEAST8_MAX = 127; + +const int INT_LEAST16_MAX = 32767; + +const int INT_LEAST32_MAX = 2147483647; + +const int INT_LEAST64_MAX = 9223372036854775807; + +const int UINT_LEAST8_MAX = 255; + +const int UINT_LEAST16_MAX = 65535; + +const int UINT_LEAST32_MAX = 4294967295; + +const int UINT_LEAST64_MAX = -1; + +const int INT_FAST8_MIN = -128; + +const int INT_FAST16_MIN = -32768; + +const int INT_FAST32_MIN = -2147483648; + +const int INT_FAST64_MIN = -9223372036854775808; + +const int INT_FAST8_MAX = 127; + +const int INT_FAST16_MAX = 32767; + +const int INT_FAST32_MAX = 2147483647; + +const int INT_FAST64_MAX = 9223372036854775807; + +const int UINT_FAST8_MAX = 255; + +const int UINT_FAST16_MAX = 65535; + +const int UINT_FAST32_MAX = 4294967295; + +const int UINT_FAST64_MAX = -1; + +const int INTPTR_MAX = 9223372036854775807; + +const int INTPTR_MIN = -9223372036854775808; + +const int UINTPTR_MAX = -1; + +const int INTMAX_MAX = 9223372036854775807; + +const int UINTMAX_MAX = -1; + +const int INTMAX_MIN = -9223372036854775808; + +const int PTRDIFF_MIN = -9223372036854775808; + +const int PTRDIFF_MAX = 9223372036854775807; const int SIZE_MAX = -1; const int RSIZE_MAX = 9223372036854775807; -const int EXIT_SUCCESS = 0; +const int WCHAR_MAX = 2147483647; + +const int WCHAR_MIN = -2147483648; + +const int WINT_MIN = -2147483648; + +const int WINT_MAX = 2147483647; + +const int SIG_ATOMIC_MIN = -2147483648; + +const int SIG_ATOMIC_MAX = 2147483647; + +const int PRIO_PROCESS = 0; + +const int PRIO_PGRP = 1; + +const int PRIO_USER = 2; + +const int PRIO_DARWIN_THREAD = 3; + +const int PRIO_DARWIN_PROCESS = 4; + +const int PRIO_MIN = -20; + +const int PRIO_MAX = 20; + +const int PRIO_DARWIN_BG = 4096; + +const int PRIO_DARWIN_NONUI = 4097; + +const int RUSAGE_SELF = 0; + +const int RUSAGE_CHILDREN = -1; + +const int RUSAGE_INFO_V0 = 0; + +const int RUSAGE_INFO_V1 = 1; + +const int RUSAGE_INFO_V2 = 2; + +const int RUSAGE_INFO_V3 = 3; + +const int RUSAGE_INFO_V4 = 4; + +const int RUSAGE_INFO_V5 = 5; + +const int RUSAGE_INFO_V6 = 6; + +const int RUSAGE_INFO_CURRENT = 6; + +const int RU_PROC_RUNS_RESLIDE = 1; + +const int RLIM_INFINITY = 9223372036854775807; + +const int RLIM_SAVED_MAX = 9223372036854775807; + +const int RLIM_SAVED_CUR = 9223372036854775807; + +const int RLIMIT_CPU = 0; + +const int RLIMIT_FSIZE = 1; + +const int RLIMIT_DATA = 2; + +const int RLIMIT_STACK = 3; + +const int RLIMIT_CORE = 4; + +const int RLIMIT_AS = 5; + +const int RLIMIT_RSS = 5; + +const int RLIMIT_MEMLOCK = 6; + +const int RLIMIT_NPROC = 7; + +const int RLIMIT_NOFILE = 8; + +const int RLIM_NLIMITS = 9; + +const int _RLIMIT_POSIX_FLAG = 4096; + +const int RLIMIT_WAKEUPS_MONITOR = 1; + +const int RLIMIT_CPU_USAGE_MONITOR = 2; + +const int RLIMIT_THREAD_CPULIMITS = 3; + +const int RLIMIT_FOOTPRINT_INTERVAL = 4; + +const int WAKEMON_ENABLE = 1; + +const int WAKEMON_DISABLE = 2; + +const int WAKEMON_GET_PARAMS = 4; + +const int WAKEMON_SET_DEFAULTS = 8; + +const int WAKEMON_MAKE_FATAL = 16; + +const int CPUMON_MAKE_FATAL = 4096; + +const int FOOTPRINT_INTERVAL_RESET = 1; + +const int IOPOL_TYPE_DISK = 0; + +const int IOPOL_TYPE_VFS_ATIME_UPDATES = 2; + +const int IOPOL_TYPE_VFS_MATERIALIZE_DATALESS_FILES = 3; + +const int IOPOL_TYPE_VFS_STATFS_NO_DATA_VOLUME = 4; + +const int IOPOL_TYPE_VFS_TRIGGER_RESOLVE = 5; + +const int IOPOL_TYPE_VFS_IGNORE_CONTENT_PROTECTION = 6; + +const int IOPOL_TYPE_VFS_IGNORE_PERMISSIONS = 7; + +const int IOPOL_TYPE_VFS_SKIP_MTIME_UPDATE = 8; + +const int IOPOL_TYPE_VFS_ALLOW_LOW_SPACE_WRITES = 9; + +const int IOPOL_TYPE_VFS_DISALLOW_RW_FOR_O_EVTONLY = 10; + +const int IOPOL_SCOPE_PROCESS = 0; + +const int IOPOL_SCOPE_THREAD = 1; + +const int IOPOL_SCOPE_DARWIN_BG = 2; + +const int IOPOL_DEFAULT = 0; + +const int IOPOL_IMPORTANT = 1; + +const int IOPOL_PASSIVE = 2; + +const int IOPOL_THROTTLE = 3; + +const int IOPOL_UTILITY = 4; + +const int IOPOL_STANDARD = 5; + +const int IOPOL_APPLICATION = 5; + +const int IOPOL_NORMAL = 1; + +const int IOPOL_ATIME_UPDATES_DEFAULT = 0; + +const int IOPOL_ATIME_UPDATES_OFF = 1; + +const int IOPOL_MATERIALIZE_DATALESS_FILES_DEFAULT = 0; + +const int IOPOL_MATERIALIZE_DATALESS_FILES_OFF = 1; + +const int IOPOL_MATERIALIZE_DATALESS_FILES_ON = 2; + +const int IOPOL_VFS_STATFS_NO_DATA_VOLUME_DEFAULT = 0; + +const int IOPOL_VFS_STATFS_FORCE_NO_DATA_VOLUME = 1; + +const int IOPOL_VFS_TRIGGER_RESOLVE_DEFAULT = 0; + +const int IOPOL_VFS_TRIGGER_RESOLVE_OFF = 1; + +const int IOPOL_VFS_CONTENT_PROTECTION_DEFAULT = 0; + +const int IOPOL_VFS_CONTENT_PROTECTION_IGNORE = 1; + +const int IOPOL_VFS_IGNORE_PERMISSIONS_OFF = 0; + +const int IOPOL_VFS_IGNORE_PERMISSIONS_ON = 1; + +const int IOPOL_VFS_SKIP_MTIME_UPDATE_OFF = 0; + +const int IOPOL_VFS_SKIP_MTIME_UPDATE_ON = 1; + +const int IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_OFF = 0; + +const int IOPOL_VFS_ALLOW_LOW_SPACE_WRITES_ON = 1; + +const int IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_DEFAULT = 0; + +const int IOPOL_VFS_DISALLOW_RW_FOR_O_EVTONLY_ON = 1; + +const int IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_DEFAULT = 0; + +const int IOPOL_VFS_NOCACHE_WRITE_FS_BLKSIZE_ON = 1; + +const int WNOHANG = 1; + +const int WUNTRACED = 2; + +const int WCOREFLAG = 128; + +const int _WSTOPPED = 127; + +const int WEXITED = 4; + +const int WSTOPPED = 8; + +const int WCONTINUED = 16; + +const int WNOWAIT = 32; + +const int WAIT_ANY = -1; + +const int WAIT_MYPGRP = 0; + +const int _QUAD_HIGHWORD = 1; + +const int _QUAD_LOWWORD = 0; + +const int __DARWIN_LITTLE_ENDIAN = 1234; + +const int __DARWIN_BIG_ENDIAN = 4321; + +const int __DARWIN_PDP_ENDIAN = 3412; + +const int LITTLE_ENDIAN = 1234; + +const int BIG_ENDIAN = 4321; + +const int PDP_ENDIAN = 3412; + +const int __DARWIN_BYTE_ORDER = 1234; + +const int BYTE_ORDER = 1234; const int EXIT_FAILURE = 1; -const int _WRITE_ABORT_MSG = 1; +const int EXIT_SUCCESS = 0; -const int _CALL_REPORTFAULT = 2; - -const int _OUT_TO_DEFAULT = 0; - -const int _OUT_TO_STDERR = 1; - -const int _OUT_TO_MSGBOX = 2; - -const int _REPORT_ERRMODE = 3; - -const int RAND_MAX = 32767; - -const int _CVTBUFSIZE = 349; - -const int _MAX_PATH = 260; - -const int _MAX_DRIVE = 3; - -const int _MAX_DIR = 256; - -const int _MAX_FNAME = 256; - -const int _MAX_EXT = 256; - -const int _MAX_ENV = 32767; +const int RAND_MAX = 2147483647; diff --git a/lib/common/color.dart b/lib/common/color.dart index bdad4a4..86002bf 100644 --- a/lib/common/color.dart +++ b/lib/common/color.dart @@ -29,7 +29,6 @@ extension ColorSchemeExtension on ColorScheme { ColorScheme toPrueBlack(bool isPrueBlack) => isPrueBlack ? copyWith( surface: Colors.black, - background: Colors.black, surfaceContainer: surfaceContainer.darken(0.05), ) : this; diff --git a/lib/common/link.dart b/lib/common/link.dart index 8abe7c1..e4d1de2 100644 --- a/lib/common/link.dart +++ b/lib/common/link.dart @@ -1,7 +1,7 @@ import 'dart:async'; import 'package:app_links/app_links.dart'; -import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; typedef InstallConfigCallBack = void Function(String url); @@ -17,7 +17,7 @@ class LinkManager { initAppLinksListen(installConfigCallBack) async { debugPrint("initAppLinksListen"); destroy(); - subscription = _appLinks.allUriLinkStream.listen( + subscription = _appLinks.uriLinkStream.listen( (uri) { debugPrint('onAppLink: $uri'); if (uri.host == 'install-config') { @@ -31,8 +31,7 @@ class LinkManager { ); } - - destroy(){ + destroy() { if (subscription != null) { subscription?.cancel(); subscription = null; diff --git a/lib/common/window.dart b/lib/common/window.dart index a031e05..30808b0 100755 --- a/lib/common/window.dart +++ b/lib/common/window.dart @@ -1,5 +1,4 @@ import 'dart:io'; -import 'dart:math'; import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/models/config.dart'; @@ -7,9 +6,6 @@ import 'package:flutter/material.dart'; import 'package:window_manager/window_manager.dart'; import 'package:windows_single_instance/windows_single_instance.dart'; -import 'protocol.dart'; -import 'system.dart'; - class Window { init(WindowProps props, int version) async { if (Platform.isWindows) { diff --git a/lib/controller.dart b/lib/controller.dart index 0c64488..d1bff04 100644 --- a/lib/controller.dart +++ b/lib/controller.dart @@ -9,15 +9,13 @@ import 'package:fl_clash/common/archive.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/state.dart'; import 'package:flutter/material.dart'; -import 'package:intl/intl.dart'; import 'package:path/path.dart'; import 'package:provider/provider.dart'; -import 'package:tray_manager/tray_manager.dart'; import 'package:url_launcher/url_launcher.dart'; import 'clash/core.dart'; -import 'models/models.dart'; import 'common/common.dart'; +import 'models/models.dart'; class AppController { final BuildContext context; @@ -116,6 +114,10 @@ class AppController { } } + updateProviders() { + globalState.updateProviders(appState); + } + Future updateProfile(Profile profile) async { final newProfile = await profile.update(); config.setProfile( @@ -530,8 +532,8 @@ class AppController { } updateSystemProxy() { - config.desktopProps = config.desktopProps.copyWith( - systemProxy: !config.desktopProps.systemProxy, + config.networkProps = config.networkProps.copyWith( + systemProxy: !config.networkProps.systemProxy, ); } @@ -599,121 +601,14 @@ class AppController { }); } - Future _updateSystemTray({ - required Brightness? brightness, - bool force = false, - }) async { - if (Platform.isLinux || force) { - await trayManager.destroy(); - } - await trayManager.setIcon( - other.getTrayIconPath( - brightness: brightness ?? - WidgetsBinding.instance.platformDispatcher.platformBrightness, - ), - isTemplate: true, - ); - if (!Platform.isLinux) { - await trayManager.setToolTip( - appName, - ); - } - } - updateTray([bool focus = false]) async { - if (!Platform.isLinux) { - await _updateSystemTray( - brightness: appState.brightness, - force: focus, - ); - } - List menuItems = []; - final showMenuItem = MenuItem( - label: appLocalizations.show, - onClick: (_) { - window?.show(); - }, + globalState.updateTray( + appState: appState, + appFlowingState: appFlowingState, + config: config, + clashConfig: clashConfig, + focus: focus, ); - menuItems.add(showMenuItem); - final startMenuItem = MenuItem.checkbox( - label: appFlowingState.isStart - ? appLocalizations.stop - : appLocalizations.start, - onClick: (_) async { - globalState.appController.updateStart(); - }, - checked: false, - ); - menuItems.add(startMenuItem); - menuItems.add(MenuItem.separator()); - for (final mode in Mode.values) { - menuItems.add( - MenuItem.checkbox( - label: Intl.message(mode.name), - onClick: (_) { - globalState.appController.clashConfig.mode = mode; - }, - checked: mode == clashConfig.mode, - ), - ); - } - menuItems.add(MenuItem.separator()); - if (appFlowingState.isStart) { - menuItems.add( - MenuItem.checkbox( - label: appLocalizations.tun, - onClick: (_) { - globalState.appController.updateTun(); - }, - checked: clashConfig.tun.enable, - ), - ); - menuItems.add( - MenuItem.checkbox( - label: appLocalizations.systemProxy, - onClick: (_) { - globalState.appController.updateSystemProxy(); - }, - checked: config.desktopProps.systemProxy, - ), - ); - menuItems.add(MenuItem.separator()); - } - final autoStartMenuItem = MenuItem.checkbox( - label: appLocalizations.autoLaunch, - onClick: (_) async { - globalState.appController.updateAutoLaunch(); - }, - checked: config.appSetting.autoLaunch, - ); - menuItems.add(autoStartMenuItem); - - if(Platform.isWindows){ - final adminAutoStartMenuItem = MenuItem.checkbox( - label: appLocalizations.adminAutoLaunch, - onClick: (_) async { - globalState.appController.updateAdminAutoLaunch(); - }, - checked: config.appSetting.adminAutoLaunch, - ); - menuItems.add(adminAutoStartMenuItem); - } - menuItems.add(MenuItem.separator()); - final exitMenuItem = MenuItem( - label: appLocalizations.exit, - onClick: (_) async { - await globalState.appController.handleExit(); - }, - ); - menuItems.add(exitMenuItem); - final menu = Menu(items: menuItems); - await trayManager.setContextMenu(menu); - if (Platform.isLinux) { - await _updateSystemTray( - brightness: appState.brightness, - force: focus, - ); - } } recoveryData( diff --git a/lib/enum/enum.dart b/lib/enum/enum.dart index 7a72811..6ef7dfe 100644 --- a/lib/enum/enum.dart +++ b/lib/enum/enum.dart @@ -173,3 +173,8 @@ enum FontFamily { const FontFamily([this.value]); } + +enum RouteMode { + bypassPrivate, + config, +} diff --git a/lib/fragments/config/config.dart b/lib/fragments/config/config.dart index f06a949..10659d2 100644 --- a/lib/fragments/config/config.dart +++ b/lib/fragments/config/config.dart @@ -24,6 +24,7 @@ class _ConfigFragmentState extends State { title: appLocalizations.network, isScaffold: true, isBlur: false, + extendPageWidth: 360, widget: const NetworkListView(), ), ), diff --git a/lib/fragments/config/network.dart b/lib/fragments/config/network.dart index 70948d5..5ed362a 100644 --- a/lib/fragments/config/network.dart +++ b/lib/fragments/config/network.dart @@ -6,10 +6,11 @@ import 'package:fl_clash/models/models.dart'; import 'package:fl_clash/state.dart'; import 'package:fl_clash/widgets/widgets.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; -class VPNSwitch extends StatelessWidget { - const VPNSwitch({super.key}); +class VPNItem extends StatelessWidget { + const VPNItem({super.key}); @override Widget build(BuildContext context) { @@ -39,8 +40,8 @@ class TUNItem extends StatelessWidget { @override Widget build(BuildContext context) { - return Selector( - selector: (_, config) => config.vpnProps.enable, + return Selector( + selector: (_, clashConfig) => clashConfig.tun.enable, builder: (_, enable, __) { return ListItem.switchItem( title: Text(appLocalizations.tun), @@ -60,8 +61,8 @@ class TUNItem extends StatelessWidget { } } -class AllowBypassSwitch extends StatelessWidget { - const AllowBypassSwitch({super.key}); +class AllowBypassItem extends StatelessWidget { + const AllowBypassItem({super.key}); @override Widget build(BuildContext context) { @@ -87,8 +88,8 @@ class AllowBypassSwitch extends StatelessWidget { } } -class SystemProxySwitch extends StatelessWidget { - const SystemProxySwitch({super.key}); +class VpnSystemProxyItem extends StatelessWidget { + const VpnSystemProxyItem({super.key}); @override Widget build(BuildContext context) { @@ -114,8 +115,35 @@ class SystemProxySwitch extends StatelessWidget { } } -class Ipv6Switch extends StatelessWidget { - const Ipv6Switch({super.key}); +class SystemProxyItem extends StatelessWidget { + const SystemProxyItem({super.key}); + + @override + Widget build(BuildContext context) { + return Selector( + selector: (_, config) => config.networkProps.systemProxy, + builder: (_, systemProxy, __) { + return ListItem.switchItem( + title: Text(appLocalizations.systemProxy), + subtitle: Text(appLocalizations.systemProxyDesc), + delegate: SwitchDelegate( + value: systemProxy, + onChanged: (bool value) async { + final config = globalState.appController.config; + final networkProps = config.networkProps; + config.networkProps = networkProps.copyWith( + systemProxy: value, + ); + }, + ), + ); + }, + ); + } +} + +class Ipv6Item extends StatelessWidget { + const Ipv6Item({super.key}); @override Widget build(BuildContext context) { @@ -176,6 +204,36 @@ class TunStackItem extends StatelessWidget { class BypassDomainItem extends StatelessWidget { const BypassDomainItem({super.key}); + _initActions(BuildContext context) { + WidgetsBinding.instance.addPostFrameCallback((timeStamp) { + final commonScaffoldState = + context.findAncestorStateOfType(); + commonScaffoldState?.actions = [ + IconButton( + onPressed: () { + globalState.showMessage( + title: appLocalizations.reset, + message: TextSpan( + text: appLocalizations.resetTip, + ), + onTab: () { + final config = globalState.appController.config; + config.networkProps = config.networkProps.copyWith( + bypassDomain: defaultBypassDomain, + ); + Navigator.of(context).pop(); + }, + ); + }, + tooltip: appLocalizations.reset, + icon: const Icon( + Icons.replay, + ), + ) + ]; + }); + } + @override Widget build(BuildContext context) { return ListItem.open( @@ -183,19 +241,20 @@ class BypassDomainItem extends StatelessWidget { subtitle: Text(appLocalizations.bypassDomainDesc), delegate: OpenDelegate( isBlur: false, + isScaffold: true, title: appLocalizations.bypassDomain, widget: Selector>( - selector: (_, config) => config.vpnProps.bypassDomain, - shouldRebuild: (prev, next) => - !stringListEquality.equals(prev, next), - builder: (_, bypassDomain, __) { + selector: (_, config) => config.networkProps.bypassDomain, + shouldRebuild: (prev, next) => !stringListEquality.equals(prev, next), + builder: (context, bypassDomain, __) { + _initActions(context); return ListPage( title: appLocalizations.bypassDomain, items: bypassDomain, titleBuilder: (item) => Text(item), - onChange: (items){ + onChange: (items) { final config = globalState.appController.config; - config.vpnProps = config.vpnProps.copyWith( + config.networkProps = config.networkProps.copyWith( bypassDomain: List.from(items), ); }, @@ -208,22 +267,108 @@ class BypassDomainItem extends StatelessWidget { } } +class RouteModeItem extends StatelessWidget { + const RouteModeItem({super.key}); + + @override + Widget build(BuildContext context) { + return Selector( + selector: (_, clashConfig) => clashConfig.routeMode, + builder: (_, value, __) { + return ListItem.options( + title: Text(appLocalizations.routeMode), + subtitle: Text(Intl.message("routeMode_${value.name}")), + delegate: OptionsDelegate( + title: appLocalizations.routeMode, + options: RouteMode.values, + onChanged: (RouteMode? value) { + if (value == null) { + return; + } + final appController = globalState.appController; + appController.clashConfig.routeMode = value; + }, + textBuilder: (routeMode) => Intl.message( + "routeMode_${routeMode.name}", + ), + value: value, + ), + ); + }, + ); + } +} + +class RouteAddressItem extends StatelessWidget { + const RouteAddressItem({super.key}); + + @override + Widget build(BuildContext context) { + return Selector( + selector: (_, clashConfig) => clashConfig.routeMode == RouteMode.config, + builder: (_, value, child) { + if (value) { + return child!; + } + return Container(); + }, + child: ListItem.open( + title: Text(appLocalizations.routeAddress), + subtitle: Text(appLocalizations.routeAddressDesc), + delegate: OpenDelegate( + isBlur: false, + isScaffold: true, + title: appLocalizations.routeAddress, + widget: Selector>( + selector: (_, clashConfig) => clashConfig.includeRouteAddress, + shouldRebuild: (prev, next) => + !stringListEquality.equals(prev, next), + builder: (context, routeAddress, __) { + return ListPage( + title: appLocalizations.routeAddress, + items: routeAddress, + titleBuilder: (item) => Text(item), + onChange: (items) { + final clashConfig = globalState.appController.clashConfig; + clashConfig.includeRouteAddress = + Set.from(items).toList(); + }, + ); + }, + ), + extendPageWidth: 360, + ), + ), + ); + } +} + final networkItems = [ - Platform.isAndroid ? const VPNSwitch() : const TUNItem(), + if (Platform.isAndroid) const VPNItem(), if (Platform.isAndroid) ...generateSection( title: "VPN", items: [ - const SystemProxySwitch(), - const AllowBypassSwitch(), - const Ipv6Switch(), - const BypassDomainItem(), + const SystemProxyItem(), + const AllowBypassItem(), + const Ipv6Item(), + ], + ), + if (system.isDesktop) + ...generateSection( + title: appLocalizations.system, + items: [ + SystemProxyItem(), + BypassDomainItem(), ], ), ...generateSection( title: appLocalizations.options, items: [ + if (system.isDesktop) const TUNItem(), const TunStackItem(), + const RouteModeItem(), + const RouteAddressItem(), ], ), ]; diff --git a/lib/fragments/dashboard/dashboard.dart b/lib/fragments/dashboard/dashboard.dart index 2e99ad1..ffb1c8e 100644 --- a/lib/fragments/dashboard/dashboard.dart +++ b/lib/fragments/dashboard/dashboard.dart @@ -1,16 +1,18 @@ +import 'dart:io'; import 'dart:math'; import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/fragments/dashboard/intranet_ip.dart'; -import 'package:fl_clash/fragments/dashboard/status_switch.dart'; +import 'package:fl_clash/fragments/dashboard/status_button.dart'; import 'package:fl_clash/models/models.dart'; -import 'package:flutter/material.dart'; import 'package:fl_clash/widgets/widgets.dart'; +import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; + import 'network_detection.dart'; +import 'network_speed.dart'; import 'outbound_mode.dart'; import 'start_button.dart'; -import 'network_speed.dart'; import 'traffic_usage.dart'; class DashboardFragment extends StatefulWidget { @@ -22,7 +24,7 @@ class DashboardFragment extends StatefulWidget { class _DashboardFragmentState extends State { _initFab(bool isCurrent) { - if(!isCurrent){ + if (!isCurrent) { return; } WidgetsBinding.instance.addPostFrameCallback((_) { @@ -66,13 +68,14 @@ class _DashboardFragmentState extends State { // child: const VPNSwitch(), // ), if (system.isDesktop) ...[ + if (Platform.isWindows) + GridItem( + crossAxisCellCount: switchCount, + child: const TUNButton(), + ), GridItem( crossAxisCellCount: switchCount, - child: const TUNSwitch(), - ), - GridItem( - crossAxisCellCount: switchCount, - child: const ProxySwitch(), + child: const SystemProxyButton(), ), ], const GridItem( diff --git a/lib/fragments/dashboard/intranet_ip.dart b/lib/fragments/dashboard/intranet_ip.dart index ebb14ac..a8ed02a 100644 --- a/lib/fragments/dashboard/intranet_ip.dart +++ b/lib/fragments/dashboard/intranet_ip.dart @@ -1,5 +1,7 @@ +import 'dart:async'; import 'dart:io'; +import 'package:connectivity_plus/connectivity_plus.dart'; import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/state.dart'; import 'package:fl_clash/widgets/widgets.dart'; @@ -14,14 +16,14 @@ class IntranetIP extends StatefulWidget { class _IntranetIPState extends State { final ipNotifier = ValueNotifier(""); + late StreamSubscription subscription; Future getNetworkType() async { try { - List interfaces = await NetworkInterface.list( + final interfaces = await NetworkInterface.list( includeLoopback: false, type: InternetAddressType.any, ); - for (var interface in interfaces) { if (interface.name.toLowerCase().contains('wlan') || interface.name.toLowerCase().contains('wi-fi')) { @@ -33,7 +35,6 @@ class _IntranetIPState extends State { return 'Mobile Data'; } } - return 'Unknown'; } catch (e) { return 'Error'; @@ -41,6 +42,7 @@ class _IntranetIPState extends State { } Future getLocalIpAddress() async { + await Future.delayed(animateDuration); List interfaces = await NetworkInterface.list( includeLoopback: false, ) @@ -66,15 +68,14 @@ class _IntranetIPState extends State { return null; } - @override - void dispose() { - super.dispose(); - ipNotifier.dispose(); - } - @override void initState() { super.initState(); + subscription = Connectivity().onConnectivityChanged.listen((_) async { + ipNotifier.value = null; + debugPrint("[App] Connection change"); + ipNotifier.value = await getLocalIpAddress() ?? ""; + }); WidgetsBinding.instance.addPostFrameCallback((_) async { ipNotifier.value = await getLocalIpAddress() ?? ""; }); @@ -104,7 +105,9 @@ class _IntranetIPState extends State { flex: 1, child: TooltipText( text: Text( - value.isNotEmpty ? value : appLocalizations.noNetwork, + value.isNotEmpty + ? value + : appLocalizations.noNetwork, style: context .textTheme.titleLarge?.toSoftBold.toMinus, maxLines: 1, @@ -127,4 +130,11 @@ class _IntranetIPState extends State { ), ); } + + @override + void dispose() { + super.dispose(); + subscription.cancel(); + ipNotifier.dispose(); + } } diff --git a/lib/fragments/dashboard/status_switch.dart b/lib/fragments/dashboard/status_button.dart similarity index 59% rename from lib/fragments/dashboard/status_switch.dart rename to lib/fragments/dashboard/status_button.dart index 37f6459..cb6e4b9 100644 --- a/lib/fragments/dashboard/status_switch.dart +++ b/lib/fragments/dashboard/status_button.dart @@ -1,45 +1,33 @@ import 'package:fl_clash/common/app_localizations.dart'; +import 'package:fl_clash/common/system.dart'; import 'package:fl_clash/models/models.dart'; import 'package:fl_clash/state.dart'; import 'package:fl_clash/widgets/widgets.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -// class VPNSwitch extends StatelessWidget { -// const VPNSwitch({super.key}); -// -// @override -// Widget build(BuildContext context) { -// return SwitchContainer( -// info: const Info( -// label: "VPN", -// iconData: Icons.stacked_line_chart, -// ), -// child: Selector( -// selector: (_, config) => config.vpnProps.enable, -// builder: (_, enable, __) { -// return Switch( -// materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, -// value: enable, -// onChanged: (value) { -// final config = globalState.appController.config; -// config.vpnProps = config.vpnProps.copyWith( -// enable: value, -// ); -// }, -// ); -// }, -// ), -// ); -// } -// } +import '../config/network.dart'; -class TUNSwitch extends StatelessWidget { - const TUNSwitch({super.key}); +class TUNButton extends StatelessWidget { + const TUNButton({super.key}); @override Widget build(BuildContext context) { - return SwitchContainer( + return ButtonContainer( + onPressed: () { + showSheet( + context: context, + builder: (_) { + return generateListView(generateSection( + items: [ + if (system.isDesktop) const TUNItem(), + const TunStackItem(), + ], + )); + }, + title: appLocalizations.tun, + ); + }, info: Info( label: appLocalizations.tun, iconData: Icons.stacked_line_chart, @@ -64,18 +52,34 @@ class TUNSwitch extends StatelessWidget { } } -class ProxySwitch extends StatelessWidget { - const ProxySwitch({super.key}); +class SystemProxyButton extends StatelessWidget { + const SystemProxyButton({super.key}); @override Widget build(BuildContext context) { - return SwitchContainer( + return ButtonContainer( + onPressed: () { + showSheet( + context: context, + builder: (_) { + return generateListView( + generateSection( + items: [ + SystemProxyItem(), + BypassDomainItem(), + ], + ), + ); + }, + title: appLocalizations.systemProxy, + ); + }, info: Info( label: appLocalizations.systemProxy, iconData: Icons.shuffle, ), child: Selector( - selector: (_, config) => config.desktopProps.systemProxy, + selector: (_, config) => config.networkProps.systemProxy, builder: (_, systemProxy, __) { return LocaleBuilder( builder: (_) => Switch( @@ -83,8 +87,8 @@ class ProxySwitch extends StatelessWidget { value: systemProxy, onChanged: (value) { final config = globalState.appController.config; - config.desktopProps = - config.desktopProps.copyWith(systemProxy: value); + config.networkProps = + config.networkProps.copyWith(systemProxy: value); }, ), ); @@ -94,20 +98,22 @@ class ProxySwitch extends StatelessWidget { } } -class SwitchContainer extends StatelessWidget { +class ButtonContainer extends StatelessWidget { final Info info; final Widget child; + final VoidCallback onPressed; - const SwitchContainer({ + const ButtonContainer({ super.key, required this.info, required this.child, + required this.onPressed, }); @override Widget build(BuildContext context) { return CommonCard( - onPressed: () {}, + onPressed: onPressed, child: Column( mainAxisSize: MainAxisSize.min, crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/fragments/profiles/profiles.dart b/lib/fragments/profiles/profiles.dart index cdd9f9b..a1dd48c 100644 --- a/lib/fragments/profiles/profiles.dart +++ b/lib/fragments/profiles/profiles.dart @@ -1,9 +1,9 @@ import 'dart:ui'; +import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/fragments/profiles/edit_profile.dart'; import 'package:fl_clash/models/models.dart'; -import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/state.dart'; import 'package:fl_clash/widgets/widgets.dart'; import 'package:flutter/material.dart'; @@ -127,8 +127,8 @@ class _ProfilesFragmentState extends State { Widget build(BuildContext context) { return ActiveBuilder( label: "profiles", - builder: (isCurrent,child){ - if(isCurrent){ + builder: (isCurrent, child) { + if (isCurrent) { _initScaffold(); } return child!; @@ -246,44 +246,16 @@ class ProfileItem extends StatelessWidget { ); } - List _buildUserInfo(BuildContext context, UserInfo userInfo) { - final use = userInfo.upload + userInfo.download; - final total = userInfo.total; - if (total == 0) { - return []; - } - final useShow = TrafficValue(value: use).show; - final totalShow = TrafficValue(value: total).show; - final progress = total == 0 ? 0.0 : use / total; - final expireShow = userInfo.expire == 0 - ? appLocalizations.infiniteTime - : DateTime.fromMillisecondsSinceEpoch(userInfo.expire * 1000).show; - return [ - LinearProgressIndicator( - minHeight: 6, - value: progress, - backgroundColor: context.colorScheme.primary.toSoft(), - ), - const SizedBox( - height: 8, - ), - Text( - "$useShow / $totalShow · $expireShow", - style: context.textTheme.labelMedium?.toLight, - ), - const SizedBox( - height: 4, - ), - ]; - } - List _buildUrlProfileInfo(BuildContext context) { - final userInfo = profile.userInfo; + final subscriptionInfo = profile.subscriptionInfo; return [ const SizedBox( height: 8, ), - if (userInfo != null) ..._buildUserInfo(context, userInfo), + if (subscriptionInfo != null) + SubscriptionInfoView( + subscriptionInfo: subscriptionInfo, + ), Text( profile.lastUpdateDate?.lastUpdateTimeDesc ?? "", style: context.textTheme.labelMedium?.toLight, diff --git a/lib/fragments/proxies/list.dart b/lib/fragments/proxies/list.dart index c661195..d45120c 100644 --- a/lib/fragments/proxies/list.dart +++ b/lib/fragments/proxies/list.dart @@ -51,7 +51,7 @@ class _ProxiesListFragmentState extends State { } _headerStateNotifier.value = _headerStateNotifier.value.copyWith( currentIndex: currentIndex, - offset: headerOffset, + offset: max(headerOffset, 0), ); } @@ -299,6 +299,9 @@ class _ProxiesListFragmentState extends State { headerState.currentIndex > state.groupNames.length - 1 ? 0 : headerState.currentIndex; + if (index < 0) { + return Container(); + } return Stack( children: [ Positioned( @@ -417,9 +420,9 @@ class _ListHeaderState extends State final iconMapEntryList = config.proxiesStyle.iconMap.entries.toList(); final index = iconMapEntryList.indexWhere((item) { - try{ + try { return RegExp(item.key).hasMatch(groupName); - }catch(_){ + } catch (_) { return false; } }); @@ -468,7 +471,7 @@ class _ListHeaderState extends State Widget build(BuildContext context) { return CommonCard( key: widget.key, - radius: 24, + radius: 18, type: CommonCardType.filled, child: Container( padding: const EdgeInsets.symmetric( diff --git a/lib/fragments/proxies/providers.dart b/lib/fragments/proxies/providers.dart index 99e50ca..a2bf945 100644 --- a/lib/fragments/proxies/providers.dart +++ b/lib/fragments/proxies/providers.dart @@ -27,6 +27,7 @@ class _ProvidersState extends State { super.initState(); WidgetsBinding.instance.addPostFrameCallback( (_) { + globalState.appController.updateProviders(); final commonScaffoldState = context.findAncestorStateOfType(); commonScaffoldState?.actions = [ @@ -132,8 +133,8 @@ class ProviderItem extends StatelessWidget { final platformFile = await picker.pickerFile(); final appState = globalState.appController.appState; final bytes = platformFile?.bytes; - if (bytes == null) return; - final file = await File(provider.path).create(recursive: true); + if (bytes == null || provider.path == null) return; + final file = await File(provider.path!).create(recursive: true); await file.writeAsBytes(bytes); final providerName = provider.name; var message = await clashCore.sideLoadExternalProvider( @@ -150,8 +151,7 @@ class ProviderItem extends StatelessWidget { } String _buildProviderDesc() { - final baseInfo = - "${provider.type}(${provider.vehicleType}) · ${provider.updateAt.lastUpdateTimeDesc}"; + final baseInfo = provider.updateAt.lastUpdateTimeDesc; final count = provider.count; return switch (count == 0) { true => baseInfo, @@ -176,10 +176,13 @@ class ProviderItem extends StatelessWidget { Text( _buildProviderDesc(), ), - Text( - provider.path, - style: context.textTheme.bodyMedium?.toLight, + const SizedBox( + height: 4, ), + if (provider.subscriptionInfo != null) + SubscriptionInfoView( + subscriptionInfo: provider.subscriptionInfo, + ), const SizedBox( height: 8, ), @@ -200,6 +203,9 @@ class ProviderItem extends StatelessWidget { ), ], ), + const SizedBox( + height: 4, + ), ], ), trailing: SizedBox( diff --git a/lib/l10n/arb/intl_en.arb b/lib/l10n/arb/intl_en.arb index c300083..905e24b 100644 --- a/lib/l10n/arb/intl_en.arb +++ b/lib/l10n/arb/intl_en.arb @@ -168,6 +168,7 @@ "ipv6Desc": "When turned on it will be able to receive IPv6 traffic", "app": "App", "general": "General", + "vpnSystemProxyDesc": "Attach HTTP proxy to VpnService", "systemProxyDesc": "Attach HTTP proxy to VpnService", "unifiedDelay": "Unified delay", "unifiedDelayDesc": "Remove extra delays such as handshaking", @@ -323,5 +324,11 @@ "adminAutoLaunchDesc": "Boot up by using admin mode", "fontFamily": "FontFamily", "systemFont": "System font", - "toggle": "Toggle" + "toggle": "Toggle", + "system": "System", + "routeMode": "Route mode", + "routeMode_bypassPrivate": "Bypass private route address", + "routeMode_config": "Use config", + "routeAddress": "Route address", + "routeAddressDesc": "Config listen route address" } \ No newline at end of file diff --git a/lib/l10n/arb/intl_zh_CN.arb b/lib/l10n/arb/intl_zh_CN.arb index e14bbf4..bb2aedf 100644 --- a/lib/l10n/arb/intl_zh_CN.arb +++ b/lib/l10n/arb/intl_zh_CN.arb @@ -168,7 +168,8 @@ "ipv6Desc": "开启后将可以接收IPv6流量", "app": "应用", "general": "基础", - "systemProxyDesc": "为VpnService附加HTTP代理", + "vpnSystemProxyDesc": "为VpnService附加HTTP代理", + "systemProxyDesc": "设置系统代理", "unifiedDelay": "统一延迟", "unifiedDelayDesc": "去除握手等额外延迟", "tcpConcurrent": "TCP并发", @@ -323,5 +324,11 @@ "adminAutoLaunchDesc": "使用管理员模式开机自启动", "fontFamily": "字体", "systemFont": "系统字体", - "toggle": "切换" -} \ No newline at end of file + "toggle": "切换", + "system": "系统", + "routeMode": "路由模式", + "routeMode_bypassPrivate": "绕过私有路由地址", + "routeMode_config": "使用配置", + "routeAddress": "路由地址", + "routeAddressDesc": "配置监听路由地址" +} diff --git a/lib/l10n/intl/messages_en.dart b/lib/l10n/intl/messages_en.dart index 8bbae6f..66d3bca 100644 --- a/lib/l10n/intl/messages_en.dart +++ b/lib/l10n/intl/messages_en.dart @@ -398,6 +398,13 @@ class MessageLookup extends MessageLookupByLibrary { "respectRules": MessageLookupByLibrary.simpleMessage("Respect rules"), "respectRulesDesc": MessageLookupByLibrary.simpleMessage( "DNS connection following rules, need to configure proxy-server-nameserver"), + "routeAddress": MessageLookupByLibrary.simpleMessage("Route address"), + "routeAddressDesc": + MessageLookupByLibrary.simpleMessage("Config listen route address"), + "routeMode": MessageLookupByLibrary.simpleMessage("Route mode"), + "routeMode_bypassPrivate": MessageLookupByLibrary.simpleMessage( + "Bypass private route address"), + "routeMode_config": MessageLookupByLibrary.simpleMessage("Use config"), "rule": MessageLookupByLibrary.simpleMessage("Rule"), "ruleProviders": MessageLookupByLibrary.simpleMessage("Rule providers"), "save": MessageLookupByLibrary.simpleMessage("Save"), @@ -426,6 +433,7 @@ class MessageLookup extends MessageLookupByLibrary { "style": MessageLookupByLibrary.simpleMessage("Style"), "submit": MessageLookupByLibrary.simpleMessage("Submit"), "sync": MessageLookupByLibrary.simpleMessage("Sync"), + "system": MessageLookupByLibrary.simpleMessage("System"), "systemFont": MessageLookupByLibrary.simpleMessage("System font"), "systemProxy": MessageLookupByLibrary.simpleMessage("System proxy"), "systemProxyDesc": MessageLookupByLibrary.simpleMessage( @@ -475,6 +483,8 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Modify VPN related settings"), "vpnEnableDesc": MessageLookupByLibrary.simpleMessage( "Auto routes all system traffic through VpnService"), + "vpnSystemProxyDesc": MessageLookupByLibrary.simpleMessage( + "Attach HTTP proxy to VpnService"), "vpnTip": MessageLookupByLibrary.simpleMessage( "Changes take effect after restarting the VPN"), "webDAVConfiguration": diff --git a/lib/l10n/intl/messages_zh_CN.dart b/lib/l10n/intl/messages_zh_CN.dart index 60e270c..030fe35 100644 --- a/lib/l10n/intl/messages_zh_CN.dart +++ b/lib/l10n/intl/messages_zh_CN.dart @@ -314,6 +314,12 @@ class MessageLookup extends MessageLookupByLibrary { "respectRules": MessageLookupByLibrary.simpleMessage("遵守规则"), "respectRulesDesc": MessageLookupByLibrary.simpleMessage( "DNS连接跟随rules,需配置proxy-server-nameserver"), + "routeAddress": MessageLookupByLibrary.simpleMessage("路由地址"), + "routeAddressDesc": MessageLookupByLibrary.simpleMessage("配置监听路由地址"), + "routeMode": MessageLookupByLibrary.simpleMessage("路由模式"), + "routeMode_bypassPrivate": + MessageLookupByLibrary.simpleMessage("绕过私有路由地址"), + "routeMode_config": MessageLookupByLibrary.simpleMessage("使用配置"), "rule": MessageLookupByLibrary.simpleMessage("规则"), "ruleProviders": MessageLookupByLibrary.simpleMessage("规则提供者"), "save": MessageLookupByLibrary.simpleMessage("保存"), @@ -340,10 +346,10 @@ class MessageLookup extends MessageLookupByLibrary { "style": MessageLookupByLibrary.simpleMessage("风格"), "submit": MessageLookupByLibrary.simpleMessage("提交"), "sync": MessageLookupByLibrary.simpleMessage("同步"), + "system": MessageLookupByLibrary.simpleMessage("系统"), "systemFont": MessageLookupByLibrary.simpleMessage("系统字体"), "systemProxy": MessageLookupByLibrary.simpleMessage("系统代理"), - "systemProxyDesc": - MessageLookupByLibrary.simpleMessage("为VpnService附加HTTP代理"), + "systemProxyDesc": MessageLookupByLibrary.simpleMessage("设置系统代理"), "tab": MessageLookupByLibrary.simpleMessage("标签页"), "tabAnimation": MessageLookupByLibrary.simpleMessage("选项卡动画"), "tabAnimationDesc": @@ -381,6 +387,8 @@ class MessageLookup extends MessageLookupByLibrary { "vpnDesc": MessageLookupByLibrary.simpleMessage("修改VPN相关设置"), "vpnEnableDesc": MessageLookupByLibrary.simpleMessage("通过VpnService自动路由系统所有流量"), + "vpnSystemProxyDesc": + MessageLookupByLibrary.simpleMessage("为VpnService附加HTTP代理"), "vpnTip": MessageLookupByLibrary.simpleMessage("重启VPN后改变生效"), "webDAVConfiguration": MessageLookupByLibrary.simpleMessage("WebDAV配置"), "whitelistMode": MessageLookupByLibrary.simpleMessage("白名单模式"), diff --git a/lib/l10n/l10n.dart b/lib/l10n/l10n.dart index 4d5ae9f..333a9a2 100644 --- a/lib/l10n/l10n.dart +++ b/lib/l10n/l10n.dart @@ -1740,6 +1740,16 @@ class AppLocalizations { ); } + /// `Attach HTTP proxy to VpnService` + String get vpnSystemProxyDesc { + return Intl.message( + 'Attach HTTP proxy to VpnService', + name: 'vpnSystemProxyDesc', + desc: '', + args: [], + ); + } + /// `Attach HTTP proxy to VpnService` String get systemProxyDesc { return Intl.message( @@ -3299,6 +3309,66 @@ class AppLocalizations { args: [], ); } + + /// `System` + String get system { + return Intl.message( + 'System', + name: 'system', + desc: '', + args: [], + ); + } + + /// `Route mode` + String get routeMode { + return Intl.message( + 'Route mode', + name: 'routeMode', + desc: '', + args: [], + ); + } + + /// `Bypass private route address` + String get routeMode_bypassPrivate { + return Intl.message( + 'Bypass private route address', + name: 'routeMode_bypassPrivate', + desc: '', + args: [], + ); + } + + /// `Use config` + String get routeMode_config { + return Intl.message( + 'Use config', + name: 'routeMode_config', + desc: '', + args: [], + ); + } + + /// `Route address` + String get routeAddress { + return Intl.message( + 'Route address', + name: 'routeAddress', + desc: '', + args: [], + ); + } + + /// `Config listen route address` + String get routeAddressDesc { + return Intl.message( + 'Config listen route address', + name: 'routeAddressDesc', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/lib/main.dart b/lib/main.dart index 41b0a18..c9c93ea 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -19,6 +19,10 @@ Future main() async { globalState.packageInfo = await PackageInfo.fromPlatform(); final version = await system.version; final config = await preferences.getConfig() ?? Config(); + await AppLocalizations.load( + other.getLocaleForString(config.appSetting.locale) ?? + WidgetsBinding.instance.platformDispatcher.locale, + ); final clashConfig = await preferences.getClashConfig() ?? ClashConfig(); await android?.init(); await window?.init(config.windowProps, version); @@ -27,10 +31,17 @@ Future main() async { version: version, selectedMap: config.currentSelectedMap, ); + final appFlowingState = AppFlowingState(); appState.navigationItems = navigation.getItems( openLogs: config.appSetting.openLogs, hasProxies: false, ); + globalState.updateTray( + appState: appState, + appFlowingState: appFlowingState, + config: config, + clashConfig: clashConfig, + ); await globalState.init( appState: appState, config: config, @@ -40,6 +51,7 @@ Future main() async { runAppWithPreferences( const Application(), appState: appState, + appFlowingState: appFlowingState, config: config, clashConfig: clashConfig, ); diff --git a/lib/manager/app_state_manager.dart b/lib/manager/app_state_manager.dart index fe23823..013e915 100644 --- a/lib/manager/app_state_manager.dart +++ b/lib/manager/app_state_manager.dart @@ -1,5 +1,3 @@ -import 'dart:convert'; - import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/models/models.dart'; import 'package:fl_clash/state.dart'; diff --git a/lib/manager/clash_manager.dart b/lib/manager/clash_manager.dart index 6c68cfa..23739ce 100644 --- a/lib/manager/clash_manager.dart +++ b/lib/manager/clash_manager.dart @@ -20,7 +20,6 @@ class ClashManager extends StatefulWidget { } class _ClashContainerState extends State with AppMessageListener { - Function? updateClashConfigDebounce; Function? updateDelayDebounce; Widget _updateContainer(Widget child) { @@ -47,10 +46,7 @@ class _ClashContainerState extends State with AppMessageListener { ), shouldRebuild: (prev, next) { if (prev != next) { - updateClashConfigDebounce ??= debounce(() async { - await globalState.appController.updateClashConfig(); - }); - updateClashConfigDebounce!(); + globalState.appController.updateClashConfigDebounce(); } return prev != next; }, @@ -68,11 +64,12 @@ class _ClashContainerState extends State with AppMessageListener { accessControl: config.isAccessControl ? config.accessControl : null, ipv6: config.vpnProps.ipv6, allowBypass: config.vpnProps.allowBypass, - bypassDomain: config.vpnProps.bypassDomain, + bypassDomain: config.networkProps.bypassDomain, systemProxy: config.vpnProps.systemProxy, onlyProxy: config.appSetting.onlyProxy, currentProfileName: config.currentProfile?.label ?? config.currentProfileId ?? "", + routeAddress: clashConfig.routeAddress, ), builder: (__, state, child) { clashCore.setState(state); diff --git a/lib/manager/proxy_manager.dart b/lib/manager/proxy_manager.dart index 25ede2c..875fdbd 100644 --- a/lib/manager/proxy_manager.dart +++ b/lib/manager/proxy_manager.dart @@ -8,13 +8,13 @@ class ProxyManager extends StatelessWidget { const ProxyManager({super.key, required this.child}); - _updateProxy(ProxyState proxyState) { + _updateProxy(ProxyState proxyState) async { final isStart = proxyState.isStart; final systemProxy = proxyState.systemProxy; final port = proxyState.port; if (isStart && systemProxy) { - proxy?.startProxy(port); - }else{ + proxy?.startProxy(port, proxyState.bassDomain); + } else { proxy?.stopProxy(); } } @@ -24,8 +24,9 @@ class ProxyManager extends StatelessWidget { return Selector3( selector: (_, appFlowingState, config, clashConfig) => ProxyState( isStart: appFlowingState.isStart, - systemProxy: config.desktopProps.systemProxy, + systemProxy: config.networkProps.systemProxy, port: clashConfig.mixedPort, + bassDomain: config.networkProps.bypassDomain, ), builder: (_, state, child) { _updateProxy(state); diff --git a/lib/manager/tile_manager.dart b/lib/manager/tile_manager.dart index 32801a4..77f2dc1 100644 --- a/lib/manager/tile_manager.dart +++ b/lib/manager/tile_manager.dart @@ -1,4 +1,3 @@ -import 'package:fl_clash/plugins/app.dart'; import 'package:fl_clash/plugins/tile.dart'; import 'package:fl_clash/state.dart'; import 'package:flutter/material.dart'; @@ -16,8 +15,6 @@ class TileManager extends StatefulWidget { } class _TileContainerState extends State with TileListener { - - @override Widget build(BuildContext context) { return widget.child; diff --git a/lib/manager/tray_manager.dart b/lib/manager/tray_manager.dart index 84d83c7..5a984eb 100755 --- a/lib/manager/tray_manager.dart +++ b/lib/manager/tray_manager.dart @@ -17,8 +17,7 @@ class TrayManager extends StatefulWidget { State createState() => _TrayContainerState(); } -class _TrayContainerState extends State - with TrayListener { +class _TrayContainerState extends State with TrayListener { @override void initState() { super.initState(); @@ -35,15 +34,17 @@ class _TrayContainerState extends State autoLaunch: config.appSetting.autoLaunch, isStart: appFlowingState.isStart, locale: config.appSetting.locale, - systemProxy: config.desktopProps.systemProxy, + systemProxy: config.networkProps.systemProxy, tunEnable: clashConfig.tun.enable, brightness: appState.brightness, ), shouldRebuild: (prev, next) { + if (prev != next) { + globalState.appController.updateTray(); + } return prev != next; }, builder: (_, state, child) { - globalState.appController.updateTray(); return child!; }, child: widget.child, diff --git a/lib/manager/window_manager.dart b/lib/manager/window_manager.dart index efcb7e2..4239716 100644 --- a/lib/manager/window_manager.dart +++ b/lib/manager/window_manager.dart @@ -59,15 +59,15 @@ class _WindowContainerState extends State super.onWindowClose(); } + @override + Future onShouldTerminate() async { + await globalState.appController.handleExit(); + super.onShouldTerminate(); + } + @override Future onWindowMoved() async { super.onWindowMoved(); - final offset = await windowManager.getPosition(); - final config = globalState.appController.config; - config.windowProps = config.windowProps.copyWith( - top: offset.dy, - left: offset.dx, - ); } @override diff --git a/lib/models/clash_config.dart b/lib/models/clash_config.dart index 11c22a6..f670a2f 100644 --- a/lib/models/clash_config.dart +++ b/lib/models/clash_config.dart @@ -7,9 +7,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import '../enum/enum.dart'; -part 'generated/clash_config.g.dart'; - part 'generated/clash_config.freezed.dart'; +part 'generated/clash_config.g.dart'; const defaultTun = Tun(); @@ -126,6 +125,91 @@ typedef HostsMap = Map; 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" +]; + @JsonSerializable() class ClashConfig extends ChangeNotifier { int _mixedPort; @@ -145,6 +229,8 @@ class ClashConfig extends ChangeNotifier { List _rules; String? _globalRealUa; HostsMap _hosts; + List _includeRouteAddress; + RouteMode _routeMode; ClashConfig() : _mixedPort = defaultMixedPort, @@ -161,6 +247,8 @@ class ClashConfig extends ChangeNotifier { _keepAliveInterval = defaultKeepAliveInterval, _dns = defaultDns, _geoXUrl = defaultGeoXMap, + _routeMode = RouteMode.config, + _includeRouteAddress = [], _rules = [], _hosts = {}; @@ -343,6 +431,34 @@ class ClashConfig extends ChangeNotifier { } } + @JsonKey(name: "route-address", includeFromJson: false, includeToJson: true) + List get routeAddress { + return switch (_routeMode == RouteMode.config) { + true => _includeRouteAddress, + false => defaultBypassPrivateRouteAddress, + }; + } + + @JsonKey(name: "include-route-address", defaultValue: []) + List get includeRouteAddress => _includeRouteAddress; + + set includeRouteAddress(List value) { + if (!stringListEquality.equals(value, _includeRouteAddress)) { + _includeRouteAddress = value; + notifyListeners(); + } + } + + @JsonKey(name: "route-mode", defaultValue: RouteMode.config) + RouteMode get routeMode => _routeMode; + + set routeMode(RouteMode value) { + if (value != _routeMode) { + _routeMode = value; + notifyListeners(); + } + } + update([ClashConfig? clashConfig]) { if (clashConfig != null) { _mixedPort = clashConfig._mixedPort; @@ -360,6 +476,8 @@ class ClashConfig extends ChangeNotifier { _geodataLoader = clashConfig._geodataLoader; _dns = clashConfig._dns; _rules = clashConfig._rules; + _routeMode = clashConfig._routeMode; + _includeRouteAddress = clashConfig._includeRouteAddress; } notifyListeners(); } diff --git a/lib/models/config.dart b/lib/models/config.dart index aa233d7..fa6c343 100644 --- a/lib/models/config.dart +++ b/lib/models/config.dart @@ -1,4 +1,5 @@ import 'dart:io'; + import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:flutter/material.dart'; @@ -6,9 +7,8 @@ import 'package:freezed_annotation/freezed_annotation.dart'; import 'models.dart'; -part 'generated/config.g.dart'; - part 'generated/config.freezed.dart'; +part 'generated/config.g.dart'; final defaultAppSetting = const AppSetting().copyWith( isAnimateToPage: system.isDesktop ? false : true, @@ -38,9 +38,8 @@ class AppSetting with _$AppSetting { _$AppSettingFromJson(json); factory AppSetting.realFromJson(Map? json) { - final appSetting = json == null - ? defaultAppSetting - : AppSetting.fromJson(json); + final appSetting = + json == null ? defaultAppSetting : AppSetting.fromJson(json); return appSetting.copyWith( isAnimateToPage: system.isDesktop ? false : appSetting.isAnimateToPage, ); @@ -110,7 +109,6 @@ class VpnProps with _$VpnProps { @Default(true) bool systemProxy, @Default(false) bool ipv6, @Default(true) bool allowBypass, - @Default(defaultBypassDomain) List bypassDomain, }) = _VpnProps; factory VpnProps.fromJson(Map? json) => @@ -118,13 +116,14 @@ class VpnProps with _$VpnProps { } @freezed -class DesktopProps with _$DesktopProps { - const factory DesktopProps({ +class NetworkProps with _$NetworkProps { + const factory NetworkProps({ @Default(true) bool systemProxy, - }) = _DesktopProps; + @Default(defaultBypassDomain) List bypassDomain, + }) = _NetworkProps; - factory DesktopProps.fromJson(Map? json) => - json == null ? const DesktopProps() : _$DesktopPropsFromJson(json); + factory NetworkProps.fromJson(Map? json) => + json == null ? const NetworkProps() : _$NetworkPropsFromJson(json); } const defaultProxiesStyle = ProxiesStyle(); @@ -188,7 +187,7 @@ class Config extends ChangeNotifier { WindowProps _windowProps; ThemeProps _themeProps; VpnProps _vpnProps; - DesktopProps _desktopProps; + NetworkProps _networkProps; bool _overrideDns; List _hotKeyActions; ProxiesStyle _proxiesStyle; @@ -199,7 +198,7 @@ class Config extends ChangeNotifier { _accessControl = const AccessControl(), _windowProps = const WindowProps(), _vpnProps = defaultVpnProps, - _desktopProps = const DesktopProps(), + _networkProps = const NetworkProps(), _overrideDns = false, _appSetting = defaultAppSetting, _hotKeyActions = [], @@ -384,11 +383,11 @@ class Config extends ChangeNotifier { } } - DesktopProps get desktopProps => _desktopProps; + NetworkProps get networkProps => _networkProps; - set desktopProps(DesktopProps value) { - if (_desktopProps != value) { - _desktopProps = value; + set networkProps(NetworkProps value) { + if (_networkProps != value) { + _networkProps = value; notifyListeners(); } } @@ -471,7 +470,7 @@ class Config extends ChangeNotifier { _proxiesStyle = config._proxiesStyle; _vpnProps = config._vpnProps; _overrideDns = config._overrideDns; - _desktopProps = config._desktopProps; + _networkProps = config._networkProps; _hotKeyActions = config._hotKeyActions; } notifyListeners(); @@ -487,6 +486,6 @@ class Config extends ChangeNotifier { @override String toString() { - return 'Config{_appSetting: $_appSetting, _profiles: $_profiles, _currentProfileId: $_currentProfileId, _isAccessControl: $_isAccessControl, _accessControl: $_accessControl, _dav: $_dav, _windowProps: $_windowProps, _themeProps: $_themeProps, _vpnProps: $_vpnProps, _desktopProps: $_desktopProps, _overrideDns: $_overrideDns, _hotKeyActions: $_hotKeyActions, _proxiesStyle: $_proxiesStyle}'; + return 'Config{_appSetting: $_appSetting, _profiles: $_profiles, _currentProfileId: $_currentProfileId, _isAccessControl: $_isAccessControl, _accessControl: $_accessControl, _dav: $_dav, _windowProps: $_windowProps, _themeProps: $_themeProps, _vpnProps: $_vpnProps, _networkProps: $_networkProps, _overrideDns: $_overrideDns, _hotKeyActions: $_hotKeyActions, _proxiesStyle: $_proxiesStyle}'; } } diff --git a/lib/models/ffi.dart b/lib/models/ffi.dart index ae347d6..5f29352 100644 --- a/lib/models/ffi.dart +++ b/lib/models/ffi.dart @@ -4,9 +4,8 @@ import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/models/models.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -part 'generated/ffi.g.dart'; - part 'generated/ffi.freezed.dart'; +part 'generated/ffi.g.dart'; @freezed class CoreState with _$CoreState { @@ -17,6 +16,7 @@ class CoreState with _$CoreState { required bool allowBypass, required bool systemProxy, required List bypassDomain, + required List routeAddress, required bool ipv6, required bool onlyProxy, }) = _CoreState; @@ -36,6 +36,7 @@ class AndroidVpnOptions with _$AndroidVpnOptions { required List bypassDomain, required String ipv4Address, required String ipv6Address, + required List routeAddress, required String dnsServerAddress, }) = _AndroidVpnOptions; @@ -154,13 +155,38 @@ class ProcessMapItem with _$ProcessMapItem { _$ProcessMapItemFromJson(json); } +@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, + }) = _ProviderSubscriptionInfo; + + factory ProviderSubscriptionInfo.fromJson(Map json) => + _$ProviderSubscriptionInfoFromJson(json); +} + +SubscriptionInfo? subscriptionInfoFormCore(Map? json) { + if (json == null) return null; + return SubscriptionInfo( + upload: (json['Upload'] as num?)?.toInt() ?? 0, + download: (json['Download'] as num?)?.toInt() ?? 0, + total: (json['Total'] as num?)?.toInt() ?? 0, + expire: (json['Expire'] as num?)?.toInt() ?? 0, + ); +} + @freezed class ExternalProvider with _$ExternalProvider { const factory ExternalProvider({ required String name, required String type, - required String path, + String? path, required int count, + @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, diff --git a/lib/models/generated/clash_config.freezed.dart b/lib/models/generated/clash_config.freezed.dart index b1c3528..118ba50 100644 --- a/lib/models/generated/clash_config.freezed.dart +++ b/lib/models/generated/clash_config.freezed.dart @@ -26,8 +26,12 @@ mixin _$Tun { @JsonKey(name: "dns-hijack") List get dnsHijack => throw _privateConstructorUsedError; + /// Serializes this Tun to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Tun + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $TunCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -52,6 +56,8 @@ class _$TunCopyWithImpl<$Res, $Val extends Tun> implements $TunCopyWith<$Res> { // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Tun + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -100,6 +106,8 @@ class __$$TunImplCopyWithImpl<$Res> extends _$TunCopyWithImpl<$Res, _$TunImpl> __$$TunImplCopyWithImpl(_$TunImpl _value, $Res Function(_$TunImpl) _then) : super(_value, _then); + /// Create a copy of Tun + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -178,12 +186,14 @@ class _$TunImpl implements _Tun { .equals(other._dnsHijack, _dnsHijack)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, enable, device, stack, const DeepCollectionEquality().hash(_dnsHijack)); - @JsonKey(ignore: true) + /// Create a copy of Tun + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$TunImplCopyWith<_$TunImpl> get copyWith => @@ -215,8 +225,11 @@ abstract class _Tun implements Tun { @override @JsonKey(name: "dns-hijack") List get dnsHijack; + + /// Create a copy of Tun + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$TunImplCopyWith<_$TunImpl> get copyWith => throw _privateConstructorUsedError; } @@ -234,8 +247,12 @@ mixin _$FallbackFilter { List get ipcidr => throw _privateConstructorUsedError; List get domain => throw _privateConstructorUsedError; + /// Serializes this FallbackFilter to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of FallbackFilter + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FallbackFilterCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -264,6 +281,8 @@ class _$FallbackFilterCopyWithImpl<$Res, $Val extends FallbackFilter> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of FallbackFilter + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -322,6 +341,8 @@ class __$$FallbackFilterImplCopyWithImpl<$Res> _$FallbackFilterImpl _value, $Res Function(_$FallbackFilterImpl) _then) : super(_value, _then); + /// Create a copy of FallbackFilter + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -427,7 +448,7 @@ class _$FallbackFilterImpl implements _FallbackFilter { const DeepCollectionEquality().equals(other._domain, _domain)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -437,7 +458,9 @@ class _$FallbackFilterImpl implements _FallbackFilter { const DeepCollectionEquality().hash(_ipcidr), const DeepCollectionEquality().hash(_domain)); - @JsonKey(ignore: true) + /// Create a copy of FallbackFilter + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FallbackFilterImplCopyWith<_$FallbackFilterImpl> get copyWith => @@ -474,8 +497,11 @@ abstract class _FallbackFilter implements FallbackFilter { List get ipcidr; @override List get domain; + + /// Create a copy of FallbackFilter + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FallbackFilterImplCopyWith<_$FallbackFilterImpl> get copyWith => throw _privateConstructorUsedError; } @@ -514,8 +540,12 @@ mixin _$Dns { @JsonKey(name: "fallback-filter") FallbackFilter get fallbackFilter => throw _privateConstructorUsedError; + /// Serializes this Dns to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DnsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -554,6 +584,8 @@ class _$DnsCopyWithImpl<$Res, $Val extends Dns> implements $DnsCopyWith<$Res> { // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -637,6 +669,8 @@ class _$DnsCopyWithImpl<$Res, $Val extends Dns> implements $DnsCopyWith<$Res> { ) as $Val); } + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $FallbackFilterCopyWith<$Res> get fallbackFilter { @@ -680,6 +714,8 @@ class __$$DnsImplCopyWithImpl<$Res> extends _$DnsCopyWithImpl<$Res, _$DnsImpl> __$$DnsImplCopyWithImpl(_$DnsImpl _value, $Res Function(_$DnsImpl) _then) : super(_value, _then); + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -932,7 +968,7 @@ class _$DnsImpl implements _Dns { other.fallbackFilter == fallbackFilter)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -952,7 +988,9 @@ class _$DnsImpl implements _Dns { const DeepCollectionEquality().hash(_proxyServerNameserver), fallbackFilter); - @JsonKey(ignore: true) + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DnsImplCopyWith<_$DnsImpl> get copyWith => @@ -1030,8 +1068,11 @@ abstract class _Dns implements Dns { @override @JsonKey(name: "fallback-filter") FallbackFilter get fallbackFilter; + + /// Create a copy of Dns + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DnsImplCopyWith<_$DnsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/generated/clash_config.g.dart b/lib/models/generated/clash_config.g.dart index 091f9b1..0d518af 100644 --- a/lib/models/generated/clash_config.g.dart +++ b/lib/models/generated/clash_config.g.dart @@ -41,7 +41,13 @@ ClashConfig _$ClashConfigFromJson(Map json) => ClashConfig() ..hosts = (json['hosts'] as Map?)?.map( (k, e) => MapEntry(k, e as String), ) ?? - {}; + {} + ..includeRouteAddress = (json['include-route-address'] as List?) + ?.map((e) => e as String) + .toList() ?? + [] + ..routeMode = $enumDecodeNullable(_$RouteModeEnumMap, json['route-mode']) ?? + RouteMode.config; Map _$ClashConfigToJson(ClashConfig instance) => { @@ -63,6 +69,9 @@ Map _$ClashConfigToJson(ClashConfig instance) => 'global-real-ua': instance.globalRealUa, 'geox-url': instance.geoXUrl, 'hosts': instance.hosts, + 'route-address': instance.routeAddress, + 'include-route-address': instance.includeRouteAddress, + 'route-mode': _$RouteModeEnumMap[instance.routeMode]!, }; const _$ModeEnumMap = { @@ -84,6 +93,11 @@ const _$LogLevelEnumMap = { LogLevel.silent: 'silent', }; +const _$RouteModeEnumMap = { + RouteMode.bypassPrivate: 'bypassPrivate', + RouteMode.config: 'config', +}; + _$TunImpl _$$TunImplFromJson(Map json) => _$TunImpl( enable: json['enable'] as bool? ?? false, device: json['device'] as String? ?? appName, diff --git a/lib/models/generated/common.freezed.dart b/lib/models/generated/common.freezed.dart index add0473..99836a7 100644 --- a/lib/models/generated/common.freezed.dart +++ b/lib/models/generated/common.freezed.dart @@ -24,7 +24,9 @@ mixin _$NavigationItem { String? get path => throw _privateConstructorUsedError; List get modes => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of NavigationItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $NavigationItemCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -55,6 +57,8 @@ class _$NavigationItemCopyWithImpl<$Res, $Val extends NavigationItem> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of NavigationItem + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -125,6 +129,8 @@ class __$$NavigationItemImplCopyWithImpl<$Res> _$NavigationItemImpl _value, $Res Function(_$NavigationItemImpl) _then) : super(_value, _then); + /// Create a copy of NavigationItem + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -232,7 +238,9 @@ class _$NavigationItemImpl implements _NavigationItem { int get hashCode => Object.hash(runtimeType, icon, label, description, fragment, keep, path, const DeepCollectionEquality().hash(_modes)); - @JsonKey(ignore: true) + /// Create a copy of NavigationItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NavigationItemImplCopyWith<_$NavigationItemImpl> get copyWith => @@ -264,8 +272,11 @@ abstract class _NavigationItem implements NavigationItem { String? get path; @override List get modes; + + /// Create a copy of NavigationItem + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$NavigationItemImplCopyWith<_$NavigationItemImpl> get copyWith => throw _privateConstructorUsedError; } @@ -281,8 +292,12 @@ mixin _$Package { bool get isSystem => throw _privateConstructorUsedError; int get firstInstallTime => throw _privateConstructorUsedError; + /// Serializes this Package to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Package + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $PackageCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -305,6 +320,8 @@ class _$PackageCopyWithImpl<$Res, $Val extends Package> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Package + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -353,6 +370,8 @@ class __$$PackageImplCopyWithImpl<$Res> _$PackageImpl _value, $Res Function(_$PackageImpl) _then) : super(_value, _then); + /// Create a copy of Package + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -422,12 +441,14 @@ class _$PackageImpl implements _Package { other.firstInstallTime == firstInstallTime)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, packageName, label, isSystem, firstInstallTime); - @JsonKey(ignore: true) + /// Create a copy of Package + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$PackageImplCopyWith<_$PackageImpl> get copyWith => @@ -458,8 +479,11 @@ abstract class _Package implements Package { bool get isSystem; @override int get firstInstallTime; + + /// Create a copy of Package + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$PackageImplCopyWith<_$PackageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -480,8 +504,12 @@ mixin _$Metadata { String get process => throw _privateConstructorUsedError; String get remoteDestination => throw _privateConstructorUsedError; + /// Serializes this Metadata to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Metadata + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $MetadataCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -513,6 +541,8 @@ class _$MetadataCopyWithImpl<$Res, $Val extends Metadata> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Metadata + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -595,6 +625,8 @@ class __$$MetadataImplCopyWithImpl<$Res> _$MetadataImpl _value, $Res Function(_$MetadataImpl) _then) : super(_value, _then); + /// Create a copy of Metadata + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -711,7 +743,7 @@ class _$MetadataImpl implements _Metadata { other.remoteDestination == remoteDestination)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -725,7 +757,9 @@ class _$MetadataImpl implements _Metadata { process, remoteDestination); - @JsonKey(ignore: true) + /// Create a copy of Metadata + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$MetadataImplCopyWith<_$MetadataImpl> get copyWith => @@ -772,8 +806,11 @@ abstract class _Metadata implements Metadata { String get process; @override String get remoteDestination; + + /// Create a copy of Metadata + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$MetadataImplCopyWith<_$MetadataImpl> get copyWith => throw _privateConstructorUsedError; } @@ -791,8 +828,12 @@ mixin _$Connection { Metadata get metadata => throw _privateConstructorUsedError; List get chains => throw _privateConstructorUsedError; + /// Serializes this Connection to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ConnectionCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -824,6 +865,8 @@ class _$ConnectionCopyWithImpl<$Res, $Val extends Connection> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -862,6 +905,8 @@ class _$ConnectionCopyWithImpl<$Res, $Val extends Connection> ) as $Val); } + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetadataCopyWith<$Res> get metadata { @@ -899,6 +944,8 @@ class __$$ConnectionImplCopyWithImpl<$Res> _$ConnectionImpl _value, $Res Function(_$ConnectionImpl) _then) : super(_value, _then); + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -991,12 +1038,14 @@ class _$ConnectionImpl implements _Connection { const DeepCollectionEquality().equals(other._chains, _chains)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, upload, download, start, metadata, const DeepCollectionEquality().hash(_chains)); - @JsonKey(ignore: true) + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ConnectionImplCopyWith<_$ConnectionImpl> get copyWith => @@ -1034,8 +1083,11 @@ abstract class _Connection implements Connection { Metadata get metadata; @override List get chains; + + /// Create a copy of Connection + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ConnectionImplCopyWith<_$ConnectionImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1049,8 +1101,12 @@ mixin _$LogsAndKeywords { List get logs => throw _privateConstructorUsedError; List get keywords => throw _privateConstructorUsedError; + /// Serializes this LogsAndKeywords to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of LogsAndKeywords + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $LogsAndKeywordsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1074,6 +1130,8 @@ class _$LogsAndKeywordsCopyWithImpl<$Res, $Val extends LogsAndKeywords> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of LogsAndKeywords + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1112,6 +1170,8 @@ class __$$LogsAndKeywordsImplCopyWithImpl<$Res> _$LogsAndKeywordsImpl _value, $Res Function(_$LogsAndKeywordsImpl) _then) : super(_value, _then); + /// Create a copy of LogsAndKeywords + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1174,14 +1234,16 @@ class _$LogsAndKeywordsImpl implements _LogsAndKeywords { const DeepCollectionEquality().equals(other._keywords, _keywords)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_logs), const DeepCollectionEquality().hash(_keywords)); - @JsonKey(ignore: true) + /// Create a copy of LogsAndKeywords + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$LogsAndKeywordsImplCopyWith<_$LogsAndKeywordsImpl> get copyWith => @@ -1208,8 +1270,11 @@ abstract class _LogsAndKeywords implements LogsAndKeywords { List get logs; @override List get keywords; + + /// Create a copy of LogsAndKeywords + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$LogsAndKeywordsImplCopyWith<_$LogsAndKeywordsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1224,8 +1289,12 @@ mixin _$ConnectionsAndKeywords { List get connections => throw _privateConstructorUsedError; List get keywords => throw _privateConstructorUsedError; + /// Serializes this ConnectionsAndKeywords to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ConnectionsAndKeywords + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ConnectionsAndKeywordsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1250,6 +1319,8 @@ class _$ConnectionsAndKeywordsCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ConnectionsAndKeywords + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1291,6 +1362,8 @@ class __$$ConnectionsAndKeywordsImplCopyWithImpl<$Res> $Res Function(_$ConnectionsAndKeywordsImpl) _then) : super(_value, _then); + /// Create a copy of ConnectionsAndKeywords + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1355,14 +1428,16 @@ class _$ConnectionsAndKeywordsImpl implements _ConnectionsAndKeywords { const DeepCollectionEquality().equals(other._keywords, _keywords)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_connections), const DeepCollectionEquality().hash(_keywords)); - @JsonKey(ignore: true) + /// Create a copy of ConnectionsAndKeywords + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ConnectionsAndKeywordsImplCopyWith<_$ConnectionsAndKeywordsImpl> @@ -1389,8 +1464,11 @@ abstract class _ConnectionsAndKeywords implements ConnectionsAndKeywords { List get connections; @override List get keywords; + + /// Create a copy of ConnectionsAndKeywords + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ConnectionsAndKeywordsImplCopyWith<_$ConnectionsAndKeywordsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1406,8 +1484,12 @@ mixin _$DAV { String get password => throw _privateConstructorUsedError; String get fileName => throw _privateConstructorUsedError; + /// Serializes this DAV to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of DAV + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DAVCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1428,6 +1510,8 @@ class _$DAVCopyWithImpl<$Res, $Val extends DAV> implements $DAVCopyWith<$Res> { // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of DAV + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1472,6 +1556,8 @@ class __$$DAVImplCopyWithImpl<$Res> extends _$DAVCopyWithImpl<$Res, _$DAVImpl> __$$DAVImplCopyWithImpl(_$DAVImpl _value, $Res Function(_$DAVImpl) _then) : super(_value, _then); + /// Create a copy of DAV + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1541,11 +1627,13 @@ class _$DAVImpl implements _DAV { other.fileName == fileName)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, uri, user, password, fileName); - @JsonKey(ignore: true) + /// Create a copy of DAV + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DAVImplCopyWith<_$DAVImpl> get copyWith => @@ -1576,8 +1664,11 @@ abstract class _DAV implements DAV { String get password; @override String get fileName; + + /// Create a copy of DAV + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DAVImplCopyWith<_$DAVImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1587,7 +1678,9 @@ mixin _$FileInfo { int get size => throw _privateConstructorUsedError; DateTime get lastModified => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of FileInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FileInfoCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1610,6 +1703,8 @@ class _$FileInfoCopyWithImpl<$Res, $Val extends FileInfo> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of FileInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1648,6 +1743,8 @@ class __$$FileInfoImplCopyWithImpl<$Res> _$FileInfoImpl _value, $Res Function(_$FileInfoImpl) _then) : super(_value, _then); + /// Create a copy of FileInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1695,7 +1792,9 @@ class _$FileInfoImpl implements _FileInfo { @override int get hashCode => Object.hash(runtimeType, size, lastModified); - @JsonKey(ignore: true) + /// Create a copy of FileInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FileInfoImplCopyWith<_$FileInfoImpl> get copyWith => @@ -1711,8 +1810,11 @@ abstract class _FileInfo implements FileInfo { int get size; @override DateTime get lastModified; + + /// Create a copy of FileInfo + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FileInfoImplCopyWith<_$FileInfoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1726,8 +1828,12 @@ mixin _$VersionInfo { String get clashName => throw _privateConstructorUsedError; String get version => throw _privateConstructorUsedError; + /// Serializes this VersionInfo to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of VersionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $VersionInfoCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1751,6 +1857,8 @@ class _$VersionInfoCopyWithImpl<$Res, $Val extends VersionInfo> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of VersionInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1789,6 +1897,8 @@ class __$$VersionInfoImplCopyWithImpl<$Res> _$VersionInfoImpl _value, $Res Function(_$VersionInfoImpl) _then) : super(_value, _then); + /// Create a copy of VersionInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1838,11 +1948,13 @@ class _$VersionInfoImpl implements _VersionInfo { (identical(other.version, version) || other.version == version)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, clashName, version); - @JsonKey(ignore: true) + /// Create a copy of VersionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$VersionInfoImplCopyWith<_$VersionInfoImpl> get copyWith => @@ -1867,8 +1979,11 @@ abstract class _VersionInfo implements VersionInfo { String get clashName; @override String get version; + + /// Create a copy of VersionInfo + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$VersionInfoImplCopyWith<_$VersionInfoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1886,8 +2001,12 @@ mixin _$Group { String get icon => throw _privateConstructorUsedError; String get name => throw _privateConstructorUsedError; + /// Serializes this Group to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Group + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $GroupCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1915,6 +2034,8 @@ class _$GroupCopyWithImpl<$Res, $Val extends Group> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Group + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1978,6 +2099,8 @@ class __$$GroupImplCopyWithImpl<$Res> _$GroupImpl _value, $Res Function(_$GroupImpl) _then) : super(_value, _then); + /// Create a copy of Group + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2071,12 +2194,14 @@ class _$GroupImpl implements _Group { (identical(other.name, name) || other.name == name)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, type, const DeepCollectionEquality().hash(_all), now, hidden, icon, name); - @JsonKey(ignore: true) + /// Create a copy of Group + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$GroupImplCopyWith<_$GroupImpl> get copyWith => @@ -2113,8 +2238,11 @@ abstract class _Group implements Group { String get icon; @override String get name; + + /// Create a copy of Group + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$GroupImplCopyWith<_$GroupImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2129,8 +2257,12 @@ mixin _$Proxy { String get type => throw _privateConstructorUsedError; String? get now => throw _privateConstructorUsedError; + /// Serializes this Proxy to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Proxy + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxyCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2152,6 +2284,8 @@ class _$ProxyCopyWithImpl<$Res, $Val extends Proxy> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Proxy + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2194,6 +2328,8 @@ class __$$ProxyImplCopyWithImpl<$Res> _$ProxyImpl _value, $Res Function(_$ProxyImpl) _then) : super(_value, _then); + /// Create a copy of Proxy + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2248,11 +2384,13 @@ class _$ProxyImpl implements _Proxy { (identical(other.now, now) || other.now == now)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, type, now); - @JsonKey(ignore: true) + /// Create a copy of Proxy + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxyImplCopyWith<_$ProxyImpl> get copyWith => @@ -2280,8 +2418,11 @@ abstract class _Proxy implements Proxy { String get type; @override String? get now; + + /// Create a copy of Proxy + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxyImplCopyWith<_$ProxyImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2296,8 +2437,12 @@ mixin _$HotKeyAction { int? get key => throw _privateConstructorUsedError; Set get modifiers => throw _privateConstructorUsedError; + /// Serializes this HotKeyAction to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of HotKeyAction + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $HotKeyActionCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2321,6 +2466,8 @@ class _$HotKeyActionCopyWithImpl<$Res, $Val extends HotKeyAction> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of HotKeyAction + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2364,6 +2511,8 @@ class __$$HotKeyActionImplCopyWithImpl<$Res> _$HotKeyActionImpl _value, $Res Function(_$HotKeyActionImpl) _then) : super(_value, _then); + /// Create a copy of HotKeyAction + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2429,12 +2578,14 @@ class _$HotKeyActionImpl implements _HotKeyAction { .equals(other._modifiers, _modifiers)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, action, key, const DeepCollectionEquality().hash(_modifiers)); - @JsonKey(ignore: true) + /// Create a copy of HotKeyAction + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$HotKeyActionImplCopyWith<_$HotKeyActionImpl> get copyWith => @@ -2463,8 +2614,11 @@ abstract class _HotKeyAction implements HotKeyAction { int? get key; @override Set get modifiers; + + /// Create a copy of HotKeyAction + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$HotKeyActionImplCopyWith<_$HotKeyActionImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2475,7 +2629,9 @@ mixin _$Field { String get value => throw _privateConstructorUsedError; Validator? get validator => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of Field + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FieldCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2497,6 +2653,8 @@ class _$FieldCopyWithImpl<$Res, $Val extends Field> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Field + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2539,6 +2697,8 @@ class __$$FieldImplCopyWithImpl<$Res> _$FieldImpl _value, $Res Function(_$FieldImpl) _then) : super(_value, _then); + /// Create a copy of Field + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2594,7 +2754,9 @@ class _$FieldImpl implements _Field { @override int get hashCode => Object.hash(runtimeType, label, value, validator); - @JsonKey(ignore: true) + /// Create a copy of Field + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FieldImplCopyWith<_$FieldImpl> get copyWith => @@ -2613,8 +2775,11 @@ abstract class _Field implements Field { String get value; @override Validator? get validator; + + /// Create a copy of Field + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FieldImplCopyWith<_$FieldImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/generated/config.freezed.dart b/lib/models/generated/config.freezed.dart index 49b808f..da63a73 100644 --- a/lib/models/generated/config.freezed.dart +++ b/lib/models/generated/config.freezed.dart @@ -36,8 +36,12 @@ mixin _$AppSetting { bool get minimizeOnExit => throw _privateConstructorUsedError; bool get hidden => throw _privateConstructorUsedError; + /// Serializes this AppSetting to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of AppSetting + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AppSettingCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -76,6 +80,8 @@ class _$AppSettingCopyWithImpl<$Res, $Val extends AppSetting> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of AppSetting + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -194,6 +200,8 @@ class __$$AppSettingImplCopyWithImpl<$Res> _$AppSettingImpl _value, $Res Function(_$AppSettingImpl) _then) : super(_value, _then); + /// Create a copy of AppSetting + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -384,7 +392,7 @@ class _$AppSettingImpl implements _AppSetting { (identical(other.hidden, hidden) || other.hidden == hidden)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -404,7 +412,9 @@ class _$AppSettingImpl implements _AppSetting { minimizeOnExit, hidden); - @JsonKey(ignore: true) + /// Create a copy of AppSetting + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AppSettingImplCopyWith<_$AppSettingImpl> get copyWith => @@ -469,8 +479,11 @@ abstract class _AppSetting implements AppSetting { bool get minimizeOnExit; @override bool get hidden; + + /// Create a copy of AppSetting + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$AppSettingImplCopyWith<_$AppSettingImpl> get copyWith => throw _privateConstructorUsedError; } @@ -487,8 +500,12 @@ mixin _$AccessControl { AccessSortType get sort => throw _privateConstructorUsedError; bool get isFilterSystemApp => throw _privateConstructorUsedError; + /// Serializes this AccessControl to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of AccessControl + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AccessControlCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -517,6 +534,8 @@ class _$AccessControlCopyWithImpl<$Res, $Val extends AccessControl> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of AccessControl + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -575,6 +594,8 @@ class __$$AccessControlImplCopyWithImpl<$Res> _$AccessControlImpl _value, $Res Function(_$AccessControlImpl) _then) : super(_value, _then); + /// Create a copy of AccessControl + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -672,7 +693,7 @@ class _$AccessControlImpl implements _AccessControl { other.isFilterSystemApp == isFilterSystemApp)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -682,7 +703,9 @@ class _$AccessControlImpl implements _AccessControl { sort, isFilterSystemApp); - @JsonKey(ignore: true) + /// Create a copy of AccessControl + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AccessControlImplCopyWith<_$AccessControlImpl> get copyWith => @@ -717,8 +740,11 @@ abstract class _AccessControl implements AccessControl { AccessSortType get sort; @override bool get isFilterSystemApp; + + /// Create a copy of AccessControl + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$AccessControlImplCopyWith<_$AccessControlImpl> get copyWith => throw _privateConstructorUsedError; } @@ -734,8 +760,12 @@ mixin _$WindowProps { double? get top => throw _privateConstructorUsedError; double? get left => throw _privateConstructorUsedError; + /// Serializes this WindowProps to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of WindowProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $WindowPropsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -759,6 +789,8 @@ class _$WindowPropsCopyWithImpl<$Res, $Val extends WindowProps> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of WindowProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -807,6 +839,8 @@ class __$$WindowPropsImplCopyWithImpl<$Res> _$WindowPropsImpl _value, $Res Function(_$WindowPropsImpl) _then) : super(_value, _then); + /// Create a copy of WindowProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -872,11 +906,13 @@ class _$WindowPropsImpl implements _WindowProps { (identical(other.left, left) || other.left == left)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, width, height, top, left); - @JsonKey(ignore: true) + /// Create a copy of WindowProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$WindowPropsImplCopyWith<_$WindowPropsImpl> get copyWith => @@ -908,8 +944,11 @@ abstract class _WindowProps implements WindowProps { double? get top; @override double? get left; + + /// Create a copy of WindowProps + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$WindowPropsImplCopyWith<_$WindowPropsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -924,10 +963,13 @@ mixin _$VpnProps { bool get systemProxy => throw _privateConstructorUsedError; bool get ipv6 => throw _privateConstructorUsedError; bool get allowBypass => throw _privateConstructorUsedError; - List get bypassDomain => throw _privateConstructorUsedError; + /// Serializes this VpnProps to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of VpnProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $VpnPropsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -937,12 +979,7 @@ abstract class $VpnPropsCopyWith<$Res> { factory $VpnPropsCopyWith(VpnProps value, $Res Function(VpnProps) then) = _$VpnPropsCopyWithImpl<$Res, VpnProps>; @useResult - $Res call( - {bool enable, - bool systemProxy, - bool ipv6, - bool allowBypass, - List bypassDomain}); + $Res call({bool enable, bool systemProxy, bool ipv6, bool allowBypass}); } /// @nodoc @@ -955,6 +992,8 @@ class _$VpnPropsCopyWithImpl<$Res, $Val extends VpnProps> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of VpnProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -962,7 +1001,6 @@ class _$VpnPropsCopyWithImpl<$Res, $Val extends VpnProps> Object? systemProxy = null, Object? ipv6 = null, Object? allowBypass = null, - Object? bypassDomain = null, }) { return _then(_value.copyWith( enable: null == enable @@ -981,10 +1019,6 @@ class _$VpnPropsCopyWithImpl<$Res, $Val extends VpnProps> ? _value.allowBypass : allowBypass // ignore: cast_nullable_to_non_nullable as bool, - bypassDomain: null == bypassDomain - ? _value.bypassDomain - : bypassDomain // ignore: cast_nullable_to_non_nullable - as List, ) as $Val); } } @@ -997,12 +1031,7 @@ abstract class _$$VpnPropsImplCopyWith<$Res> __$$VpnPropsImplCopyWithImpl<$Res>; @override @useResult - $Res call( - {bool enable, - bool systemProxy, - bool ipv6, - bool allowBypass, - List bypassDomain}); + $Res call({bool enable, bool systemProxy, bool ipv6, bool allowBypass}); } /// @nodoc @@ -1013,6 +1042,8 @@ class __$$VpnPropsImplCopyWithImpl<$Res> _$VpnPropsImpl _value, $Res Function(_$VpnPropsImpl) _then) : super(_value, _then); + /// Create a copy of VpnProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1020,7 +1051,6 @@ class __$$VpnPropsImplCopyWithImpl<$Res> Object? systemProxy = null, Object? ipv6 = null, Object? allowBypass = null, - Object? bypassDomain = null, }) { return _then(_$VpnPropsImpl( enable: null == enable @@ -1039,10 +1069,6 @@ class __$$VpnPropsImplCopyWithImpl<$Res> ? _value.allowBypass : allowBypass // ignore: cast_nullable_to_non_nullable as bool, - bypassDomain: null == bypassDomain - ? _value._bypassDomain - : bypassDomain // ignore: cast_nullable_to_non_nullable - as List, )); } } @@ -1054,9 +1080,7 @@ class _$VpnPropsImpl implements _VpnProps { {this.enable = true, this.systemProxy = true, this.ipv6 = false, - this.allowBypass = true, - final List bypassDomain = defaultBypassDomain}) - : _bypassDomain = bypassDomain; + this.allowBypass = true}); factory _$VpnPropsImpl.fromJson(Map json) => _$$VpnPropsImplFromJson(json); @@ -1073,18 +1097,10 @@ class _$VpnPropsImpl implements _VpnProps { @override @JsonKey() final bool allowBypass; - final List _bypassDomain; - @override - @JsonKey() - List get bypassDomain { - if (_bypassDomain is EqualUnmodifiableListView) return _bypassDomain; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(_bypassDomain); - } @override String toString() { - return 'VpnProps(enable: $enable, systemProxy: $systemProxy, ipv6: $ipv6, allowBypass: $allowBypass, bypassDomain: $bypassDomain)'; + return 'VpnProps(enable: $enable, systemProxy: $systemProxy, ipv6: $ipv6, allowBypass: $allowBypass)'; } @override @@ -1097,17 +1113,17 @@ class _$VpnPropsImpl implements _VpnProps { other.systemProxy == systemProxy) && (identical(other.ipv6, ipv6) || other.ipv6 == ipv6) && (identical(other.allowBypass, allowBypass) || - other.allowBypass == allowBypass) && - const DeepCollectionEquality() - .equals(other._bypassDomain, _bypassDomain)); + other.allowBypass == allowBypass)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, enable, systemProxy, ipv6, - allowBypass, const DeepCollectionEquality().hash(_bypassDomain)); + int get hashCode => + Object.hash(runtimeType, enable, systemProxy, ipv6, allowBypass); - @JsonKey(ignore: true) + /// Create a copy of VpnProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$VpnPropsImplCopyWith<_$VpnPropsImpl> get copyWith => @@ -1126,8 +1142,7 @@ abstract class _VpnProps implements VpnProps { {final bool enable, final bool systemProxy, final bool ipv6, - final bool allowBypass, - final List bypassDomain}) = _$VpnPropsImpl; + final bool allowBypass}) = _$VpnPropsImpl; factory _VpnProps.fromJson(Map json) = _$VpnPropsImpl.fromJson; @@ -1140,149 +1155,192 @@ abstract class _VpnProps implements VpnProps { bool get ipv6; @override bool get allowBypass; + + /// Create a copy of VpnProps + /// with the given fields replaced by the non-null parameter values. @override - List get bypassDomain; - @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$VpnPropsImplCopyWith<_$VpnPropsImpl> get copyWith => throw _privateConstructorUsedError; } -DesktopProps _$DesktopPropsFromJson(Map json) { - return _DesktopProps.fromJson(json); +NetworkProps _$NetworkPropsFromJson(Map json) { + return _NetworkProps.fromJson(json); } /// @nodoc -mixin _$DesktopProps { +mixin _$NetworkProps { bool get systemProxy => throw _privateConstructorUsedError; + List get bypassDomain => throw _privateConstructorUsedError; + /// Serializes this NetworkProps to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $DesktopPropsCopyWith get copyWith => + + /// Create a copy of NetworkProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $NetworkPropsCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $DesktopPropsCopyWith<$Res> { - factory $DesktopPropsCopyWith( - DesktopProps value, $Res Function(DesktopProps) then) = - _$DesktopPropsCopyWithImpl<$Res, DesktopProps>; +abstract class $NetworkPropsCopyWith<$Res> { + factory $NetworkPropsCopyWith( + NetworkProps value, $Res Function(NetworkProps) then) = + _$NetworkPropsCopyWithImpl<$Res, NetworkProps>; @useResult - $Res call({bool systemProxy}); + $Res call({bool systemProxy, List bypassDomain}); } /// @nodoc -class _$DesktopPropsCopyWithImpl<$Res, $Val extends DesktopProps> - implements $DesktopPropsCopyWith<$Res> { - _$DesktopPropsCopyWithImpl(this._value, this._then); +class _$NetworkPropsCopyWithImpl<$Res, $Val extends NetworkProps> + implements $NetworkPropsCopyWith<$Res> { + _$NetworkPropsCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of NetworkProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? systemProxy = null, + Object? bypassDomain = null, }) { return _then(_value.copyWith( systemProxy: null == systemProxy ? _value.systemProxy : systemProxy // ignore: cast_nullable_to_non_nullable as bool, + bypassDomain: null == bypassDomain + ? _value.bypassDomain + : bypassDomain // ignore: cast_nullable_to_non_nullable + as List, ) as $Val); } } /// @nodoc -abstract class _$$DesktopPropsImplCopyWith<$Res> - implements $DesktopPropsCopyWith<$Res> { - factory _$$DesktopPropsImplCopyWith( - _$DesktopPropsImpl value, $Res Function(_$DesktopPropsImpl) then) = - __$$DesktopPropsImplCopyWithImpl<$Res>; +abstract class _$$NetworkPropsImplCopyWith<$Res> + implements $NetworkPropsCopyWith<$Res> { + factory _$$NetworkPropsImplCopyWith( + _$NetworkPropsImpl value, $Res Function(_$NetworkPropsImpl) then) = + __$$NetworkPropsImplCopyWithImpl<$Res>; @override @useResult - $Res call({bool systemProxy}); + $Res call({bool systemProxy, List bypassDomain}); } /// @nodoc -class __$$DesktopPropsImplCopyWithImpl<$Res> - extends _$DesktopPropsCopyWithImpl<$Res, _$DesktopPropsImpl> - implements _$$DesktopPropsImplCopyWith<$Res> { - __$$DesktopPropsImplCopyWithImpl( - _$DesktopPropsImpl _value, $Res Function(_$DesktopPropsImpl) _then) +class __$$NetworkPropsImplCopyWithImpl<$Res> + extends _$NetworkPropsCopyWithImpl<$Res, _$NetworkPropsImpl> + implements _$$NetworkPropsImplCopyWith<$Res> { + __$$NetworkPropsImplCopyWithImpl( + _$NetworkPropsImpl _value, $Res Function(_$NetworkPropsImpl) _then) : super(_value, _then); + /// Create a copy of NetworkProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? systemProxy = null, + Object? bypassDomain = null, }) { - return _then(_$DesktopPropsImpl( + return _then(_$NetworkPropsImpl( systemProxy: null == systemProxy ? _value.systemProxy : systemProxy // ignore: cast_nullable_to_non_nullable as bool, + bypassDomain: null == bypassDomain + ? _value._bypassDomain + : bypassDomain // ignore: cast_nullable_to_non_nullable + as List, )); } } /// @nodoc @JsonSerializable() -class _$DesktopPropsImpl implements _DesktopProps { - const _$DesktopPropsImpl({this.systemProxy = true}); +class _$NetworkPropsImpl implements _NetworkProps { + const _$NetworkPropsImpl( + {this.systemProxy = true, + final List bypassDomain = defaultBypassDomain}) + : _bypassDomain = bypassDomain; - factory _$DesktopPropsImpl.fromJson(Map json) => - _$$DesktopPropsImplFromJson(json); + factory _$NetworkPropsImpl.fromJson(Map json) => + _$$NetworkPropsImplFromJson(json); @override @JsonKey() final bool systemProxy; + final List _bypassDomain; + @override + @JsonKey() + List get bypassDomain { + if (_bypassDomain is EqualUnmodifiableListView) return _bypassDomain; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_bypassDomain); + } @override String toString() { - return 'DesktopProps(systemProxy: $systemProxy)'; + return 'NetworkProps(systemProxy: $systemProxy, bypassDomain: $bypassDomain)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$DesktopPropsImpl && + other is _$NetworkPropsImpl && (identical(other.systemProxy, systemProxy) || - other.systemProxy == systemProxy)); + other.systemProxy == systemProxy) && + const DeepCollectionEquality() + .equals(other._bypassDomain, _bypassDomain)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash(runtimeType, systemProxy); + int get hashCode => Object.hash(runtimeType, systemProxy, + const DeepCollectionEquality().hash(_bypassDomain)); - @JsonKey(ignore: true) + /// Create a copy of NetworkProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$DesktopPropsImplCopyWith<_$DesktopPropsImpl> get copyWith => - __$$DesktopPropsImplCopyWithImpl<_$DesktopPropsImpl>(this, _$identity); + _$$NetworkPropsImplCopyWith<_$NetworkPropsImpl> get copyWith => + __$$NetworkPropsImplCopyWithImpl<_$NetworkPropsImpl>(this, _$identity); @override Map toJson() { - return _$$DesktopPropsImplToJson( + return _$$NetworkPropsImplToJson( this, ); } } -abstract class _DesktopProps implements DesktopProps { - const factory _DesktopProps({final bool systemProxy}) = _$DesktopPropsImpl; +abstract class _NetworkProps implements NetworkProps { + const factory _NetworkProps( + {final bool systemProxy, + final List bypassDomain}) = _$NetworkPropsImpl; - factory _DesktopProps.fromJson(Map json) = - _$DesktopPropsImpl.fromJson; + factory _NetworkProps.fromJson(Map json) = + _$NetworkPropsImpl.fromJson; @override bool get systemProxy; @override - @JsonKey(ignore: true) - _$$DesktopPropsImplCopyWith<_$DesktopPropsImpl> get copyWith => + List get bypassDomain; + + /// Create a copy of NetworkProps + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$NetworkPropsImplCopyWith<_$NetworkPropsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1299,8 +1357,12 @@ mixin _$ProxiesStyle { ProxyCardType get cardType => throw _privateConstructorUsedError; Map get iconMap => throw _privateConstructorUsedError; + /// Serializes this ProxiesStyle to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ProxiesStyle + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesStyleCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1330,6 +1392,8 @@ class _$ProxiesStyleCopyWithImpl<$Res, $Val extends ProxiesStyle> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesStyle + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1394,6 +1458,8 @@ class __$$ProxiesStyleImplCopyWithImpl<$Res> _$ProxiesStyleImpl _value, $Res Function(_$ProxiesStyleImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesStyle + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1493,12 +1559,14 @@ class _$ProxiesStyleImpl implements _ProxiesStyle { const DeepCollectionEquality().equals(other._iconMap, _iconMap)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, type, sortType, layout, iconStyle, cardType, const DeepCollectionEquality().hash(_iconMap)); - @JsonKey(ignore: true) + /// Create a copy of ProxiesStyle + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesStyleImplCopyWith<_$ProxiesStyleImpl> get copyWith => @@ -1536,8 +1604,11 @@ abstract class _ProxiesStyle implements ProxiesStyle { ProxyCardType get cardType; @override Map get iconMap; + + /// Create a copy of ProxiesStyle + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesStyleImplCopyWith<_$ProxiesStyleImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1553,8 +1624,12 @@ mixin _$ThemeProps { bool get prueBlack => throw _privateConstructorUsedError; FontFamily get fontFamily => throw _privateConstructorUsedError; + /// Serializes this ThemeProps to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ThemeProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ThemePropsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1582,6 +1657,8 @@ class _$ThemePropsCopyWithImpl<$Res, $Val extends ThemeProps> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ThemeProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1634,6 +1711,8 @@ class __$$ThemePropsImplCopyWithImpl<$Res> _$ThemePropsImpl _value, $Res Function(_$ThemePropsImpl) _then) : super(_value, _then); + /// Create a copy of ThemeProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1707,12 +1786,14 @@ class _$ThemePropsImpl implements _ThemeProps { other.fontFamily == fontFamily)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, primaryColor, themeMode, prueBlack, fontFamily); - @JsonKey(ignore: true) + /// Create a copy of ThemeProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ThemePropsImplCopyWith<_$ThemePropsImpl> get copyWith => @@ -1744,8 +1825,11 @@ abstract class _ThemeProps implements ThemeProps { bool get prueBlack; @override FontFamily get fontFamily; + + /// Create a copy of ThemeProps + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ThemePropsImplCopyWith<_$ThemePropsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/generated/config.g.dart b/lib/models/generated/config.g.dart index f72a083..c5f0980 100644 --- a/lib/models/generated/config.g.dart +++ b/lib/models/generated/config.g.dart @@ -23,8 +23,8 @@ Config _$ConfigFromJson(Map json) => Config() ..windowProps = WindowProps.fromJson(json['windowProps'] as Map?) ..vpnProps = VpnProps.fromJson(json['vpnProps'] as Map?) - ..desktopProps = - DesktopProps.fromJson(json['desktopProps'] as Map?) + ..networkProps = + NetworkProps.fromJson(json['networkProps'] as Map?) ..overrideDns = json['overrideDns'] as bool? ?? false ..hotKeyActions = (json['hotKeyActions'] as List?) ?.map((e) => HotKeyAction.fromJson(e as Map)) @@ -44,7 +44,7 @@ Map _$ConfigToJson(Config instance) => { 'dav': instance.dav, 'windowProps': instance.windowProps, 'vpnProps': instance.vpnProps, - 'desktopProps': instance.desktopProps, + 'networkProps': instance.networkProps, 'overrideDns': instance.overrideDns, 'hotKeyActions': instance.hotKeyActions, 'proxiesStyle': instance.proxiesStyle, @@ -148,10 +148,6 @@ _$VpnPropsImpl _$$VpnPropsImplFromJson(Map json) => systemProxy: json['systemProxy'] as bool? ?? true, ipv6: json['ipv6'] as bool? ?? false, allowBypass: json['allowBypass'] as bool? ?? true, - bypassDomain: (json['bypassDomain'] as List?) - ?.map((e) => e as String) - .toList() ?? - defaultBypassDomain, ); Map _$$VpnPropsImplToJson(_$VpnPropsImpl instance) => @@ -160,17 +156,21 @@ Map _$$VpnPropsImplToJson(_$VpnPropsImpl instance) => 'systemProxy': instance.systemProxy, 'ipv6': instance.ipv6, 'allowBypass': instance.allowBypass, - 'bypassDomain': instance.bypassDomain, }; -_$DesktopPropsImpl _$$DesktopPropsImplFromJson(Map json) => - _$DesktopPropsImpl( +_$NetworkPropsImpl _$$NetworkPropsImplFromJson(Map json) => + _$NetworkPropsImpl( systemProxy: json['systemProxy'] as bool? ?? true, + bypassDomain: (json['bypassDomain'] as List?) + ?.map((e) => e as String) + .toList() ?? + defaultBypassDomain, ); -Map _$$DesktopPropsImplToJson(_$DesktopPropsImpl instance) => +Map _$$NetworkPropsImplToJson(_$NetworkPropsImpl instance) => { 'systemProxy': instance.systemProxy, + 'bypassDomain': instance.bypassDomain, }; _$ProxiesStyleImpl _$$ProxiesStyleImplFromJson(Map json) => diff --git a/lib/models/generated/ffi.freezed.dart b/lib/models/generated/ffi.freezed.dart index d2bb34d..d6269e3 100644 --- a/lib/models/generated/ffi.freezed.dart +++ b/lib/models/generated/ffi.freezed.dart @@ -26,11 +26,16 @@ mixin _$CoreState { bool get allowBypass => throw _privateConstructorUsedError; bool get systemProxy => throw _privateConstructorUsedError; List get bypassDomain => throw _privateConstructorUsedError; + List get routeAddress => throw _privateConstructorUsedError; bool get ipv6 => throw _privateConstructorUsedError; bool get onlyProxy => throw _privateConstructorUsedError; + /// Serializes this CoreState to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CoreStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -47,6 +52,7 @@ abstract class $CoreStateCopyWith<$Res> { bool allowBypass, bool systemProxy, List bypassDomain, + List routeAddress, bool ipv6, bool onlyProxy}); @@ -63,6 +69,8 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -72,6 +80,7 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> Object? allowBypass = null, Object? systemProxy = null, Object? bypassDomain = null, + Object? routeAddress = null, Object? ipv6 = null, Object? onlyProxy = null, }) { @@ -100,6 +109,10 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> ? _value.bypassDomain : bypassDomain // ignore: cast_nullable_to_non_nullable as List, + routeAddress: null == routeAddress + ? _value.routeAddress + : routeAddress // ignore: cast_nullable_to_non_nullable + as List, ipv6: null == ipv6 ? _value.ipv6 : ipv6 // ignore: cast_nullable_to_non_nullable @@ -111,6 +124,8 @@ class _$CoreStateCopyWithImpl<$Res, $Val extends CoreState> ) as $Val); } + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AccessControlCopyWith<$Res>? get accessControl { @@ -139,6 +154,7 @@ abstract class _$$CoreStateImplCopyWith<$Res> bool allowBypass, bool systemProxy, List bypassDomain, + List routeAddress, bool ipv6, bool onlyProxy}); @@ -154,6 +170,8 @@ class __$$CoreStateImplCopyWithImpl<$Res> _$CoreStateImpl _value, $Res Function(_$CoreStateImpl) _then) : super(_value, _then); + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -163,6 +181,7 @@ class __$$CoreStateImplCopyWithImpl<$Res> Object? allowBypass = null, Object? systemProxy = null, Object? bypassDomain = null, + Object? routeAddress = null, Object? ipv6 = null, Object? onlyProxy = null, }) { @@ -191,6 +210,10 @@ class __$$CoreStateImplCopyWithImpl<$Res> ? _value._bypassDomain : bypassDomain // ignore: cast_nullable_to_non_nullable as List, + routeAddress: null == routeAddress + ? _value._routeAddress + : routeAddress // ignore: cast_nullable_to_non_nullable + as List, ipv6: null == ipv6 ? _value.ipv6 : ipv6 // ignore: cast_nullable_to_non_nullable @@ -213,9 +236,11 @@ class _$CoreStateImpl implements _CoreState { required this.allowBypass, required this.systemProxy, required final List bypassDomain, + required final List routeAddress, required this.ipv6, required this.onlyProxy}) - : _bypassDomain = bypassDomain; + : _bypassDomain = bypassDomain, + _routeAddress = routeAddress; factory _$CoreStateImpl.fromJson(Map json) => _$$CoreStateImplFromJson(json); @@ -238,6 +263,14 @@ class _$CoreStateImpl implements _CoreState { return EqualUnmodifiableListView(_bypassDomain); } + final List _routeAddress; + @override + List get routeAddress { + if (_routeAddress is EqualUnmodifiableListView) return _routeAddress; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_routeAddress); + } + @override final bool ipv6; @override @@ -245,7 +278,7 @@ class _$CoreStateImpl implements _CoreState { @override String toString() { - return 'CoreState(enable: $enable, accessControl: $accessControl, currentProfileName: $currentProfileName, allowBypass: $allowBypass, systemProxy: $systemProxy, bypassDomain: $bypassDomain, ipv6: $ipv6, onlyProxy: $onlyProxy)'; + return 'CoreState(enable: $enable, accessControl: $accessControl, currentProfileName: $currentProfileName, allowBypass: $allowBypass, systemProxy: $systemProxy, bypassDomain: $bypassDomain, routeAddress: $routeAddress, ipv6: $ipv6, onlyProxy: $onlyProxy)'; } @override @@ -264,12 +297,14 @@ class _$CoreStateImpl implements _CoreState { other.systemProxy == systemProxy) && const DeepCollectionEquality() .equals(other._bypassDomain, _bypassDomain) && + const DeepCollectionEquality() + .equals(other._routeAddress, _routeAddress) && (identical(other.ipv6, ipv6) || other.ipv6 == ipv6) && (identical(other.onlyProxy, onlyProxy) || other.onlyProxy == onlyProxy)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -279,10 +314,13 @@ class _$CoreStateImpl implements _CoreState { allowBypass, systemProxy, const DeepCollectionEquality().hash(_bypassDomain), + const DeepCollectionEquality().hash(_routeAddress), ipv6, onlyProxy); - @JsonKey(ignore: true) + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CoreStateImplCopyWith<_$CoreStateImpl> get copyWith => @@ -304,6 +342,7 @@ abstract class _CoreState implements CoreState { required final bool allowBypass, required final bool systemProxy, required final List bypassDomain, + required final List routeAddress, required final bool ipv6, required final bool onlyProxy}) = _$CoreStateImpl; @@ -323,11 +362,16 @@ abstract class _CoreState implements CoreState { @override List get bypassDomain; @override + List get routeAddress; + @override bool get ipv6; @override bool get onlyProxy; + + /// Create a copy of CoreState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$CoreStateImplCopyWith<_$CoreStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -346,10 +390,15 @@ mixin _$AndroidVpnOptions { List get bypassDomain => throw _privateConstructorUsedError; String get ipv4Address => throw _privateConstructorUsedError; String get ipv6Address => throw _privateConstructorUsedError; + List get routeAddress => throw _privateConstructorUsedError; String get dnsServerAddress => throw _privateConstructorUsedError; + /// Serializes this AndroidVpnOptions to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AndroidVpnOptionsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -369,6 +418,7 @@ abstract class $AndroidVpnOptionsCopyWith<$Res> { List bypassDomain, String ipv4Address, String ipv6Address, + List routeAddress, String dnsServerAddress}); $AccessControlCopyWith<$Res>? get accessControl; @@ -384,6 +434,8 @@ class _$AndroidVpnOptionsCopyWithImpl<$Res, $Val extends AndroidVpnOptions> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -395,6 +447,7 @@ class _$AndroidVpnOptionsCopyWithImpl<$Res, $Val extends AndroidVpnOptions> Object? bypassDomain = null, Object? ipv4Address = null, Object? ipv6Address = null, + Object? routeAddress = null, Object? dnsServerAddress = null, }) { return _then(_value.copyWith( @@ -430,6 +483,10 @@ class _$AndroidVpnOptionsCopyWithImpl<$Res, $Val extends AndroidVpnOptions> ? _value.ipv6Address : ipv6Address // ignore: cast_nullable_to_non_nullable as String, + routeAddress: null == routeAddress + ? _value.routeAddress + : routeAddress // ignore: cast_nullable_to_non_nullable + as List, dnsServerAddress: null == dnsServerAddress ? _value.dnsServerAddress : dnsServerAddress // ignore: cast_nullable_to_non_nullable @@ -437,6 +494,8 @@ class _$AndroidVpnOptionsCopyWithImpl<$Res, $Val extends AndroidVpnOptions> ) as $Val); } + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AccessControlCopyWith<$Res>? get accessControl { @@ -467,6 +526,7 @@ abstract class _$$AndroidVpnOptionsImplCopyWith<$Res> List bypassDomain, String ipv4Address, String ipv6Address, + List routeAddress, String dnsServerAddress}); @override @@ -481,6 +541,8 @@ class __$$AndroidVpnOptionsImplCopyWithImpl<$Res> $Res Function(_$AndroidVpnOptionsImpl) _then) : super(_value, _then); + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -492,6 +554,7 @@ class __$$AndroidVpnOptionsImplCopyWithImpl<$Res> Object? bypassDomain = null, Object? ipv4Address = null, Object? ipv6Address = null, + Object? routeAddress = null, Object? dnsServerAddress = null, }) { return _then(_$AndroidVpnOptionsImpl( @@ -527,6 +590,10 @@ class __$$AndroidVpnOptionsImplCopyWithImpl<$Res> ? _value.ipv6Address : ipv6Address // ignore: cast_nullable_to_non_nullable as String, + routeAddress: null == routeAddress + ? _value._routeAddress + : routeAddress // ignore: cast_nullable_to_non_nullable + as List, dnsServerAddress: null == dnsServerAddress ? _value.dnsServerAddress : dnsServerAddress // ignore: cast_nullable_to_non_nullable @@ -547,8 +614,10 @@ class _$AndroidVpnOptionsImpl implements _AndroidVpnOptions { required final List bypassDomain, required this.ipv4Address, required this.ipv6Address, + required final List routeAddress, required this.dnsServerAddress}) - : _bypassDomain = bypassDomain; + : _bypassDomain = bypassDomain, + _routeAddress = routeAddress; factory _$AndroidVpnOptionsImpl.fromJson(Map json) => _$$AndroidVpnOptionsImplFromJson(json); @@ -575,12 +644,20 @@ class _$AndroidVpnOptionsImpl implements _AndroidVpnOptions { final String ipv4Address; @override final String ipv6Address; + final List _routeAddress; + @override + List get routeAddress { + if (_routeAddress is EqualUnmodifiableListView) return _routeAddress; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_routeAddress); + } + @override final String dnsServerAddress; @override String toString() { - return 'AndroidVpnOptions(enable: $enable, port: $port, accessControl: $accessControl, allowBypass: $allowBypass, systemProxy: $systemProxy, bypassDomain: $bypassDomain, ipv4Address: $ipv4Address, ipv6Address: $ipv6Address, dnsServerAddress: $dnsServerAddress)'; + return 'AndroidVpnOptions(enable: $enable, port: $port, accessControl: $accessControl, allowBypass: $allowBypass, systemProxy: $systemProxy, bypassDomain: $bypassDomain, ipv4Address: $ipv4Address, ipv6Address: $ipv6Address, routeAddress: $routeAddress, dnsServerAddress: $dnsServerAddress)'; } @override @@ -602,11 +679,13 @@ class _$AndroidVpnOptionsImpl implements _AndroidVpnOptions { other.ipv4Address == ipv4Address) && (identical(other.ipv6Address, ipv6Address) || other.ipv6Address == ipv6Address) && + const DeepCollectionEquality() + .equals(other._routeAddress, _routeAddress) && (identical(other.dnsServerAddress, dnsServerAddress) || other.dnsServerAddress == dnsServerAddress)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -618,9 +697,12 @@ class _$AndroidVpnOptionsImpl implements _AndroidVpnOptions { const DeepCollectionEquality().hash(_bypassDomain), ipv4Address, ipv6Address, + const DeepCollectionEquality().hash(_routeAddress), dnsServerAddress); - @JsonKey(ignore: true) + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AndroidVpnOptionsImplCopyWith<_$AndroidVpnOptionsImpl> get copyWith => @@ -645,6 +727,7 @@ abstract class _AndroidVpnOptions implements AndroidVpnOptions { required final List bypassDomain, required final String ipv4Address, required final String ipv6Address, + required final List routeAddress, required final String dnsServerAddress}) = _$AndroidVpnOptionsImpl; factory _AndroidVpnOptions.fromJson(Map json) = @@ -667,9 +750,14 @@ abstract class _AndroidVpnOptions implements AndroidVpnOptions { @override String get ipv6Address; @override - String get dnsServerAddress; + List get routeAddress; @override - @JsonKey(ignore: true) + String get dnsServerAddress; + + /// Create a copy of AndroidVpnOptions + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) _$$AndroidVpnOptionsImplCopyWith<_$AndroidVpnOptionsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -691,8 +779,12 @@ mixin _$ConfigExtendedParams { @JsonKey(name: "test-url") String get testUrl => throw _privateConstructorUsedError; + /// Serializes this ConfigExtendedParams to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ConfigExtendedParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ConfigExtendedParamsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -722,6 +814,8 @@ class _$ConfigExtendedParamsCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ConfigExtendedParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -780,6 +874,8 @@ class __$$ConfigExtendedParamsImplCopyWithImpl<$Res> $Res Function(_$ConfigExtendedParamsImpl) _then) : super(_value, _then); + /// Create a copy of ConfigExtendedParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -871,12 +967,14 @@ class _$ConfigExtendedParamsImpl implements _ConfigExtendedParams { (identical(other.testUrl, testUrl) || other.testUrl == testUrl)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, isPatch, isCompatible, const DeepCollectionEquality().hash(_selectedMap), overrideDns, testUrl); - @JsonKey(ignore: true) + /// Create a copy of ConfigExtendedParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ConfigExtendedParamsImplCopyWith<_$ConfigExtendedParamsImpl> @@ -920,8 +1018,11 @@ abstract class _ConfigExtendedParams implements ConfigExtendedParams { @override @JsonKey(name: "test-url") String get testUrl; + + /// Create a copy of ConfigExtendedParams + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ConfigExtendedParamsImplCopyWith<_$ConfigExtendedParamsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -937,8 +1038,12 @@ mixin _$UpdateConfigParams { ClashConfig get config => throw _privateConstructorUsedError; ConfigExtendedParams get params => throw _privateConstructorUsedError; + /// Serializes this UpdateConfigParams to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $UpdateConfigParamsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -967,6 +1072,8 @@ class _$UpdateConfigParamsCopyWithImpl<$Res, $Val extends UpdateConfigParams> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -990,6 +1097,8 @@ class _$UpdateConfigParamsCopyWithImpl<$Res, $Val extends UpdateConfigParams> ) as $Val); } + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $ConfigExtendedParamsCopyWith<$Res> get params { @@ -1024,6 +1133,8 @@ class __$$UpdateConfigParamsImplCopyWithImpl<$Res> $Res Function(_$UpdateConfigParamsImpl) _then) : super(_value, _then); + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1083,11 +1194,13 @@ class _$UpdateConfigParamsImpl implements _UpdateConfigParams { (identical(other.params, params) || other.params == params)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, profileId, config, params); - @JsonKey(ignore: true) + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$UpdateConfigParamsImplCopyWith<_$UpdateConfigParamsImpl> get copyWith => @@ -1118,8 +1231,11 @@ abstract class _UpdateConfigParams implements UpdateConfigParams { ClashConfig get config; @override ConfigExtendedParams get params; + + /// Create a copy of UpdateConfigParams + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$UpdateConfigParamsImplCopyWith<_$UpdateConfigParamsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1135,8 +1251,12 @@ mixin _$ChangeProxyParams { @JsonKey(name: "proxy-name") String get proxyName => throw _privateConstructorUsedError; + /// Serializes this ChangeProxyParams to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ChangeProxyParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ChangeProxyParamsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1162,6 +1282,8 @@ class _$ChangeProxyParamsCopyWithImpl<$Res, $Val extends ChangeProxyParams> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ChangeProxyParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1202,6 +1324,8 @@ class __$$ChangeProxyParamsImplCopyWithImpl<$Res> $Res Function(_$ChangeProxyParamsImpl) _then) : super(_value, _then); + /// Create a copy of ChangeProxyParams + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1254,11 +1378,13 @@ class _$ChangeProxyParamsImpl implements _ChangeProxyParams { other.proxyName == proxyName)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, groupName, proxyName); - @JsonKey(ignore: true) + /// Create a copy of ChangeProxyParams + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ChangeProxyParamsImplCopyWith<_$ChangeProxyParamsImpl> get copyWith => @@ -1288,8 +1414,11 @@ abstract class _ChangeProxyParams implements ChangeProxyParams { @override @JsonKey(name: "proxy-name") String get proxyName; + + /// Create a copy of ChangeProxyParams + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ChangeProxyParamsImplCopyWith<_$ChangeProxyParamsImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1303,8 +1432,12 @@ mixin _$AppMessage { AppMessageType get type => throw _privateConstructorUsedError; dynamic get data => throw _privateConstructorUsedError; + /// Serializes this AppMessage to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of AppMessage + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AppMessageCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1328,6 +1461,8 @@ class _$AppMessageCopyWithImpl<$Res, $Val extends AppMessage> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of AppMessage + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1366,6 +1501,8 @@ class __$$AppMessageImplCopyWithImpl<$Res> _$AppMessageImpl _value, $Res Function(_$AppMessageImpl) _then) : super(_value, _then); + /// Create a copy of AppMessage + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1412,12 +1549,14 @@ class _$AppMessageImpl implements _AppMessage { const DeepCollectionEquality().equals(other.data, data)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, type, const DeepCollectionEquality().hash(data)); - @JsonKey(ignore: true) + /// Create a copy of AppMessage + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AppMessageImplCopyWith<_$AppMessageImpl> get copyWith => @@ -1443,8 +1582,11 @@ abstract class _AppMessage implements AppMessage { AppMessageType get type; @override dynamic get data; + + /// Create a copy of AppMessage + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$AppMessageImplCopyWith<_$AppMessageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1458,8 +1600,12 @@ mixin _$ServiceMessage { ServiceMessageType get type => throw _privateConstructorUsedError; dynamic get data => throw _privateConstructorUsedError; + /// Serializes this ServiceMessage to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ServiceMessage + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ServiceMessageCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1483,6 +1629,8 @@ class _$ServiceMessageCopyWithImpl<$Res, $Val extends ServiceMessage> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ServiceMessage + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1521,6 +1669,8 @@ class __$$ServiceMessageImplCopyWithImpl<$Res> _$ServiceMessageImpl _value, $Res Function(_$ServiceMessageImpl) _then) : super(_value, _then); + /// Create a copy of ServiceMessage + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1567,12 +1717,14 @@ class _$ServiceMessageImpl implements _ServiceMessage { const DeepCollectionEquality().equals(other.data, data)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, type, const DeepCollectionEquality().hash(data)); - @JsonKey(ignore: true) + /// Create a copy of ServiceMessage + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ServiceMessageImplCopyWith<_$ServiceMessageImpl> get copyWith => @@ -1599,8 +1751,11 @@ abstract class _ServiceMessage implements ServiceMessage { ServiceMessageType get type; @override dynamic get data; + + /// Create a copy of ServiceMessage + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ServiceMessageImplCopyWith<_$ServiceMessageImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1614,8 +1769,12 @@ mixin _$Delay { String get name => throw _privateConstructorUsedError; int? get value => throw _privateConstructorUsedError; + /// Serializes this Delay to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Delay + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $DelayCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1637,6 +1796,8 @@ class _$DelayCopyWithImpl<$Res, $Val extends Delay> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Delay + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1674,6 +1835,8 @@ class __$$DelayImplCopyWithImpl<$Res> _$DelayImpl _value, $Res Function(_$DelayImpl) _then) : super(_value, _then); + /// Create a copy of Delay + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1720,11 +1883,13 @@ class _$DelayImpl implements _Delay { (identical(other.value, value) || other.value == value)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, value); - @JsonKey(ignore: true) + /// Create a copy of Delay + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$DelayImplCopyWith<_$DelayImpl> get copyWith => @@ -1748,8 +1913,11 @@ abstract class _Delay implements Delay { String get name; @override int? get value; + + /// Create a copy of Delay + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$DelayImplCopyWith<_$DelayImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1763,8 +1931,12 @@ mixin _$Now { String get name => throw _privateConstructorUsedError; String get value => throw _privateConstructorUsedError; + /// Serializes this Now to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Now + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $NowCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1785,6 +1957,8 @@ class _$NowCopyWithImpl<$Res, $Val extends Now> implements $NowCopyWith<$Res> { // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Now + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1819,6 +1993,8 @@ class __$$NowImplCopyWithImpl<$Res> extends _$NowCopyWithImpl<$Res, _$NowImpl> __$$NowImplCopyWithImpl(_$NowImpl _value, $Res Function(_$NowImpl) _then) : super(_value, _then); + /// Create a copy of Now + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1865,11 +2041,13 @@ class _$NowImpl implements _Now { (identical(other.value, value) || other.value == value)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, name, value); - @JsonKey(ignore: true) + /// Create a copy of Now + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NowImplCopyWith<_$NowImpl> get copyWith => @@ -1893,8 +2071,11 @@ abstract class _Now implements Now { String get name; @override String get value; + + /// Create a copy of Now + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$NowImplCopyWith<_$NowImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1908,8 +2089,12 @@ mixin _$Process { int get id => throw _privateConstructorUsedError; Metadata get metadata => throw _privateConstructorUsedError; + /// Serializes this Process to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProcessCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1933,6 +2118,8 @@ class _$ProcessCopyWithImpl<$Res, $Val extends Process> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1951,6 +2138,8 @@ class _$ProcessCopyWithImpl<$Res, $Val extends Process> ) as $Val); } + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $MetadataCopyWith<$Res> get metadata { @@ -1981,6 +2170,8 @@ class __$$ProcessImplCopyWithImpl<$Res> _$ProcessImpl _value, $Res Function(_$ProcessImpl) _then) : super(_value, _then); + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2028,11 +2219,13 @@ class _$ProcessImpl implements _Process { other.metadata == metadata)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, metadata); - @JsonKey(ignore: true) + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProcessImplCopyWith<_$ProcessImpl> get copyWith => @@ -2057,8 +2250,11 @@ abstract class _Process implements Process { int get id; @override Metadata get metadata; + + /// Create a copy of Process + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProcessImplCopyWith<_$ProcessImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2072,8 +2268,12 @@ mixin _$Fd { int get id => throw _privateConstructorUsedError; int get value => throw _privateConstructorUsedError; + /// Serializes this Fd to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Fd + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $FdCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2094,6 +2294,8 @@ class _$FdCopyWithImpl<$Res, $Val extends Fd> implements $FdCopyWith<$Res> { // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Fd + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2128,6 +2330,8 @@ class __$$FdImplCopyWithImpl<$Res> extends _$FdCopyWithImpl<$Res, _$FdImpl> __$$FdImplCopyWithImpl(_$FdImpl _value, $Res Function(_$FdImpl) _then) : super(_value, _then); + /// Create a copy of Fd + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2174,11 +2378,13 @@ class _$FdImpl implements _Fd { (identical(other.value, value) || other.value == value)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, value); - @JsonKey(ignore: true) + /// Create a copy of Fd + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$FdImplCopyWith<_$FdImpl> get copyWith => @@ -2202,8 +2408,11 @@ abstract class _Fd implements Fd { int get id; @override int get value; + + /// Create a copy of Fd + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$FdImplCopyWith<_$FdImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2217,8 +2426,12 @@ mixin _$ProcessMapItem { int get id => throw _privateConstructorUsedError; String get value => throw _privateConstructorUsedError; + /// Serializes this ProcessMapItem to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ProcessMapItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProcessMapItemCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2242,6 +2455,8 @@ class _$ProcessMapItemCopyWithImpl<$Res, $Val extends ProcessMapItem> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProcessMapItem + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2280,6 +2495,8 @@ class __$$ProcessMapItemImplCopyWithImpl<$Res> _$ProcessMapItemImpl _value, $Res Function(_$ProcessMapItemImpl) _then) : super(_value, _then); + /// Create a copy of ProcessMapItem + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2326,11 +2543,13 @@ class _$ProcessMapItemImpl implements _ProcessMapItem { (identical(other.value, value) || other.value == value)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, id, value); - @JsonKey(ignore: true) + /// Create a copy of ProcessMapItem + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProcessMapItemImplCopyWith<_$ProcessMapItemImpl> get copyWith => @@ -2357,12 +2576,248 @@ abstract class _ProcessMapItem implements ProcessMapItem { int get id; @override String get value; + + /// Create a copy of ProcessMapItem + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProcessMapItemImplCopyWith<_$ProcessMapItemImpl> get copyWith => throw _privateConstructorUsedError; } +ProviderSubscriptionInfo _$ProviderSubscriptionInfoFromJson( + Map json) { + return _ProviderSubscriptionInfo.fromJson(json); +} + +/// @nodoc +mixin _$ProviderSubscriptionInfo { + @JsonKey(name: "UPLOAD") + int get upload => throw _privateConstructorUsedError; + @JsonKey(name: "DOWNLOAD") + int get download => throw _privateConstructorUsedError; + @JsonKey(name: "TOTAL") + int get total => throw _privateConstructorUsedError; + @JsonKey(name: "EXPIRE") + int get expire => throw _privateConstructorUsedError; + + /// Serializes this ProviderSubscriptionInfo to a JSON map. + Map toJson() => throw _privateConstructorUsedError; + + /// Create a copy of ProviderSubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $ProviderSubscriptionInfoCopyWith get copyWith => + throw _privateConstructorUsedError; +} + +/// @nodoc +abstract class $ProviderSubscriptionInfoCopyWith<$Res> { + factory $ProviderSubscriptionInfoCopyWith(ProviderSubscriptionInfo value, + $Res Function(ProviderSubscriptionInfo) then) = + _$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}); +} + +/// @nodoc +class _$ProviderSubscriptionInfoCopyWithImpl<$Res, + $Val extends ProviderSubscriptionInfo> + implements $ProviderSubscriptionInfoCopyWith<$Res> { + _$ProviderSubscriptionInfoCopyWithImpl(this._value, this._then); + + // ignore: unused_field + final $Val _value; + // ignore: unused_field + final $Res Function($Val) _then; + + /// Create a copy of ProviderSubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? upload = null, + Object? download = null, + Object? total = null, + Object? expire = null, + }) { + return _then(_value.copyWith( + upload: null == upload + ? _value.upload + : upload // ignore: cast_nullable_to_non_nullable + as int, + download: null == download + ? _value.download + : download // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + expire: null == expire + ? _value.expire + : expire // ignore: cast_nullable_to_non_nullable + as int, + ) as $Val); + } +} + +/// @nodoc +abstract class _$$ProviderSubscriptionInfoImplCopyWith<$Res> + implements $ProviderSubscriptionInfoCopyWith<$Res> { + factory _$$ProviderSubscriptionInfoImplCopyWith( + _$ProviderSubscriptionInfoImpl value, + $Res Function(_$ProviderSubscriptionInfoImpl) then) = + __$$ProviderSubscriptionInfoImplCopyWithImpl<$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}); +} + +/// @nodoc +class __$$ProviderSubscriptionInfoImplCopyWithImpl<$Res> + extends _$ProviderSubscriptionInfoCopyWithImpl<$Res, + _$ProviderSubscriptionInfoImpl> + implements _$$ProviderSubscriptionInfoImplCopyWith<$Res> { + __$$ProviderSubscriptionInfoImplCopyWithImpl( + _$ProviderSubscriptionInfoImpl _value, + $Res Function(_$ProviderSubscriptionInfoImpl) _then) + : super(_value, _then); + + /// Create a copy of ProviderSubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @pragma('vm:prefer-inline') + @override + $Res call({ + Object? upload = null, + Object? download = null, + Object? total = null, + Object? expire = null, + }) { + return _then(_$ProviderSubscriptionInfoImpl( + upload: null == upload + ? _value.upload + : upload // ignore: cast_nullable_to_non_nullable + as int, + download: null == download + ? _value.download + : download // ignore: cast_nullable_to_non_nullable + as int, + total: null == total + ? _value.total + : total // ignore: cast_nullable_to_non_nullable + as int, + expire: null == expire + ? _value.expire + : expire // ignore: cast_nullable_to_non_nullable + as int, + )); + } +} + +/// @nodoc +@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}); + + factory _$ProviderSubscriptionInfoImpl.fromJson(Map json) => + _$$ProviderSubscriptionInfoImplFromJson(json); + + @override + @JsonKey(name: "UPLOAD") + final int upload; + @override + @JsonKey(name: "DOWNLOAD") + final int download; + @override + @JsonKey(name: "TOTAL") + final int total; + @override + @JsonKey(name: "EXPIRE") + final int expire; + + @override + String toString() { + return 'ProviderSubscriptionInfo(upload: $upload, download: $download, total: $total, expire: $expire)'; + } + + @override + bool operator ==(Object other) { + return identical(this, other) || + (other.runtimeType == runtimeType && + other is _$ProviderSubscriptionInfoImpl && + (identical(other.upload, upload) || other.upload == upload) && + (identical(other.download, download) || + other.download == download) && + (identical(other.total, total) || other.total == total) && + (identical(other.expire, expire) || other.expire == expire)); + } + + @JsonKey(includeFromJson: false, includeToJson: false) + @override + int get hashCode => Object.hash(runtimeType, upload, download, total, expire); + + /// Create a copy of ProviderSubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + @override + @pragma('vm:prefer-inline') + _$$ProviderSubscriptionInfoImplCopyWith<_$ProviderSubscriptionInfoImpl> + get copyWith => __$$ProviderSubscriptionInfoImplCopyWithImpl< + _$ProviderSubscriptionInfoImpl>(this, _$identity); + + @override + Map toJson() { + return _$$ProviderSubscriptionInfoImplToJson( + this, + ); + } +} + +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}) = + _$ProviderSubscriptionInfoImpl; + + factory _ProviderSubscriptionInfo.fromJson(Map json) = + _$ProviderSubscriptionInfoImpl.fromJson; + + @override + @JsonKey(name: "UPLOAD") + int get upload; + @override + @JsonKey(name: "DOWNLOAD") + int get download; + @override + @JsonKey(name: "TOTAL") + int get total; + @override + @JsonKey(name: "EXPIRE") + int get expire; + + /// Create a copy of ProviderSubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) + _$$ProviderSubscriptionInfoImplCopyWith<_$ProviderSubscriptionInfoImpl> + get copyWith => throw _privateConstructorUsedError; +} + ExternalProvider _$ExternalProviderFromJson(Map json) { return _ExternalProvider.fromJson(json); } @@ -2371,16 +2826,22 @@ ExternalProvider _$ExternalProviderFromJson(Map json) { mixin _$ExternalProvider { String get name => throw _privateConstructorUsedError; String get type => throw _privateConstructorUsedError; - String get path => throw _privateConstructorUsedError; + String? get path => throw _privateConstructorUsedError; int get count => throw _privateConstructorUsedError; + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + SubscriptionInfo? get subscriptionInfo => throw _privateConstructorUsedError; bool get isUpdating => throw _privateConstructorUsedError; @JsonKey(name: "vehicle-type") String get vehicleType => throw _privateConstructorUsedError; @JsonKey(name: "update-at") DateTime get updateAt => throw _privateConstructorUsedError; + /// Serializes this ExternalProvider to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ExternalProviderCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2394,11 +2855,15 @@ abstract class $ExternalProviderCopyWith<$Res> { $Res call( {String name, String type, - String path, + String? path, int count, + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + SubscriptionInfo? subscriptionInfo, bool isUpdating, @JsonKey(name: "vehicle-type") String vehicleType, @JsonKey(name: "update-at") DateTime updateAt}); + + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo; } /// @nodoc @@ -2411,13 +2876,16 @@ class _$ExternalProviderCopyWithImpl<$Res, $Val extends ExternalProvider> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? name = null, Object? type = null, - Object? path = null, + Object? path = freezed, Object? count = null, + Object? subscriptionInfo = freezed, Object? isUpdating = null, Object? vehicleType = null, Object? updateAt = null, @@ -2431,14 +2899,18 @@ class _$ExternalProviderCopyWithImpl<$Res, $Val extends ExternalProvider> ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: freezed == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String?, count: null == count ? _value.count : count // ignore: cast_nullable_to_non_nullable as int, + subscriptionInfo: freezed == subscriptionInfo + ? _value.subscriptionInfo + : subscriptionInfo // ignore: cast_nullable_to_non_nullable + as SubscriptionInfo?, isUpdating: null == isUpdating ? _value.isUpdating : isUpdating // ignore: cast_nullable_to_non_nullable @@ -2453,6 +2925,20 @@ class _$ExternalProviderCopyWithImpl<$Res, $Val extends ExternalProvider> as DateTime, ) as $Val); } + + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. + @override + @pragma('vm:prefer-inline') + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo { + if (_value.subscriptionInfo == null) { + return null; + } + + return $SubscriptionInfoCopyWith<$Res>(_value.subscriptionInfo!, (value) { + return _then(_value.copyWith(subscriptionInfo: value) as $Val); + }); + } } /// @nodoc @@ -2466,11 +2952,16 @@ abstract class _$$ExternalProviderImplCopyWith<$Res> $Res call( {String name, String type, - String path, + String? path, int count, + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + SubscriptionInfo? subscriptionInfo, bool isUpdating, @JsonKey(name: "vehicle-type") String vehicleType, @JsonKey(name: "update-at") DateTime updateAt}); + + @override + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo; } /// @nodoc @@ -2481,13 +2972,16 @@ class __$$ExternalProviderImplCopyWithImpl<$Res> $Res Function(_$ExternalProviderImpl) _then) : super(_value, _then); + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? name = null, Object? type = null, - Object? path = null, + Object? path = freezed, Object? count = null, + Object? subscriptionInfo = freezed, Object? isUpdating = null, Object? vehicleType = null, Object? updateAt = null, @@ -2501,14 +2995,18 @@ class __$$ExternalProviderImplCopyWithImpl<$Res> ? _value.type : type // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: freezed == path ? _value.path : path // ignore: cast_nullable_to_non_nullable - as String, + as String?, count: null == count ? _value.count : count // ignore: cast_nullable_to_non_nullable as int, + subscriptionInfo: freezed == subscriptionInfo + ? _value.subscriptionInfo + : subscriptionInfo // ignore: cast_nullable_to_non_nullable + as SubscriptionInfo?, isUpdating: null == isUpdating ? _value.isUpdating : isUpdating // ignore: cast_nullable_to_non_nullable @@ -2531,8 +3029,10 @@ class _$ExternalProviderImpl implements _ExternalProvider { const _$ExternalProviderImpl( {required this.name, required this.type, - required this.path, + this.path, required this.count, + @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}); @@ -2545,10 +3045,13 @@ class _$ExternalProviderImpl implements _ExternalProvider { @override final String type; @override - final String path; + final String? path; @override final int count; @override + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + final SubscriptionInfo? subscriptionInfo; + @override @JsonKey() final bool isUpdating; @override @@ -2560,7 +3063,7 @@ class _$ExternalProviderImpl implements _ExternalProvider { @override String toString() { - return 'ExternalProvider(name: $name, type: $type, path: $path, count: $count, isUpdating: $isUpdating, vehicleType: $vehicleType, updateAt: $updateAt)'; + return 'ExternalProvider(name: $name, type: $type, path: $path, count: $count, subscriptionInfo: $subscriptionInfo, isUpdating: $isUpdating, vehicleType: $vehicleType, updateAt: $updateAt)'; } @override @@ -2572,6 +3075,8 @@ class _$ExternalProviderImpl implements _ExternalProvider { (identical(other.type, type) || other.type == type) && (identical(other.path, path) || other.path == path) && (identical(other.count, count) || other.count == count) && + (identical(other.subscriptionInfo, subscriptionInfo) || + other.subscriptionInfo == subscriptionInfo) && (identical(other.isUpdating, isUpdating) || other.isUpdating == isUpdating) && (identical(other.vehicleType, vehicleType) || @@ -2580,12 +3085,14 @@ class _$ExternalProviderImpl implements _ExternalProvider { other.updateAt == updateAt)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override - int get hashCode => Object.hash( - runtimeType, name, type, path, count, isUpdating, vehicleType, updateAt); + int get hashCode => Object.hash(runtimeType, name, type, path, count, + subscriptionInfo, isUpdating, vehicleType, updateAt); - @JsonKey(ignore: true) + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ExternalProviderImplCopyWith<_$ExternalProviderImpl> get copyWith => @@ -2602,14 +3109,16 @@ class _$ExternalProviderImpl implements _ExternalProvider { abstract class _ExternalProvider implements ExternalProvider { const factory _ExternalProvider( - {required final String name, - required final String type, - required final String path, - required final int count, - final bool isUpdating, - @JsonKey(name: "vehicle-type") required final String vehicleType, - @JsonKey(name: "update-at") required final DateTime updateAt}) = - _$ExternalProviderImpl; + {required final String name, + required final String type, + final String? path, + required final int count, + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + final SubscriptionInfo? subscriptionInfo, + final bool isUpdating, + @JsonKey(name: "vehicle-type") required final String vehicleType, + @JsonKey(name: "update-at") + required final DateTime updateAt}) = _$ExternalProviderImpl; factory _ExternalProvider.fromJson(Map json) = _$ExternalProviderImpl.fromJson; @@ -2619,10 +3128,13 @@ abstract class _ExternalProvider implements ExternalProvider { @override String get type; @override - String get path; + String? get path; @override int get count; @override + @JsonKey(name: "subscription-info", fromJson: subscriptionInfoFormCore) + SubscriptionInfo? get subscriptionInfo; + @override bool get isUpdating; @override @JsonKey(name: "vehicle-type") @@ -2630,8 +3142,11 @@ abstract class _ExternalProvider implements ExternalProvider { @override @JsonKey(name: "update-at") DateTime get updateAt; + + /// Create a copy of ExternalProvider + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ExternalProviderImplCopyWith<_$ExternalProviderImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2650,8 +3165,12 @@ mixin _$TunProps { String get dns => throw _privateConstructorUsedError; String get dns6 => throw _privateConstructorUsedError; + /// Serializes this TunProps to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of TunProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $TunPropsCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2681,6 +3200,8 @@ class _$TunPropsCopyWithImpl<$Res, $Val extends TunProps> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of TunProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2751,6 +3272,8 @@ class __$$TunPropsImplCopyWithImpl<$Res> _$TunPropsImpl _value, $Res Function(_$TunPropsImpl) _then) : super(_value, _then); + /// Create a copy of TunProps + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2845,12 +3368,14 @@ class _$TunPropsImpl implements _TunProps { (identical(other.dns6, dns6) || other.dns6 == dns6)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, fd, gateway, gateway6, portal, portal6, dns, dns6); - @JsonKey(ignore: true) + /// Create a copy of TunProps + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$TunPropsImplCopyWith<_$TunPropsImpl> get copyWith => @@ -2891,8 +3416,11 @@ abstract class _TunProps implements TunProps { String get dns; @override String get dns6; + + /// Create a copy of TunProps + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$TunPropsImplCopyWith<_$TunPropsImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/generated/ffi.g.dart b/lib/models/generated/ffi.g.dart index cb4557a..8793a5e 100644 --- a/lib/models/generated/ffi.g.dart +++ b/lib/models/generated/ffi.g.dart @@ -19,6 +19,9 @@ _$CoreStateImpl _$$CoreStateImplFromJson(Map json) => bypassDomain: (json['bypassDomain'] as List) .map((e) => e as String) .toList(), + routeAddress: (json['routeAddress'] as List) + .map((e) => e as String) + .toList(), ipv6: json['ipv6'] as bool, onlyProxy: json['onlyProxy'] as bool, ); @@ -31,6 +34,7 @@ Map _$$CoreStateImplToJson(_$CoreStateImpl instance) => 'allowBypass': instance.allowBypass, 'systemProxy': instance.systemProxy, 'bypassDomain': instance.bypassDomain, + 'routeAddress': instance.routeAddress, 'ipv6': instance.ipv6, 'onlyProxy': instance.onlyProxy, }; @@ -51,6 +55,9 @@ _$AndroidVpnOptionsImpl _$$AndroidVpnOptionsImplFromJson( .toList(), ipv4Address: json['ipv4Address'] as String, ipv6Address: json['ipv6Address'] as String, + routeAddress: (json['routeAddress'] as List) + .map((e) => e as String) + .toList(), dnsServerAddress: json['dnsServerAddress'] as String, ); @@ -65,6 +72,7 @@ Map _$$AndroidVpnOptionsImplToJson( 'bypassDomain': instance.bypassDomain, 'ipv4Address': instance.ipv4Address, 'ipv6Address': instance.ipv6Address, + 'routeAddress': instance.routeAddress, 'dnsServerAddress': instance.dnsServerAddress, }; @@ -215,13 +223,33 @@ Map _$$ProcessMapItemImplToJson( 'value': instance.value, }; +_$ProviderSubscriptionInfoImpl _$$ProviderSubscriptionInfoImplFromJson( + Map json) => + _$ProviderSubscriptionInfoImpl( + upload: (json['UPLOAD'] as num?)?.toInt() ?? 0, + download: (json['DOWNLOAD'] as num?)?.toInt() ?? 0, + total: (json['TOTAL'] as num?)?.toInt() ?? 0, + expire: (json['EXPIRE'] as num?)?.toInt() ?? 0, + ); + +Map _$$ProviderSubscriptionInfoImplToJson( + _$ProviderSubscriptionInfoImpl instance) => + { + 'UPLOAD': instance.upload, + 'DOWNLOAD': instance.download, + 'TOTAL': instance.total, + 'EXPIRE': instance.expire, + }; + _$ExternalProviderImpl _$$ExternalProviderImplFromJson( Map json) => _$ExternalProviderImpl( name: json['name'] as String, type: json['type'] as String, - path: json['path'] as String, + path: json['path'] as String?, count: (json['count'] as num).toInt(), + subscriptionInfo: subscriptionInfoFormCore( + json['subscription-info'] as Map?), isUpdating: json['isUpdating'] as bool? ?? false, vehicleType: json['vehicle-type'] as String, updateAt: DateTime.parse(json['update-at'] as String), @@ -234,6 +262,7 @@ Map _$$ExternalProviderImplToJson( 'type': instance.type, 'path': instance.path, 'count': instance.count, + 'subscription-info': instance.subscriptionInfo, 'isUpdating': instance.isUpdating, 'vehicle-type': instance.vehicleType, 'update-at': instance.updateAt.toIso8601String(), diff --git a/lib/models/generated/profile.freezed.dart b/lib/models/generated/profile.freezed.dart index 7263cc0..0dc3aca 100644 --- a/lib/models/generated/profile.freezed.dart +++ b/lib/models/generated/profile.freezed.dart @@ -14,41 +14,48 @@ T _$identity(T value) => value; final _privateConstructorUsedError = UnsupportedError( 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models'); -UserInfo _$UserInfoFromJson(Map json) { - return _UserInfo.fromJson(json); +SubscriptionInfo _$SubscriptionInfoFromJson(Map json) { + return _SubscriptionInfo.fromJson(json); } /// @nodoc -mixin _$UserInfo { +mixin _$SubscriptionInfo { int get upload => throw _privateConstructorUsedError; int get download => throw _privateConstructorUsedError; int get total => throw _privateConstructorUsedError; int get expire => throw _privateConstructorUsedError; + /// Serializes this SubscriptionInfo to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) - $UserInfoCopyWith get copyWith => + + /// Create a copy of SubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) + $SubscriptionInfoCopyWith get copyWith => throw _privateConstructorUsedError; } /// @nodoc -abstract class $UserInfoCopyWith<$Res> { - factory $UserInfoCopyWith(UserInfo value, $Res Function(UserInfo) then) = - _$UserInfoCopyWithImpl<$Res, UserInfo>; +abstract class $SubscriptionInfoCopyWith<$Res> { + factory $SubscriptionInfoCopyWith( + SubscriptionInfo value, $Res Function(SubscriptionInfo) then) = + _$SubscriptionInfoCopyWithImpl<$Res, SubscriptionInfo>; @useResult $Res call({int upload, int download, int total, int expire}); } /// @nodoc -class _$UserInfoCopyWithImpl<$Res, $Val extends UserInfo> - implements $UserInfoCopyWith<$Res> { - _$UserInfoCopyWithImpl(this._value, this._then); +class _$SubscriptionInfoCopyWithImpl<$Res, $Val extends SubscriptionInfo> + implements $SubscriptionInfoCopyWith<$Res> { + _$SubscriptionInfoCopyWithImpl(this._value, this._then); // ignore: unused_field final $Val _value; // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of SubscriptionInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -79,24 +86,26 @@ class _$UserInfoCopyWithImpl<$Res, $Val extends UserInfo> } /// @nodoc -abstract class _$$UserInfoImplCopyWith<$Res> - implements $UserInfoCopyWith<$Res> { - factory _$$UserInfoImplCopyWith( - _$UserInfoImpl value, $Res Function(_$UserInfoImpl) then) = - __$$UserInfoImplCopyWithImpl<$Res>; +abstract class _$$SubscriptionInfoImplCopyWith<$Res> + implements $SubscriptionInfoCopyWith<$Res> { + factory _$$SubscriptionInfoImplCopyWith(_$SubscriptionInfoImpl value, + $Res Function(_$SubscriptionInfoImpl) then) = + __$$SubscriptionInfoImplCopyWithImpl<$Res>; @override @useResult $Res call({int upload, int download, int total, int expire}); } /// @nodoc -class __$$UserInfoImplCopyWithImpl<$Res> - extends _$UserInfoCopyWithImpl<$Res, _$UserInfoImpl> - implements _$$UserInfoImplCopyWith<$Res> { - __$$UserInfoImplCopyWithImpl( - _$UserInfoImpl _value, $Res Function(_$UserInfoImpl) _then) +class __$$SubscriptionInfoImplCopyWithImpl<$Res> + extends _$SubscriptionInfoCopyWithImpl<$Res, _$SubscriptionInfoImpl> + implements _$$SubscriptionInfoImplCopyWith<$Res> { + __$$SubscriptionInfoImplCopyWithImpl(_$SubscriptionInfoImpl _value, + $Res Function(_$SubscriptionInfoImpl) _then) : super(_value, _then); + /// Create a copy of SubscriptionInfo + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -105,7 +114,7 @@ class __$$UserInfoImplCopyWithImpl<$Res> Object? total = null, Object? expire = null, }) { - return _then(_$UserInfoImpl( + return _then(_$SubscriptionInfoImpl( upload: null == upload ? _value.upload : upload // ignore: cast_nullable_to_non_nullable @@ -128,12 +137,12 @@ class __$$UserInfoImplCopyWithImpl<$Res> /// @nodoc @JsonSerializable() -class _$UserInfoImpl implements _UserInfo { - const _$UserInfoImpl( +class _$SubscriptionInfoImpl implements _SubscriptionInfo { + const _$SubscriptionInfoImpl( {this.upload = 0, this.download = 0, this.total = 0, this.expire = 0}); - factory _$UserInfoImpl.fromJson(Map json) => - _$$UserInfoImplFromJson(json); + factory _$SubscriptionInfoImpl.fromJson(Map json) => + _$$SubscriptionInfoImplFromJson(json); @override @JsonKey() @@ -150,14 +159,14 @@ class _$UserInfoImpl implements _UserInfo { @override String toString() { - return 'UserInfo(upload: $upload, download: $download, total: $total, expire: $expire)'; + return 'SubscriptionInfo(upload: $upload, download: $download, total: $total, expire: $expire)'; } @override bool operator ==(Object other) { return identical(this, other) || (other.runtimeType == runtimeType && - other is _$UserInfoImpl && + other is _$SubscriptionInfoImpl && (identical(other.upload, upload) || other.upload == upload) && (identical(other.download, download) || other.download == download) && @@ -165,33 +174,36 @@ class _$UserInfoImpl implements _UserInfo { (identical(other.expire, expire) || other.expire == expire)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash(runtimeType, upload, download, total, expire); - @JsonKey(ignore: true) + /// Create a copy of SubscriptionInfo + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') - _$$UserInfoImplCopyWith<_$UserInfoImpl> get copyWith => - __$$UserInfoImplCopyWithImpl<_$UserInfoImpl>(this, _$identity); + _$$SubscriptionInfoImplCopyWith<_$SubscriptionInfoImpl> get copyWith => + __$$SubscriptionInfoImplCopyWithImpl<_$SubscriptionInfoImpl>( + this, _$identity); @override Map toJson() { - return _$$UserInfoImplToJson( + return _$$SubscriptionInfoImplToJson( this, ); } } -abstract class _UserInfo implements UserInfo { - const factory _UserInfo( +abstract class _SubscriptionInfo implements SubscriptionInfo { + const factory _SubscriptionInfo( {final int upload, final int download, final int total, - final int expire}) = _$UserInfoImpl; + final int expire}) = _$SubscriptionInfoImpl; - factory _UserInfo.fromJson(Map json) = - _$UserInfoImpl.fromJson; + factory _SubscriptionInfo.fromJson(Map json) = + _$SubscriptionInfoImpl.fromJson; @override int get upload; @@ -201,9 +213,12 @@ abstract class _UserInfo implements UserInfo { int get total; @override int get expire; + + /// Create a copy of SubscriptionInfo + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) - _$$UserInfoImplCopyWith<_$UserInfoImpl> get copyWith => + @JsonKey(includeFromJson: false, includeToJson: false) + _$$SubscriptionInfoImplCopyWith<_$SubscriptionInfoImpl> get copyWith => throw _privateConstructorUsedError; } @@ -219,15 +234,19 @@ mixin _$Profile { String get url => throw _privateConstructorUsedError; DateTime? get lastUpdateDate => throw _privateConstructorUsedError; Duration get autoUpdateDuration => throw _privateConstructorUsedError; - UserInfo? get userInfo => throw _privateConstructorUsedError; + SubscriptionInfo? get subscriptionInfo => throw _privateConstructorUsedError; bool get autoUpdate => throw _privateConstructorUsedError; Map get selectedMap => throw _privateConstructorUsedError; Set get unfoldSet => throw _privateConstructorUsedError; @JsonKey(includeToJson: false, includeFromJson: false) bool get isUpdating => throw _privateConstructorUsedError; + /// Serializes this Profile to a JSON map. Map toJson() => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProfileCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -243,13 +262,13 @@ abstract class $ProfileCopyWith<$Res> { String url, DateTime? lastUpdateDate, Duration autoUpdateDuration, - UserInfo? userInfo, + SubscriptionInfo? subscriptionInfo, bool autoUpdate, Map selectedMap, Set unfoldSet, @JsonKey(includeToJson: false, includeFromJson: false) bool isUpdating}); - $UserInfoCopyWith<$Res>? get userInfo; + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo; } /// @nodoc @@ -262,6 +281,8 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -271,7 +292,7 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> Object? url = null, Object? lastUpdateDate = freezed, Object? autoUpdateDuration = null, - Object? userInfo = freezed, + Object? subscriptionInfo = freezed, Object? autoUpdate = null, Object? selectedMap = null, Object? unfoldSet = null, @@ -302,10 +323,10 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> ? _value.autoUpdateDuration : autoUpdateDuration // ignore: cast_nullable_to_non_nullable as Duration, - userInfo: freezed == userInfo - ? _value.userInfo - : userInfo // ignore: cast_nullable_to_non_nullable - as UserInfo?, + subscriptionInfo: freezed == subscriptionInfo + ? _value.subscriptionInfo + : subscriptionInfo // ignore: cast_nullable_to_non_nullable + as SubscriptionInfo?, autoUpdate: null == autoUpdate ? _value.autoUpdate : autoUpdate // ignore: cast_nullable_to_non_nullable @@ -325,15 +346,17 @@ class _$ProfileCopyWithImpl<$Res, $Val extends Profile> ) as $Val); } + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') - $UserInfoCopyWith<$Res>? get userInfo { - if (_value.userInfo == null) { + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo { + if (_value.subscriptionInfo == null) { return null; } - return $UserInfoCopyWith<$Res>(_value.userInfo!, (value) { - return _then(_value.copyWith(userInfo: value) as $Val); + return $SubscriptionInfoCopyWith<$Res>(_value.subscriptionInfo!, (value) { + return _then(_value.copyWith(subscriptionInfo: value) as $Val); }); } } @@ -352,14 +375,14 @@ abstract class _$$ProfileImplCopyWith<$Res> implements $ProfileCopyWith<$Res> { String url, DateTime? lastUpdateDate, Duration autoUpdateDuration, - UserInfo? userInfo, + SubscriptionInfo? subscriptionInfo, bool autoUpdate, Map selectedMap, Set unfoldSet, @JsonKey(includeToJson: false, includeFromJson: false) bool isUpdating}); @override - $UserInfoCopyWith<$Res>? get userInfo; + $SubscriptionInfoCopyWith<$Res>? get subscriptionInfo; } /// @nodoc @@ -370,6 +393,8 @@ class __$$ProfileImplCopyWithImpl<$Res> _$ProfileImpl _value, $Res Function(_$ProfileImpl) _then) : super(_value, _then); + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -379,7 +404,7 @@ class __$$ProfileImplCopyWithImpl<$Res> Object? url = null, Object? lastUpdateDate = freezed, Object? autoUpdateDuration = null, - Object? userInfo = freezed, + Object? subscriptionInfo = freezed, Object? autoUpdate = null, Object? selectedMap = null, Object? unfoldSet = null, @@ -410,10 +435,10 @@ class __$$ProfileImplCopyWithImpl<$Res> ? _value.autoUpdateDuration : autoUpdateDuration // ignore: cast_nullable_to_non_nullable as Duration, - userInfo: freezed == userInfo - ? _value.userInfo - : userInfo // ignore: cast_nullable_to_non_nullable - as UserInfo?, + subscriptionInfo: freezed == subscriptionInfo + ? _value.subscriptionInfo + : subscriptionInfo // ignore: cast_nullable_to_non_nullable + as SubscriptionInfo?, autoUpdate: null == autoUpdate ? _value.autoUpdate : autoUpdate // ignore: cast_nullable_to_non_nullable @@ -444,7 +469,7 @@ class _$ProfileImpl implements _Profile { this.url = "", this.lastUpdateDate, required this.autoUpdateDuration, - this.userInfo, + this.subscriptionInfo, this.autoUpdate = true, final Map selectedMap = const {}, final Set unfoldSet = const {}, @@ -470,7 +495,7 @@ class _$ProfileImpl implements _Profile { @override final Duration autoUpdateDuration; @override - final UserInfo? userInfo; + final SubscriptionInfo? subscriptionInfo; @override @JsonKey() final bool autoUpdate; @@ -498,7 +523,7 @@ class _$ProfileImpl implements _Profile { @override String toString() { - return 'Profile(id: $id, label: $label, currentGroupName: $currentGroupName, url: $url, lastUpdateDate: $lastUpdateDate, autoUpdateDuration: $autoUpdateDuration, userInfo: $userInfo, autoUpdate: $autoUpdate, selectedMap: $selectedMap, unfoldSet: $unfoldSet, isUpdating: $isUpdating)'; + return 'Profile(id: $id, label: $label, currentGroupName: $currentGroupName, url: $url, lastUpdateDate: $lastUpdateDate, autoUpdateDuration: $autoUpdateDuration, subscriptionInfo: $subscriptionInfo, autoUpdate: $autoUpdate, selectedMap: $selectedMap, unfoldSet: $unfoldSet, isUpdating: $isUpdating)'; } @override @@ -515,8 +540,8 @@ class _$ProfileImpl implements _Profile { other.lastUpdateDate == lastUpdateDate) && (identical(other.autoUpdateDuration, autoUpdateDuration) || other.autoUpdateDuration == autoUpdateDuration) && - (identical(other.userInfo, userInfo) || - other.userInfo == userInfo) && + (identical(other.subscriptionInfo, subscriptionInfo) || + other.subscriptionInfo == subscriptionInfo) && (identical(other.autoUpdate, autoUpdate) || other.autoUpdate == autoUpdate) && const DeepCollectionEquality() @@ -527,7 +552,7 @@ class _$ProfileImpl implements _Profile { other.isUpdating == isUpdating)); } - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) @override int get hashCode => Object.hash( runtimeType, @@ -537,13 +562,15 @@ class _$ProfileImpl implements _Profile { url, lastUpdateDate, autoUpdateDuration, - userInfo, + subscriptionInfo, autoUpdate, const DeepCollectionEquality().hash(_selectedMap), const DeepCollectionEquality().hash(_unfoldSet), isUpdating); - @JsonKey(ignore: true) + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => @@ -565,7 +592,7 @@ abstract class _Profile implements Profile { final String url, final DateTime? lastUpdateDate, required final Duration autoUpdateDuration, - final UserInfo? userInfo, + final SubscriptionInfo? subscriptionInfo, final bool autoUpdate, final Map selectedMap, final Set unfoldSet, @@ -587,7 +614,7 @@ abstract class _Profile implements Profile { @override Duration get autoUpdateDuration; @override - UserInfo? get userInfo; + SubscriptionInfo? get subscriptionInfo; @override bool get autoUpdate; @override @@ -597,8 +624,11 @@ abstract class _Profile implements Profile { @override @JsonKey(includeToJson: false, includeFromJson: false) bool get isUpdating; + + /// Create a copy of Profile + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfileImplCopyWith<_$ProfileImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/generated/profile.g.dart b/lib/models/generated/profile.g.dart index 5741d26..ac8f926 100644 --- a/lib/models/generated/profile.g.dart +++ b/lib/models/generated/profile.g.dart @@ -6,15 +6,17 @@ part of '../profile.dart'; // JsonSerializableGenerator // ************************************************************************** -_$UserInfoImpl _$$UserInfoImplFromJson(Map json) => - _$UserInfoImpl( +_$SubscriptionInfoImpl _$$SubscriptionInfoImplFromJson( + Map json) => + _$SubscriptionInfoImpl( upload: (json['upload'] as num?)?.toInt() ?? 0, download: (json['download'] as num?)?.toInt() ?? 0, total: (json['total'] as num?)?.toInt() ?? 0, expire: (json['expire'] as num?)?.toInt() ?? 0, ); -Map _$$UserInfoImplToJson(_$UserInfoImpl instance) => +Map _$$SubscriptionInfoImplToJson( + _$SubscriptionInfoImpl instance) => { 'upload': instance.upload, 'download': instance.download, @@ -33,9 +35,10 @@ _$ProfileImpl _$$ProfileImplFromJson(Map json) => : DateTime.parse(json['lastUpdateDate'] as String), autoUpdateDuration: Duration(microseconds: (json['autoUpdateDuration'] as num).toInt()), - userInfo: json['userInfo'] == null + subscriptionInfo: json['subscriptionInfo'] == null ? null - : UserInfo.fromJson(json['userInfo'] as Map), + : SubscriptionInfo.fromJson( + json['subscriptionInfo'] as Map), autoUpdate: json['autoUpdate'] as bool? ?? true, selectedMap: (json['selectedMap'] as Map?)?.map( (k, e) => MapEntry(k, e as String), @@ -55,7 +58,7 @@ Map _$$ProfileImplToJson(_$ProfileImpl instance) => 'url': instance.url, 'lastUpdateDate': instance.lastUpdateDate?.toIso8601String(), 'autoUpdateDuration': instance.autoUpdateDuration.inMicroseconds, - 'userInfo': instance.userInfo, + 'subscriptionInfo': instance.subscriptionInfo, 'autoUpdate': instance.autoUpdate, 'selectedMap': instance.selectedMap, 'unfoldSet': instance.unfoldSet.toList(), diff --git a/lib/models/generated/selector.freezed.dart b/lib/models/generated/selector.freezed.dart index b3dad0b..5fcfb78 100644 --- a/lib/models/generated/selector.freezed.dart +++ b/lib/models/generated/selector.freezed.dart @@ -19,7 +19,9 @@ mixin _$StartButtonSelectorState { bool get isInit => throw _privateConstructorUsedError; bool get hasProfile => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of StartButtonSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $StartButtonSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -44,6 +46,8 @@ class _$StartButtonSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of StartButtonSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -85,6 +89,8 @@ class __$$StartButtonSelectorStateImplCopyWithImpl<$Res> $Res Function(_$StartButtonSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of StartButtonSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -133,7 +139,9 @@ class _$StartButtonSelectorStateImpl implements _StartButtonSelectorState { @override int get hashCode => Object.hash(runtimeType, isInit, hasProfile); - @JsonKey(ignore: true) + /// Create a copy of StartButtonSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$StartButtonSelectorStateImplCopyWith<_$StartButtonSelectorStateImpl> @@ -150,8 +158,11 @@ abstract class _StartButtonSelectorState implements StartButtonSelectorState { bool get isInit; @override bool get hasProfile; + + /// Create a copy of StartButtonSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$StartButtonSelectorStateImplCopyWith<_$StartButtonSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -161,7 +172,9 @@ mixin _$CheckIpSelectorState { String? get currentProfileId => throw _privateConstructorUsedError; Map get selectedMap => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of CheckIpSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $CheckIpSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -186,6 +199,8 @@ class _$CheckIpSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of CheckIpSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -224,6 +239,8 @@ class __$$CheckIpSelectorStateImplCopyWithImpl<$Res> $Res Function(_$CheckIpSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of CheckIpSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -281,7 +298,9 @@ class _$CheckIpSelectorStateImpl implements _CheckIpSelectorState { int get hashCode => Object.hash(runtimeType, currentProfileId, const DeepCollectionEquality().hash(_selectedMap)); - @JsonKey(ignore: true) + /// Create a copy of CheckIpSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$CheckIpSelectorStateImplCopyWith<_$CheckIpSelectorStateImpl> @@ -300,8 +319,11 @@ abstract class _CheckIpSelectorState implements CheckIpSelectorState { String? get currentProfileId; @override Map get selectedMap; + + /// Create a copy of CheckIpSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$CheckIpSelectorStateImplCopyWith<_$CheckIpSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -311,7 +333,9 @@ mixin _$NetworkDetectionSelectorState { String? get currentProxyName => throw _privateConstructorUsedError; int? get delay => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of NetworkDetectionSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $NetworkDetectionSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -338,6 +362,8 @@ class _$NetworkDetectionSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of NetworkDetectionSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -379,6 +405,8 @@ class __$$NetworkDetectionSelectorStateImplCopyWithImpl<$Res> $Res Function(_$NetworkDetectionSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of NetworkDetectionSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -428,7 +456,9 @@ class _$NetworkDetectionSelectorStateImpl @override int get hashCode => Object.hash(runtimeType, currentProxyName, delay); - @JsonKey(ignore: true) + /// Create a copy of NetworkDetectionSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NetworkDetectionSelectorStateImplCopyWith< @@ -447,8 +477,11 @@ abstract class _NetworkDetectionSelectorState String? get currentProxyName; @override int? get delay; + + /// Create a copy of NetworkDetectionSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$NetworkDetectionSelectorStateImplCopyWith< _$NetworkDetectionSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; @@ -460,7 +493,9 @@ mixin _$ProfilesSelectorState { String? get currentProfileId => throw _privateConstructorUsedError; int get columns => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProfilesSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProfilesSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -485,6 +520,8 @@ class _$ProfilesSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProfilesSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -530,6 +567,8 @@ class __$$ProfilesSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProfilesSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProfilesSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -599,7 +638,9 @@ class _$ProfilesSelectorStateImpl implements _ProfilesSelectorState { currentProfileId, columns); - @JsonKey(ignore: true) + /// Create a copy of ProfilesSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProfilesSelectorStateImplCopyWith<_$ProfilesSelectorStateImpl> @@ -619,8 +660,11 @@ abstract class _ProfilesSelectorState implements ProfilesSelectorState { String? get currentProfileId; @override int get columns; + + /// Create a copy of ProfilesSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProfilesSelectorStateImplCopyWith<_$ProfilesSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -630,7 +674,9 @@ mixin _$NetworkDetectionState { bool get isTesting => throw _privateConstructorUsedError; IpInfo? get ipInfo => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of NetworkDetectionState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $NetworkDetectionStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -655,6 +701,8 @@ class _$NetworkDetectionStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of NetworkDetectionState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -695,6 +743,8 @@ class __$$NetworkDetectionStateImplCopyWithImpl<$Res> $Res Function(_$NetworkDetectionStateImpl) _then) : super(_value, _then); + /// Create a copy of NetworkDetectionState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -743,7 +793,9 @@ class _$NetworkDetectionStateImpl implements _NetworkDetectionState { @override int get hashCode => Object.hash(runtimeType, isTesting, ipInfo); - @JsonKey(ignore: true) + /// Create a copy of NetworkDetectionState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$NetworkDetectionStateImplCopyWith<_$NetworkDetectionStateImpl> @@ -760,8 +812,11 @@ abstract class _NetworkDetectionState implements NetworkDetectionState { bool get isTesting; @override IpInfo? get ipInfo; + + /// Create a copy of NetworkDetectionState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$NetworkDetectionStateImplCopyWith<_$NetworkDetectionStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -774,7 +829,9 @@ mixin _$ApplicationSelectorState { bool get prueBlack => throw _privateConstructorUsedError; FontFamily get fontFamily => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ApplicationSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ApplicationSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -804,6 +861,8 @@ class _$ApplicationSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ApplicationSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -865,6 +924,8 @@ class __$$ApplicationSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ApplicationSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ApplicationSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -945,7 +1006,9 @@ class _$ApplicationSelectorStateImpl implements _ApplicationSelectorState { int get hashCode => Object.hash( runtimeType, locale, themeMode, primaryColor, prueBlack, fontFamily); - @JsonKey(ignore: true) + /// Create a copy of ApplicationSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ApplicationSelectorStateImplCopyWith<_$ApplicationSelectorStateImpl> @@ -971,8 +1034,11 @@ abstract class _ApplicationSelectorState implements ApplicationSelectorState { bool get prueBlack; @override FontFamily get fontFamily; + + /// Create a copy of ApplicationSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ApplicationSelectorStateImplCopyWith<_$ApplicationSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -988,7 +1054,9 @@ mixin _$TrayState { String? get locale => throw _privateConstructorUsedError; Brightness? get brightness => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of TrayState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $TrayStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1019,6 +1087,8 @@ class _$TrayStateCopyWithImpl<$Res, $Val extends TrayState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of TrayState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1095,6 +1165,8 @@ class __$$TrayStateImplCopyWithImpl<$Res> _$TrayStateImpl _value, $Res Function(_$TrayStateImpl) _then) : super(_value, _then); + /// Create a copy of TrayState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1203,7 +1275,9 @@ class _$TrayStateImpl implements _TrayState { int get hashCode => Object.hash(runtimeType, mode, autoLaunch, adminAutoLaunch, systemProxy, tunEnable, isStart, locale, brightness); - @JsonKey(ignore: true) + /// Create a copy of TrayState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$TrayStateImplCopyWith<_$TrayStateImpl> get copyWith => @@ -1237,8 +1311,11 @@ abstract class _TrayState implements TrayState { String? get locale; @override Brightness? get brightness; + + /// Create a copy of TrayState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$TrayStateImplCopyWith<_$TrayStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1248,7 +1325,9 @@ mixin _$UpdateNavigationsSelector { bool get openLogs => throw _privateConstructorUsedError; bool get hasProxies => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of UpdateNavigationsSelector + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $UpdateNavigationsSelectorCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1273,6 +1352,8 @@ class _$UpdateNavigationsSelectorCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of UpdateNavigationsSelector + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1314,6 +1395,8 @@ class __$$UpdateNavigationsSelectorImplCopyWithImpl<$Res> $Res Function(_$UpdateNavigationsSelectorImpl) _then) : super(_value, _then); + /// Create a copy of UpdateNavigationsSelector + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1363,7 +1446,9 @@ class _$UpdateNavigationsSelectorImpl implements _UpdateNavigationsSelector { @override int get hashCode => Object.hash(runtimeType, openLogs, hasProxies); - @JsonKey(ignore: true) + /// Create a copy of UpdateNavigationsSelector + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$UpdateNavigationsSelectorImplCopyWith<_$UpdateNavigationsSelectorImpl> @@ -1380,8 +1465,11 @@ abstract class _UpdateNavigationsSelector implements UpdateNavigationsSelector { bool get openLogs; @override bool get hasProxies; + + /// Create a copy of UpdateNavigationsSelector + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$UpdateNavigationsSelectorImplCopyWith<_$UpdateNavigationsSelectorImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1394,7 +1482,9 @@ mixin _$HomeState { ViewMode get viewMode => throw _privateConstructorUsedError; String? get locale => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of HomeState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $HomeStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1421,6 +1511,8 @@ class _$HomeStateCopyWithImpl<$Res, $Val extends HomeState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of HomeState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1473,6 +1565,8 @@ class __$$HomeStateImplCopyWithImpl<$Res> _$HomeStateImpl _value, $Res Function(_$HomeStateImpl) _then) : super(_value, _then); + /// Create a copy of HomeState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1550,7 +1644,9 @@ class _$HomeStateImpl implements _HomeState { int get hashCode => Object.hash(runtimeType, currentLabel, const DeepCollectionEquality().hash(_navigationItems), viewMode, locale); - @JsonKey(ignore: true) + /// Create a copy of HomeState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$HomeStateImplCopyWith<_$HomeStateImpl> get copyWith => @@ -1572,8 +1668,11 @@ abstract class _HomeState implements HomeState { ViewMode get viewMode; @override String? get locale; + + /// Create a copy of HomeState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$HomeStateImplCopyWith<_$HomeStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1582,7 +1681,9 @@ abstract class _HomeState implements HomeState { mixin _$ProxiesCardSelectorState { bool get isSelected => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxiesCardSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesCardSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1607,6 +1708,8 @@ class _$ProxiesCardSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesCardSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1643,6 +1746,8 @@ class __$$ProxiesCardSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProxiesCardSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesCardSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1682,7 +1787,9 @@ class _$ProxiesCardSelectorStateImpl implements _ProxiesCardSelectorState { @override int get hashCode => Object.hash(runtimeType, isSelected); - @JsonKey(ignore: true) + /// Create a copy of ProxiesCardSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesCardSelectorStateImplCopyWith<_$ProxiesCardSelectorStateImpl> @@ -1696,8 +1803,11 @@ abstract class _ProxiesCardSelectorState implements ProxiesCardSelectorState { @override bool get isSelected; + + /// Create a copy of ProxiesCardSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesCardSelectorStateImplCopyWith<_$ProxiesCardSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1707,7 +1817,9 @@ mixin _$ProxiesSelectorState { List get groupNames => throw _privateConstructorUsedError; String? get currentGroupName => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxiesSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1732,6 +1844,8 @@ class _$ProxiesSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1770,6 +1884,8 @@ class __$$ProxiesSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProxiesSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1827,7 +1943,9 @@ class _$ProxiesSelectorStateImpl implements _ProxiesSelectorState { int get hashCode => Object.hash(runtimeType, const DeepCollectionEquality().hash(_groupNames), currentGroupName); - @JsonKey(ignore: true) + /// Create a copy of ProxiesSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesSelectorStateImplCopyWith<_$ProxiesSelectorStateImpl> @@ -1845,8 +1963,11 @@ abstract class _ProxiesSelectorState implements ProxiesSelectorState { List get groupNames; @override String? get currentGroupName; + + /// Create a copy of ProxiesSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesSelectorStateImplCopyWith<_$ProxiesSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -1860,7 +1981,9 @@ mixin _$ProxiesListSelectorState { num get sortNum => throw _privateConstructorUsedError; int get columns => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxiesListSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesListSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -1891,6 +2014,8 @@ class _$ProxiesListSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesListSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -1958,6 +2083,8 @@ class __$$ProxiesListSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProxiesListSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesListSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2067,7 +2194,9 @@ class _$ProxiesListSelectorStateImpl implements _ProxiesListSelectorState { sortNum, columns); - @JsonKey(ignore: true) + /// Create a copy of ProxiesListSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesListSelectorStateImplCopyWith<_$ProxiesListSelectorStateImpl> @@ -2096,8 +2225,11 @@ abstract class _ProxiesListSelectorState implements ProxiesListSelectorState { num get sortNum; @override int get columns; + + /// Create a copy of ProxiesListSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesListSelectorStateImplCopyWith<_$ProxiesListSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2111,7 +2243,9 @@ mixin _$ProxyGroupSelectorState { List get proxies => throw _privateConstructorUsedError; int get columns => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxyGroupSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxyGroupSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2142,6 +2276,8 @@ class _$ProxyGroupSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxyGroupSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2209,6 +2345,8 @@ class __$$ProxyGroupSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProxyGroupSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxyGroupSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2310,7 +2448,9 @@ class _$ProxyGroupSelectorStateImpl implements _ProxyGroupSelectorState { const DeepCollectionEquality().hash(_proxies), columns); - @JsonKey(ignore: true) + /// Create a copy of ProxyGroupSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxyGroupSelectorStateImplCopyWith<_$ProxyGroupSelectorStateImpl> @@ -2339,8 +2479,11 @@ abstract class _ProxyGroupSelectorState implements ProxyGroupSelectorState { List get proxies; @override int get columns; + + /// Create a copy of ProxyGroupSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxyGroupSelectorStateImplCopyWith<_$ProxyGroupSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2350,7 +2493,9 @@ mixin _$MoreToolsSelectorState { List get navigationItems => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of MoreToolsSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $MoreToolsSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2375,6 +2520,8 @@ class _$MoreToolsSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of MoreToolsSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2411,6 +2558,8 @@ class __$$MoreToolsSelectorStateImplCopyWithImpl<$Res> $Res Function(_$MoreToolsSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of MoreToolsSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2458,7 +2607,9 @@ class _$MoreToolsSelectorStateImpl implements _MoreToolsSelectorState { int get hashCode => Object.hash( runtimeType, const DeepCollectionEquality().hash(_navigationItems)); - @JsonKey(ignore: true) + /// Create a copy of MoreToolsSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$MoreToolsSelectorStateImplCopyWith<_$MoreToolsSelectorStateImpl> @@ -2473,8 +2624,11 @@ abstract class _MoreToolsSelectorState implements MoreToolsSelectorState { @override List get navigationItems; + + /// Create a copy of MoreToolsSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$MoreToolsSelectorStateImplCopyWith<_$MoreToolsSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2485,7 +2639,9 @@ mixin _$PackageListSelectorState { AccessControl get accessControl => throw _privateConstructorUsedError; bool get isAccessControl => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $PackageListSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2515,6 +2671,8 @@ class _$PackageListSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2538,6 +2696,8 @@ class _$PackageListSelectorStateCopyWithImpl<$Res, ) as $Val); } + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AccessControlCopyWith<$Res> get accessControl { @@ -2575,6 +2735,8 @@ class __$$PackageListSelectorStateImplCopyWithImpl<$Res> $Res Function(_$PackageListSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2645,7 +2807,9 @@ class _$PackageListSelectorStateImpl implements _PackageListSelectorState { accessControl, isAccessControl); - @JsonKey(ignore: true) + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$PackageListSelectorStateImplCopyWith<_$PackageListSelectorStateImpl> @@ -2665,8 +2829,11 @@ abstract class _PackageListSelectorState implements PackageListSelectorState { AccessControl get accessControl; @override bool get isAccessControl; + + /// Create a copy of PackageListSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$PackageListSelectorStateImplCopyWith<_$PackageListSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2676,7 +2843,9 @@ mixin _$ProxiesListHeaderSelectorState { double get offset => throw _privateConstructorUsedError; int get currentIndex => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxiesListHeaderSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesListHeaderSelectorStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2703,6 +2872,8 @@ class _$ProxiesListHeaderSelectorStateCopyWithImpl<$Res, // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesListHeaderSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2744,6 +2915,8 @@ class __$$ProxiesListHeaderSelectorStateImplCopyWithImpl<$Res> $Res Function(_$ProxiesListHeaderSelectorStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesListHeaderSelectorState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2793,7 +2966,9 @@ class _$ProxiesListHeaderSelectorStateImpl @override int get hashCode => Object.hash(runtimeType, offset, currentIndex); - @JsonKey(ignore: true) + /// Create a copy of ProxiesListHeaderSelectorState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesListHeaderSelectorStateImplCopyWith< @@ -2812,8 +2987,11 @@ abstract class _ProxiesListHeaderSelectorState double get offset; @override int get currentIndex; + + /// Create a copy of ProxiesListHeaderSelectorState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesListHeaderSelectorStateImplCopyWith< _$ProxiesListHeaderSelectorStateImpl> get copyWith => throw _privateConstructorUsedError; @@ -2824,7 +3002,9 @@ mixin _$ProxiesActionsState { bool get isCurrent => throw _privateConstructorUsedError; bool get hasProvider => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxiesActionsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxiesActionsStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2848,6 +3028,8 @@ class _$ProxiesActionsStateCopyWithImpl<$Res, $Val extends ProxiesActionsState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxiesActionsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2886,6 +3068,8 @@ class __$$ProxiesActionsStateImplCopyWithImpl<$Res> $Res Function(_$ProxiesActionsStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxiesActionsState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -2935,7 +3119,9 @@ class _$ProxiesActionsStateImpl implements _ProxiesActionsState { @override int get hashCode => Object.hash(runtimeType, isCurrent, hasProvider); - @JsonKey(ignore: true) + /// Create a copy of ProxiesActionsState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxiesActionsStateImplCopyWith<_$ProxiesActionsStateImpl> get copyWith => @@ -2952,8 +3138,11 @@ abstract class _ProxiesActionsState implements ProxiesActionsState { bool get isCurrent; @override bool get hasProvider; + + /// Create a copy of ProxiesActionsState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxiesActionsStateImplCopyWith<_$ProxiesActionsStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -2963,7 +3152,9 @@ mixin _$AutoLaunchState { bool get isAutoLaunch => throw _privateConstructorUsedError; bool get isAdminAutoLaunch => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of AutoLaunchState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $AutoLaunchStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -2987,6 +3178,8 @@ class _$AutoLaunchStateCopyWithImpl<$Res, $Val extends AutoLaunchState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of AutoLaunchState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3025,6 +3218,8 @@ class __$$AutoLaunchStateImplCopyWithImpl<$Res> _$AutoLaunchStateImpl _value, $Res Function(_$AutoLaunchStateImpl) _then) : super(_value, _then); + /// Create a copy of AutoLaunchState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3074,7 +3269,9 @@ class _$AutoLaunchStateImpl implements _AutoLaunchState { @override int get hashCode => Object.hash(runtimeType, isAutoLaunch, isAdminAutoLaunch); - @JsonKey(ignore: true) + /// Create a copy of AutoLaunchState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$AutoLaunchStateImplCopyWith<_$AutoLaunchStateImpl> get copyWith => @@ -3091,8 +3288,11 @@ abstract class _AutoLaunchState implements AutoLaunchState { bool get isAutoLaunch; @override bool get isAdminAutoLaunch; + + /// Create a copy of AutoLaunchState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$AutoLaunchStateImplCopyWith<_$AutoLaunchStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3101,9 +3301,12 @@ abstract class _AutoLaunchState implements AutoLaunchState { mixin _$ProxyState { bool get isStart => throw _privateConstructorUsedError; bool get systemProxy => throw _privateConstructorUsedError; + List get bassDomain => throw _privateConstructorUsedError; int get port => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ProxyState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ProxyStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -3114,7 +3317,8 @@ abstract class $ProxyStateCopyWith<$Res> { ProxyState value, $Res Function(ProxyState) then) = _$ProxyStateCopyWithImpl<$Res, ProxyState>; @useResult - $Res call({bool isStart, bool systemProxy, int port}); + $Res call( + {bool isStart, bool systemProxy, List bassDomain, int port}); } /// @nodoc @@ -3127,11 +3331,14 @@ class _$ProxyStateCopyWithImpl<$Res, $Val extends ProxyState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ProxyState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? isStart = null, Object? systemProxy = null, + Object? bassDomain = null, Object? port = null, }) { return _then(_value.copyWith( @@ -3143,6 +3350,10 @@ class _$ProxyStateCopyWithImpl<$Res, $Val extends ProxyState> ? _value.systemProxy : systemProxy // ignore: cast_nullable_to_non_nullable as bool, + bassDomain: null == bassDomain + ? _value.bassDomain + : bassDomain // ignore: cast_nullable_to_non_nullable + as List, port: null == port ? _value.port : port // ignore: cast_nullable_to_non_nullable @@ -3159,7 +3370,8 @@ abstract class _$$ProxyStateImplCopyWith<$Res> __$$ProxyStateImplCopyWithImpl<$Res>; @override @useResult - $Res call({bool isStart, bool systemProxy, int port}); + $Res call( + {bool isStart, bool systemProxy, List bassDomain, int port}); } /// @nodoc @@ -3170,11 +3382,14 @@ class __$$ProxyStateImplCopyWithImpl<$Res> _$ProxyStateImpl _value, $Res Function(_$ProxyStateImpl) _then) : super(_value, _then); + /// Create a copy of ProxyState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ Object? isStart = null, Object? systemProxy = null, + Object? bassDomain = null, Object? port = null, }) { return _then(_$ProxyStateImpl( @@ -3186,6 +3401,10 @@ class __$$ProxyStateImplCopyWithImpl<$Res> ? _value.systemProxy : systemProxy // ignore: cast_nullable_to_non_nullable as bool, + bassDomain: null == bassDomain + ? _value._bassDomain + : bassDomain // ignore: cast_nullable_to_non_nullable + as List, port: null == port ? _value.port : port // ignore: cast_nullable_to_non_nullable @@ -3198,18 +3417,30 @@ class __$$ProxyStateImplCopyWithImpl<$Res> class _$ProxyStateImpl implements _ProxyState { const _$ProxyStateImpl( - {required this.isStart, required this.systemProxy, required this.port}); + {required this.isStart, + required this.systemProxy, + required final List bassDomain, + required this.port}) + : _bassDomain = bassDomain; @override final bool isStart; @override final bool systemProxy; + final List _bassDomain; + @override + List get bassDomain { + if (_bassDomain is EqualUnmodifiableListView) return _bassDomain; + // ignore: implicit_dynamic_type + return EqualUnmodifiableListView(_bassDomain); + } + @override final int port; @override String toString() { - return 'ProxyState(isStart: $isStart, systemProxy: $systemProxy, port: $port)'; + return 'ProxyState(isStart: $isStart, systemProxy: $systemProxy, bassDomain: $bassDomain, port: $port)'; } @override @@ -3220,13 +3451,18 @@ class _$ProxyStateImpl implements _ProxyState { (identical(other.isStart, isStart) || other.isStart == isStart) && (identical(other.systemProxy, systemProxy) || other.systemProxy == systemProxy) && + const DeepCollectionEquality() + .equals(other._bassDomain, _bassDomain) && (identical(other.port, port) || other.port == port)); } @override - int get hashCode => Object.hash(runtimeType, isStart, systemProxy, port); + int get hashCode => Object.hash(runtimeType, isStart, systemProxy, + const DeepCollectionEquality().hash(_bassDomain), port); - @JsonKey(ignore: true) + /// Create a copy of ProxyState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ProxyStateImplCopyWith<_$ProxyStateImpl> get copyWith => @@ -3237,6 +3473,7 @@ abstract class _ProxyState implements ProxyState { const factory _ProxyState( {required final bool isStart, required final bool systemProxy, + required final List bassDomain, required final int port}) = _$ProxyStateImpl; @override @@ -3244,9 +3481,14 @@ abstract class _ProxyState implements ProxyState { @override bool get systemProxy; @override - int get port; + List get bassDomain; @override - @JsonKey(ignore: true) + int get port; + + /// Create a copy of ProxyState + /// with the given fields replaced by the non-null parameter values. + @override + @JsonKey(includeFromJson: false, includeToJson: false) _$$ProxyStateImplCopyWith<_$ProxyStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3256,7 +3498,9 @@ mixin _$HttpOverridesState { bool get isStart => throw _privateConstructorUsedError; int get port => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of HttpOverridesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $HttpOverridesStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -3280,6 +3524,8 @@ class _$HttpOverridesStateCopyWithImpl<$Res, $Val extends HttpOverridesState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of HttpOverridesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3318,6 +3564,8 @@ class __$$HttpOverridesStateImplCopyWithImpl<$Res> $Res Function(_$HttpOverridesStateImpl) _then) : super(_value, _then); + /// Create a copy of HttpOverridesState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3364,7 +3612,9 @@ class _$HttpOverridesStateImpl implements _HttpOverridesState { @override int get hashCode => Object.hash(runtimeType, isStart, port); - @JsonKey(ignore: true) + /// Create a copy of HttpOverridesState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$HttpOverridesStateImplCopyWith<_$HttpOverridesStateImpl> get copyWith => @@ -3381,8 +3631,11 @@ abstract class _HttpOverridesState implements HttpOverridesState { bool get isStart; @override int get port; + + /// Create a copy of HttpOverridesState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$HttpOverridesStateImplCopyWith<_$HttpOverridesStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3408,7 +3661,9 @@ mixin _$ClashConfigState { List get rules => throw _privateConstructorUsedError; String? get globalRealUa => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $ClashConfigStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -3453,6 +3708,8 @@ class _$ClashConfigStateCopyWithImpl<$Res, $Val extends ClashConfigState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3551,6 +3808,8 @@ class _$ClashConfigStateCopyWithImpl<$Res, $Val extends ClashConfigState> ) as $Val); } + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $TunCopyWith<$Res> get tun { @@ -3559,6 +3818,8 @@ class _$ClashConfigStateCopyWithImpl<$Res, $Val extends ClashConfigState> }); } + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $DnsCopyWith<$Res> get dns { @@ -3610,6 +3871,8 @@ class __$$ClashConfigStateImplCopyWithImpl<$Res> $Res Function(_$ClashConfigStateImpl) _then) : super(_value, _then); + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3853,7 +4116,9 @@ class _$ClashConfigStateImpl implements _ClashConfigState { const DeepCollectionEquality().hash(_rules), globalRealUa); - @JsonKey(ignore: true) + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$ClashConfigStateImplCopyWith<_$ClashConfigStateImpl> get copyWith => @@ -3918,8 +4183,11 @@ abstract class _ClashConfigState implements ClashConfigState { List get rules; @override String? get globalRealUa; + + /// Create a copy of ClashConfigState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$ClashConfigStateImplCopyWith<_$ClashConfigStateImpl> get copyWith => throw _privateConstructorUsedError; } @@ -3930,7 +4198,9 @@ mixin _$VPNState { TunStack get stack => throw _privateConstructorUsedError; VpnProps get vpnProps => throw _privateConstructorUsedError; - @JsonKey(ignore: true) + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) $VPNStateCopyWith get copyWith => throw _privateConstructorUsedError; } @@ -3956,6 +4226,8 @@ class _$VPNStateCopyWithImpl<$Res, $Val extends VPNState> // ignore: unused_field final $Res Function($Val) _then; + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -3979,6 +4251,8 @@ class _$VPNStateCopyWithImpl<$Res, $Val extends VPNState> ) as $Val); } + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $AccessControlCopyWith<$Res>? get accessControl { @@ -3991,6 +4265,8 @@ class _$VPNStateCopyWithImpl<$Res, $Val extends VPNState> }); } + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $VpnPropsCopyWith<$Res> get vpnProps { @@ -4024,6 +4300,8 @@ class __$$VPNStateImplCopyWithImpl<$Res> _$VPNStateImpl _value, $Res Function(_$VPNStateImpl) _then) : super(_value, _then); + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({ @@ -4083,7 +4361,9 @@ class _$VPNStateImpl implements _VPNState { @override int get hashCode => Object.hash(runtimeType, accessControl, stack, vpnProps); - @JsonKey(ignore: true) + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. + @JsonKey(includeFromJson: false, includeToJson: false) @override @pragma('vm:prefer-inline') _$$VPNStateImplCopyWith<_$VPNStateImpl> get copyWith => @@ -4102,8 +4382,11 @@ abstract class _VPNState implements VPNState { TunStack get stack; @override VpnProps get vpnProps; + + /// Create a copy of VPNState + /// with the given fields replaced by the non-null parameter values. @override - @JsonKey(ignore: true) + @JsonKey(includeFromJson: false, includeToJson: false) _$$VPNStateImplCopyWith<_$VPNStateImpl> get copyWith => throw _privateConstructorUsedError; } diff --git a/lib/models/profile.dart b/lib/models/profile.dart index b7439b8..7951122 100644 --- a/lib/models/profile.dart +++ b/lib/models/profile.dart @@ -4,37 +4,36 @@ import 'dart:io'; import 'dart:typed_data'; import 'package:fl_clash/clash/core.dart'; -import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/common/common.dart'; +import 'package:fl_clash/enum/enum.dart'; import 'package:freezed_annotation/freezed_annotation.dart'; -part 'generated/profile.g.dart'; - part 'generated/profile.freezed.dart'; +part 'generated/profile.g.dart'; typedef SelectedMap = Map; @freezed -class UserInfo with _$UserInfo { - const factory UserInfo({ +class SubscriptionInfo with _$SubscriptionInfo { + const factory SubscriptionInfo({ @Default(0) int upload, @Default(0) int download, @Default(0) int total, @Default(0) int expire, - }) = _UserInfo; + }) = _SubscriptionInfo; - factory UserInfo.fromJson(Map json) => - _$UserInfoFromJson(json); + factory SubscriptionInfo.fromJson(Map json) => + _$SubscriptionInfoFromJson(json); - factory UserInfo.formHString(String? info) { - if (info == null) return const UserInfo(); + factory SubscriptionInfo.formHString(String? info) { + if (info == null) return const SubscriptionInfo(); final list = info.split(";"); Map map = {}; for (final i in list) { final keyValue = i.trim().split("="); map[keyValue[0]] = int.tryParse(keyValue[1]); } - return UserInfo( + return SubscriptionInfo( upload: map["upload"] ?? 0, download: map["download"] ?? 0, total: map["total"] ?? 0, @@ -52,7 +51,7 @@ class Profile with _$Profile { @Default("") String url, DateTime? lastUpdateDate, required Duration autoUpdateDuration, - UserInfo? userInfo, + SubscriptionInfo? subscriptionInfo, @Default(true) bool autoUpdate, @Default({}) SelectedMap selectedMap, @Default({}) Set unfoldSet, @@ -103,7 +102,7 @@ extension ProfileExtension on Profile { final userinfo = response.headers.value('subscription-userinfo'); return await copyWith( label: label ?? other.getFileNameForDisposition(disposition) ?? id, - userInfo: UserInfo.formHString(userinfo), + subscriptionInfo: SubscriptionInfo.formHString(userinfo), ).saveFile(response.data); } diff --git a/lib/models/selector.dart b/lib/models/selector.dart index 0f5fd96..3926db4 100644 --- a/lib/models/selector.dart +++ b/lib/models/selector.dart @@ -206,6 +206,7 @@ class ProxyState with _$ProxyState { const factory ProxyState({ required bool isStart, required bool systemProxy, + required List bassDomain, required int port, }) = _ProxyState; } @@ -218,8 +219,6 @@ class HttpOverridesState with _$HttpOverridesState { }) = _HttpOverridesState; } - - @freezed class ClashConfigState with _$ClashConfigState { const factory ClashConfigState({ @@ -251,4 +250,4 @@ class VPNState with _$VPNState { required TunStack stack, required VpnProps vpnProps, }) = _VPNState; -} \ No newline at end of file +} diff --git a/lib/plugins/vpn.dart b/lib/plugins/vpn.dart index 327eb47..6d267c1 100644 --- a/lib/plugins/vpn.dart +++ b/lib/plugins/vpn.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'dart:ffi'; import 'dart:io'; import 'dart:isolate'; + import 'package:fl_clash/clash/clash.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/models/models.dart'; diff --git a/lib/state.dart b/lib/state.dart index f9f172e..cff5a49 100644 --- a/lib/state.dart +++ b/lib/state.dart @@ -3,16 +3,19 @@ import 'dart:io'; import 'package:animations/animations.dart'; import 'package:fl_clash/clash/clash.dart'; +import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/plugins/service.dart'; import 'package:fl_clash/plugins/vpn.dart'; import 'package:fl_clash/widgets/scaffold.dart'; import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:package_info_plus/package_info_plus.dart'; +import 'package:tray_manager/tray_manager.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'common/common.dart'; import 'controller.dart'; import 'models/models.dart'; -import 'common/common.dart'; class GlobalState { Timer? timer; @@ -101,6 +104,7 @@ class GlobalState { required Config config, required ClashConfig clashConfig, }) async { + clashCore.requestGc(); await updateClashConfig( clashConfig: clashConfig, config: config, @@ -126,19 +130,22 @@ class GlobalState { clashConfig: clashConfig, ); } - clashCore.setState( - CoreState( - enable: config.vpnProps.enable, - accessControl: config.isAccessControl ? config.accessControl : null, - ipv6: config.vpnProps.ipv6, - allowBypass: config.vpnProps.allowBypass, - systemProxy: config.vpnProps.systemProxy, - onlyProxy: config.appSetting.onlyProxy, - bypassDomain: config.vpnProps.bypassDomain, - currentProfileName: - config.currentProfile?.label ?? config.currentProfileId ?? "", - ), - ); + if (Platform.isAndroid && !isVpnService) { + clashCore.setState( + CoreState( + enable: config.vpnProps.enable, + accessControl: config.isAccessControl ? config.accessControl : null, + ipv6: config.vpnProps.ipv6, + allowBypass: config.vpnProps.allowBypass, + systemProxy: config.vpnProps.systemProxy, + onlyProxy: config.appSetting.onlyProxy, + bypassDomain: config.networkProps.bypassDomain, + routeAddress: clashConfig.routeAddress, + currentProfileName: + config.currentProfile?.label ?? config.currentProfileId ?? "", + ), + ); + } updateCoreVersionInfo(appState); } @@ -294,6 +301,132 @@ class GlobalState { }, ); } + + Future _updateSystemTray({ + required Brightness? brightness, + bool force = false, + }) async { + if (Platform.isAndroid) { + return; + } + if (Platform.isLinux || force) { + await trayManager.destroy(); + } + await trayManager.setIcon( + other.getTrayIconPath( + brightness: brightness ?? + WidgetsBinding.instance.platformDispatcher.platformBrightness, + ), + isTemplate: true, + ); + if (!Platform.isLinux) { + await trayManager.setToolTip( + appName, + ); + } + } + + updateTray({ + required AppState appState, + required AppFlowingState appFlowingState, + required Config config, + required ClashConfig clashConfig, + bool focus = false, + }) async { + if (!Platform.isLinux) { + await _updateSystemTray( + brightness: appState.brightness, + force: focus, + ); + } + List menuItems = []; + final showMenuItem = MenuItem( + label: appLocalizations.show, + onClick: (_) { + window?.show(); + }, + ); + menuItems.add(showMenuItem); + final startMenuItem = MenuItem.checkbox( + label: appFlowingState.isStart + ? appLocalizations.stop + : appLocalizations.start, + onClick: (_) async { + globalState.appController.updateStart(); + }, + checked: false, + ); + menuItems.add(startMenuItem); + menuItems.add(MenuItem.separator()); + for (final mode in Mode.values) { + menuItems.add( + MenuItem.checkbox( + label: Intl.message(mode.name), + onClick: (_) { + globalState.appController.clashConfig.mode = mode; + }, + checked: mode == clashConfig.mode, + ), + ); + } + menuItems.add(MenuItem.separator()); + if (appFlowingState.isStart) { + menuItems.add( + MenuItem.checkbox( + label: appLocalizations.tun, + onClick: (_) { + globalState.appController.updateTun(); + }, + checked: clashConfig.tun.enable, + ), + ); + menuItems.add( + MenuItem.checkbox( + label: appLocalizations.systemProxy, + onClick: (_) { + globalState.appController.updateSystemProxy(); + }, + checked: config.networkProps.systemProxy, + ), + ); + menuItems.add(MenuItem.separator()); + } + final autoStartMenuItem = MenuItem.checkbox( + label: appLocalizations.autoLaunch, + onClick: (_) async { + globalState.appController.updateAutoLaunch(); + }, + checked: config.appSetting.autoLaunch, + ); + menuItems.add(autoStartMenuItem); + + if (Platform.isWindows) { + final adminAutoStartMenuItem = MenuItem.checkbox( + label: appLocalizations.adminAutoLaunch, + onClick: (_) async { + globalState.appController.updateAdminAutoLaunch(); + }, + checked: config.appSetting.adminAutoLaunch, + ); + menuItems.add(adminAutoStartMenuItem); + } + menuItems.add(MenuItem.separator()); + final exitMenuItem = MenuItem( + label: appLocalizations.exit, + onClick: (_) async { + await globalState.appController.handleExit(); + }, + ); + menuItems.add(exitMenuItem); + final menu = Menu(items: menuItems); + await trayManager.setContextMenu(menu); + if (Platform.isLinux) { + await _updateSystemTray( + brightness: appState.brightness, + force: focus, + ); + } + } } final globalState = GlobalState(); diff --git a/lib/widgets/back_scope.dart b/lib/widgets/back_scope.dart index c4e5b3f..5f36330 100644 --- a/lib/widgets/back_scope.dart +++ b/lib/widgets/back_scope.dart @@ -1,6 +1,4 @@ import 'dart:io'; - - import 'package:fl_clash/state.dart'; import 'package:flutter/widgets.dart'; @@ -19,7 +17,7 @@ class _PopContainerState extends State { if (Platform.isAndroid) { return PopScope( canPop: false, - onPopInvoked: (_) async { + onPopInvokedWithResult: (_, __) async { final canPop = Navigator.canPop(context); if (canPop) { Navigator.pop(context); diff --git a/lib/widgets/list.dart b/lib/widgets/list.dart index 9d68da6..365cf75 100644 --- a/lib/widgets/list.dart +++ b/lib/widgets/list.dart @@ -6,8 +6,8 @@ import 'package:flutter/material.dart'; import 'card.dart'; import 'input.dart'; -import 'sheet.dart'; import 'scaffold.dart'; +import 'sheet.dart'; class Delegate { const Delegate(); @@ -360,11 +360,13 @@ class ListItem extends StatelessWidget { return; } - BaseNavigator.push(context, CommonScaffold( - key: Key(nextDelegate.title), - body: nextDelegate.widget, - title: nextDelegate.title, - )); + BaseNavigator.push( + context, + CommonScaffold( + key: Key(nextDelegate.title), + body: nextDelegate.widget, + title: nextDelegate.title, + )); }, ); } @@ -468,7 +470,7 @@ class ListHeader extends StatelessWidget { } List generateSection({ - required String title, + String? title, required Iterable items, List? actions, bool separated = true, @@ -481,7 +483,7 @@ List generateSection({ ) : items; return [ - if (items.isNotEmpty) + if (items.isNotEmpty && title != null) ListHeader( title: title, actions: actions, diff --git a/lib/widgets/sheet.dart b/lib/widgets/sheet.dart index e409293..69d966f 100644 --- a/lib/widgets/sheet.dart +++ b/lib/widgets/sheet.dart @@ -2,8 +2,8 @@ import 'package:fl_clash/common/common.dart'; import 'package:fl_clash/enum/enum.dart'; import 'package:fl_clash/state.dart'; import 'package:fl_clash/widgets/scaffold.dart'; -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; + import 'side_sheet.dart'; showExtendPage( diff --git a/lib/widgets/subscription_info_view.dart b/lib/widgets/subscription_info_view.dart new file mode 100644 index 0000000..636d997 --- /dev/null +++ b/lib/widgets/subscription_info_view.dart @@ -0,0 +1,53 @@ +import 'package:fl_clash/common/common.dart'; +import 'package:fl_clash/models/models.dart'; +import 'package:flutter/material.dart'; + +class SubscriptionInfoView extends StatelessWidget { + final SubscriptionInfo? subscriptionInfo; + + const SubscriptionInfoView({ + super.key, + this.subscriptionInfo, + }); + + @override + Widget build(BuildContext context) { + if (subscriptionInfo == null) { + return Container(); + } + if (subscriptionInfo?.total == 0) { + return Container(); + } + final use = subscriptionInfo!.upload + subscriptionInfo!.download; + final total = subscriptionInfo!.total; + final progress = use / total; + + final useShow = TrafficValue(value: use).show; + final totalShow = TrafficValue(value: total).show; + final expireShow = subscriptionInfo?.expire != null && + subscriptionInfo!.expire != 0 + ? DateTime.fromMillisecondsSinceEpoch(subscriptionInfo!.expire * 1000) + .show + : appLocalizations.infiniteTime; + return Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + LinearProgressIndicator( + minHeight: 6, + value: progress, + backgroundColor: context.colorScheme.primary.toSoft(), + ), + const SizedBox( + height: 8, + ), + Text( + "$useShow / $totalShow · $expireShow", + style: context.textTheme.labelMedium?.toLight, + ), + const SizedBox( + height: 4, + ), + ], + ); + } +} diff --git a/lib/widgets/widgets.dart b/lib/widgets/widgets.dart index 1b735b1..5804977 100644 --- a/lib/widgets/widgets.dart +++ b/lib/widgets/widgets.dart @@ -1,24 +1,25 @@ -export 'scaffold.dart'; -export 'float_layout.dart'; -export 'popup_menu.dart'; -export 'card.dart'; -export 'list.dart'; -export 'line_chart.dart'; -export 'grid.dart'; -export 'open_container.dart'; -export 'color_scheme_box.dart'; -export 'null_status.dart'; -export 'disabled_mask.dart'; -export 'side_sheet.dart'; -export 'sheet.dart'; export 'animate_grid.dart'; -export 'chip.dart'; -export 'fade_box.dart'; -export 'text.dart'; -export 'connection_item.dart'; +export 'back_scope.dart'; export 'builder.dart'; -export 'setting.dart'; +export 'card.dart'; +export 'chip.dart'; +export 'color_scheme_box.dart'; +export 'connection_item.dart'; +export 'disabled_mask.dart'; +export 'fade_box.dart'; +export 'float_layout.dart'; +export 'grid.dart'; +export 'icon.dart'; export 'input.dart'; export 'keep_scope.dart'; -export 'back_scope.dart'; -export 'icon.dart'; +export 'line_chart.dart'; +export 'list.dart'; +export 'null_status.dart'; +export 'open_container.dart'; +export 'popup_menu.dart'; +export 'scaffold.dart'; +export 'setting.dart'; +export 'sheet.dart'; +export 'side_sheet.dart'; +export 'subscription_info_view.dart'; +export 'text.dart'; diff --git a/linux/flutter/generated_plugin_registrant.cc b/linux/flutter/generated_plugin_registrant.cc index 4af4bb2..4f15677 100755 --- a/linux/flutter/generated_plugin_registrant.cc +++ b/linux/flutter/generated_plugin_registrant.cc @@ -10,7 +10,7 @@ #include #include #include -#include +#include #include #include #include @@ -28,9 +28,9 @@ void fl_register_plugins(FlPluginRegistry* registry) { g_autoptr(FlPluginRegistrar) hotkey_manager_linux_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "HotkeyManagerLinuxPlugin"); hotkey_manager_linux_plugin_register_with_registrar(hotkey_manager_linux_registrar); - g_autoptr(FlPluginRegistrar) screen_retriever_registrar = - fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverPlugin"); - screen_retriever_plugin_register_with_registrar(screen_retriever_registrar); + g_autoptr(FlPluginRegistrar) screen_retriever_linux_registrar = + fl_plugin_registry_get_registrar_for_plugin(registry, "ScreenRetrieverLinuxPlugin"); + screen_retriever_linux_plugin_register_with_registrar(screen_retriever_linux_registrar); g_autoptr(FlPluginRegistrar) tray_manager_registrar = fl_plugin_registry_get_registrar_for_plugin(registry, "TrayManagerPlugin"); tray_manager_plugin_register_with_registrar(tray_manager_registrar); diff --git a/linux/flutter/generated_plugins.cmake b/linux/flutter/generated_plugins.cmake index 7fb4ddf..cc00887 100755 --- a/linux/flutter/generated_plugins.cmake +++ b/linux/flutter/generated_plugins.cmake @@ -7,7 +7,7 @@ list(APPEND FLUTTER_PLUGIN_LIST file_selector_linux gtk hotkey_manager_linux - screen_retriever + screen_retriever_linux tray_manager url_launcher_linux window_manager diff --git a/macos/Flutter/GeneratedPluginRegistrant.swift b/macos/Flutter/GeneratedPluginRegistrant.swift index e72650c..536feea 100755 --- a/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/macos/Flutter/GeneratedPluginRegistrant.swift @@ -6,6 +6,7 @@ import FlutterMacOS import Foundation import app_links +import connectivity_plus import device_info_plus import dynamic_color import file_selector_macos @@ -13,15 +14,17 @@ import hotkey_manager_macos import mobile_scanner import package_info_plus import path_provider_foundation -import screen_retriever +import screen_retriever_macos import shared_preferences_foundation -import sqflite +import sqflite_darwin import tray_manager import url_launcher_macos +import window_ext import window_manager func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { AppLinksMacosPlugin.register(with: registry.registrar(forPlugin: "AppLinksMacosPlugin")) + ConnectivityPlusPlugin.register(with: registry.registrar(forPlugin: "ConnectivityPlusPlugin")) DeviceInfoPlusMacosPlugin.register(with: registry.registrar(forPlugin: "DeviceInfoPlusMacosPlugin")) DynamicColorPlugin.register(with: registry.registrar(forPlugin: "DynamicColorPlugin")) FileSelectorPlugin.register(with: registry.registrar(forPlugin: "FileSelectorPlugin")) @@ -29,10 +32,11 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { MobileScannerPlugin.register(with: registry.registrar(forPlugin: "MobileScannerPlugin")) FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) - ScreenRetrieverPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverPlugin")) + ScreenRetrieverMacosPlugin.register(with: registry.registrar(forPlugin: "ScreenRetrieverMacosPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) TrayManagerPlugin.register(with: registry.registrar(forPlugin: "TrayManagerPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) + WindowExtPlugin.register(with: registry.registrar(forPlugin: "WindowExtPlugin")) WindowManagerPlugin.register(with: registry.registrar(forPlugin: "WindowManagerPlugin")) } diff --git a/macos/Runner/AppDelegate.swift b/macos/Runner/AppDelegate.swift index a4f796f..9a1b339 100755 --- a/macos/Runner/AppDelegate.swift +++ b/macos/Runner/AppDelegate.swift @@ -1,23 +1,29 @@ import Cocoa import FlutterMacOS +import window_ext @main class AppDelegate: FlutterAppDelegate { - - override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { - return false - } - - override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { - if !flag { - for window in NSApp.windows { - if !window.isVisible { - window.setIsVisible(true) - } - window.makeKeyAndOrderFront(self) - NSApp.activate(ignoringOtherApps: true) - } - } - return true - } + + override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { + return false + } + + override func applicationShouldTerminate(_ sender: NSApplication) -> NSApplication.TerminateReply { + WindowExtPlugin.instance?.handleShouldTerminate() + return .terminateCancel + } + + override func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool { + if !flag { + for window in NSApp.windows { + if !window.isVisible { + window.setIsVisible(true) + } + window.makeKeyAndOrderFront(self) + NSApp.activate(ignoringOtherApps: true) + } + } + return true + } } diff --git a/macos/Runner/MainFlutterWindow.swift b/macos/Runner/MainFlutterWindow.swift index c48170a..0a58fd4 100755 --- a/macos/Runner/MainFlutterWindow.swift +++ b/macos/Runner/MainFlutterWindow.swift @@ -8,9 +8,8 @@ class MainFlutterWindow: NSWindow { let windowFrame = self.frame self.contentViewController = flutterViewController self.setFrame(windowFrame, display: true) - + RegisterGeneratedPlugins(registry: flutterViewController) - super.awakeFromNib() } override public func order(_ place: NSWindow.OrderingMode, relativeTo otherWin: Int) { diff --git a/plugins/proxy/lib/proxy.dart b/plugins/proxy/lib/proxy.dart index 4096d67..72a155c 100644 --- a/plugins/proxy/lib/proxy.dart +++ b/plugins/proxy/lib/proxy.dart @@ -1,19 +1,23 @@ import 'dart:io'; -import 'proxy_platform_interface.dart'; import "package:path/path.dart"; +import 'proxy_platform_interface.dart'; + enum ProxyTypes { http, https, socks } class Proxy extends ProxyPlatform { static String url = "127.0.0.1"; @override - Future startProxy(int port) async { + Future startProxy( + int port, [ + List bypassDomain = const [], + ]) async { return switch (Platform.operatingSystem) { - "macos" => await _startProxyWithMacos(port), - "linux" => await _startProxyWithLinux(port), - "windows" => await ProxyPlatform.instance.startProxy(port), + "macos" => await _startProxyWithMacos(port, bypassDomain), + "linux" => await _startProxyWithLinux(port, bypassDomain), + "windows" => await ProxyPlatform.instance.startProxy(port, bypassDomain), String() => false, }; } @@ -28,48 +32,93 @@ class Proxy extends ProxyPlatform { }; } - Future _startProxyWithLinux(int port) async { + Future _startProxyWithLinux(int port, List bypassDomain) async { try { final homeDir = Platform.environment['HOME']!; final configDir = join(homeDir, ".config"); final cmdList = List>.empty(growable: true); final desktop = Platform.environment['XDG_CURRENT_DESKTOP']; final isKDE = desktop == "KDE"; - for (final type in ProxyTypes.values) { + if (isKDE) { + cmdList.add( + [ + "kwriteconfig5", + "--file", + "$configDir/kioslaverc", + "--group", + "Proxy Settings", + "--key", + "ProxyType", + "1" + ], + ); + cmdList.add( + [ + "kwriteconfig5", + "--file", + "$configDir/kioslaverc", + "--group", + "Proxy Settings", + "--key", + "NoProxyFor", + bypassDomain.join(",") + ], + ); + } else { cmdList.add( ["gsettings", "set", "org.gnome.system.proxy", "mode", "manual"], ); + final ignoreHosts = "\"['${bypassDomain.join("', '")}']\""; cmdList.add( [ "gsettings", "set", - "org.gnome.system.proxy.${type.name}", - "host", - url + "org.gnome.system.proxy", + "ignore-hosts", + ignoreHosts ], ); - cmdList.add( - [ - "gsettings", - "set", - "org.gnome.system.proxy.${type.name}", - "port", - "$port" - ], - ); - if (isKDE) { + } + for (final type in ProxyTypes.values) { + if (!isKDE) { cmdList.add( [ - "kwriteconfig5", - "--file", - "$configDir/kioslaverc", - "--group", - "Proxy Settings", - "--key", - "ProxyType", - "1" + "gsettings", + "set", + "org.gnome.system.proxy.${type.name}", + "host", + url ], ); + cmdList.add( + [ + "gsettings", + "set", + "org.gnome.system.proxy.${type.name}", + "port", + "$port" + ], + ); + cmdList.add( + [ + "gsettings", + "set", + "org.gnome.system.proxy.${type.name}", + "port", + "$port" + ], + ); + cmdList.add( + [ + "gsettings", + "set", + "org.gnome.system.proxy.${type.name}", + "port", + "$port" + ], + ); + } + if (isKDE) { cmdList.add( [ "kwriteconfig5", @@ -100,19 +149,23 @@ class Proxy extends ProxyPlatform { final cmdList = List>.empty(growable: true); final desktop = Platform.environment['XDG_CURRENT_DESKTOP']; final isKDE = desktop == "KDE"; - cmdList - .add(["gsettings", "set", "org.gnome.system.proxy", "mode", "none"]); if (isKDE) { - cmdList.add([ - "kwriteconfig5", - "--file", - "$configDir/kioslaverc", - "--group", - "Proxy Settings", - "--key", - "ProxyType", - "0" - ]); + cmdList.add( + [ + "kwriteconfig5", + "--file", + "$configDir/kioslaverc", + "--group", + "Proxy Settings", + "--key", + "ProxyType", + "0" + ], + ); + } else { + cmdList.add( + ["gsettings", "set", "org.gnome.system.proxy", "mode", "none"], + ); } for (final cmd in cmdList) { await Process.run(cmd[0], cmd.sublist(1)); @@ -123,23 +176,43 @@ class Proxy extends ProxyPlatform { } } - Future _startProxyWithMacos(int port) async { + Future _startProxyWithMacos(int port, List bypassDomain) async { try { final devices = await _getNetworkDeviceListWithMacos(); for (final dev in devices) { await Future.wait([ Process.run( - "/usr/sbin/networksetup", ["-setwebproxystate", dev, "on"]), + "/usr/sbin/networksetup", + ["-setwebproxystate", dev, "on"], + ), Process.run( - "/usr/sbin/networksetup", ["-setwebproxy", dev, url, "$port"]), + "/usr/sbin/networksetup", + ["-setwebproxy", dev, url, "$port"], + ), Process.run( - "/usr/sbin/networksetup", ["-setsecurewebproxystate", dev, "on"]), - Process.run("/usr/sbin/networksetup", - ["-setsecurewebproxy", dev, url, "$port"]), - Process.run("/usr/sbin/networksetup", - ["-setsocksfirewallproxystate", dev, "on"]), - Process.run("/usr/sbin/networksetup", - ["-setsocksfirewallproxy", dev, url, "$port"]), + "/usr/sbin/networksetup", + ["-setsecurewebproxystate", dev, "on"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setsecurewebproxy", dev, url, "$port"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setsocksfirewallproxystate", dev, "on"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setsocksfirewallproxy", dev, url, "$port"], + ), + Process.run( + "/usr/sbin/networksetup", + [ + "-setproxybypassdomains", + dev, + bypassDomain.join(" "), + ], + ), ]); } return true; @@ -154,13 +227,25 @@ class Proxy extends ProxyPlatform { for (final dev in devices) { await Future.wait([ Process.run( - "/usr/sbin/networksetup", ["-setautoproxystate", dev, "off"]), + "/usr/sbin/networksetup", + ["-setautoproxystate", dev, "off"], + ), Process.run( - "/usr/sbin/networksetup", ["-setwebproxystate", dev, "off"]), - Process.run("/usr/sbin/networksetup", - ["-setsecurewebproxystate", dev, "off"]), - Process.run("/usr/sbin/networksetup", - ["-setsocksfirewallproxystate", dev, "off"]), + "/usr/sbin/networksetup", + ["-setwebproxystate", dev, "off"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setsecurewebproxystate", dev, "off"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setsocksfirewallproxystate", dev, "off"], + ), + Process.run( + "/usr/sbin/networksetup", + ["-setproxybypassdomains", dev, ""], + ), ]); } return true; diff --git a/plugins/proxy/lib/proxy_method_channel.dart b/plugins/proxy/lib/proxy_method_channel.dart index 1bc0ffb..a4ac5fd 100644 --- a/plugins/proxy/lib/proxy_method_channel.dart +++ b/plugins/proxy/lib/proxy_method_channel.dart @@ -12,12 +12,15 @@ class MethodChannelProxy extends ProxyPlatform { MethodChannelProxy(); @override - Future startProxy(int port) async { - return await methodChannel.invokeMethod("StartProxy", {'port': port}); + Future startProxy(int port, List bypassDomain) async { + return await methodChannel.invokeMethod("StartProxy", { + 'port': port, + 'bypassDomain': bypassDomain, + }); } @override Future stopProxy() async { - return await methodChannel.invokeMethod("StopProxy"); + return await methodChannel.invokeMethod("StopProxy"); } } diff --git a/plugins/proxy/lib/proxy_platform_interface.dart b/plugins/proxy/lib/proxy_platform_interface.dart index e8e7279..7e21d95 100644 --- a/plugins/proxy/lib/proxy_platform_interface.dart +++ b/plugins/proxy/lib/proxy_platform_interface.dart @@ -20,7 +20,7 @@ abstract class ProxyPlatform extends PlatformInterface { _instance = instance; } - Future startProxy(int port) { + Future startProxy(int port, List bypassDomain) { throw UnimplementedError('startProxy() has not been implemented.'); } diff --git a/plugins/proxy/windows/proxy_plugin.cpp b/plugins/proxy/windows/proxy_plugin.cpp index 9f4aa12..7fbb352 100644 --- a/plugins/proxy/windows/proxy_plugin.cpp +++ b/plugins/proxy/windows/proxy_plugin.cpp @@ -22,18 +22,32 @@ #include #include -void startProxy(const int port) +void startProxy(const int port, const flutter::EncodableList& bypassDomain) { INTERNET_PER_CONN_OPTION_LIST list; DWORD dwBufSize = sizeof(list); list.dwSize = sizeof(list); list.pszConnection = nullptr; + auto url = "127.0.0.1:" + std::to_string(port); auto wUrl = std::wstring(url.begin(), url.end()); auto fullAddr = new WCHAR[url.length() + 1]; wcscpy_s(fullAddr, url.length() + 1, wUrl.c_str()); - list.dwOptionCount = 2; - list.pOptions = new INTERNET_PER_CONN_OPTION[2]; + + std::wstring wBypassList; + + for (const auto& domain : bypassDomain) { + if (!wBypassList.empty()) { + wBypassList += L";"; + } + wBypassList += std::wstring(std::get(domain).begin(), std::get(domain).end()); + } + + auto bypassAddr = new WCHAR[wBypassList.length() + 1]; + wcscpy_s(bypassAddr, wBypassList.length() + 1, wBypassList.c_str()); + + list.dwOptionCount = 3; + list.pOptions = new INTERNET_PER_CONN_OPTION[3]; if (!list.pOptions) { @@ -46,6 +60,9 @@ void startProxy(const int port) list.pOptions[1].dwOption = INTERNET_PER_CONN_PROXY_SERVER; list.pOptions[1].Value.pszValue = fullAddr; + list.pOptions[2].dwOption = INTERNET_PER_CONN_PROXY_BYPASS; + list.pOptions[2].Value.pszValue = bypassAddr; + InternetSetOption(nullptr, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize); RASENTRYNAME entry; @@ -70,7 +87,11 @@ void startProxy(const int port) list.pszConnection = entryAddr[i].szEntryName; InternetSetOption(nullptr, INTERNET_OPTION_PER_CONNECTION_OPTION, &list, dwBufSize); } + + delete[] fullAddr; + delete[] bypassAddr; delete[] list.pOptions; + InternetSetOption(nullptr, INTERNET_OPTION_SETTINGS_CHANGED, nullptr, 0); InternetSetOption(nullptr, INTERNET_OPTION_REFRESH, nullptr, 0); } @@ -160,7 +181,8 @@ namespace proxy { auto *arguments = std::get_if(method_call.arguments()); auto port = std::get(arguments->at(flutter::EncodableValue("port"))); - startProxy(port); + auto bypassDomain = std::get(arguments->at(flutter::EncodableValue("bypassDomain"))); + startProxy(port, bypassDomain); result->Success(true); } else diff --git a/plugins/window_ext/.metadata b/plugins/window_ext/.metadata index 98d0c5d..ee45ddd 100644 --- a/plugins/window_ext/.metadata +++ b/plugins/window_ext/.metadata @@ -4,7 +4,7 @@ # This file should be version controlled and should not be manually edited. version: - revision: "b0850beeb25f6d5b10426284f506557f66181b36" + revision: "603104015dd692ea3403755b55d07813d5cf8965" channel: "stable" project_type: plugin @@ -13,11 +13,14 @@ project_type: plugin migration: platforms: - platform: root - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 + - platform: macos + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 - platform: windows - create_revision: b0850beeb25f6d5b10426284f506557f66181b36 - base_revision: b0850beeb25f6d5b10426284f506557f66181b36 + create_revision: 603104015dd692ea3403755b55d07813d5cf8965 + base_revision: 603104015dd692ea3403755b55d07813d5cf8965 # User provided section diff --git a/plugins/window_ext/example/.gitignore b/plugins/window_ext/example/.gitignore deleted file mode 100644 index 29a3a50..0000000 --- a/plugins/window_ext/example/.gitignore +++ /dev/null @@ -1,43 +0,0 @@ -# Miscellaneous -*.class -*.log -*.pyc -*.swp -.DS_Store -.atom/ -.buildlog/ -.history -.svn/ -migrate_working_dir/ - -# IntelliJ related -*.iml -*.ipr -*.iws -.idea/ - -# The .vscode folder contains launch configuration and tasks you configure in -# VS Code which you may wish to be included in version control, so this line -# is commented out by default. -#.vscode/ - -# Flutter/Dart/Pub related -**/doc/api/ -**/ios/Flutter/.last_build_id -.dart_tool/ -.flutter-plugins -.flutter-plugins-dependencies -.pub-cache/ -.pub/ -/build/ - -# Symbolication related -app.*.symbols - -# Obfuscation related -app.*.map.json - -# Android Studio will place build artifacts here -/android/app/debug -/android/app/profile -/android/app/release diff --git a/plugins/window_ext/example/README.md b/plugins/window_ext/example/README.md deleted file mode 100644 index b006ab5..0000000 --- a/plugins/window_ext/example/README.md +++ /dev/null @@ -1,16 +0,0 @@ -# window_ext_example - -Demonstrates how to use the window_ext plugin. - -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. diff --git a/plugins/window_ext/example/analysis_options.yaml b/plugins/window_ext/example/analysis_options.yaml deleted file mode 100644 index 0d29021..0000000 --- a/plugins/window_ext/example/analysis_options.yaml +++ /dev/null @@ -1,28 +0,0 @@ -# This file configures the analyzer, which statically analyzes Dart code to -# check for errors, warnings, and lints. -# -# The issues identified by the analyzer are surfaced in the UI of Dart-enabled -# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be -# invoked from the command line by running `flutter analyze`. - -# The following line activates a set of recommended lints for Flutter apps, -# packages, and plugins designed to encourage good coding practices. -include: package:flutter_lints/flutter.yaml - -linter: - # The lint rules applied to this project can be customized in the - # section below to disable rules from the `package:flutter_lints/flutter.yaml` - # included above or to enable additional rules. A list of all available lints - # and their documentation is published at https://dart.dev/lints. - # - # Instead of disabling a lint rule for the entire project in the - # section below, it can also be suppressed for a single line of code - # or a specific dart file by using the `// ignore: name_of_lint` and - # `// ignore_for_file: name_of_lint` syntax on the line or in the file - # producing the lint. - rules: - # avoid_print: false # Uncomment to disable the `avoid_print` rule - # prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule - -# Additional information about this file can be found at -# https://dart.dev/guides/language/analysis-options diff --git a/plugins/window_ext/example/integration_test/plugin_integration_test.dart b/plugins/window_ext/example/integration_test/plugin_integration_test.dart deleted file mode 100644 index 5386994..0000000 --- a/plugins/window_ext/example/integration_test/plugin_integration_test.dart +++ /dev/null @@ -1,25 +0,0 @@ -// This is a basic Flutter integration test. -// -// Since integration tests run in a full Flutter application, they can interact -// with the host side of a plugin implementation, unlike Dart unit tests. -// -// For more information about Flutter integration tests, please see -// https://docs.flutter.dev/cookbook/testing/integration/introduction - - -import 'package:flutter_test/flutter_test.dart'; -import 'package:integration_test/integration_test.dart'; - -import 'package:window_ext/window_ext.dart'; - -void main() { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); - - testWidgets('getPlatformVersion test', (WidgetTester tester) async { - final WindowExt plugin = WindowExt(); - final String? version = await plugin.getPlatformVersion(); - // The version string depends on the host platform running the test, so - // just assert that some non-empty string is returned. - expect(version?.isNotEmpty, true); - }); -} diff --git a/plugins/window_ext/example/lib/main.dart b/plugins/window_ext/example/lib/main.dart deleted file mode 100644 index ed87dda..0000000 --- a/plugins/window_ext/example/lib/main.dart +++ /dev/null @@ -1,63 +0,0 @@ -import 'package:flutter/material.dart'; -import 'dart:async'; - -import 'package:flutter/services.dart'; -import 'package:window_ext/window_ext.dart'; - -void main() { - runApp(const MyApp()); -} - -class MyApp extends StatefulWidget { - const MyApp({super.key}); - - @override - State createState() => _MyAppState(); -} - -class _MyAppState extends State { - String _platformVersion = 'Unknown'; - final _windowExtPlugin = WindowExt(); - - @override - void initState() { - super.initState(); - initPlatformState(); - } - - // Platform messages are asynchronous, so we initialize in an async method. - Future initPlatformState() async { - String platformVersion; - // Platform messages may fail, so we use a try/catch PlatformException. - // We also handle the message potentially returning null. - try { - platformVersion = - await _windowExtPlugin.getPlatformVersion() ?? 'Unknown platform version'; - } on PlatformException { - platformVersion = 'Failed to get platform version.'; - } - - // If the widget was removed from the tree while the asynchronous platform - // message was in flight, we want to discard the reply rather than calling - // setState to update our non-existent appearance. - if (!mounted) return; - - setState(() { - _platformVersion = platformVersion; - }); - } - - @override - Widget build(BuildContext context) { - return MaterialApp( - home: Scaffold( - appBar: AppBar( - title: const Text('Plugin example app'), - ), - body: Center( - child: Text('Running on: $_platformVersion\n'), - ), - ), - ); - } -} diff --git a/plugins/window_ext/example/pubspec.lock b/plugins/window_ext/example/pubspec.lock deleted file mode 100644 index bfc9581..0000000 --- a/plugins/window_ext/example/pubspec.lock +++ /dev/null @@ -1,283 +0,0 @@ -# Generated by pub -# See https://dart.dev/tools/pub/glossary#lockfile -packages: - async: - dependency: transitive - description: - name: async - sha256: "947bfcf187f74dbc5e146c9eb9c0f10c9f8b30743e341481c1e2ed3ecc18c20c" - url: "https://pub.dev" - source: hosted - version: "2.11.0" - boolean_selector: - dependency: transitive - description: - name: boolean_selector - sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66" - url: "https://pub.dev" - source: hosted - version: "2.1.1" - characters: - dependency: transitive - description: - name: characters - sha256: "04a925763edad70e8443c99234dc3328f442e811f1d8fd1a72f1c8ad0f69a605" - url: "https://pub.dev" - source: hosted - version: "1.3.0" - clock: - dependency: transitive - description: - name: clock - sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf - url: "https://pub.dev" - source: hosted - version: "1.1.1" - collection: - dependency: transitive - description: - name: collection - sha256: ee67cb0715911d28db6bf4af1026078bd6f0128b07a5f66fb2ed94ec6783c09a - url: "https://pub.dev" - source: hosted - version: "1.18.0" - cupertino_icons: - dependency: "direct main" - description: - name: cupertino_icons - sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://pub.dev" - source: hosted - version: "1.0.8" - fake_async: - dependency: transitive - description: - name: fake_async - sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78" - url: "https://pub.dev" - source: hosted - version: "1.3.1" - file: - dependency: transitive - description: - name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" - url: "https://pub.dev" - source: hosted - version: "7.0.0" - flutter: - dependency: "direct main" - description: flutter - source: sdk - version: "0.0.0" - flutter_driver: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - flutter_lints: - dependency: "direct dev" - description: - name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" - url: "https://pub.dev" - source: hosted - version: "3.0.2" - flutter_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - fuchsia_remote_debug_protocol: - dependency: transitive - description: flutter - source: sdk - version: "0.0.0" - integration_test: - dependency: "direct dev" - description: flutter - source: sdk - version: "0.0.0" - leak_tracker: - dependency: transitive - description: - name: leak_tracker - sha256: "7f0df31977cb2c0b88585095d168e689669a2cc9b97c309665e3386f3e9d341a" - url: "https://pub.dev" - source: hosted - version: "10.0.4" - leak_tracker_flutter_testing: - dependency: transitive - description: - name: leak_tracker_flutter_testing - sha256: "06e98f569d004c1315b991ded39924b21af84cf14cc94791b8aea337d25b57f8" - url: "https://pub.dev" - source: hosted - version: "3.0.3" - leak_tracker_testing: - dependency: transitive - description: - name: leak_tracker_testing - sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://pub.dev" - source: hosted - version: "3.0.1" - lints: - dependency: transitive - description: - name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 - url: "https://pub.dev" - source: hosted - version: "3.0.0" - matcher: - dependency: transitive - description: - name: matcher - sha256: d2323aa2060500f906aa31a895b4030b6da3ebdcc5619d14ce1aada65cd161cb - url: "https://pub.dev" - source: hosted - version: "0.12.16+1" - material_color_utilities: - dependency: transitive - description: - name: material_color_utilities - sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a" - url: "https://pub.dev" - source: hosted - version: "0.8.0" - meta: - dependency: transitive - description: - name: meta - sha256: "7687075e408b093f36e6bbf6c91878cc0d4cd10f409506f7bc996f68220b9136" - url: "https://pub.dev" - source: hosted - version: "1.12.0" - path: - dependency: transitive - description: - name: path - sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af" - url: "https://pub.dev" - source: hosted - version: "1.9.0" - platform: - dependency: transitive - description: - name: platform - sha256: "12220bb4b65720483f8fa9450b4332347737cf8213dd2840d8b2c823e47243ec" - url: "https://pub.dev" - source: hosted - version: "3.1.4" - plugin_platform_interface: - dependency: transitive - description: - name: plugin_platform_interface - sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://pub.dev" - source: hosted - version: "2.1.8" - process: - dependency: transitive - description: - name: process - sha256: "21e54fd2faf1b5bdd5102afd25012184a6793927648ea81eea80552ac9405b32" - url: "https://pub.dev" - source: hosted - version: "5.0.2" - sky_engine: - dependency: transitive - description: flutter - source: sdk - version: "0.0.99" - source_span: - dependency: transitive - description: - name: source_span - sha256: "53e943d4206a5e30df338fd4c6e7a077e02254531b138a15aec3bd143c1a8b3c" - url: "https://pub.dev" - source: hosted - version: "1.10.0" - stack_trace: - dependency: transitive - description: - name: stack_trace - sha256: "73713990125a6d93122541237550ee3352a2d84baad52d375a4cad2eb9b7ce0b" - url: "https://pub.dev" - source: hosted - version: "1.11.1" - stream_channel: - dependency: transitive - description: - name: stream_channel - sha256: ba2aa5d8cc609d96bbb2899c28934f9e1af5cddbd60a827822ea467161eb54e7 - url: "https://pub.dev" - source: hosted - version: "2.1.2" - string_scanner: - dependency: transitive - description: - name: string_scanner - sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde" - url: "https://pub.dev" - source: hosted - version: "1.2.0" - sync_http: - dependency: transitive - description: - name: sync_http - sha256: "7f0cd72eca000d2e026bcd6f990b81d0ca06022ef4e32fb257b30d3d1014a961" - url: "https://pub.dev" - source: hosted - version: "0.3.1" - term_glyph: - dependency: transitive - description: - name: term_glyph - sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84 - url: "https://pub.dev" - source: hosted - version: "1.2.1" - test_api: - dependency: transitive - description: - name: test_api - sha256: "9955ae474176f7ac8ee4e989dadfb411a58c30415bcfb648fa04b2b8a03afa7f" - url: "https://pub.dev" - source: hosted - version: "0.7.0" - vector_math: - dependency: transitive - description: - name: vector_math - sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://pub.dev" - source: hosted - version: "2.1.4" - vm_service: - dependency: transitive - description: - name: vm_service - sha256: "3923c89304b715fb1eb6423f017651664a03bf5f4b29983627c4da791f74a4ec" - url: "https://pub.dev" - source: hosted - version: "14.2.1" - webdriver: - dependency: transitive - description: - name: webdriver - sha256: "003d7da9519e1e5f329422b36c4dcdf18d7d2978d1ba099ea4e45ba490ed845e" - url: "https://pub.dev" - source: hosted - version: "3.0.3" - window_ext: - dependency: "direct main" - description: - path: ".." - relative: true - source: path - version: "0.0.1" -sdks: - dart: ">=3.4.4 <4.0.0" - flutter: ">=3.18.0-18.0.pre.54" diff --git a/plugins/window_ext/example/pubspec.yaml b/plugins/window_ext/example/pubspec.yaml deleted file mode 100644 index 891eb81..0000000 --- a/plugins/window_ext/example/pubspec.yaml +++ /dev/null @@ -1,85 +0,0 @@ -name: window_ext_example -description: "Demonstrates how to use the window_ext plugin." -# The following line prevents the package from being accidentally published to -# pub.dev using `flutter pub publish`. This is preferred for private packages. -publish_to: 'none' # Remove this line if you wish to publish to pub.dev - -environment: - sdk: '>=3.4.4 <4.0.0' - -# Dependencies specify other packages that your package needs in order to work. -# To automatically upgrade your package dependencies to the latest versions -# consider running `flutter pub upgrade --major-versions`. Alternatively, -# dependencies can be manually updated by changing the version numbers below to -# the latest version available on pub.dev. To see which dependencies have newer -# versions available, run `flutter pub outdated`. -dependencies: - flutter: - sdk: flutter - - window_ext: - # When depending on this package from a real application you should use: - # window_ext: ^x.y.z - # See https://dart.dev/tools/pub/dependencies#version-constraints - # The example app is bundled with the plugin so we use a path dependency on - # the parent directory to use the current plugin's version. - path: ../ - - # The following adds the Cupertino Icons font to your application. - # Use with the CupertinoIcons class for iOS style icons. - cupertino_icons: ^1.0.6 - -dev_dependencies: - integration_test: - sdk: flutter - flutter_test: - sdk: flutter - - # The "flutter_lints" package below contains a set of recommended lints to - # encourage good coding practices. The lint set provided by the package is - # activated in the `analysis_options.yaml` file located at the root of your - # package. See that file for information about deactivating specific lint - # rules and activating additional ones. - flutter_lints: ^3.0.0 - -# For information on the generic Dart part of this file, see the -# following page: https://dart.dev/tools/pub/pubspec - -# The following section is specific to Flutter packages. -flutter: - - # The following line ensures that the Material Icons font is - # included with your application, so that you can use the icons in - # the material Icons class. - uses-material-design: true - - # To add assets to your application, add an assets section, like this: - # assets: - # - images/a_dot_burr.jpeg - # - images/a_dot_ham.jpeg - - # An image asset can refer to one or more resolution-specific "variants", see - # https://flutter.dev/assets-and-images/#resolution-aware - - # For details regarding adding assets from package dependencies, see - # https://flutter.dev/assets-and-images/#from-packages - - # To add custom fonts to your application, add a fonts section here, - # in this "flutter" section. Each entry in this list should have a - # "family" key with the font family name, and a "fonts" key with a - # list giving the asset and other descriptors for the font. For - # example: - # fonts: - # - family: Schyler - # fonts: - # - asset: fonts/Schyler-Regular.ttf - # - asset: fonts/Schyler-Italic.ttf - # style: italic - # - family: Trajan Pro - # fonts: - # - asset: fonts/TrajanPro.ttf - # - asset: fonts/TrajanPro_Bold.ttf - # weight: 700 - # - # For details regarding fonts from package dependencies, - # see https://flutter.dev/custom-fonts/#from-packages diff --git a/plugins/window_ext/example/test/widget_test.dart b/plugins/window_ext/example/test/widget_test.dart deleted file mode 100644 index 0ee266c..0000000 --- a/plugins/window_ext/example/test/widget_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -// This is a basic Flutter widget test. -// -// To perform an interaction with a widget in your test, use the WidgetTester -// utility in the flutter_test package. For example, you can send tap and scroll -// gestures. You can also use WidgetTester to find child widgets in the widget -// tree, read text, and verify that the values of widget properties are correct. - -import 'package:flutter/material.dart'; -import 'package:flutter_test/flutter_test.dart'; - -import 'package:window_ext_example/main.dart'; - -void main() { - testWidgets('Verify Platform version', (WidgetTester tester) async { - // Build our app and trigger a frame. - await tester.pumpWidget(const MyApp()); - - // Verify that platform version is retrieved. - expect( - find.byWidgetPredicate( - (Widget widget) => widget is Text && - widget.data!.startsWith('Running on:'), - ), - findsOneWidget, - ); - }); -} diff --git a/plugins/window_ext/example/windows/.gitignore b/plugins/window_ext/example/windows/.gitignore deleted file mode 100644 index d492d0d..0000000 --- a/plugins/window_ext/example/windows/.gitignore +++ /dev/null @@ -1,17 +0,0 @@ -flutter/ephemeral/ - -# Visual Studio user-specific files. -*.suo -*.user -*.userosscache -*.sln.docstates - -# Visual Studio build-related files. -x64/ -x86/ - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ diff --git a/plugins/window_ext/example/windows/CMakeLists.txt b/plugins/window_ext/example/windows/CMakeLists.txt deleted file mode 100644 index 5c1302c..0000000 --- a/plugins/window_ext/example/windows/CMakeLists.txt +++ /dev/null @@ -1,110 +0,0 @@ -# Project-level configuration. -cmake_minimum_required(VERSION 3.14) -project(window_ext_example LANGUAGES CXX) - -# The name of the executable created for the application. Change this to change -# the on-disk name of your application. -set(BINARY_NAME "window_ext_example") - -# Explicitly opt in to modern CMake behaviors to avoid warnings with recent -# versions of CMake. -cmake_policy(VERSION 3.14...3.25) - -# Define build configuration option. -get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) -if(IS_MULTICONFIG) - set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" - CACHE STRING "" FORCE) -else() - if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) - set(CMAKE_BUILD_TYPE "Debug" CACHE - STRING "Flutter build mode" FORCE) - set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS - "Debug" "Profile" "Release") - endif() -endif() -# Define settings for the Profile build mode. -set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") -set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") -set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") -set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") - -# Use Unicode for all projects. -add_definitions(-DUNICODE -D_UNICODE) - -# Compilation settings that should be applied to most targets. -# -# Be cautious about adding new options here, as plugins use this function by -# default. In most cases, you should add new options to specific targets instead -# of modifying this function. -function(APPLY_STANDARD_SETTINGS TARGET) - target_compile_features(${TARGET} PUBLIC cxx_std_17) - target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") - target_compile_options(${TARGET} PRIVATE /EHsc) - target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") - target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") -endfunction() - -# Flutter library and tool build rules. -set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") -add_subdirectory(${FLUTTER_MANAGED_DIR}) - -# Application build; see runner/CMakeLists.txt. -add_subdirectory("runner") - -# Enable the test target. -set(include_window_ext_tests TRUE) - -# Generated plugin build rules, which manage building the plugins and adding -# them to the application. -include(flutter/generated_plugins.cmake) - - -# === Installation === -# Support files are copied into place next to the executable, so that it can -# run in place. This is done instead of making a separate bundle (as on Linux) -# so that building and running from within Visual Studio will work. -set(BUILD_BUNDLE_DIR "$") -# Make the "install" step default, as it's required to run. -set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) -if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) -endif() - -set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") -set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") - -install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - COMPONENT Runtime) - -install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -if(PLUGIN_BUNDLED_LIBRARIES) - install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) -endif() - -# Copy the native assets provided by the build.dart from all packages. -set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") -install(DIRECTORY "${NATIVE_ASSETS_DIR}" - DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" - COMPONENT Runtime) - -# Fully re-copy the assets directory on each build to avoid having stale files -# from a previous install. -set(FLUTTER_ASSET_DIR_NAME "flutter_assets") -install(CODE " - file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") - " COMPONENT Runtime) -install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" - DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) - -# Install the AOT library on non-Debug builds only. -install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" - CONFIGURATIONS Profile;Release - COMPONENT Runtime) diff --git a/plugins/window_ext/example/windows/flutter/CMakeLists.txt b/plugins/window_ext/example/windows/flutter/CMakeLists.txt deleted file mode 100644 index 903f489..0000000 --- a/plugins/window_ext/example/windows/flutter/CMakeLists.txt +++ /dev/null @@ -1,109 +0,0 @@ -# This file controls Flutter-level build steps. It should not be edited. -cmake_minimum_required(VERSION 3.14) - -set(EPHEMERAL_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ephemeral") - -# Configuration provided via flutter tool. -include(${EPHEMERAL_DIR}/generated_config.cmake) - -# TODO: Move the rest of this into files in ephemeral. See -# https://github.com/flutter/flutter/issues/57146. -set(WRAPPER_ROOT "${EPHEMERAL_DIR}/cpp_client_wrapper") - -# Set fallback configurations for older versions of the flutter tool. -if (NOT DEFINED FLUTTER_TARGET_PLATFORM) - set(FLUTTER_TARGET_PLATFORM "windows-x64") -endif() - -# === Flutter Library === -set(FLUTTER_LIBRARY "${EPHEMERAL_DIR}/flutter_windows.dll") - -# Published to parent scope for install step. -set(FLUTTER_LIBRARY ${FLUTTER_LIBRARY} PARENT_SCOPE) -set(FLUTTER_ICU_DATA_FILE "${EPHEMERAL_DIR}/icudtl.dat" PARENT_SCOPE) -set(PROJECT_BUILD_DIR "${PROJECT_DIR}/build/" PARENT_SCOPE) -set(AOT_LIBRARY "${PROJECT_DIR}/build/windows/app.so" PARENT_SCOPE) - -list(APPEND FLUTTER_LIBRARY_HEADERS - "flutter_export.h" - "flutter_windows.h" - "flutter_messenger.h" - "flutter_plugin_registrar.h" - "flutter_texture_registrar.h" -) -list(TRANSFORM FLUTTER_LIBRARY_HEADERS PREPEND "${EPHEMERAL_DIR}/") -add_library(flutter INTERFACE) -target_include_directories(flutter INTERFACE - "${EPHEMERAL_DIR}" -) -target_link_libraries(flutter INTERFACE "${FLUTTER_LIBRARY}.lib") -add_dependencies(flutter flutter_assemble) - -# === Wrapper === -list(APPEND CPP_WRAPPER_SOURCES_CORE - "core_implementations.cc" - "standard_codec.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_CORE PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_PLUGIN - "plugin_registrar.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_PLUGIN PREPEND "${WRAPPER_ROOT}/") -list(APPEND CPP_WRAPPER_SOURCES_APP - "flutter_engine.cc" - "flutter_view_controller.cc" -) -list(TRANSFORM CPP_WRAPPER_SOURCES_APP PREPEND "${WRAPPER_ROOT}/") - -# Wrapper sources needed for a plugin. -add_library(flutter_wrapper_plugin STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} -) -apply_standard_settings(flutter_wrapper_plugin) -set_target_properties(flutter_wrapper_plugin PROPERTIES - POSITION_INDEPENDENT_CODE ON) -set_target_properties(flutter_wrapper_plugin PROPERTIES - CXX_VISIBILITY_PRESET hidden) -target_link_libraries(flutter_wrapper_plugin PUBLIC flutter) -target_include_directories(flutter_wrapper_plugin PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_plugin flutter_assemble) - -# Wrapper sources needed for the runner. -add_library(flutter_wrapper_app STATIC - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_APP} -) -apply_standard_settings(flutter_wrapper_app) -target_link_libraries(flutter_wrapper_app PUBLIC flutter) -target_include_directories(flutter_wrapper_app PUBLIC - "${WRAPPER_ROOT}/include" -) -add_dependencies(flutter_wrapper_app flutter_assemble) - -# === Flutter tool backend === -# _phony_ is a non-existent file to force this command to run every time, -# since currently there's no way to get a full input/output list from the -# flutter tool. -set(PHONY_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/_phony_") -set_source_files_properties("${PHONY_OUTPUT}" PROPERTIES SYMBOLIC TRUE) -add_custom_command( - OUTPUT ${FLUTTER_LIBRARY} ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} - ${PHONY_OUTPUT} - COMMAND ${CMAKE_COMMAND} -E env - ${FLUTTER_TOOL_ENVIRONMENT} - "${FLUTTER_ROOT}/packages/flutter_tools/bin/tool_backend.bat" - ${FLUTTER_TARGET_PLATFORM} $ - VERBATIM -) -add_custom_target(flutter_assemble DEPENDS - "${FLUTTER_LIBRARY}" - ${FLUTTER_LIBRARY_HEADERS} - ${CPP_WRAPPER_SOURCES_CORE} - ${CPP_WRAPPER_SOURCES_PLUGIN} - ${CPP_WRAPPER_SOURCES_APP} -) diff --git a/plugins/window_ext/example/windows/runner/CMakeLists.txt b/plugins/window_ext/example/windows/runner/CMakeLists.txt deleted file mode 100644 index 394917c..0000000 --- a/plugins/window_ext/example/windows/runner/CMakeLists.txt +++ /dev/null @@ -1,40 +0,0 @@ -cmake_minimum_required(VERSION 3.14) -project(runner LANGUAGES CXX) - -# Define the application target. To change its name, change BINARY_NAME in the -# top-level CMakeLists.txt, not the value here, or `flutter run` will no longer -# work. -# -# Any new source files that you add to the application should be added here. -add_executable(${BINARY_NAME} WIN32 - "flutter_window.cpp" - "main.cpp" - "utils.cpp" - "win32_window.cpp" - "${FLUTTER_MANAGED_DIR}/generated_plugin_registrant.cc" - "Runner.rc" - "runner.exe.manifest" -) - -# Apply the standard set of build settings. This can be removed for applications -# that need different build settings. -apply_standard_settings(${BINARY_NAME}) - -# Add preprocessor definitions for the build version. -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION=\"${FLUTTER_VERSION}\"") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MAJOR=${FLUTTER_VERSION_MAJOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_MINOR=${FLUTTER_VERSION_MINOR}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_PATCH=${FLUTTER_VERSION_PATCH}") -target_compile_definitions(${BINARY_NAME} PRIVATE "FLUTTER_VERSION_BUILD=${FLUTTER_VERSION_BUILD}") - -# Disable Windows macros that collide with C++ standard library functions. -target_compile_definitions(${BINARY_NAME} PRIVATE "NOMINMAX") - -# Add dependency libraries and include directories. Add any application-specific -# dependencies here. -target_link_libraries(${BINARY_NAME} PRIVATE flutter flutter_wrapper_app) -target_link_libraries(${BINARY_NAME} PRIVATE "dwmapi.lib") -target_include_directories(${BINARY_NAME} PRIVATE "${CMAKE_SOURCE_DIR}") - -# Run the Flutter tool portions of the build. This must not be removed. -add_dependencies(${BINARY_NAME} flutter_assemble) diff --git a/plugins/window_ext/example/windows/runner/Runner.rc b/plugins/window_ext/example/windows/runner/Runner.rc deleted file mode 100644 index 6079d4d..0000000 --- a/plugins/window_ext/example/windows/runner/Runner.rc +++ /dev/null @@ -1,121 +0,0 @@ -// Microsoft Visual C++ generated resource script. -// -#pragma code_page(65001) -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winres.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (United States) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE -BEGIN - "#include ""winres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - - -///////////////////////////////////////////////////////////////////////////// -// -// Icon -// - -// Icon with lowest ID value placed first to ensure application icon -// remains consistent on all systems. -IDI_APP_ICON ICON "resources\\app_icon.ico" - - -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -#if defined(FLUTTER_VERSION_MAJOR) && defined(FLUTTER_VERSION_MINOR) && defined(FLUTTER_VERSION_PATCH) && defined(FLUTTER_VERSION_BUILD) -#define VERSION_AS_NUMBER FLUTTER_VERSION_MAJOR,FLUTTER_VERSION_MINOR,FLUTTER_VERSION_PATCH,FLUTTER_VERSION_BUILD -#else -#define VERSION_AS_NUMBER 1,0,0,0 -#endif - -#if defined(FLUTTER_VERSION) -#define VERSION_AS_STRING FLUTTER_VERSION -#else -#define VERSION_AS_STRING "1.0.0" -#endif - -VS_VERSION_INFO VERSIONINFO - FILEVERSION VERSION_AS_NUMBER - PRODUCTVERSION VERSION_AS_NUMBER - FILEFLAGSMASK VS_FFI_FILEFLAGSMASK -#ifdef _DEBUG - FILEFLAGS VS_FF_DEBUG -#else - FILEFLAGS 0x0L -#endif - FILEOS VOS__WINDOWS32 - FILETYPE VFT_APP - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904e4" - BEGIN - VALUE "CompanyName", "com.example" "\0" - VALUE "FileDescription", "window_ext_example" "\0" - VALUE "FileVersion", VERSION_AS_STRING "\0" - VALUE "InternalName", "window_ext_example" "\0" - VALUE "LegalCopyright", "Copyright (C) 2024 com.example. All rights reserved." "\0" - VALUE "OriginalFilename", "window_ext_example.exe" "\0" - VALUE "ProductName", "window_ext_example" "\0" - VALUE "ProductVersion", VERSION_AS_STRING "\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1252 - END -END - -#endif // English (United States) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED diff --git a/plugins/window_ext/example/windows/runner/flutter_window.cpp b/plugins/window_ext/example/windows/runner/flutter_window.cpp deleted file mode 100644 index 955ee30..0000000 --- a/plugins/window_ext/example/windows/runner/flutter_window.cpp +++ /dev/null @@ -1,71 +0,0 @@ -#include "flutter_window.h" - -#include - -#include "flutter/generated_plugin_registrant.h" - -FlutterWindow::FlutterWindow(const flutter::DartProject& project) - : project_(project) {} - -FlutterWindow::~FlutterWindow() {} - -bool FlutterWindow::OnCreate() { - if (!Win32Window::OnCreate()) { - return false; - } - - RECT frame = GetClientArea(); - - // The size here must match the window dimensions to avoid unnecessary surface - // creation / destruction in the startup path. - flutter_controller_ = std::make_unique( - frame.right - frame.left, frame.bottom - frame.top, project_); - // Ensure that basic setup of the controller was successful. - if (!flutter_controller_->engine() || !flutter_controller_->view()) { - return false; - } - RegisterPlugins(flutter_controller_->engine()); - SetChildContent(flutter_controller_->view()->GetNativeWindow()); - - flutter_controller_->engine()->SetNextFrameCallback([&]() { - this->Show(); - }); - - // Flutter can complete the first frame before the "show window" callback is - // registered. The following call ensures a frame is pending to ensure the - // window is shown. It is a no-op if the first frame hasn't completed yet. - flutter_controller_->ForceRedraw(); - - return true; -} - -void FlutterWindow::OnDestroy() { - if (flutter_controller_) { - flutter_controller_ = nullptr; - } - - Win32Window::OnDestroy(); -} - -LRESULT -FlutterWindow::MessageHandler(HWND hwnd, UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - // Give Flutter, including plugins, an opportunity to handle window messages. - if (flutter_controller_) { - std::optional result = - flutter_controller_->HandleTopLevelWindowProc(hwnd, message, wparam, - lparam); - if (result) { - return *result; - } - } - - switch (message) { - case WM_FONTCHANGE: - flutter_controller_->engine()->ReloadSystemFonts(); - break; - } - - return Win32Window::MessageHandler(hwnd, message, wparam, lparam); -} diff --git a/plugins/window_ext/example/windows/runner/flutter_window.h b/plugins/window_ext/example/windows/runner/flutter_window.h deleted file mode 100644 index 6da0652..0000000 --- a/plugins/window_ext/example/windows/runner/flutter_window.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef RUNNER_FLUTTER_WINDOW_H_ -#define RUNNER_FLUTTER_WINDOW_H_ - -#include -#include - -#include - -#include "win32_window.h" - -// A window that does nothing but host a Flutter view. -class FlutterWindow : public Win32Window { - public: - // Creates a new FlutterWindow hosting a Flutter view running |project|. - explicit FlutterWindow(const flutter::DartProject& project); - virtual ~FlutterWindow(); - - protected: - // Win32Window: - bool OnCreate() override; - void OnDestroy() override; - LRESULT MessageHandler(HWND window, UINT const message, WPARAM const wparam, - LPARAM const lparam) noexcept override; - - private: - // The project to run. - flutter::DartProject project_; - - // The Flutter instance hosted by this window. - std::unique_ptr flutter_controller_; -}; - -#endif // RUNNER_FLUTTER_WINDOW_H_ diff --git a/plugins/window_ext/example/windows/runner/main.cpp b/plugins/window_ext/example/windows/runner/main.cpp deleted file mode 100644 index 03589ba..0000000 --- a/plugins/window_ext/example/windows/runner/main.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include -#include - -#include "flutter_window.h" -#include "utils.h" - -int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev, - _In_ wchar_t *command_line, _In_ int show_command) { - // Attach to console when present (e.g., 'flutter run') or create a - // new console when running with a debugger. - if (!::AttachConsole(ATTACH_PARENT_PROCESS) && ::IsDebuggerPresent()) { - CreateAndAttachConsole(); - } - - // Initialize COM, so that it is available for use in the library and/or - // plugins. - ::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED); - - flutter::DartProject project(L"data"); - - std::vector command_line_arguments = - GetCommandLineArguments(); - - project.set_dart_entrypoint_arguments(std::move(command_line_arguments)); - - FlutterWindow window(project); - Win32Window::Point origin(10, 10); - Win32Window::Size size(1280, 720); - if (!window.Create(L"window_ext_example", origin, size)) { - return EXIT_FAILURE; - } - window.SetQuitOnClose(true); - - ::MSG msg; - while (::GetMessage(&msg, nullptr, 0, 0)) { - ::TranslateMessage(&msg); - ::DispatchMessage(&msg); - } - - ::CoUninitialize(); - return EXIT_SUCCESS; -} diff --git a/plugins/window_ext/example/windows/runner/resource.h b/plugins/window_ext/example/windows/runner/resource.h deleted file mode 100644 index 66a65d1..0000000 --- a/plugins/window_ext/example/windows/runner/resource.h +++ /dev/null @@ -1,16 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Visual C++ generated include file. -// Used by Runner.rc -// -#define IDI_APP_ICON 101 - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 102 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1001 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/plugins/window_ext/example/windows/runner/resources/app_icon.ico b/plugins/window_ext/example/windows/runner/resources/app_icon.ico deleted file mode 100644 index c04e20caf6370ebb9253ad831cc31de4a9c965f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 33772 zcmeHQc|26z|35SKE&G-*mXah&B~fFkXr)DEO&hIfqby^T&>|8^_Ub8Vp#`BLl3lbZ zvPO!8k!2X>cg~Elr=IVxo~J*a`+9wR=A83c-k-DFd(XM&UI1VKCqM@V;DDtJ09WB} zRaHKiW(GT00brH|0EeTeKVbpbGZg?nK6-j827q-+NFM34gXjqWxJ*a#{b_apGN<-L_m3#8Z26atkEn& ze87Bvv^6vVmM+p+cQ~{u%=NJF>#(d;8{7Q{^rWKWNtf14H}>#&y7$lqmY6xmZryI& z($uy?c5-+cPnt2%)R&(KIWEXww>Cnz{OUpT>W$CbO$h1= z#4BPMkFG1Y)x}Ui+WXr?Z!w!t_hjRq8qTaWpu}FH{MsHlU{>;08goVLm{V<&`itk~ zE_Ys=D(hjiy+5=?=$HGii=Y5)jMe9|wWoD_K07(}edAxh`~LBorOJ!Cf@f{_gNCC| z%{*04ViE!#>@hc1t5bb+NO>ncf@@Dv01K!NxH$3Eg1%)|wLyMDF8^d44lV!_Sr}iEWefOaL z8f?ud3Q%Sen39u|%00W<#!E=-RpGa+H8}{ulxVl4mwpjaU+%2pzmi{3HM)%8vb*~-M9rPUAfGCSos8GUXp02|o~0BTV2l#`>>aFV&_P$ejS;nGwSVP8 zMbOaG7<7eKD>c12VdGH;?2@q7535sa7MN*L@&!m?L`ASG%boY7(&L5imY#EQ$KrBB z4@_tfP5m50(T--qv1BJcD&aiH#b-QC>8#7Fx@3yXlonJI#aEIi=8&ChiVpc#N=5le zM*?rDIdcpawoc5kizv$GEjnveyrp3sY>+5_R5;>`>erS%JolimF=A^EIsAK zsPoVyyUHCgf0aYr&alx`<)eb6Be$m&`JYSuBu=p8j%QlNNp$-5C{b4#RubPb|CAIS zGE=9OFLP7?Hgc{?k45)84biT0k&-C6C%Q}aI~q<(7BL`C#<6HyxaR%!dFx7*o^laG z=!GBF^cwK$IA(sn9y6>60Rw{mYRYkp%$jH z*xQM~+bp)G$_RhtFPYx2HTsWk80+p(uqv9@I9)y{b$7NK53rYL$ezbmRjdXS?V}fj zWxX_feWoLFNm3MG7pMUuFPs$qrQWO9!l2B(SIuy2}S|lHNbHzoE+M2|Zxhjq9+Ws8c{*}x^VAib7SbxJ*Q3EnY5lgI9 z=U^f3IW6T=TWaVj+2N%K3<%Un;CF(wUp`TC&Y|ZjyFu6co^uqDDB#EP?DV5v_dw~E zIRK*BoY9y-G_ToU2V_XCX4nJ32~`czdjT!zwme zGgJ0nOk3U4@IE5JwtM}pwimLjk{ln^*4HMU%Fl4~n(cnsLB}Ja-jUM>xIB%aY;Nq8 z)Fp8dv1tkqKanv<68o@cN|%thj$+f;zGSO7H#b+eMAV8xH$hLggtt?O?;oYEgbq@= zV(u9bbd12^%;?nyk6&$GPI%|+<_mEpJGNfl*`!KV;VfmZWw{n{rnZ51?}FDh8we_L z8OI9nE31skDqJ5Oa_ybn7|5@ui>aC`s34p4ZEu6-s!%{uU45$Zd1=p$^^dZBh zu<*pDDPLW+c>iWO$&Z_*{VSQKg7=YEpS3PssPn1U!lSm6eZIho*{@&20e4Y_lRklKDTUCKI%o4Pc<|G^Xgu$J^Q|B87U;`c1zGwf^-zH*VQ^x+i^OUWE0yd z;{FJq)2w!%`x7yg@>uGFFf-XJl4H`YtUG%0slGKOlXV`q?RP>AEWg#x!b{0RicxGhS!3$p7 zij;{gm!_u@D4$Ox%>>bPtLJ> zwKtYz?T_DR1jN>DkkfGU^<#6sGz|~p*I{y`aZ>^Di#TC|Z!7j_O1=Wo8thuit?WxR zh9_S>kw^{V^|g}HRUF=dcq>?q(pHxw!8rx4dC6vbQVmIhmICF#zU!HkHpQ>9S%Uo( zMw{eC+`&pb=GZRou|3;Po1}m46H6NGd$t<2mQh}kaK-WFfmj_66_17BX0|j-E2fe3Jat}ijpc53 zJV$$;PC<5aW`{*^Z6e5##^`Ed#a0nwJDT#Qq~^e8^JTA=z^Kl>La|(UQ!bI@#ge{Dzz@61p-I)kc2?ZxFt^QQ}f%ldLjO*GPj(5)V9IyuUakJX=~GnTgZ4$5!3E=V#t`yOG4U z(gphZB6u2zsj=qNFLYShhg$}lNpO`P9xOSnO*$@@UdMYES*{jJVj|9z-}F^riksLK zbsU+4-{281P9e2UjY6tse^&a)WM1MFw;p#_dHhWI7p&U*9TR0zKdVuQed%6{otTsq z$f~S!;wg#Bd9kez=Br{m|66Wv z#g1xMup<0)H;c2ZO6su_ii&m8j&+jJz4iKnGZ&wxoQX|5a>v&_e#6WA!MB_4asTxLRGQCC5cI(em z%$ZfeqP>!*q5kU>a+BO&ln=4Jm>Ef(QE8o&RgLkk%2}4Tf}U%IFP&uS7}&|Q-)`5< z+e>;s#4cJ-z%&-^&!xsYx777Wt(wZY9(3(avmr|gRe4cD+a8&!LY`1^T?7x{E<=kdY9NYw>A;FtTvQ=Y&1M%lyZPl$ss1oY^Sl8we}n}Aob#6 zl4jERwnt9BlSoWb@3HxYgga(752Vu6Y)k4yk9u~Kw>cA5&LHcrvn1Y-HoIuFWg~}4 zEw4bR`mXZQIyOAzo)FYqg?$5W<;^+XX%Uz61{-L6@eP|lLH%|w?g=rFc;OvEW;^qh z&iYXGhVt(G-q<+_j}CTbPS_=K>RKN0&;dubh0NxJyDOHFF;<1k!{k#7b{|Qok9hac z;gHz}6>H6C6RnB`Tt#oaSrX0p-j-oRJ;_WvS-qS--P*8}V943RT6kou-G=A+7QPGQ z!ze^UGxtW3FC0$|(lY9^L!Lx^?Q8cny(rR`es5U;-xBhphF%_WNu|aO<+e9%6LuZq zt(0PoagJG<%hyuf;te}n+qIl_Ej;czWdc{LX^pS>77s9t*2b4s5dvP_!L^3cwlc)E!(!kGrg~FescVT zZCLeua3f4;d;Tk4iXzt}g}O@nlK3?_o91_~@UMIl?@77Qc$IAlLE95#Z=TES>2E%z zxUKpK{_HvGF;5%Q7n&vA?`{%8ohlYT_?(3A$cZSi)MvIJygXD}TS-3UwyUxGLGiJP znblO~G|*uA^|ac8E-w#}uBtg|s_~s&t>-g0X%zIZ@;o_wNMr_;{KDg^O=rg`fhDZu zFp(VKd1Edj%F zWHPl+)FGj%J1BO3bOHVfH^3d1F{)*PL&sRX`~(-Zy3&9UQX)Z;c51tvaI2E*E7!)q zcz|{vpK7bjxix(k&6=OEIBJC!9lTkUbgg?4-yE{9+pFS)$Ar@vrIf`D0Bnsed(Cf? zObt2CJ>BKOl>q8PyFO6w)+6Iz`LW%T5^R`U_NIW0r1dWv6OY=TVF?N=EfA(k(~7VBW(S;Tu5m4Lg8emDG-(mOSSs=M9Q&N8jc^Y4&9RqIsk(yO_P(mcCr}rCs%1MW1VBrn=0-oQN(Xj!k%iKV zb%ricBF3G4S1;+8lzg5PbZ|$Se$)I=PwiK=cDpHYdov2QO1_a-*dL4KUi|g&oh>(* zq$<`dQ^fat`+VW?m)?_KLn&mp^-@d=&7yGDt<=XwZZC=1scwxO2^RRI7n@g-1o8ps z)&+et_~)vr8aIF1VY1Qrq~Xe``KJrQSnAZ{CSq3yP;V*JC;mmCT6oRLSs7=GA?@6g zUooM}@tKtx(^|aKK8vbaHlUQqwE0}>j&~YlN3H#vKGm@u)xxS?n9XrOWUfCRa< z`20Fld2f&;gg7zpo{Adh+mqNntMc-D$N^yWZAZRI+u1T1zWHPxk{+?vcS1D>08>@6 zLhE@`gt1Y9mAK6Z4p|u(5I%EkfU7rKFSM=E4?VG9tI;a*@?6!ey{lzN5=Y-!$WFSe z&2dtO>^0@V4WRc#L&P%R(?@KfSblMS+N+?xUN$u3K4Ys%OmEh+tq}fnU}i>6YHM?< zlnL2gl~sF!j!Y4E;j3eIU-lfa`RsOL*Tt<%EFC0gPzoHfNWAfKFIKZN8}w~(Yi~=q z>=VNLO2|CjkxP}RkutxjV#4fWYR1KNrPYq5ha9Wl+u>ipsk*I(HS@iLnmGH9MFlTU zaFZ*KSR0px>o+pL7BbhB2EC1%PJ{67_ z#kY&#O4@P=OV#-79y_W>Gv2dxL*@G7%LksNSqgId9v;2xJ zrh8uR!F-eU$NMx@S*+sk=C~Dxr9Qn7TfWnTupuHKuQ$;gGiBcU>GF5sWx(~4IP3`f zWE;YFO*?jGwYh%C3X<>RKHC-DZ!*r;cIr}GLOno^3U4tFSSoJp%oHPiSa%nh=Zgn% z14+8v@ygy0>UgEN1bczD6wK45%M>psM)y^)IfG*>3ItX|TzV*0i%@>L(VN!zdKb8S?Qf7BhjNpziA zR}?={-eu>9JDcl*R=OP9B8N$IcCETXah9SUDhr{yrld{G;PnCWRsPD7!eOOFBTWUQ=LrA_~)mFf&!zJX!Oc-_=kT<}m|K52 z)M=G#;p;Rdb@~h5D{q^K;^fX-m5V}L%!wVC2iZ1uu401Ll}#rocTeK|7FAeBRhNdQ zCc2d^aQnQp=MpOmak60N$OgS}a;p(l9CL`o4r(e-nN}mQ?M&isv-P&d$!8|1D1I(3-z!wi zTgoo)*Mv`gC?~bm?S|@}I|m-E2yqPEvYybiD5azInexpK8?9q*$9Yy9-t%5jU8~ym zgZDx>!@ujQ=|HJnwp^wv-FdD{RtzO9SnyfB{mH_(c!jHL*$>0o-(h(eqe*ZwF6Lvu z{7rkk%PEqaA>o+f{H02tzZ@TWy&su?VNw43! z-X+rN`6llvpUms3ZiSt)JMeztB~>9{J8SPmYs&qohxdYFi!ra8KR$35Zp9oR)eFC4 zE;P31#3V)n`w$fZ|4X-|%MX`xZDM~gJyl2W;O$H25*=+1S#%|53>|LyH za@yh+;325%Gq3;J&a)?%7X%t@WXcWL*BaaR*7UEZad4I8iDt7^R_Fd`XeUo256;sAo2F!HcIQKk;h})QxEsPE5BcKc7WyerTchgKmrfRX z!x#H_%cL#B9TWAqkA4I$R^8{%do3Y*&(;WFmJ zU7Dih{t1<{($VtJRl9|&EB?|cJ)xse!;}>6mSO$o5XIx@V|AA8ZcoD88ZM?C*;{|f zZVmf94_l1OmaICt`2sTyG!$^UeTHx9YuUP!omj(r|7zpm5475|yXI=rR>>fteLI+| z)MoiGho0oEt=*J(;?VY0QzwCqw@cVm?d7Y!z0A@u#H?sCJ*ecvyhj& z-F77lO;SH^dmf?L>3i>?Z*U}Em4ZYV_CjgfvzYsRZ+1B!Uo6H6mbS<-FFL`ytqvb& zE7+)2ahv-~dz(Hs+f})z{*4|{)b=2!RZK;PWwOnO=hG7xG`JU5>bAvUbdYd_CjvtHBHgtGdlO+s^9ca^Bv3`t@VRX2_AD$Ckg36OcQRF zXD6QtGfHdw*hx~V(MV-;;ZZF#dJ-piEF+s27z4X1qi5$!o~xBnvf=uopcn7ftfsZc zy@(PuOk`4GL_n(H9(E2)VUjqRCk9kR?w)v@xO6Jm_Mx})&WGEl=GS0#)0FAq^J*o! zAClhvoTsNP*-b~rN{8Yym3g{01}Ep^^Omf=SKqvN?{Q*C4HNNAcrowIa^mf+3PRy! z*_G-|3i8a;+q;iP@~Of_$(vtFkB8yOyWt2*K)vAn9El>=D;A$CEx6b*XF@4y_6M+2 zpeW`RHoI_p(B{%(&jTHI->hmNmZjHUj<@;7w0mx3&koy!2$@cfX{sN19Y}euYJFn& z1?)+?HCkD0MRI$~uB2UWri})0bru_B;klFdwsLc!ne4YUE;t41JqfG# zZJq6%vbsdx!wYeE<~?>o4V`A3?lN%MnKQ`z=uUivQN^vzJ|C;sdQ37Qn?;lpzg})y z)_2~rUdH}zNwX;Tp0tJ78+&I=IwOQ-fl30R79O8@?Ub8IIA(6I`yHn%lARVL`%b8+ z4$8D-|MZZWxc_)vu6@VZN!HsI$*2NOV&uMxBNzIbRgy%ob_ zhwEH{J9r$!dEix9XM7n&c{S(h>nGm?el;gaX0@|QnzFD@bne`el^CO$yXC?BDJ|Qg z+y$GRoR`?ST1z^e*>;!IS@5Ovb7*RlN>BV_UC!7E_F;N#ky%1J{+iixp(dUJj93aK zzHNN>R-oN7>kykHClPnoPTIj7zc6KM(Pnlb(|s??)SMb)4!sMHU^-ntJwY5Big7xv zb1Ew`Xj;|D2kzGja*C$eS44(d&RMU~c_Y14V9_TLTz0J#uHlsx`S6{nhsA0dWZ#cG zJ?`fO50E>*X4TQLv#nl%3GOk*UkAgt=IY+u0LNXqeln3Z zv$~&Li`ZJOKkFuS)dJRA>)b_Da%Q~axwA_8zNK{BH{#}#m}zGcuckz}riDE-z_Ms> zR8-EqAMcfyGJCtvTpaUVQtajhUS%c@Yj}&6Zz;-M7MZzqv3kA7{SuW$oW#=0az2wQ zg-WG@Vb4|D`pl~Il54N7Hmsauc_ne-a!o5#j3WaBBh@Wuefb!QJIOn5;d)%A#s+5% zuD$H=VNux9bE-}1&bcYGZ+>1Fo;3Z@e&zX^n!?JK*adSbONm$XW9z;Q^L>9U!}Toj2WdafJ%oL#h|yWWwyAGxzfrAWdDTtaKl zK4`5tDpPg5>z$MNv=X0LZ0d6l%D{(D8oT@+w0?ce$DZ6pv>{1&Ok67Ix1 zH}3=IEhPJEhItCC8E=`T`N5(k?G=B4+xzZ?<4!~ ze~z6Wk9!CHTI(0rLJ4{JU?E-puc;xusR?>G?;4vt;q~iI9=kDL=z0Rr%O$vU`30X$ zDZRFyZ`(omOy@u|i6h;wtJlP;+}$|Ak|k2dea7n?U1*$T!sXqqOjq^NxLPMmk~&qI zYg0W?yK8T(6+Ea+$YyspKK?kP$+B`~t3^Pib_`!6xCs32!i@pqXfFV6PmBIR<-QW= zN8L{pt0Vap0x`Gzn#E@zh@H)0FfVfA_Iu4fjYZ+umO1LXIbVc$pY+E234u)ttcrl$ z>s92z4vT%n6cMb>=XT6;l0+9e(|CZG)$@C7t7Z7Ez@a)h)!hyuV&B5K%%)P5?Lk|C zZZSVzdXp{@OXSP0hoU-gF8s8Um(#xzjP2Vem zec#-^JqTa&Y#QJ>-FBxd7tf`XB6e^JPUgagB8iBSEps;92KG`!#mvVcPQ5yNC-GEG zTiHEDYfH+0O15}r^+ z#jxj=@x8iNHWALe!P3R67TwmhItn**0JwnzSV2O&KE8KcT+0hWH^OPD1pwiuyx=b@ zNf5Jh0{9X)8;~Es)$t@%(3!OnbY+`@?i{mGX7Yy}8T_*0a6g;kaFPq;*=px5EhO{Cp%1kI<0?*|h8v!6WnO3cCJRF2-CRrU3JiLJnj@6;L)!0kWYAc_}F{2P))3HmCrz zQ&N&gE70;`!6*eJ4^1IR{f6j4(-l&X!tjHxkbHA^Zhrnhr9g{exN|xrS`5Pq=#Xf& zG%P=#ra-TyVFfgW%cZo5OSIwFL9WtXAlFOa+ubmI5t*3=g#Y zF%;70p5;{ZeFL}&}yOY1N1*Q;*<(kTB!7vM$QokF)yr2FlIU@$Ph58$Bz z0J?xQG=MlS4L6jA22eS42g|9*9pX@$#*sUeM(z+t?hr@r5J&D1rx}2pW&m*_`VDCW zUYY@v-;bAO0HqoAgbbiGGC<=ryf96}3pouhy3XJrX+!!u*O_>Si38V{uJmQ&USptX zKp#l(?>%^7;2%h(q@YWS#9;a!JhKlkR#Vd)ERILlgu!Hr@jA@V;sk4BJ-H#p*4EqC zDGjC*tl=@3Oi6)Bn^QwFpul18fpkbpg0+peH$xyPBqb%`$OUhPKyWb32o7clB*9Z< zN=i~NLjavrLtwgJ01bufP+>p-jR2I95|TpmKpQL2!oV>g(4RvS2pK4*ou%m(h6r3A zX#s&`9LU1ZG&;{CkOK!4fLDTnBys`M!vuz>Q&9OZ0hGQl!~!jSDg|~s*w52opC{sB ze|Cf2luD(*G13LcOAGA!s2FjSK8&IE5#W%J25w!vM0^VyQM!t)inj&RTiJ!wXzFgz z3^IqzB7I0L$llljsGq})thBy9UOyjtFO_*hYM_sgcMk>44jeH0V1FDyELc{S1F-;A zS;T^k^~4biG&V*Irq}O;e}j$$+E_#G?HKIn05iP3j|87TkGK~SqG!-KBg5+mN(aLm z8ybhIM`%C19UX$H$KY6JgXbY$0AT%rEpHC;u`rQ$Y=rxUdsc5*Kvc8jaYaO$^)cI6){P6K0r)I6DY4Wr4&B zLQUBraey#0HV|&c4v7PVo3n$zHj99(TZO^3?Ly%C4nYvJTL9eLBLHsM3WKKD>5!B` zQ=BsR3aR6PD(Fa>327E2HAu5TM~Wusc!)>~(gM)+3~m;92Jd;FnSib=M5d6;;5{%R zb4V7DEJ0V!CP-F*oU?gkc>ksUtAYP&V4ND5J>J2^jt*vcFflQWCrB&fLdT%O59PVJ zhid#toR=FNgD!q3&r8#wEBr`!wzvQu5zX?Q>nlSJ4i@WC*CN*-xU66F^V5crWevQ9gsq$I@z1o(a=k7LL~ z7m_~`o;_Ozha1$8Q}{WBehvAlO4EL60y5}8GDrZ< zXh&F}71JbW2A~8KfEWj&UWV#4+Z4p`b{uAj4&WC zha`}X@3~+Iz^WRlOHU&KngK>#j}+_o@LdBC1H-`gT+krWX3-;!)6?{FBp~%20a}FL zFP9%Emqcwa#(`=G>BBZ0qZDQhmZKJg_g8<=bBFKWr!dyg(YkpE+|R*SGpDVU!+VlU zFC54^DLv}`qa%49T>nNiA9Q7Ips#!Xx90tCU2gvK`(F+GPcL=J^>No{)~we#o@&mUb6c$ zCc*<|NJBk-#+{j9xkQ&ujB zI~`#kN~7W!f*-}wkG~Ld!JqZ@tK}eeSnsS5J1fMFXm|`LJx&}5`@dK3W^7#Wnm+_P zBZkp&j1fa2Y=eIjJ0}gh85jt43kaIXXv?xmo@eHrka!Z|vQv12HN#+!I5E z`(fbuW>gFiJL|uXJ!vKt#z3e3HlVdboH7;e#i3(2<)Fg-I@BR!qY#eof3MFZ&*Y@l zI|KJf&ge@p2Dq09Vu$$Qxb7!}{m-iRk@!)%KL)txi3;~Z4Pb}u@GsW;ELiWeG9V51 znX#}B&4Y2E7-H=OpNE@q{%hFLxwIpBF2t{vPREa8_{linXT;#1vMRWjOzLOP$-hf( z>=?$0;~~PnkqY;~K{EM6Vo-T(0K{A0}VUGmu*hR z{tw3hvBN%N3G3Yw`X5Te+F{J`(3w1s3-+1EbnFQKcrgrX1Jqvs@ADGe%M0s$EbK$$ zK)=y=upBc6SjGYAACCcI=Y*6Fi8_jgwZlLxD26fnQfJmb8^gHRN5(TemhX@0e=vr> zg`W}6U>x6VhoA3DqsGGD9uL1DhB3!OXO=k}59TqD@(0Nb{)Ut_luTioK_>7wjc!5C zIr@w}b`Fez3)0wQfKl&bae7;PcTA7%?f2xucM0G)wt_KO!Ewx>F~;=BI0j=Fb4>pp zv}0R^xM4eti~+^+gE$6b81p(kwzuDti(-K9bc|?+pJEl@H+jSYuxZQV8rl8 zjp@M{#%qItIUFN~KcO9Hed*`$5A-2~pAo~K&<-Q+`9`$CK>rzqAI4w~$F%vs9s{~x zg4BP%Gy*@m?;D6=SRX?888Q6peF@_4Z->8wAH~Cn!R$|Hhq2cIzFYqT_+cDourHbY z0qroxJnrZ4Gh+Ay+F`_c%+KRT>y3qw{)89?=hJ@=KO=@ep)aBJ$c!JHfBMJpsP*3G za7|)VJJ8B;4?n{~ldJF7%jmb`-ftIvNd~ekoufG(`K(3=LNc;HBY& z(lp#q8XAD#cIf}k49zX_i`*fO+#!zKA&%T3j@%)R+#yag067CU%yUEe47>wzGU8^` z1EXFT^@I!{J!F8!X?S6ph8J=gUi5tl93*W>7}_uR<2N2~e}FaG?}KPyugQ=-OGEZs z!GBoyYY+H*ANn4?Z)X4l+7H%`17i5~zRlRIX?t)6_eu=g2Q`3WBhxSUeea+M-S?RL zX9oBGKn%a!H+*hx4d2(I!gsi+@SQK%<{X22M~2tMulJoa)0*+z9=-YO+;DFEm5eE1U9b^B(Z}2^9!Qk`!A$wUE z7$Ar5?NRg2&G!AZqnmE64eh^Anss3i!{}%6@Et+4rr!=}!SBF8eZ2*J3ujCWbl;3; z48H~goPSv(8X61fKKdpP!Z7$88NL^Z?j`!^*I?-P4X^pMxyWz~@$(UeAcTSDd(`vO z{~rc;9|GfMJcApU3k}22a!&)k4{CU!e_ny^Y3cO;tOvOMKEyWz!vG(Kp*;hB?d|R3`2X~=5a6#^o5@qn?J-bI8Ppip{-yG z!k|VcGsq!jF~}7DMr49Wap-s&>o=U^T0!Lcy}!(bhtYsPQy z4|EJe{12QL#=c(suQ89Mhw9<`bui%nx7Nep`C&*M3~vMEACmcRYYRGtANq$F%zh&V zc)cEVeHz*Z1N)L7k-(k3np#{GcDh2Q@ya0YHl*n7fl*ZPAsbU-a94MYYtA#&!c`xGIaV;yzsmrjfieTEtqB_WgZp2*NplHx=$O{M~2#i_vJ{ps-NgK zQsxKK_CBM2PP_je+Xft`(vYfXXgIUr{=PA=7a8`2EHk)Ym2QKIforz# tySWtj{oF3N9@_;i*Fv5S)9x^z=nlWP>jpp-9)52ZmLVA=i*%6g{{fxOO~wEK diff --git a/plugins/window_ext/example/windows/runner/runner.exe.manifest b/plugins/window_ext/example/windows/runner/runner.exe.manifest deleted file mode 100644 index a42ea76..0000000 --- a/plugins/window_ext/example/windows/runner/runner.exe.manifest +++ /dev/null @@ -1,20 +0,0 @@ - - - - - PerMonitorV2 - - - - - - - - - - - - - - - diff --git a/plugins/window_ext/example/windows/runner/utils.cpp b/plugins/window_ext/example/windows/runner/utils.cpp deleted file mode 100644 index 3a0b465..0000000 --- a/plugins/window_ext/example/windows/runner/utils.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include "utils.h" - -#include -#include -#include -#include - -#include - -void CreateAndAttachConsole() { - if (::AllocConsole()) { - FILE *unused; - if (freopen_s(&unused, "CONOUT$", "w", stdout)) { - _dup2(_fileno(stdout), 1); - } - if (freopen_s(&unused, "CONOUT$", "w", stderr)) { - _dup2(_fileno(stdout), 2); - } - std::ios::sync_with_stdio(); - FlutterDesktopResyncOutputStreams(); - } -} - -std::vector GetCommandLineArguments() { - // Convert the UTF-16 command line arguments to UTF-8 for the Engine to use. - int argc; - wchar_t** argv = ::CommandLineToArgvW(::GetCommandLineW(), &argc); - if (argv == nullptr) { - return std::vector(); - } - - std::vector command_line_arguments; - - // Skip the first argument as it's the binary name. - for (int i = 1; i < argc; i++) { - command_line_arguments.push_back(Utf8FromUtf16(argv[i])); - } - - ::LocalFree(argv); - - return command_line_arguments; -} - -std::string Utf8FromUtf16(const wchar_t* utf16_string) { - if (utf16_string == nullptr) { - return std::string(); - } - unsigned int target_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - -1, nullptr, 0, nullptr, nullptr) - -1; // remove the trailing null character - int input_length = (int)wcslen(utf16_string); - std::string utf8_string; - if (target_length == 0 || target_length > utf8_string.max_size()) { - return utf8_string; - } - utf8_string.resize(target_length); - int converted_length = ::WideCharToMultiByte( - CP_UTF8, WC_ERR_INVALID_CHARS, utf16_string, - input_length, utf8_string.data(), target_length, nullptr, nullptr); - if (converted_length == 0) { - return std::string(); - } - return utf8_string; -} diff --git a/plugins/window_ext/example/windows/runner/utils.h b/plugins/window_ext/example/windows/runner/utils.h deleted file mode 100644 index 3879d54..0000000 --- a/plugins/window_ext/example/windows/runner/utils.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef RUNNER_UTILS_H_ -#define RUNNER_UTILS_H_ - -#include -#include - -// Creates a console for the process, and redirects stdout and stderr to -// it for both the runner and the Flutter library. -void CreateAndAttachConsole(); - -// Takes a null-terminated wchar_t* encoded in UTF-16 and returns a std::string -// encoded in UTF-8. Returns an empty std::string on failure. -std::string Utf8FromUtf16(const wchar_t* utf16_string); - -// Gets the command line arguments passed in as a std::vector, -// encoded in UTF-8. Returns an empty std::vector on failure. -std::vector GetCommandLineArguments(); - -#endif // RUNNER_UTILS_H_ diff --git a/plugins/window_ext/example/windows/runner/win32_window.cpp b/plugins/window_ext/example/windows/runner/win32_window.cpp deleted file mode 100644 index 60608d0..0000000 --- a/plugins/window_ext/example/windows/runner/win32_window.cpp +++ /dev/null @@ -1,288 +0,0 @@ -#include "win32_window.h" - -#include -#include - -#include "resource.h" - -namespace { - -/// Window attribute that enables dark mode window decorations. -/// -/// Redefined in case the developer's machine has a Windows SDK older than -/// version 10.0.22000.0. -/// See: https://docs.microsoft.com/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute -#ifndef DWMWA_USE_IMMERSIVE_DARK_MODE -#define DWMWA_USE_IMMERSIVE_DARK_MODE 20 -#endif - -constexpr const wchar_t kWindowClassName[] = L"FLUTTER_RUNNER_WIN32_WINDOW"; - -/// Registry key for app theme preference. -/// -/// A value of 0 indicates apps should use dark mode. A non-zero or missing -/// value indicates apps should use light mode. -constexpr const wchar_t kGetPreferredBrightnessRegKey[] = - L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize"; -constexpr const wchar_t kGetPreferredBrightnessRegValue[] = L"AppsUseLightTheme"; - -// The number of Win32Window objects that currently exist. -static int g_active_window_count = 0; - -using EnableNonClientDpiScaling = BOOL __stdcall(HWND hwnd); - -// Scale helper to convert logical scaler values to physical using passed in -// scale factor -int Scale(int source, double scale_factor) { - return static_cast(source * scale_factor); -} - -// Dynamically loads the |EnableNonClientDpiScaling| from the User32 module. -// This API is only needed for PerMonitor V1 awareness mode. -void EnableFullDpiSupportIfAvailable(HWND hwnd) { - HMODULE user32_module = LoadLibraryA("User32.dll"); - if (!user32_module) { - return; - } - auto enable_non_client_dpi_scaling = - reinterpret_cast( - GetProcAddress(user32_module, "EnableNonClientDpiScaling")); - if (enable_non_client_dpi_scaling != nullptr) { - enable_non_client_dpi_scaling(hwnd); - } - FreeLibrary(user32_module); -} - -} // namespace - -// Manages the Win32Window's window class registration. -class WindowClassRegistrar { - public: - ~WindowClassRegistrar() = default; - - // Returns the singleton registrar instance. - static WindowClassRegistrar* GetInstance() { - if (!instance_) { - instance_ = new WindowClassRegistrar(); - } - return instance_; - } - - // Returns the name of the window class, registering the class if it hasn't - // previously been registered. - const wchar_t* GetWindowClass(); - - // Unregisters the window class. Should only be called if there are no - // instances of the window. - void UnregisterWindowClass(); - - private: - WindowClassRegistrar() = default; - - static WindowClassRegistrar* instance_; - - bool class_registered_ = false; -}; - -WindowClassRegistrar* WindowClassRegistrar::instance_ = nullptr; - -const wchar_t* WindowClassRegistrar::GetWindowClass() { - if (!class_registered_) { - WNDCLASS window_class{}; - window_class.hCursor = LoadCursor(nullptr, IDC_ARROW); - window_class.lpszClassName = kWindowClassName; - window_class.style = CS_HREDRAW | CS_VREDRAW; - window_class.cbClsExtra = 0; - window_class.cbWndExtra = 0; - window_class.hInstance = GetModuleHandle(nullptr); - window_class.hIcon = - LoadIcon(window_class.hInstance, MAKEINTRESOURCE(IDI_APP_ICON)); - window_class.hbrBackground = 0; - window_class.lpszMenuName = nullptr; - window_class.lpfnWndProc = Win32Window::WndProc; - RegisterClass(&window_class); - class_registered_ = true; - } - return kWindowClassName; -} - -void WindowClassRegistrar::UnregisterWindowClass() { - UnregisterClass(kWindowClassName, nullptr); - class_registered_ = false; -} - -Win32Window::Win32Window() { - ++g_active_window_count; -} - -Win32Window::~Win32Window() { - --g_active_window_count; - Destroy(); -} - -bool Win32Window::Create(const std::wstring& title, - const Point& origin, - const Size& size) { - Destroy(); - - const wchar_t* window_class = - WindowClassRegistrar::GetInstance()->GetWindowClass(); - - const POINT target_point = {static_cast(origin.x), - static_cast(origin.y)}; - HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTONEAREST); - UINT dpi = FlutterDesktopGetDpiForMonitor(monitor); - double scale_factor = dpi / 96.0; - - HWND window = CreateWindow( - window_class, title.c_str(), WS_OVERLAPPEDWINDOW, - Scale(origin.x, scale_factor), Scale(origin.y, scale_factor), - Scale(size.width, scale_factor), Scale(size.height, scale_factor), - nullptr, nullptr, GetModuleHandle(nullptr), this); - - if (!window) { - return false; - } - - UpdateTheme(window); - - return OnCreate(); -} - -bool Win32Window::Show() { - return ShowWindow(window_handle_, SW_SHOWNORMAL); -} - -// static -LRESULT CALLBACK Win32Window::WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - if (message == WM_NCCREATE) { - auto window_struct = reinterpret_cast(lparam); - SetWindowLongPtr(window, GWLP_USERDATA, - reinterpret_cast(window_struct->lpCreateParams)); - - auto that = static_cast(window_struct->lpCreateParams); - EnableFullDpiSupportIfAvailable(window); - that->window_handle_ = window; - } else if (Win32Window* that = GetThisFromHandle(window)) { - return that->MessageHandler(window, message, wparam, lparam); - } - - return DefWindowProc(window, message, wparam, lparam); -} - -LRESULT -Win32Window::MessageHandler(HWND hwnd, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept { - switch (message) { - case WM_DESTROY: - window_handle_ = nullptr; - Destroy(); - if (quit_on_close_) { - PostQuitMessage(0); - } - return 0; - - case WM_DPICHANGED: { - auto newRectSize = reinterpret_cast(lparam); - LONG newWidth = newRectSize->right - newRectSize->left; - LONG newHeight = newRectSize->bottom - newRectSize->top; - - SetWindowPos(hwnd, nullptr, newRectSize->left, newRectSize->top, newWidth, - newHeight, SWP_NOZORDER | SWP_NOACTIVATE); - - return 0; - } - case WM_SIZE: { - RECT rect = GetClientArea(); - if (child_content_ != nullptr) { - // Size and position the child window. - MoveWindow(child_content_, rect.left, rect.top, rect.right - rect.left, - rect.bottom - rect.top, TRUE); - } - return 0; - } - - case WM_ACTIVATE: - if (child_content_ != nullptr) { - SetFocus(child_content_); - } - return 0; - - case WM_DWMCOLORIZATIONCOLORCHANGED: - UpdateTheme(hwnd); - return 0; - } - - return DefWindowProc(window_handle_, message, wparam, lparam); -} - -void Win32Window::Destroy() { - OnDestroy(); - - if (window_handle_) { - DestroyWindow(window_handle_); - window_handle_ = nullptr; - } - if (g_active_window_count == 0) { - WindowClassRegistrar::GetInstance()->UnregisterWindowClass(); - } -} - -Win32Window* Win32Window::GetThisFromHandle(HWND const window) noexcept { - return reinterpret_cast( - GetWindowLongPtr(window, GWLP_USERDATA)); -} - -void Win32Window::SetChildContent(HWND content) { - child_content_ = content; - SetParent(content, window_handle_); - RECT frame = GetClientArea(); - - MoveWindow(content, frame.left, frame.top, frame.right - frame.left, - frame.bottom - frame.top, true); - - SetFocus(child_content_); -} - -RECT Win32Window::GetClientArea() { - RECT frame; - GetClientRect(window_handle_, &frame); - return frame; -} - -HWND Win32Window::GetHandle() { - return window_handle_; -} - -void Win32Window::SetQuitOnClose(bool quit_on_close) { - quit_on_close_ = quit_on_close; -} - -bool Win32Window::OnCreate() { - // No-op; provided for subclasses. - return true; -} - -void Win32Window::OnDestroy() { - // No-op; provided for subclasses. -} - -void Win32Window::UpdateTheme(HWND const window) { - DWORD light_mode; - DWORD light_mode_size = sizeof(light_mode); - LSTATUS result = RegGetValue(HKEY_CURRENT_USER, kGetPreferredBrightnessRegKey, - kGetPreferredBrightnessRegValue, - RRF_RT_REG_DWORD, nullptr, &light_mode, - &light_mode_size); - - if (result == ERROR_SUCCESS) { - BOOL enable_dark_mode = light_mode == 0; - DwmSetWindowAttribute(window, DWMWA_USE_IMMERSIVE_DARK_MODE, - &enable_dark_mode, sizeof(enable_dark_mode)); - } -} diff --git a/plugins/window_ext/example/windows/runner/win32_window.h b/plugins/window_ext/example/windows/runner/win32_window.h deleted file mode 100644 index e901dde..0000000 --- a/plugins/window_ext/example/windows/runner/win32_window.h +++ /dev/null @@ -1,102 +0,0 @@ -#ifndef RUNNER_WIN32_WINDOW_H_ -#define RUNNER_WIN32_WINDOW_H_ - -#include - -#include -#include -#include - -// A class abstraction for a high DPI-aware Win32 Window. Intended to be -// inherited from by classes that wish to specialize with custom -// rendering and input handling -class Win32Window { - public: - struct Point { - unsigned int x; - unsigned int y; - Point(unsigned int x, unsigned int y) : x(x), y(y) {} - }; - - struct Size { - unsigned int width; - unsigned int height; - Size(unsigned int width, unsigned int height) - : width(width), height(height) {} - }; - - Win32Window(); - virtual ~Win32Window(); - - // Creates a win32 window with |title| that is positioned and sized using - // |origin| and |size|. New windows are created on the default monitor. Window - // sizes are specified to the OS in physical pixels, hence to ensure a - // consistent size this function will scale the inputted width and height as - // as appropriate for the default monitor. The window is invisible until - // |Show| is called. Returns true if the window was created successfully. - bool Create(const std::wstring& title, const Point& origin, const Size& size); - - // Show the current window. Returns true if the window was successfully shown. - bool Show(); - - // Release OS resources associated with window. - void Destroy(); - - // Inserts |content| into the window tree. - void SetChildContent(HWND content); - - // Returns the backing Window handle to enable clients to set icon and other - // window properties. Returns nullptr if the window has been destroyed. - HWND GetHandle(); - - // If true, closing this window will quit the application. - void SetQuitOnClose(bool quit_on_close); - - // Return a RECT representing the bounds of the current client area. - RECT GetClientArea(); - - protected: - // Processes and route salient window messages for mouse handling, - // size change and DPI. Delegates handling of these to member overloads that - // inheriting classes can handle. - virtual LRESULT MessageHandler(HWND window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Called when CreateAndShow is called, allowing subclass window-related - // setup. Subclasses should return false if setup fails. - virtual bool OnCreate(); - - // Called when Destroy is called. - virtual void OnDestroy(); - - private: - friend class WindowClassRegistrar; - - // OS callback called by message pump. Handles the WM_NCCREATE message which - // is passed when the non-client area is being created and enables automatic - // non-client DPI scaling so that the non-client area automatically - // responds to changes in DPI. All other messages are handled by - // MessageHandler. - static LRESULT CALLBACK WndProc(HWND const window, - UINT const message, - WPARAM const wparam, - LPARAM const lparam) noexcept; - - // Retrieves a class instance pointer for |window| - static Win32Window* GetThisFromHandle(HWND const window) noexcept; - - // Update the window frame's theme to match the system theme. - static void UpdateTheme(HWND const window); - - bool quit_on_close_ = false; - - // window handle for top level window. - HWND window_handle_ = nullptr; - - // window handle for hosted content. - HWND child_content_ = nullptr; -}; - -#endif // RUNNER_WIN32_WINDOW_H_ diff --git a/plugins/window_ext/lib/window_ext_listener.dart b/plugins/window_ext/lib/window_ext_listener.dart index 6ead40a..cab0a96 100644 --- a/plugins/window_ext/lib/window_ext_listener.dart +++ b/plugins/window_ext/lib/window_ext_listener.dart @@ -1,3 +1,5 @@ abstract mixin class WindowExtListener { void onTaskbarCreated() {} + + void onShouldTerminate() {} } diff --git a/plugins/window_ext/lib/window_ext_manager.dart b/plugins/window_ext/lib/window_ext_manager.dart index 02bd2aa..6bf22a1 100644 --- a/plugins/window_ext/lib/window_ext_manager.dart +++ b/plugins/window_ext/lib/window_ext_manager.dart @@ -7,12 +7,13 @@ class WindowExtManager { WindowExtManager._() { _channel.setMethodCallHandler(_methodCallHandler); } + static final WindowExtManager instance = WindowExtManager._(); final MethodChannel _channel = const MethodChannel('window_ext'); - final ObserverList _listeners = ObserverList(); - + final ObserverList _listeners = + ObserverList(); Future _methodCallHandler(MethodCall call) async { for (final WindowExtListener listener in _listeners) { @@ -20,6 +21,9 @@ class WindowExtManager { case "taskbarCreated": listener.onTaskbarCreated(); break; + case "shouldTerminate": + listener.onShouldTerminate(); + break; } } } @@ -37,4 +41,4 @@ class WindowExtManager { } } -final windowExtManager = WindowExtManager.instance; \ No newline at end of file +final windowExtManager = WindowExtManager.instance; diff --git a/plugins/window_ext/macos/Classes/WindowExtPlugin.swift b/plugins/window_ext/macos/Classes/WindowExtPlugin.swift new file mode 100644 index 0000000..b659b3e --- /dev/null +++ b/plugins/window_ext/macos/Classes/WindowExtPlugin.swift @@ -0,0 +1,25 @@ +import Cocoa +import FlutterMacOS + +public class WindowExtPlugin: NSObject, FlutterPlugin { + public static var instance:WindowExtPlugin? + + public static func register(with registrar: FlutterPluginRegistrar) { + let channel = FlutterMethodChannel(name: "window_ext", binaryMessenger: registrar.messenger) + instance = WindowExtPlugin(registrar, channel) + registrar.addMethodCallDelegate(instance!, channel: channel) + } + + private var registrar: FlutterPluginRegistrar! + private var channel: FlutterMethodChannel! + + public init(_ registrar: FlutterPluginRegistrar, _ channel: FlutterMethodChannel) { + super.init() + self.registrar = registrar + self.channel = channel + } + + public func handleShouldTerminate(){ + channel.invokeMethod("shouldTerminate", arguments: nil) + } +} diff --git a/plugins/window_ext/macos/window_ext.podspec b/plugins/window_ext/macos/window_ext.podspec new file mode 100644 index 0000000..fcf8580 --- /dev/null +++ b/plugins/window_ext/macos/window_ext.podspec @@ -0,0 +1,23 @@ +# +# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html. +# Run `pod lib lint window_ext.podspec` to validate before publishing. +# +Pod::Spec.new do |s| + s.name = 'window_ext' + s.version = '0.0.1' + s.summary = 'A new Flutter plugin project.' + s.description = <<-DESC +A new Flutter plugin project. + DESC + s.homepage = 'http://example.com' + s.license = { :file => '../LICENSE' } + s.author = { 'Your Company' => 'email@example.com' } + + s.source = { :path => '.' } + s.source_files = 'Classes/**/*' + s.dependency 'FlutterMacOS' + + s.platform = :osx, '10.11' + s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } + s.swift_version = '5.0' +end diff --git a/plugins/window_ext/pubspec.yaml b/plugins/window_ext/pubspec.yaml index 12d88ba..bed43a1 100644 --- a/plugins/window_ext/pubspec.yaml +++ b/plugins/window_ext/pubspec.yaml @@ -36,6 +36,8 @@ flutter: platforms: windows: pluginClass: WindowExtPluginCApi + macos: + pluginClass: WindowExtPlugin # To add assets to your plugin package, add an assets section, like this: # assets: diff --git a/plugins/window_ext/test/window_ext_method_channel_test.dart b/plugins/window_ext/test/window_ext_method_channel_test.dart deleted file mode 100644 index c78eec4..0000000 --- a/plugins/window_ext/test/window_ext_method_channel_test.dart +++ /dev/null @@ -1,27 +0,0 @@ -import 'package:flutter/services.dart'; -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_ext/window_ext_method_channel.dart'; - -void main() { - TestWidgetsFlutterBinding.ensureInitialized(); - - MethodChannelWindowExt platform = MethodChannelWindowExt(); - const MethodChannel channel = MethodChannel('window_ext'); - - setUp(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler( - channel, - (MethodCall methodCall) async { - return '42'; - }, - ); - }); - - tearDown(() { - TestDefaultBinaryMessengerBinding.instance.defaultBinaryMessenger.setMockMethodCallHandler(channel, null); - }); - - test('getPlatformVersion', () async { - expect(await platform.getPlatformVersion(), '42'); - }); -} diff --git a/plugins/window_ext/test/window_ext_test.dart b/plugins/window_ext/test/window_ext_test.dart deleted file mode 100644 index b7faab8..0000000 --- a/plugins/window_ext/test/window_ext_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -import 'package:flutter_test/flutter_test.dart'; -import 'package:window_ext/window_ext.dart'; -import 'package:window_ext/window_ext_platform_interface.dart'; -import 'package:window_ext/window_ext_method_channel.dart'; -import 'package:plugin_platform_interface/plugin_platform_interface.dart'; - -class MockWindowExtPlatform - with MockPlatformInterfaceMixin - implements WindowExtPlatform { - - @override - Future getPlatformVersion() => Future.value('42'); -} - -void main() { - final WindowExtPlatform initialPlatform = WindowExtPlatform.instance; - - test('$MethodChannelWindowExt is the default instance', () { - expect(initialPlatform, isInstanceOf()); - }); - - test('getPlatformVersion', () async { - WindowExt windowExtPlugin = WindowExt(); - MockWindowExtPlatform fakePlatform = MockWindowExtPlatform(); - WindowExtPlatform.instance = fakePlatform; - - expect(await windowExtPlugin.getPlatformVersion(), '42'); - }); -} diff --git a/pubspec.lock b/pubspec.lock index 52c2a57..8609f87 100755 --- a/pubspec.lock +++ b/pubspec.lock @@ -5,18 +5,23 @@ packages: dependency: transitive description: name: _fe_analyzer_shared - sha256: "0b2f2bd91ba804e53a61d757b986f89f1f9eaed5b11e4b2f5a2468d86d6c9fc7" + sha256: f256b0c0ba6c7577c15e2e4e114755640a875e885099367bf6e012b19314c834 url: "https://pub.dev" source: hosted - version: "67.0.0" + version: "72.0.0" + _macros: + dependency: transitive + description: dart + source: sdk + version: "0.3.2" analyzer: dependency: transitive description: name: analyzer - sha256: "37577842a27e4338429a1cbc32679d508836510b056f1eedf0c8d20e39c1383d" + sha256: b652861553cd3990d8ed361f7979dc6d7053a9ac8843fa73820ab68ce5410139 url: "https://pub.dev" source: hosted - version: "6.4.1" + version: "6.7.0" animations: dependency: "direct main" description: @@ -45,10 +50,10 @@ packages: dependency: "direct dev" description: name: args - sha256: "7cf60b9f0cc88203c5a190b4cd62a99feea42759a7fa695010eb5de1c0b2252a" + sha256: bf9f5caeea8d8fe6721a9c358dd8a5c1947b27f1cfaa18b39c301273594919e6 url: "https://pub.dev" source: hosted - version: "2.5.0" + version: "2.6.0" async: dependency: transitive description: @@ -101,18 +106,18 @@ packages: dependency: "direct dev" description: name: build_runner - sha256: "644dc98a0f179b872f612d3eb627924b578897c629788e858157fa5e704ca0c7" + sha256: "028819cfb90051c6b5440c7e574d1896f8037e3c96cf17aaeb054c9311cfbf4d" url: "https://pub.dev" source: hosted - version: "2.4.11" + version: "2.4.13" build_runner_core: dependency: transitive description: name: build_runner_core - sha256: e3c79f69a64bdfcd8a776a3c28db4eb6e3fb5356d013ae5eb2e52007706d5dbe + sha256: f8126682b87a7282a339b871298cc12009cb67109cfa1614d6436fb0289193e0 url: "https://pub.dev" source: hosted - version: "7.3.1" + version: "7.3.2" built_collection: dependency: transitive description: @@ -181,10 +186,10 @@ packages: dependency: transitive description: name: cli_util - sha256: c05b7406fdabc7a49a3929d4af76bcaccbbffcbcdcf185b082e1ae07da323d19 + sha256: ff6785f7e9e3c38ac98b2fb035701789de90154024a75b6cb926445e83197d1c url: "https://pub.dev" source: hosted - version: "0.4.1" + version: "0.4.2" clock: dependency: transitive description: @@ -197,10 +202,10 @@ packages: dependency: transitive description: name: code_builder - sha256: f692079e25e7869c14132d39f223f8eec9830eb76131925143b2129c4bb01b37 + sha256: "0ec10bf4a89e4c613960bf1e8b42c64127021740fb21640c29c909826a5eea3e" url: "https://pub.dev" source: hosted - version: "4.10.0" + version: "4.10.1" collection: dependency: "direct main" description: @@ -209,14 +214,30 @@ packages: url: "https://pub.dev" source: hosted version: "1.18.0" + connectivity_plus: + dependency: "direct main" + description: + name: connectivity_plus + sha256: "876849631b0c7dc20f8b471a2a03142841b482438e3b707955464f5ffca3e4c3" + url: "https://pub.dev" + source: hosted + version: "6.1.0" + connectivity_plus_platform_interface: + dependency: transitive + description: + name: connectivity_plus_platform_interface + sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" + url: "https://pub.dev" + source: hosted + version: "2.0.1" convert: dependency: transitive description: name: convert - sha256: "0f08b14755d163f6e2134cb58222dd25ea2a2ee8a195e53983d57c075324d592" + sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 url: "https://pub.dev" source: hosted - version: "3.1.1" + version: "3.1.2" cross_file: dependency: transitive description: @@ -229,18 +250,26 @@ packages: dependency: transitive description: name: crypto - sha256: ec30d999af904f33454ba22ed9a86162b35e52b44ac4807d1d93c288041d7d27 + sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" dart_style: dependency: transitive description: name: dart_style - sha256: "99e066ce75c89d6b29903d788a7bb9369cf754f7b24bf70bf4b6d6d6b26853b9" + sha256: "7856d364b589d1f08986e140938578ed36ed948581fbc3bc9aef1805039ac5ab" url: "https://pub.dev" source: hosted - version: "2.3.6" + version: "2.3.7" + dbus: + dependency: transitive + description: + name: dbus + sha256: "365c771ac3b0e58845f39ec6deebc76e3276aa9922b0cc60840712094d9047ac" + url: "https://pub.dev" + source: hosted + version: "0.7.10" device_info_plus: dependency: "direct main" description: @@ -309,18 +338,18 @@ packages: dependency: "direct dev" description: name: ffigen - sha256: dead012f29db2be71ea152458f5eab600de98fbc244e01088ae6bf2616bceca7 + sha256: a0ca4853028c6a9e4d9a0a40bb744fceb898c89d75931d08e87b3987d0087060 url: "https://pub.dev" source: hosted - version: "11.0.0" + version: "15.0.0" file: dependency: transitive description: name: file - sha256: "5fc22d7c25582e38ad9a8515372cd9a93834027aacf1801cf01164dac0ffa08c" + sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "7.0.1" file_picker: dependency: "direct main" description: @@ -365,10 +394,10 @@ packages: dependency: transitive description: name: fixnum - sha256: "25517a4deb0c03aa0f32fd12db525856438902d9c16536311e76cdc57b31d7d1" + sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.1.1" flutter: dependency: "direct main" description: flutter @@ -386,10 +415,10 @@ packages: dependency: "direct dev" description: name: flutter_lints - sha256: "9e8c3858111da373efc5aa341de011d9bd23e2c5c5e0c62bccf32438e192d7b1" + sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" url: "https://pub.dev" source: hosted - version: "3.0.2" + version: "5.0.0" flutter_localizations: dependency: "direct main" description: flutter @@ -399,10 +428,10 @@ packages: dependency: transitive description: name: flutter_plugin_android_lifecycle - sha256: "9ee02950848f61c4129af3d6ec84a1cfc0e47931abc746b03e7a3bc3e8ff6eda" + sha256: "9b78450b89f059e96c9ebb355fa6b3df1d6b330436e0b885fb49594c41721398" url: "https://pub.dev" source: hosted - version: "2.0.22" + version: "2.0.23" flutter_test: dependency: "direct dev" description: flutter @@ -417,10 +446,10 @@ packages: dependency: "direct dev" description: name: freezed - sha256: a434911f643466d78462625df76fd9eb13e57348ff43fe1f77bbe909522c67a1 + sha256: "44c19278dd9d89292cf46e97dc0c1e52ce03275f40a97c5a348e802a924bf40e" url: "https://pub.dev" source: hosted - version: "2.5.2" + version: "2.5.7" freezed_annotation: dependency: "direct main" description: @@ -529,10 +558,10 @@ packages: dependency: "direct main" description: name: image - sha256: "2237616a36c0d69aef7549ab439b833fb7f9fb9fc861af2cc9ac3eedddd69ca8" + sha256: f31d52537dc417fdcde36088fdf11d191026fd5e4fae742491ebd40e5a8bea7d url: "https://pub.dev" source: hosted - version: "4.2.0" + version: "4.3.0" image_picker: dependency: "direct main" description: @@ -545,26 +574,26 @@ packages: dependency: transitive description: name: image_picker_android - sha256: "8c5abf0dcc24fe6e8e0b4a5c0b51a5cf30cefdf6407a3213dae61edc75a70f56" + sha256: "8faba09ba361d4b246dc0a17cb4289b3324c2b9f6db7b3d457ee69106a86bd32" url: "https://pub.dev" source: hosted - version: "0.8.12+12" + version: "0.8.12+17" image_picker_for_web: dependency: transitive description: name: image_picker_for_web - sha256: "65d94623e15372c5c51bebbcb820848d7bcb323836e12dfdba60b5d3a8b39e50" + sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" url: "https://pub.dev" source: hosted - version: "3.0.5" + version: "3.0.6" image_picker_ios: dependency: transitive description: name: image_picker_ios - sha256: "6703696ad49f5c3c8356d576d7ace84d1faf459afb07accbb0fae780753ff447" + sha256: "4f0568120c6fcc0aaa04511cb9f9f4d29fc3d0139884b1d06be88dcec7641d6b" url: "https://pub.dev" source: hosted - version: "0.8.12" + version: "0.8.12+1" image_picker_linux: dependency: transitive description: @@ -689,18 +718,18 @@ packages: dependency: transitive description: name: lints - sha256: cbf8d4b858bb0134ef3ef87841abdf8d63bfc255c266b7bf6b39daa1085c4290 + sha256: "3315600f3fb3b135be672bf4a178c55f274bebe368325ae18462c89ac1e3b413" url: "https://pub.dev" source: hosted - version: "3.0.0" + version: "5.0.0" logging: dependency: transitive description: name: logging - sha256: "623a88c9594aa774443aa3eb2d41807a48486b5613e67599fb4c41c0ad47c340" + sha256: c8245ada5f1717ed44271ed1c26b8ce85ca3228fd2ffdb75468ab01979309d61 url: "https://pub.dev" source: hosted - version: "1.2.0" + version: "1.3.0" lpinyin: dependency: "direct main" description: @@ -709,6 +738,14 @@ packages: url: "https://pub.dev" source: hosted version: "2.0.3" + macros: + dependency: transitive + description: + name: macros + sha256: "0acaed5d6b7eab89f63350bccd82119e6c602df0f391260d0e32b5e23db79536" + url: "https://pub.dev" + source: hosted + version: "0.1.2-main.4" matcher: dependency: transitive description: @@ -745,18 +782,18 @@ packages: dependency: transitive description: name: mime - sha256: "801fd0b26f14a4a58ccb09d5892c3fbdeff209594300a542492cf13fba9d247a" + sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" url: "https://pub.dev" source: hosted - version: "1.0.6" + version: "2.0.0" mobile_scanner: dependency: "direct main" description: name: mobile_scanner - sha256: d234581c090526676fd8fab4ada92f35c6746e3fb4f05a399665d75a399fb760 + sha256: "728828a798d1a2ee506beb652ca23d974c542c96ed03dcbd5eaf97bef96cdaad" url: "https://pub.dev" source: hosted - version: "5.2.3" + version: "6.0.2" nested: dependency: transitive description: @@ -765,6 +802,14 @@ packages: url: "https://pub.dev" source: hosted version: "1.0.0" + nm: + dependency: transitive + description: + name: nm + sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" + url: "https://pub.dev" + source: hosted + version: "0.5.0" octo_image: dependency: transitive description: @@ -785,10 +830,10 @@ packages: dependency: "direct main" description: name: package_info_plus - sha256: "2c582551839386fa7ddbc7770658be7c0f87f388a4bff72066478f597c34d17f" + sha256: da8d9ac8c4b1df253d1a328b7bf01ae77ef132833479ab40763334db13b91cce url: "https://pub.dev" source: hosted - version: "7.0.0" + version: "8.1.1" package_info_plus_platform_interface: dependency: transitive description: @@ -809,18 +854,18 @@ packages: dependency: "direct main" description: name: path_provider - sha256: fec0d61223fba3154d87759e3cc27fe2c8dc498f6386c6d6fc80d1afdd1bf378 + sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" url: "https://pub.dev" source: hosted - version: "2.1.4" + version: "2.1.5" path_provider_android: dependency: transitive description: name: path_provider_android - sha256: "6f01f8e37ec30b07bc424b4deabac37cacb1bc7e2e515ad74486039918a37eb7" + sha256: c464428172cb986b758c6d1724c603097febb8fb855aa265aeecc9280c294d4a url: "https://pub.dev" source: hosted - version: "2.2.10" + version: "2.2.12" path_provider_foundation: dependency: transitive description: @@ -865,10 +910,10 @@ packages: dependency: transitive description: name: platform - sha256: "9b71283fc13df574056616011fb138fd3b793ea47cc509c189a6c3fa5f8a1a65" + sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" url: "https://pub.dev" source: hosted - version: "3.1.5" + version: "3.1.6" plugin_platform_interface: dependency: transitive description: @@ -889,10 +934,10 @@ packages: dependency: "direct main" description: name: process_run - sha256: c917dfb5f7afad4c7485bc00a4df038621248fce046105020cea276d1a87c820 + sha256: "5736140acb1c54a11bd4c1e8d4821bfd684de69a4bf88835316cb05e596d8091" url: "https://pub.dev" source: hosted - version: "1.1.0" + version: "1.2.2" provider: dependency: "direct main" description: @@ -936,10 +981,10 @@ packages: dependency: "direct main" description: name: re_editor - sha256: abae2b015799c936b9f9b68888e2c55007dd159b4654a85da22ce1af84efbd17 + sha256: "2169c114c7877bcaae72d6e8b69cdaa2a9cded69a51e3cf26209dad4a3ed2b9c" url: "https://pub.dev" source: hosted - version: "0.3.1" + version: "0.6.0" re_highlight: dependency: "direct main" description: @@ -960,26 +1005,58 @@ packages: dependency: transitive description: name: screen_retriever - sha256: "6ee02c8a1158e6dae7ca430da79436e3b1c9563c8cf02f524af997c201ac2b90" + sha256: "570dbc8e4f70bac451e0efc9c9bb19fa2d6799a11e6ef04f946d7886d2e23d0c" url: "https://pub.dev" source: hosted - version: "0.1.9" + version: "0.2.0" + screen_retriever_linux: + dependency: transitive + description: + name: screen_retriever_linux + sha256: f7f8120c92ef0784e58491ab664d01efda79a922b025ff286e29aa123ea3dd18 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_macos: + dependency: transitive + description: + name: screen_retriever_macos + sha256: "71f956e65c97315dd661d71f828708bd97b6d358e776f1a30d5aa7d22d78a149" + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_platform_interface: + dependency: transitive + description: + name: screen_retriever_platform_interface + sha256: ee197f4581ff0d5608587819af40490748e1e39e648d7680ecf95c05197240c0 + url: "https://pub.dev" + source: hosted + version: "0.2.0" + screen_retriever_windows: + dependency: transitive + description: + name: screen_retriever_windows + sha256: "449ee257f03ca98a57288ee526a301a430a344a161f9202b4fcc38576716fe13" + url: "https://pub.dev" + source: hosted + version: "0.2.0" shared_preferences: dependency: "direct main" description: name: shared_preferences - sha256: "746e5369a43170c25816cc472ee016d3a66bc13fcf430c0bc41ad7b4b2922051" + sha256: "95f9997ca1fb9799d494d0cb2a780fd7be075818d59f00c43832ed112b158a82" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_android: dependency: transitive description: name: shared_preferences_android - sha256: "480ba4345773f56acda9abf5f50bd966f581dac5d514e5fc4a18c62976bbba7e" + sha256: "3b9febd815c9ca29c9e3520d50ec32f49157711e143b7a4ca039eb87e8ade5ab" url: "https://pub.dev" source: hosted - version: "2.3.2" + version: "2.3.3" shared_preferences_foundation: dependency: transitive description: @@ -1085,18 +1162,42 @@ packages: dependency: transitive description: name: sqflite - sha256: a43e5a27235518c03ca238e7b4732cf35eabe863a369ceba6cbefa537a66f16d + sha256: "2d7299468485dca85efeeadf5d38986909c5eb0cd71fd3db2c2f000e6c9454bb" url: "https://pub.dev" source: hosted - version: "2.3.3+1" + version: "2.4.1" + sqflite_android: + dependency: transitive + description: + name: sqflite_android + sha256: "78f489aab276260cdd26676d2169446c7ecd3484bbd5fead4ca14f3ed4dd9ee3" + url: "https://pub.dev" + source: hosted + version: "2.4.0" sqflite_common: dependency: transitive description: name: sqflite_common - sha256: "3da423ce7baf868be70e2c0976c28a1bb2f73644268b7ffa7d2e08eab71f16a4" + sha256: "4468b24876d673418a7b7147e5a08a715b4998a7ae69227acafaab762e0e5490" url: "https://pub.dev" source: hosted - version: "2.5.4" + version: "2.5.4+5" + sqflite_darwin: + dependency: transitive + description: + name: sqflite_darwin + sha256: "96a698e2bc82bd770a4d6aab00b42396a7c63d9e33513a56945cbccb594c2474" + url: "https://pub.dev" + source: hosted + version: "2.4.1" + sqflite_platform_interface: + dependency: transitive + description: + name: sqflite_platform_interface + sha256: "8dd4515c7bdcae0a785b0062859336de775e8c65db81ae33dd5445f35be61920" + url: "https://pub.dev" + source: hosted + version: "2.4.0" stack_trace: dependency: transitive description: @@ -1133,10 +1234,10 @@ packages: dependency: transitive description: name: synchronized - sha256: "539ef412b170d65ecdafd780f924e5be3f60032a1128df156adad6c5b373d558" + sha256: "69fe30f3a8b04a0be0c15ae6490fc859a78ef4c43ae2dd5e8a623d45bfcf9225" url: "https://pub.dev" source: hosted - version: "3.1.0+1" + version: "3.3.0+3" term_glyph: dependency: transitive description: @@ -1173,10 +1274,10 @@ packages: dependency: transitive description: name: typed_data - sha256: facc8d6582f16042dd49f2463ff1bd6e2c9ef9f3d5da3d9b087e244a7b564b3c + sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 url: "https://pub.dev" source: hosted - version: "1.3.2" + version: "1.4.0" uni_platform: dependency: "direct main" description: @@ -1189,18 +1290,18 @@ packages: dependency: "direct main" description: name: url_launcher - sha256: "21b704ce5fa560ea9f3b525b43601c678728ba46725bab9b01187b4831377ed3" + sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603" url: "https://pub.dev" source: hosted - version: "6.3.0" + version: "6.3.1" url_launcher_android: dependency: transitive description: name: url_launcher_android - sha256: f0c73347dfcfa5b3db8bc06e1502668265d39c08f310c29bff4e28eea9699f79 + sha256: "6fc2f56536ee873eeb867ad176ae15f304ccccc357848b351f6f0d8d4a40d193" url: "https://pub.dev" source: hosted - version: "6.3.9" + version: "6.3.14" url_launcher_ios: dependency: transitive description: @@ -1245,10 +1346,10 @@ packages: dependency: transitive description: name: url_launcher_windows - sha256: "49c10f879746271804767cb45551ec5592cdab00ee105c06dddde1a98f73b185" + sha256: "44cf3aabcedde30f2dba119a9dea3b0f2672fbe6fa96e85536251d678216b3c4" url: "https://pub.dev" source: hosted - version: "3.1.2" + version: "3.1.3" uuid: dependency: transitive description: @@ -1317,10 +1418,10 @@ packages: dependency: "direct main" description: name: win32 - sha256: "68d1e89a91ed61ad9c370f9f8b6effed9ae5e0ede22a270bdfa6daf79fc2290a" + sha256: "84ba388638ed7a8cb3445a320c8273136ab2631cd5f2c57888335504ddab1bc2" url: "https://pub.dev" source: hosted - version: "5.5.4" + version: "5.8.0" win32_registry: dependency: "direct main" description: @@ -1340,10 +1441,10 @@ packages: dependency: "direct main" description: name: window_manager - sha256: "8699323b30da4cdbe2aa2e7c9de567a6abd8a97d9a5c850a3c86dcd0b34bbfbf" + sha256: "732896e1416297c63c9e3fb95aea72d0355f61390263982a47fd519169dc5059" url: "https://pub.dev" source: hosted - version: "0.3.9" + version: "0.4.3" windows_single_instance: dependency: "direct main" description: @@ -1393,5 +1494,5 @@ packages: source: hosted version: "0.2.3" sdks: - dart: ">=3.4.4 <4.0.0" - flutter: ">=3.22.0" + dart: ">=3.5.0 <4.0.0" + flutter: ">=3.24.0" diff --git a/pubspec.yaml b/pubspec.yaml index d97286b..3bd5071 100755 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: fl_clash description: A multi-platform proxy client based on ClashMeta, simple and easy to use, open-source and ad-free. publish_to: 'none' -version: 0.8.67+202411091 +version: 0.8.68+202411171 environment: sdk: '>=3.1.0 <4.0.0' @@ -12,10 +12,10 @@ dependencies: sdk: flutter intl: ^0.19.0 path_provider: ^2.1.0 - path: ^1.8.3 + path: ^1.9.0 shared_preferences: ^2.2.0 provider: ^6.0.5 - window_manager: ^0.3.8 + window_manager: ^0.4.3 dynamic_color: ^1.7.0 proxy: path: plugins/proxy @@ -25,13 +25,13 @@ dependencies: windows_single_instance: ^1.0.1 json_annotation: ^4.9.0 file_picker: ^8.0.3 - mobile_scanner: ^5.1.1 + mobile_scanner: ^6.0.2 app_links: ^3.5.0 - win32_registry: ^1.1.2 + win32_registry: ^1.1.5 tray_manager: ^0.2.1 collection: ^1.18.0 animations: ^2.0.11 - package_info_plus: ^7.0.0 + package_info_plus: ^8.0.0 url_launcher: ^6.2.6 freezed_annotation: ^2.4.1 image_picker: ^1.1.2 @@ -41,7 +41,7 @@ dependencies: dio: ^5.4.3+1 win32: ^5.5.1 ffi: ^2.1.2 - re_editor: ^0.3.1 + re_editor: ^0.6.0 re_highlight: ^0.0.3 archive: ^3.6.1 lpinyin: ^2.0.3 @@ -51,11 +51,12 @@ dependencies: hotkey_manager: ^0.2.3 uni_platform: ^0.1.3 device_info_plus: ^10.1.2 + connectivity_plus: ^6.1.0 dev_dependencies: flutter_test: sdk: flutter - flutter_lints: ^3.0.1 - ffigen: ^11.0.0 + flutter_lints: ^5.0.0 + ffigen: ^15.0.0 json_serializable: ^6.7.1 build_runner: ^2.4.9 args: ^2.4.2 diff --git a/test/command_test.dart b/test/command_test.dart index 88eb9fd..d4af2dd 100644 --- a/test/command_test.dart +++ b/test/command_test.dart @@ -3,11 +3,15 @@ import 'dart:io'; void main() { - startService(); + final cmdList = []; + final ignoreHosts = "\"ass\""; + cmdList.add( + ["gsettings", "set", "org.gnome.system.proxy", "port", ignoreHosts], + ); + print(cmdList.first); } startService() async { - try { // 创建服务器 final server = await HttpServer.bind("127.0.0.1", 10001); diff --git a/windows/flutter/generated_plugin_registrant.cc b/windows/flutter/generated_plugin_registrant.cc index 4d30f21..4396ef1 100755 --- a/windows/flutter/generated_plugin_registrant.cc +++ b/windows/flutter/generated_plugin_registrant.cc @@ -7,11 +7,12 @@ #include "generated_plugin_registrant.h" #include +#include #include #include #include #include -#include +#include #include #include #include @@ -21,6 +22,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { AppLinksPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("AppLinksPluginCApi")); + ConnectivityPlusWindowsPluginRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ConnectivityPlusWindowsPlugin")); DynamicColorPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("DynamicColorPluginCApi")); FileSelectorWindowsRegisterWithRegistrar( @@ -29,8 +32,8 @@ void RegisterPlugins(flutter::PluginRegistry* registry) { registry->GetRegistrarForPlugin("HotkeyManagerWindowsPluginCApi")); ProxyPluginCApiRegisterWithRegistrar( registry->GetRegistrarForPlugin("ProxyPluginCApi")); - ScreenRetrieverPluginRegisterWithRegistrar( - registry->GetRegistrarForPlugin("ScreenRetrieverPlugin")); + ScreenRetrieverWindowsPluginCApiRegisterWithRegistrar( + registry->GetRegistrarForPlugin("ScreenRetrieverWindowsPluginCApi")); TrayManagerPluginRegisterWithRegistrar( registry->GetRegistrarForPlugin("TrayManagerPlugin")); UrlLauncherWindowsRegisterWithRegistrar( diff --git a/windows/flutter/generated_plugins.cmake b/windows/flutter/generated_plugins.cmake index a36d960..977794d 100755 --- a/windows/flutter/generated_plugins.cmake +++ b/windows/flutter/generated_plugins.cmake @@ -4,11 +4,12 @@ list(APPEND FLUTTER_PLUGIN_LIST app_links + connectivity_plus dynamic_color file_selector_windows hotkey_manager_windows proxy - screen_retriever + screen_retriever_windows tray_manager url_launcher_windows window_ext