From 3154ec1ff3c54d8c2884a729836569c642fc2f6b Mon Sep 17 00:00:00 2001 From: "github-action[bot]" Date: Mon, 22 Jul 2024 20:31:16 +0200 Subject: [PATCH] Update On Mon Jul 22 20:31:16 CEST 2024 --- .github/update.log | 1 + .../adapter/outboundgroup/loadbalance.go | 2 - clash-meta/common/lru/lrucache.go | 32 + clash-meta/common/queue/queue.go | 4 +- clash-meta/common/utils/callback.go | 4 +- clash-meta/component/sniffer/dispatcher.go | 20 +- clash-meta/config/config.go | 3 + clash-meta/docs/config.yaml | 4 + clash-meta/hub/hub.go | 5 +- clash-meta/hub/route/doh.go | 67 + clash-meta/hub/route/server.go | 16 +- .../.github/ISSUE_TEMPLATE/bug_report.yaml | 77 +- clash-nyanpasu/.github/workflows/ci.yml | 2 +- clash-nyanpasu/backend/Cargo.lock | 1085 +++++++++++------ clash-nyanpasu/backend/tauri/Cargo.toml | 11 +- clash-nyanpasu/backend/tauri/build.rs | 59 +- clash-nyanpasu/backend/tauri/src/cmds.rs | 9 +- clash-nyanpasu/backend/tauri/src/consts.rs | 30 + .../tauri/src/core/commands/migrate.rs | 79 ++ .../backend/tauri/src/core/commands/mod.rs | 165 +-- clash-nyanpasu/backend/tauri/src/main.rs | 2 + .../backend/tauri/src/utils/collect.rs | 93 ++ clash-nyanpasu/backend/tauri/src/utils/mod.rs | 2 + .../frontend/interface/service/tauri.ts | 11 +- .../frontend/interface/service/types.ts | 11 + clash-nyanpasu/frontend/nyanpasu/package.json | 2 +- .../src/components/dashboard/data-panel.tsx | 20 +- .../setting/modules/hotkey-dialog.tsx | 138 +++ .../setting/modules/hotkey-input.module.scss | 20 + .../modules/hotkey-input.module.scss.d.ts | 6 + .../setting/modules/hotkey-input.tsx | 103 ++ .../frontend/nyanpasu/src/pages/settings.tsx | 58 +- .../frontend/nyanpasu/src/utils/index.ts | 25 + .../frontend/ui/chart/sparkline.tsx | 27 +- .../components/baseDialog/index.tsx | 17 +- .../components/kbd/index.module.scss | 18 + .../components/kbd/index.module.scss.d.ts | 5 + .../ui/materialYou/components/kbd/index.tsx | 25 + clash-nyanpasu/frontend/ui/package.json | 2 + clash-nyanpasu/manifest/version.json | 4 +- clash-nyanpasu/package.json | 2 +- clash-nyanpasu/pnpm-lock.yaml | 34 +- lede/config/Config-build.in | 6 +- lede/config/Config-images.in | 29 +- lede/config/Config-kernel.in | 150 ++- lede/package/kernel/mt76/Makefile | 7 +- .../002-mt7603-fix-mixed-code.patch | 33 + ...ch => 003-wifi-mt76-mt7915-fix-oops.patch} | 0 mihomo/adapter/outboundgroup/loadbalance.go | 2 - mihomo/common/lru/lrucache.go | 32 + mihomo/common/queue/queue.go | 4 +- mihomo/common/utils/callback.go | 4 +- mihomo/component/sniffer/dispatcher.go | 20 +- mihomo/config/config.go | 3 + mihomo/docs/config.yaml | 4 + mihomo/hub/hub.go | 5 +- mihomo/hub/route/doh.go | 67 + mihomo/hub/route/server.go | 16 +- .../net/tools/naive/naive_proxy_delegate.cc | 2 + .../model/cbi/passwall/client/other.lua | 12 +- .../HOS/Kernel/Memory/AddressSpaceType.cs | 10 - .../HOS/Kernel/Memory/KPageTableBase.cs | 66 +- .../HOS/Kernel/Process/KProcess.cs | 29 +- .../Kernel/Process/KProcessCapabilities.cs | 14 +- .../Kernel/Process/ProcessCreationFlags.cs | 6 +- .../HOS/Kernel/SupervisorCall/InfoType.cs | 7 +- .../HOS/Kernel/SupervisorCall/Syscall.cs | 144 +-- shadowsocks-rust/Cargo.lock | 8 +- sing-box/common/process/searcher_darwin.go | 4 +- sing-box/docs/changelog.md | 6 +- sing-box/go.mod | 2 +- sing-box/go.sum | 4 +- sing-box/option/json.go | 6 +- sing-box/option/types.go | 4 +- sing-box/option/udp_over_tcp.go | 2 +- .../model/cbi/passwall/client/other.lua | 12 +- small/v2ray-geodata/Makefile | 2 +- small/xray-core/Makefile | 4 +- trojan-rs/Cargo.lock | 913 +++++++++----- trojan-rs/Cargo.toml | 24 +- trojan-rs/src/aproxy/mod.rs | 11 +- trojan-rs/src/aproxy/profiler.rs | 17 +- trojan-rs/src/main.rs | 3 + trojan-rs/src/proxy/net_profiler.rs | 15 +- v2rayng/V2rayNG/app/build.gradle.kts | 4 +- v2rayu/V2rayU.xcodeproj/project.pbxproj | 8 +- v2rayu/V2rayU/Import.swift | 3 - v2rayu/V2rayU/Uri.swift | 3 - v2rayu/V2rayU/v2ray/V2rayConfig.swift | 3 - xray-core/.github/workflows/docker.yml | 2 +- xray-core/core/core.go | 2 +- .../transport/internet/splithttp/client.go | 4 + yass/CMakeLists.txt | 22 +- .../main/java/it/gui/yass/MainActivity.java | 103 +- .../main/java/it/gui/yass/YassVpnService.java | 17 +- yass/third_party/googletest/BUILD.bazel | 26 +- yass/third_party/googletest/MODULE.bazel | 4 +- yass/third_party/googletest/WORKSPACE | 32 +- .../googletest/googletest_deps.bzl | 8 +- yass/third_party/sqlite/CMakeLists.txt | 4 +- 100 files changed, 3001 insertions(+), 1253 deletions(-) create mode 100644 clash-meta/hub/route/doh.go create mode 100644 clash-nyanpasu/backend/tauri/src/consts.rs create mode 100644 clash-nyanpasu/backend/tauri/src/core/commands/migrate.rs create mode 100644 clash-nyanpasu/backend/tauri/src/utils/collect.rs create mode 100644 clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-dialog.tsx create mode 100644 clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss create mode 100644 clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss.d.ts create mode 100644 clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.tsx create mode 100644 clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss create mode 100644 clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss.d.ts create mode 100644 clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.tsx create mode 100644 lede/package/kernel/mt76/patches-6.x/002-mt7603-fix-mixed-code.patch rename lede/package/kernel/mt76/patches-6.x/{002-wifi-mt76-mt7915-fix-oops.patch => 003-wifi-mt76-mt7915-fix-oops.patch} (100%) create mode 100644 mihomo/hub/route/doh.go delete mode 100644 ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/AddressSpaceType.cs diff --git a/.github/update.log b/.github/update.log index 5ac5231f8d..a16248ce71 100644 --- a/.github/update.log +++ b/.github/update.log @@ -710,3 +710,4 @@ Update On Thu Jul 18 20:31:52 CEST 2024 Update On Fri Jul 19 20:31:21 CEST 2024 Update On Sat Jul 20 20:32:08 CEST 2024 Update On Sun Jul 21 20:28:53 CEST 2024 +Update On Mon Jul 22 20:31:05 CEST 2024 diff --git a/clash-meta/adapter/outboundgroup/loadbalance.go b/clash-meta/adapter/outboundgroup/loadbalance.go index 4cb0db004f..738ed15479 100644 --- a/clash-meta/adapter/outboundgroup/loadbalance.go +++ b/clash-meta/adapter/outboundgroup/loadbalance.go @@ -205,7 +205,6 @@ func strategyStickySessions(url string) strategyFn { proxy := proxies[nowIdx] if proxy.AliveForTestUrl(url) { if nowIdx != idx { - lruCache.Delete(key) lruCache.Set(key, nowIdx) } @@ -215,7 +214,6 @@ func strategyStickySessions(url string) strategyFn { } } - lruCache.Delete(key) lruCache.Set(key, 0) return proxies[0] } diff --git a/clash-meta/common/lru/lrucache.go b/clash-meta/common/lru/lrucache.go index 6f32ed18b1..35f605b10c 100644 --- a/clash-meta/common/lru/lrucache.go +++ b/clash-meta/common/lru/lrucache.go @@ -223,6 +223,10 @@ func (c *LruCache[K, V]) Delete(key K) { c.mu.Lock() defer c.mu.Unlock() + c.delete(key) +} + +func (c *LruCache[K, V]) delete(key K) { if le, ok := c.cache[key]; ok { c.deleteElement(le) } @@ -255,6 +259,34 @@ func (c *LruCache[K, V]) Clear() error { return nil } +// Compute either sets the computed new value for the key or deletes +// the value for the key. When the delete result of the valueFn function +// is set to true, the value will be deleted, if it exists. When delete +// is set to false, the value is updated to the newValue. +// The ok result indicates whether value was computed and stored, thus, is +// present in the map. The actual result contains the new value in cases where +// the value was computed and stored. +func (c *LruCache[K, V]) Compute( + key K, + valueFn func(oldValue V, loaded bool) (newValue V, delete bool), +) (actual V, ok bool) { + c.mu.Lock() + defer c.mu.Unlock() + + if el := c.get(key); el != nil { + actual, ok = el.value, true + } + if newValue, del := valueFn(actual, ok); del { + if ok { // data not in cache, so needn't delete + c.delete(key) + } + return lo.Empty[V](), false + } else { + c.set(key, newValue) + return newValue, true + } +} + type entry[K comparable, V any] struct { key K value V diff --git a/clash-meta/common/queue/queue.go b/clash-meta/common/queue/queue.go index cb58e2f5a2..d1b6beebe5 100644 --- a/clash-meta/common/queue/queue.go +++ b/clash-meta/common/queue/queue.go @@ -59,8 +59,8 @@ func (q *Queue[T]) Copy() []T { // Len returns the number of items in this queue. func (q *Queue[T]) Len() int64 { - q.lock.Lock() - defer q.lock.Unlock() + q.lock.RLock() + defer q.lock.RUnlock() return int64(len(q.items)) } diff --git a/clash-meta/common/utils/callback.go b/clash-meta/common/utils/callback.go index df950d3a81..ad734c0fd6 100644 --- a/clash-meta/common/utils/callback.go +++ b/clash-meta/common/utils/callback.go @@ -17,8 +17,8 @@ func NewCallback[T any]() *Callback[T] { } func (c *Callback[T]) Register(item func(T)) io.Closer { - c.mutex.RLock() - defer c.mutex.RUnlock() + c.mutex.Lock() + defer c.mutex.Unlock() element := c.list.PushBack(item) return &callbackCloser[T]{ element: element, diff --git a/clash-meta/component/sniffer/dispatcher.go b/clash-meta/component/sniffer/dispatcher.go index 97bf162969..4438638dad 100644 --- a/clash-meta/component/sniffer/dispatcher.go +++ b/clash-meta/component/sniffer/dispatcher.go @@ -5,7 +5,6 @@ import ( "fmt" "net" "net/netip" - "sync" "time" "github.com/metacubex/mihomo/common/lru" @@ -30,7 +29,6 @@ type SnifferDispatcher struct { forceDomain *trie.DomainSet skipSNI *trie.DomainSet skipList *lru.LruCache[string, uint8] - rwMux sync.RWMutex forceDnsMapping bool parsePureIp bool } @@ -85,14 +83,11 @@ func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata return false } - sd.rwMux.RLock() dst := fmt.Sprintf("%s:%d", metadata.DstIP, metadata.DstPort) if count, ok := sd.skipList.Get(dst); ok && count > 5 { log.Debugln("[Sniffer] Skip sniffing[%s] due to multiple failures", dst) - defer sd.rwMux.RUnlock() return false } - sd.rwMux.RUnlock() if host, err := sd.sniffDomain(conn, metadata); err != nil { sd.cacheSniffFailed(metadata) @@ -104,9 +99,7 @@ func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata return false } - sd.rwMux.RLock() sd.skipList.Delete(dst) - sd.rwMux.RUnlock() sd.replaceDomain(metadata, host, overrideDest) return true @@ -176,14 +169,13 @@ func (sd *SnifferDispatcher) sniffDomain(conn *N.BufferedConn, metadata *C.Metad } func (sd *SnifferDispatcher) cacheSniffFailed(metadata *C.Metadata) { - sd.rwMux.Lock() dst := fmt.Sprintf("%s:%d", metadata.DstIP, metadata.DstPort) - count, _ := sd.skipList.Get(dst) - if count <= 5 { - count++ - } - sd.skipList.Set(dst, count) - sd.rwMux.Unlock() + sd.skipList.Compute(dst, func(oldValue uint8, loaded bool) (newValue uint8, delete bool) { + if oldValue <= 5 { + oldValue++ + } + return oldValue, false + }) } func NewCloseSnifferDispatcher() (*SnifferDispatcher, error) { diff --git a/clash-meta/config/config.go b/clash-meta/config/config.go index ae82ac3f7e..f58709c9c0 100644 --- a/clash-meta/config/config.go +++ b/clash-meta/config/config.go @@ -96,6 +96,7 @@ type Controller struct { ExternalControllerTLS string `json:"-"` ExternalControllerUnix string `json:"-"` ExternalUI string `json:"-"` + ExternalDohServer string `json:"-"` Secret string `json:"-"` } @@ -322,6 +323,7 @@ type RawConfig struct { ExternalUI string `yaml:"external-ui"` ExternalUIURL string `yaml:"external-ui-url" json:"external-ui-url"` ExternalUIName string `yaml:"external-ui-name" json:"external-ui-name"` + ExternalDohServer string `yaml:"external-doh-server"` Secret string `yaml:"secret"` Interface string `yaml:"interface-name"` RoutingMark int `yaml:"routing-mark"` @@ -697,6 +699,7 @@ func parseGeneral(cfg *RawConfig) (*General, error) { Secret: cfg.Secret, ExternalControllerUnix: cfg.ExternalControllerUnix, ExternalControllerTLS: cfg.ExternalControllerTLS, + ExternalDohServer: cfg.ExternalDohServer, }, UnifiedDelay: cfg.UnifiedDelay, Mode: cfg.Mode, diff --git a/clash-meta/docs/config.yaml b/clash-meta/docs/config.yaml index 9c51bc10b3..4e4b9b16ef 100644 --- a/clash-meta/docs/config.yaml +++ b/clash-meta/docs/config.yaml @@ -70,6 +70,10 @@ external-ui: /path/to/ui/folder/ external-ui-name: xd external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip" +# 在RESTful API端口上开启DOH服务器 +# !!!该URL不会验证secret, 如果开启请自行保证安全问题 !!! +external-doh-server: /dns-query + # interface-name: en0 # 设置出口网卡 # 全局 TLS 指纹,优先低于 proxy 内的 client-fingerprint diff --git a/clash-meta/hub/hub.go b/clash-meta/hub/hub.go index 38779e13b6..57c91aaef9 100644 --- a/clash-meta/hub/hub.go +++ b/clash-meta/hub/hub.go @@ -50,11 +50,12 @@ func Parse(options ...Option) error { if cfg.General.ExternalController != "" { go route.Start(cfg.General.ExternalController, cfg.General.ExternalControllerTLS, - cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.LogLevel == log.DEBUG) + cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.ExternalDohServer, + cfg.General.LogLevel == log.DEBUG) } if cfg.General.ExternalControllerUnix != "" { - go route.StartUnix(cfg.General.ExternalControllerUnix, cfg.General.LogLevel == log.DEBUG) + go route.StartUnix(cfg.General.ExternalControllerUnix, cfg.General.ExternalDohServer, cfg.General.LogLevel == log.DEBUG) } executor.ApplyConfig(cfg, true) diff --git a/clash-meta/hub/route/doh.go b/clash-meta/hub/route/doh.go new file mode 100644 index 0000000000..5f993c021d --- /dev/null +++ b/clash-meta/hub/route/doh.go @@ -0,0 +1,67 @@ +package route + +import ( + "context" + "encoding/base64" + "io" + "net/http" + + "github.com/metacubex/mihomo/component/resolver" + + "github.com/go-chi/render" +) + +func dohRouter() http.Handler { + return http.HandlerFunc(dohHandler) +} + +func dohHandler(w http.ResponseWriter, r *http.Request) { + if resolver.DefaultResolver == nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("DNS section is disabled")) + return + } + + if r.Header.Get("Accept") != "application/dns-message" { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("invalid accept header")) + return + } + + var dnsData []byte + var err error + switch r.Method { + case "GET": + dnsData, err = base64.RawURLEncoding.DecodeString(r.URL.Query().Get("dns")) + case "POST": + if r.Header.Get("Content-Type") != "application/dns-message" { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("invalid content-type")) + return + } + dnsData, err = io.ReadAll(r.Body) + _ = r.Body.Close() + default: + render.Status(r, http.StatusMethodNotAllowed) + render.JSON(w, r, newError("method not allowed")) + return + } + if err != nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError(err.Error())) + return + } + + ctx, cancel := context.WithTimeout(context.Background(), resolver.DefaultDNSTimeout) + defer cancel() + + dnsData, err = resolver.RelayDnsPacket(ctx, dnsData, dnsData) + if err != nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError(err.Error())) + return + } + + render.Status(r, http.StatusOK) + render.Data(w, r, dnsData) +} diff --git a/clash-meta/hub/route/server.go b/clash-meta/hub/route/server.go index c28782b9c3..165c7c6970 100644 --- a/clash-meta/hub/route/server.go +++ b/clash-meta/hub/route/server.go @@ -50,7 +50,7 @@ func SetUIPath(path string) { uiPath = C.Path.Resolve(path) } -func router(isDebug bool, withAuth bool) *chi.Mux { +func router(isDebug bool, withAuth bool, dohServer string) *chi.Mux { r := chi.NewRouter() corsM := cors.New(cors.Options{ AllowedOrigins: []string{"*"}, @@ -104,11 +104,15 @@ func router(isDebug bool, withAuth bool) *chi.Mux { }) }) } + if len(dohServer) > 0 && dohServer[0] == '/' { + r.Mount(dohServer, dohRouter()) + } + return r } func Start(addr string, tlsAddr string, secret string, - certificate, privateKey string, isDebug bool) { + certificate, privateKey string, dohServer string, isDebug bool) { if serverAddr != "" { return } @@ -133,7 +137,7 @@ func Start(addr string, tlsAddr string, secret string, serverAddr = l.Addr().String() log.Infoln("RESTful API tls listening at: %s", serverAddr) tlsServe := &http.Server{ - Handler: router(isDebug, true), + Handler: router(isDebug, true, dohServer), TLSConfig: &tls.Config{ Certificates: []tls.Certificate{c}, }, @@ -152,13 +156,13 @@ func Start(addr string, tlsAddr string, secret string, serverAddr = l.Addr().String() log.Infoln("RESTful API listening at: %s", serverAddr) - if err = http.Serve(l, router(isDebug, true)); err != nil { + if err = http.Serve(l, router(isDebug, true, dohServer)); err != nil { log.Errorln("External controller serve error: %s", err) } } -func StartUnix(addr string, isDebug bool) { +func StartUnix(addr string, dohServer string, isDebug bool) { addr = C.Path.Resolve(addr) dir := filepath.Dir(addr) @@ -186,7 +190,7 @@ func StartUnix(addr string, isDebug bool) { serverAddr = l.Addr().String() log.Infoln("RESTful API unix listening at: %s", serverAddr) - if err = http.Serve(l, router(isDebug, false)); err != nil { + if err = http.Serve(l, router(isDebug, false, dohServer)); err != nil { log.Errorln("External controller unix serve error: %s", err) } } diff --git a/clash-nyanpasu/.github/ISSUE_TEMPLATE/bug_report.yaml b/clash-nyanpasu/.github/ISSUE_TEMPLATE/bug_report.yaml index 2708ee51d1..b45781fcea 100644 --- a/clash-nyanpasu/.github/ISSUE_TEMPLATE/bug_report.yaml +++ b/clash-nyanpasu/.github/ISSUE_TEMPLATE/bug_report.yaml @@ -83,41 +83,52 @@ body: Additional details and attachments validations: required: false + - type: textarea + id: env_infos + attributes: + label: 环境信息 / Environment information + description: | + 请在此处提供您的环境信息,例如操作系统、Clash Nyanpasu 版本号、Clash 核心及其版本号等 + Please provide your environment information here, such as operating system, Clash Nyanpasu version number, Clash core and its version number, etc. + placeholder: | + 此处应该由 Nyanpasu 设置页面反馈按钮自动填写的内容,如果是老版本,请手动填写。 + This should be automatically filled in by the feedback button on the Nyanpasu settings page. If it is an old version, please fill it in manually. + validations: + required: true + # - type: input + # id: version + # attributes: + # label: Clash Nyanpasu 版本号 / Clash Nyanpasu + # description: 您可以在 **设置 - 关于** 或在 **托盘 - 更多** 中找到版本号 / You can find the version number in **Settings - About** or **Tray - More** + # placeholder: 1.5.0 + # validations: + # required: true - - type: input - id: version - attributes: - label: Clash Nyanpasu 版本号 / Clash Nyanpasu - description: 您可以在 **设置 - 关于** 或在 **托盘 - 更多** 中找到版本号 / You can find the version number in **Settings - About** or **Tray - More** - placeholder: 1.5.0 - validations: - required: true + # - type: input + # id: core-version + # attributes: + # label: Clash 核心及其版本号 / Clash core and version + # description: 您可以在 **设置 - Clash 内核** 中找到内核及其版本号 / You can find the core and its version number in **Settings - Clash Core** + # placeholder: v1.18.1 Meta + # validations: + # required: true + # - type: input + # id: pre-release + # attributes: + # label: 是否为 Pre-release / Is pre-release version + # description: 是否为 Pre-release 下载的应用,若是则填写对应的commit hash / Is this an app downloaded from Pre-release? If so, please fill in the corresponding commit hash. + # placeholder: 26f05a0 + # validations: + # required: true - - type: input - id: core-version - attributes: - label: Clash 核心及其版本号 / Clash core and version - description: 您可以在 **设置 - Clash 内核** 中找到内核及其版本号 / You can find the core and its version number in **Settings - Clash Core** - placeholder: v1.18.1 Meta - validations: - required: true - - type: input - id: pre-release - attributes: - label: 是否为 Pre-release / Is pre-release version - description: 是否为 Pre-release 下载的应用,若是则填写对应的commit hash / Is this an app downloaded from Pre-release? If so, please fill in the corresponding commit hash. - placeholder: 26f05a0 - validations: - required: true - - - type: input - id: system - attributes: - label: 操作系统及版本 / OS version - description: 操作系统 + 版本号 / OS + version code - placeholder: Windows 11, macOS 14 - validations: - required: true + # - type: input + # id: system + # attributes: + # label: 操作系统及版本 / OS version + # description: 操作系统 + 版本号 / OS + version code + # placeholder: Windows 11, macOS 14 + # validations: + # required: true - type: checkboxes id: check diff --git a/clash-nyanpasu/.github/workflows/ci.yml b/clash-nyanpasu/.github/workflows/ci.yml index 43348bb6be..e4afa1d336 100644 --- a/clash-nyanpasu/.github/workflows/ci.yml +++ b/clash-nyanpasu/.github/workflows/ci.yml @@ -14,7 +14,7 @@ jobs: matrix: targets: - os: ubuntu-latest - - os: macos-13 + - os: macos-latest - os: windows-latest runs-on: ${{ matrix.targets.os }} steps: diff --git a/clash-nyanpasu/backend/Cargo.lock b/clash-nyanpasu/backend/Cargo.lock index e1c217b567..e59976afd1 100644 --- a/clash-nyanpasu/backend/Cargo.lock +++ b/clash-nyanpasu/backend/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -92,6 +92,25 @@ dependencies = [ "libc", ] +[[package]] +name = "ansi-str" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cf4578926a981ab0ca955dc023541d19de37112bc24c1a197bd806d3d86ad1d" +dependencies = [ + "ansitok", +] + +[[package]] +name = "ansitok" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "220044e6a1bb31ddee4e3db724d29767f352de47445a6cd75e1a173142136c83" +dependencies = [ + "nom 7.1.3", + "vte", +] + [[package]] name = "anstream" version = "0.6.14" @@ -124,9 +143,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -164,7 +183,7 @@ checksum = "9fb4009533e8ff8f1450a5bcbc30f4242a1d34442221f72314bea1f5dc9c7f89" dependencies = [ "clipboard-win", "core-graphics 0.23.2", - "image 0.25.1", + "image 0.25.2", "log", "objc2", "objc2-app-kit", @@ -189,9 +208,15 @@ checksum = "0ae92a5119aa49cdbcf6b9f893fe4e1d98b04ccbf82ee0584ad948a44a734dea" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + [[package]] name = "arrayvec" version = "0.7.4" @@ -200,12 +225,12 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-broadcast" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258b52a1aa741b9f09783b2d86cf0aeeb617bbf847f6933340a39644227acbdb" +checksum = "20cd0e2e25ea8e5f7e9df04578dc6cf5c83577fd09b1a46aaf5c85e1c33f2a7e" dependencies = [ "event-listener 5.3.0", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] @@ -228,16 +253,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b47800b0be77592da0afd425cc03468052844aff33b84e33cc696f64e77b6a" dependencies = [ "concurrent-queue", - "event-listener-strategy 0.5.2", + "event-listener-strategy", "futures-core", "pin-project-lite", ] [[package]] name = "async-executor" -version = "1.11.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10202063978b3351199d68f8b22c4e47e4b1b822f8d43fd862d5ea8c006b29a" +checksum = "d7ebdfa2ebdab6b1760375fa7d6f382b9f486eac35fc994625a00e89280bdbb7" dependencies = [ "async-task", "concurrent-queue", @@ -264,7 +289,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebcd09b382f40fcd159c2d695175b2ae620ffa5f3bd6f664131efff4e8b9e04a" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "blocking", "futures-lite 2.3.0", ] @@ -291,17 +316,17 @@ dependencies = [ [[package]] name = "async-io" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcccb0f599cfa2f8ace422d3555572f47424da5648a4382a9dd0310ff8210884" +checksum = "0d6baa8f0178795da0e71bc42c9e5d13261aac7ee549853162e66a241ba17964" dependencies = [ - "async-lock 3.3.0", + "async-lock 3.4.0", "cfg-if", "concurrent-queue", "futures-io", "futures-lite 2.3.0", "parking", - "polling 3.7.0", + "polling 3.7.2", "rustix 0.38.34", "slab", "tracing", @@ -319,12 +344,12 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" +checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 4.0.3", - "event-listener-strategy 0.4.0", + "event-listener 5.3.0", + "event-listener-strategy", "pin-project-lite", ] @@ -358,13 +383,13 @@ dependencies = [ [[package]] name = "async-process" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53fc6301894e04a92cb2584fedde80cb25ba8e02d9dc39d4a87d036e22f397d" +checksum = "f7eda79bbd84e29c2b308d1dc099d7de8dcc7035e48f4bf5dc4a531a44ff5e2a" dependencies = [ "async-channel 2.3.1", - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "async-signal", "async-task", "blocking", @@ -384,17 +409,17 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "async-signal" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afe66191c335039c7bb78f99dc7520b0cbb166b3a1cb33a03f53d8a1c6f2afda" +checksum = "dfb3634b73397aa844481f814fad23bbf07fdb0eabec10f2eb95e58944b1ec32" dependencies = [ - "async-io 2.3.2", - "async-lock 3.3.0", + "async-io 2.3.3", + "async-lock 3.4.0", "atomic-waker", "cfg-if", "futures-core", @@ -419,7 +444,7 @@ checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -476,7 +501,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6678909d8c5d46a42abcf571271e15fdbc0a225e3646cf23762cd415046c78bf" dependencies = [ "anyhow", - "arrayvec", + "arrayvec 0.7.4", "log", "nom 7.1.3", "num-rational", @@ -489,7 +514,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "876c75a42f6364451a033496a14c44bffe41f5f4a8236f697391f11024e596d2" dependencies = [ - "arrayvec", + "arrayvec 0.7.4", ] [[package]] @@ -506,9 +531,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -537,6 +562,29 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.71", + "which 4.4.2", +] + [[package]] name = "bit_field" version = "0.10.2" @@ -551,15 +599,15 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bitstream-io" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c12d1856e42f0d817a835fe55853957c85c8c8a470114029143d3f12671446e" +checksum = "3dcde5f311c85b8ca30c2e4198d4326bc342c76541590106f5fa4a50946ea499" [[package]] name = "block" @@ -587,21 +635,20 @@ dependencies = [ [[package]] name = "block2" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ff7d91d3c1d568065b06c899777d1e48dcf76103a672a0adbc238a7f247f1e" +checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ "objc2", ] [[package]] name = "blocking" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "495f7104e962b7356f0aeb34247aca1fe7d2e783b346582db7f2904cb5717e88" +checksum = "703f41c54fc768e63e091340b424302bb1c29ef4aa0c7f10fe849dfb114d29ea" dependencies = [ "async-channel 2.3.1", - "async-lock 3.3.0", "async-task", "futures-io", "futures-lite 2.3.0", @@ -641,9 +688,9 @@ dependencies = [ [[package]] name = "built" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41bfbdb21256b87a8b5e80fab81a8eed158178e812fd7ba451907518b2742f16" +checksum = "236e6289eda5a812bc6b53c3b024039382a2895fbbeef2d748b2931546d392c4" [[package]] name = "bumpalo" @@ -653,9 +700,9 @@ checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytemuck" -version = "1.16.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78834c15cb5d5efe3452d58b1e8ba890dd62d21907f867f383358198e56ebca5" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" [[package]] name = "byteorder" @@ -671,9 +718,9 @@ checksum = "8f1fe948ff07f4bd06c30984e69f5b4899c516a3ef74f34df92a2df2ab535495" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" dependencies = [ "serde", ] @@ -735,13 +782,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -750,6 +796,15 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom 7.1.3", +] + [[package]] name = "cfb" version = "0.7.3" @@ -792,6 +847,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" version = "0.4.38" @@ -804,7 +865,7 @@ dependencies = [ "num-traits", "serde", "wasm-bindgen", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -817,6 +878,17 @@ dependencies = [ "inout", ] +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading 0.8.5", +] + [[package]] name = "clap" version = "4.5.9" @@ -848,20 +920,21 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] -name = "clash-verge" +name = "clash-nyanpasu" version = "0.1.0" dependencies = [ "adler", + "ansi-str", "anyhow", "async-trait", "auto-launch", @@ -870,6 +943,7 @@ dependencies = [ "chrono", "clap", "cocoa 0.25.0", + "colored", "ctrlc", "dashmap 6.0.1", "deelevate", @@ -885,12 +959,14 @@ dependencies = [ "glob", "gunzip", "hex", - "image 0.25.1", + "humansize", + "image 0.25.2", "indexmap 2.2.6", "log", "md-5", "nanoid", "num_cpus", + "nyanpasu-utils", "objc", "once_cell", "open 5.3.0", @@ -905,6 +981,7 @@ dependencies = [ "rs-snowflake", "runas", "rust-i18n", + "rustc_version 0.4.0", "semver 1.0.23", "serde", "serde_json", @@ -919,6 +996,7 @@ dependencies = [ "tempfile", "test-log", "thiserror", + "timeago", "tokio", "tracing", "tracing-appender", @@ -942,9 +1020,9 @@ dependencies = [ [[package]] name = "clipboard-win" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f4473f5144e20d9aceaf2972478f06ddf687831eafeeb434fbaf0acc4144ad" +checksum = "15efe7a882b08f34e38556b14f2fb3daa98769d06c7f0c1b076dfd0d983bc892" dependencies = [ "error-code", ] @@ -1007,6 +1085,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +[[package]] +name = "colored" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +dependencies = [ + "lazy_static", + "windows-sys 0.48.0", +] + [[package]] name = "combine" version = "4.6.7" @@ -1024,7 +1112,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f76990911f2267d837d9d0ad060aa63aaad170af40904b29461734c339030d4d" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1042,6 +1130,12 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7144d30dcf0fafbce74250a3963025d8d52177934239851c917d29f1df280c2" +[[package]] +name = "constcat" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f2e5af989b1955b092db01462980c0a286217f86817e12b2c09aea46bd03651" + [[package]] name = "convert_case" version = "0.4.0" @@ -1219,7 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1229,7 +1323,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "edb49164822f3ee45b17acd4a208cfc1251410cf0cad9a833234c9890774dd9f" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1250,9 +1344,9 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "darling" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b2eb4d90d12bdda5ed17de686c2acb4c57914f8f921b8da7e112b5a36f3fe1" +checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ "darling_core", "darling_macro", @@ -1260,27 +1354,27 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622687fe0bac72a04e5599029151f5796111b90f1baaa9b544d807a5e31cd120" +checksum = "95133861a8032aaea082871032f5815eb9e98cef03fa916ab4500513994df9e5" dependencies = [ "fnv", "ident_case", "proc-macro2", "quote", "strsim", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "darling_macro" -version = "0.20.9" +version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733cabb43482b1a1b53eee8583c2b9e8684d592215ea83efd305dd31bc2f0178" +checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ "darling_core", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1373,7 +1467,7 @@ checksum = "d150dea618e920167e5973d70ae6ece4385b7164e0d799fe7c122dd0a5d912ad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1384,7 +1478,7 @@ checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1405,7 +1499,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1415,20 +1509,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b" dependencies = [ "derive_builder_core", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.0", - "syn 1.0.109", + "syn 2.0.71", ] [[package]] @@ -1513,6 +1607,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "dirs-utils" +version = "0.1.0" +source = "git+https://github.com/LibNyanpasu/nyanpasu-utils#aae6449b002bfd36eba878153e2e3b5029b9fd29" +dependencies = [ + "dirs-next", + "thiserror", + "tracing", + "windows 0.58.0", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -1537,13 +1642,13 @@ dependencies = [ [[package]] name = "displaydoc" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1552,7 +1657,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.3", + "libloading 0.8.5", ] [[package]] @@ -1578,9 +1683,9 @@ checksum = "dcbb2bf8e87535c23f7a8a321e364ce21462d0ff10cb6407820e8e96dfff6653" [[package]] name = "dtoa-short" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbaceec3c6e4211c79e7b1800fb9680527106beb2f9c51904a3210c03a448c74" +checksum = "cd1511a7b6a56299bd043a9c167a6d2bfb37bf84a6dfceaba651168adfb43c87" dependencies = [ "dtoa", ] @@ -1599,20 +1704,20 @@ checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.4.2" +version = "2.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" +checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" dependencies = [ "cc", "memchr", "rustc_version 0.4.0", - "toml 0.8.13", + "toml 0.8.15", "vswhom", "winreg 0.52.0", ] @@ -1640,9 +1745,9 @@ checksum = "a3d8a32ae18130a3c84dd492d4215c3d913c3b07c6b63c2eb3eb7ff1101ab7bf" [[package]] name = "enumflags2" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3278c9d5fb675e0a51dabcf4c0d355f692b064171535ba72361be1528a9d8e8d" +checksum = "d232db7f5956f3f14313dc2f87985c58bd2c695ce124c8cdd984e08e15ac133d" dependencies = [ "enumflags2_derive", "serde", @@ -1650,13 +1755,13 @@ dependencies = [ [[package]] name = "enumflags2_derive" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c785274071b1b420972453b306eeca06acf4633829db4223b58a2a8c5953bc4" +checksum = "de0d48a183585823424a4ce1aa132d174a6a81bd540895822eb4c8373a8e49e8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -1719,17 +1824,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - [[package]] name = "event-listener" version = "5.3.0" @@ -1741,16 +1835,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "event-listener-strategy" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" -dependencies = [ - "event-listener 4.0.3", - "pin-project-lite", -] - [[package]] name = "event-listener-strategy" version = "0.5.2" @@ -1913,7 +1997,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -2037,7 +2121,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -2234,9 +2318,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gio" @@ -2328,8 +2412,8 @@ dependencies = [ "aho-corasick", "bstr", "log", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -2412,7 +2496,7 @@ dependencies = [ [[package]] name = "gunzip" version = "0.1.0" -source = "git+https://github.com/TechHara/gunzip.git#399d63f2fcc90863a9846a19b428af8c1d930b32" +source = "git+https://github.com/TechHara/gunzip.git#51b00e9c7b1930fc252ae4fcf1a0a9bffdafbb8d" dependencies = [ "crc32fast", ] @@ -2513,6 +2597,12 @@ version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" +[[package]] +name = "hermit-abi" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" + [[package]] name = "hex" version = "0.4.3" @@ -2581,9 +2671,9 @@ checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573" [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2592,10 +2682,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] -name = "hyper" -version = "0.14.28" +name = "humansize" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" +checksum = "6cb51c9a029ddc91b07a787f1d86b53ccfa49b0e86688c946ebe8d3555685dd7" +dependencies = [ + "libm", +] + +[[package]] +name = "hyper" +version = "0.14.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -2608,7 +2707,7 @@ dependencies = [ "httpdate", "itoa 1.0.11", "pin-project-lite", - "socket2 0.4.10", + "socket2 0.5.7", "tokio", "tower-service", "tracing", @@ -2701,7 +2800,7 @@ dependencies = [ "globset", "log", "memchr", - "regex-automata 0.4.6", + "regex-automata 0.4.7", "same-file", "walkdir", "winapi-util", @@ -2721,12 +2820,12 @@ dependencies = [ [[package]] name = "image" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd54d660e773627692c524beaad361aca785a4f9f5730ce91f42aabe5bce3d11" +checksum = "99314c8a2152b8ddb211f924cdae532d8c5e4c8bb54728e12fff1b0cd5963a10" dependencies = [ "bytemuck", - "byteorder", + "byteorder-lite", "color_quant", "exr", "gif", @@ -2744,12 +2843,12 @@ dependencies = [ [[package]] name = "image-webp" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d730b085583c4d789dfd07fdcf185be59501666a90c97c40162b37e4fdad272d" +checksum = "f79afb8cbee2ef20f59ccd477a218c12a93943d075b492015ecb1bb81f8ee904" dependencies = [ "byteorder-lite", - "thiserror", + "quick-error", ] [[package]] @@ -2822,7 +2921,7 @@ version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb6250a98af259a26fd5a4a6081fccea9ac116e4c3178acf4aeb86d32d2b7715" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cc", "handlebars", "lazy_static", @@ -2840,7 +2939,7 @@ checksum = "c34819042dc3d3971c46c2190835914dfbe0c3c13f61449b2997f4e9722dfa60" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -2862,7 +2961,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", "windows-sys 0.48.0", ] @@ -2909,6 +3008,15 @@ version = "1.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +[[package]] +name = "isolang" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe50d48c77760c55188549098b9a7f6e37ae980c586a24693d6b01c3b2010c3c" +dependencies = [ + "phf 0.11.2", +] + [[package]] name = "itertools" version = "0.12.1" @@ -3008,6 +3116,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "kill_tree" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3879339076ac4da142cc852d91693462927cbc99773b5ea422e4834e68c4ff2" +dependencies = [ + "bindgen", + "nix 0.27.1", + "tokio", + "tracing", + "windows 0.52.0", +] + [[package]] name = "kuchikiki" version = "0.8.2" @@ -3023,9 +3144,15 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "lebe" @@ -3150,30 +3277,30 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] +[[package]] +name = "libm" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" + [[package]] name = "libredox" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] -[[package]] -name = "line-wrap" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1bc4d24ad230d21fb898d1116b1801d7adfc449d42026475862ab48b11e70e" - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -3342,9 +3469,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" @@ -3408,9 +3535,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", "simd-adler32", @@ -3438,11 +3565,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -3514,15 +3640,38 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "libc", +] + [[package]] name = "nix" version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", + "libc", +] + +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.6.0", + "cfg-if", + "cfg_aliases 0.2.1", "libc", "memoffset 0.9.1", ] @@ -3602,9 +3751,9 @@ dependencies = [ [[package]] name = "num-bigint" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c165a9ab64cf766f73521c0dd2cfdff64f488b8f0b3e621face3462d3db536d7" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", @@ -3635,7 +3784,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -3673,7 +3822,7 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi", + "hermit-abi 0.3.9", "libc", ] @@ -3698,6 +3847,28 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "nyanpasu-utils" +version = "0.1.0" +source = "git+https://github.com/LibNyanpasu/nyanpasu-utils#aae6449b002bfd36eba878153e2e3b5029b9fd29" +dependencies = [ + "constcat", + "derive_builder", + "dirs-utils", + "encoding_rs", + "kill_tree", + "memchr", + "os_pipe", + "parking_lot", + "serde", + "shared_child", + "sysinfo", + "thiserror", + "tokio", + "tracing", + "tracing-attributes", +] + [[package]] name = "objc" version = "0.2.7" @@ -3737,25 +3908,42 @@ dependencies = [ [[package]] name = "objc2-app-kit" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb79768a710a9a1798848179edb186d1af7e8a8679f369e4b8d201dd2a034047" +checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ + "bitflags 2.6.0", "block2", + "libc", "objc2", "objc2-core-data", + "objc2-core-image", "objc2-foundation", + "objc2-quartz-core", ] [[package]] name = "objc2-core-data" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e092bc42eaf30a08844e6a076938c60751225ec81431ab89f5d1ccd9f958d6c" +checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-core-image" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ "block2", "objc2", "objc2-foundation", + "objc2-metal", ] [[package]] @@ -3766,12 +3954,39 @@ checksum = "7891e71393cd1f227313c9379a26a584ff3d7e6e7159e988851f0934c993f0f8" [[package]] name = "objc2-foundation" -version = "0.2.0" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfaefe14254871ea16c7d88968c0ff14ba554712a20d76421eec52f0a7fb8904" +checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ + "bitflags 2.6.0", + "block2", + "libc", + "objc2", +] + +[[package]] +name = "objc2-metal" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" +dependencies = [ + "bitflags 2.6.0", "block2", "objc2", + "objc2-foundation", +] + +[[package]] +name = "objc2-quartz-core" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" +dependencies = [ + "bitflags 2.6.0", + "block2", + "objc2", + "objc2-foundation", + "objc2-metal", ] [[package]] @@ -3794,9 +4009,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -3836,11 +4051,11 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -3857,7 +4072,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -3868,18 +4083,18 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.2.3+3.2.1" +version = "300.3.1+3.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cff92b6f71555b61bb9315f7c64da3ca43d87531622120fea0195fc761b4843" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" dependencies = [ "cc", ] [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -3926,9 +4141,9 @@ dependencies = [ [[package]] name = "os_pipe" -version = "1.1.5" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57119c3b893986491ec9aa85056780d3a0f3cf4da7cc09dd3650dbd6c6738fb9" +checksum = "29d73ba8daf8fac13b0501d1abeddcfe21ba7401ada61a819144b6c2a4f32209" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3991,10 +4206,10 @@ dependencies = [ "cfg-if", "libc", "petgraph", - "redox_syscall 0.5.1", + "redox_syscall 0.5.3", "smallvec", "thread-id", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4037,9 +4252,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560131c633294438da9f7c4b08189194b20946c8274c6b9e38881a7874dc8ee8" +checksum = "cd53dff83f26735fdc1ca837098ccf133605d794cdae66acfc2bfac3ec809d95" dependencies = [ "memchr", "thiserror", @@ -4048,9 +4263,9 @@ dependencies = [ [[package]] name = "pest_derive" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26293c9193fbca7b1a3bf9b79dc1e388e927e6cacaa78b4a3ab705a1d3d41459" +checksum = "2a548d2beca6773b1c244554d36fcf8548a8a58e74156968211567250e48e49a" dependencies = [ "pest", "pest_generator", @@ -4058,22 +4273,22 @@ dependencies = [ [[package]] name = "pest_generator" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec22af7d3fb470a85dd2ca96b7c577a1eb4ef6f1683a9fe9a8c16e136c04687" +checksum = "3c93a82e8d145725dcbaf44e5ea887c8a869efdcc28706df2d08c69e17077183" dependencies = [ "pest", "pest_meta", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "pest_meta" -version = "2.7.10" +version = "2.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a240022f37c361ec1878d646fc5b7d7c4d28d5946e1a80ad5a7a4f4ca0bdcd" +checksum = "a941429fea7e08bedec25e4f6785b6ffaacc6b755da98df5ef3e7dcf4a124c4f" dependencies = [ "once_cell", "pest", @@ -4204,7 +4419,7 @@ dependencies = [ "phf_shared 0.11.2", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -4251,7 +4466,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -4268,9 +4483,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "piper" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "464db0c665917b13ebb5d453ccdec4add5658ee1adc7affc7677615356a8afaf" +checksum = "ae1d5c74c9876f070d3e8fd503d748c7d974c3e48da8f41350fa5222ef9b4391" dependencies = [ "atomic-waker", "fastrand 2.1.0", @@ -4285,14 +4500,13 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plist" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d34169e64b3c7a80c8621a48adaf44e0cf62c78a9b25dd9dd35f1881a17cf9" +checksum = "42cf17e9a1800f5f396bc67d193dc9411b59012a5876445ef450d449881e1016" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "indexmap 2.2.6", - "line-wrap", - "quick-xml 0.31.0", + "quick-xml 0.32.0", "serde", "time", ] @@ -4328,13 +4542,13 @@ dependencies = [ [[package]] name = "polling" -version = "3.7.0" +version = "3.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645493cf344456ef24219d02a768cf1fb92ddf8c92161679ae3d91b91a637be3" +checksum = "a3ed00ed3fbf728b5816498ecd316d1716eecaced9c0c8d2c5a6740ca214985b" dependencies = [ "cfg-if", "concurrent-queue", - "hermit-abi", + "hermit-abi 0.4.0", "pin-project-lite", "rustix 0.38.34", "tracing", @@ -4365,6 +4579,16 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.71", +] + [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -4416,9 +4640,9 @@ checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -4439,7 +4663,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8021cf59c8ec9c432cfc2526ac6b8aa508ecaf29cd415f271b8406c1b851c3fd" dependencies = [ "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -4475,6 +4699,24 @@ dependencies = [ "memchr", ] +[[package]] +name = "quick-xml" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d3a6e5838b60e0e8fa7a43f22ade549a37d61f8bdbe636d0d7816191de969c2" +dependencies = [ + "memchr", +] + +[[package]] +name = "quick-xml" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f24d770aeca0eacb81ac29dfbc55ebcc09312fdd1f8bbecdc7e4a84e000e3b4" +dependencies = [ + "memchr", +] + [[package]] name = "quote" version = "1.0.36" @@ -4573,7 +4815,7 @@ checksum = "cd87ce80a7665b1cce111f8a16c1f3929f6547ce91ade6addf4ec86a8dda5ce9" dependencies = [ "arbitrary", "arg_enum_proc_macro", - "arrayvec", + "arrayvec 0.7.4", "av1-grain", "bitstream-io", "built", @@ -4602,9 +4844,9 @@ dependencies = [ [[package]] name = "ravif" -version = "0.11.5" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc13288f5ab39e6d7c9d501759712e6969fcc9734220846fc9ed26cae2cc4234" +checksum = "c6ba61c28ba24c0cf8406e025cb29a742637e3f70776e61c27a8a8b72a042d12" dependencies = [ "avif-serialize", "imgref", @@ -4667,11 +4909,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -4702,19 +4944,19 @@ checksum = "bcc303e793d3734489387d205e9b186fac9c6cfacedd98cbb2e8a5943595f3e6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata 0.4.6", - "regex-syntax 0.8.3", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] @@ -4728,13 +4970,13 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.3", + "regex-syntax 0.8.4", ] [[package]] @@ -4745,9 +4987,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -4821,9 +5063,9 @@ dependencies = [ [[package]] name = "rgb" -version = "0.8.37" +version = "0.8.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05aaa8004b64fd573fc9d002f4e632d51ad4f026c2b5ba95fcb6c2f32c2c47d8" +checksum = "ade4539f42266ded9e755c605bdddf546242b2c961b03b06a7375260788a0523" dependencies = [ "bytemuck", ] @@ -4916,7 +5158,7 @@ dependencies = [ "serde", "serde_json", "serde_yaml 0.8.26", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -4945,6 +5187,12 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.2.3" @@ -4983,7 +5231,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.14", @@ -5075,11 +5323,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -5088,9 +5336,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -5175,7 +5423,7 @@ checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -5198,7 +5446,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -5224,9 +5472,9 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ad483d2ab0149d5a5ebcd9972a3852711e0153d863bf5a5d0391d28883c4a20" +checksum = "69cecfa94848272156ea67b2b1a53f20fc7bc638c4a46d2f8abde08f05f4b857" dependencies = [ "base64 0.22.1", "chrono", @@ -5242,14 +5490,14 @@ dependencies = [ [[package]] name = "serde_with_macros" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65569b702f41443e8bc8bbb1c5779bd0450bbe723b56198980e80ec45780bce2" +checksum = "a8fee4991ef4f274617a51ad4af30519438dacb2f56ac773b08a1922ff743350" dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -5373,6 +5621,12 @@ dependencies = [ "libc", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.1.17" @@ -5469,7 +5723,7 @@ version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cursor-icon", "libc", "log", @@ -5615,9 +5869,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -5632,9 +5886,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.65" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2863d96a84c6439701d7a38f9de935ec562c8832cc55d1dde0f513b52fad106" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -5729,7 +5983,7 @@ dependencies = [ "cfg-expr 0.15.8", "heck 0.5.0", "pkg-config", - "toml 0.8.13", + "toml 0.8.15", "version-compare 0.2.0", ] @@ -5795,9 +6049,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "cb797dad5fb5b76fcf519e702f4a589483b5ef06567f160c392832c1f5e44909" dependencies = [ "filetime", "libc", @@ -5806,9 +6060,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "tauri" @@ -6137,7 +6391,7 @@ checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -6163,14 +6417,14 @@ checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] name = "thread-id" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ec81c46e9eb50deaa257be2f148adf052d1fb7701cfd55ccfab2525280b70b" +checksum = "cfe8f25bbdd100db7e1d34acf7fd2dc59c4bf8f7483f505eaa7d4f12f76cc0ea" dependencies = [ "libc", "winapi", @@ -6229,10 +6483,20 @@ dependencies = [ ] [[package]] -name = "tinyvec" -version = "1.6.0" +name = "timeago" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "a1710e589de0a76aaf295cd47a6699f6405737dbfd3cf2b75c92d000b548d0e6" +dependencies = [ + "chrono", + "isolang", +] + +[[package]] +name = "tinyvec" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -6276,7 +6540,7 @@ checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -6335,14 +6599,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.13", + "toml_edit 0.22.16", ] [[package]] @@ -6380,15 +6644,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ "indexmap 2.2.6", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.8", + "winnow 0.6.14", ] [[package]] @@ -6429,7 +6693,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -6507,9 +6771,9 @@ dependencies = [ [[package]] name = "tree_magic_mini" -version = "3.1.4" +version = "3.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ee137597cdb361b55a4746983e4ac1b35ab6024396a419944ad473bb915265" +checksum = "469a727cac55b41448315cc10427c069c618ac59bb6a4480283fcd811749bdc2" dependencies = [ "fnv", "home", @@ -6521,9 +6785,9 @@ dependencies = [ [[package]] name = "triomphe" -version = "0.1.11" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" +checksum = "e6631e42e10b40c0690bf92f404ebcfe6e1fdb480391d15f17cc8e96eeed5369" dependencies = [ "arc-swap", "serde", @@ -6618,9 +6882,9 @@ checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" @@ -6704,6 +6968,27 @@ dependencies = [ "libc", ] +[[package]] +name = "vte" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6cbce692ab4ca2f1f3047fcf732430249c0e971bfdd2b234cf2c47ad93af5983" +dependencies = [ + "arrayvec 0.5.2", + "utf8parse", + "vte_generate_state_changes", +] + +[[package]] +name = "vte_generate_state_changes" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e369bee1b05d510a7b4ed645f5faa90619e05437111783ea5848f28d97d3c2e" +dependencies = [ + "proc-macro2", + "quote", +] + [[package]] name = "vtparse" version = "0.6.2" @@ -6771,7 +7056,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", "wasm-bindgen-shared", ] @@ -6805,7 +7090,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -6831,9 +7116,9 @@ dependencies = [ [[package]] name = "wayland-backend" -version = "0.3.3" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d50fa61ce90d76474c87f5fc002828d81b32677340112b4ef08079a9d459a40" +checksum = "f90e11ce2ca99c97b940ee83edbae9da2d56a08f9ea8158550fd77fa31722993" dependencies = [ "cc", "downcast-rs", @@ -6845,11 +7130,11 @@ dependencies = [ [[package]] name = "wayland-client" -version = "0.31.2" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82fb96ee935c2cea6668ccb470fb7771f6215d1691746c2d896b447a00ad3f1f" +checksum = "7e321577a0a165911bdcfb39cf029302479d7527b517ee58ab0f6ad09edf0943" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "rustix 0.38.34", "wayland-backend", "wayland-scanner", @@ -6861,16 +7146,16 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] [[package]] name = "wayland-cursor" -version = "0.31.1" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ce5fa868dd13d11a0d04c5e2e65726d0897be8de247c0c5a65886e283231ba" +checksum = "6ef9489a8df197ebf3a8ce8a7a7f0a2320035c3743f3c1bd0bdbccf07ce64f95" dependencies = [ "rustix 0.38.34", "wayland-client", @@ -6883,7 +7168,7 @@ version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -6895,7 +7180,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -6904,20 +7189,20 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.31.1" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63b3a62929287001986fb58c789dce9b67604a397c15c611ad9f747300b6c283" +checksum = "d7b56f89937f1cf2ee1f1259cf2936a17a1f45d8f0aa1019fae6d470d304cfa6" dependencies = [ "proc-macro2", - "quick-xml 0.31.0", + "quick-xml 0.34.0", "quote", ] [[package]] name = "wayland-sys" -version = "0.31.1" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +checksum = "43676fe2daf68754ecf1d72026e4e6c15483198b5d24e888b74d3f22f887a148" dependencies = [ "dlib", "log", @@ -7174,7 +7459,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7184,7 +7469,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ "windows-core 0.56.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7194,7 +7479,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ "windows-core 0.57.0", - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] @@ -7213,7 +7508,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7224,8 +7519,8 @@ checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ "windows-implement 0.56.0", "windows-interface 0.56.0", - "windows-result", - "windows-targets 0.52.5", + "windows-result 0.1.2", + "windows-targets 0.52.6", ] [[package]] @@ -7236,8 +7531,21 @@ checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ "windows-implement 0.57.0", "windows-interface 0.57.0", - "windows-result", - "windows-targets 0.52.5", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", ] [[package]] @@ -7258,7 +7566,7 @@ checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -7269,7 +7577,18 @@ checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", +] + +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", ] [[package]] @@ -7280,7 +7599,7 @@ checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -7291,7 +7610,18 @@ checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", +] + +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.71", ] [[package]] @@ -7302,11 +7632,30 @@ checksum = "9ee5e275231f07c6e240d14f34e1b635bf1faa1c76c57cfd59a5cdb9848e4278" [[package]] name = "windows-result" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", ] [[package]] @@ -7348,7 +7697,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7383,18 +7732,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -7409,7 +7758,7 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6998aa457c9ba8ff2fb9f13e9d2a930dabcea28f1d0ab94d687d8b3654844515" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -7426,9 +7775,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -7456,9 +7805,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -7486,15 +7835,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -7522,9 +7871,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -7552,9 +7901,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -7570,9 +7919,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -7600,9 +7949,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -7615,9 +7964,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "374ec40a2d767a3c1b4972d9475ecd557356637be906f2cb3f7fe17a6eb5e22f" dependencies = [ "memchr", ] @@ -7777,25 +8126,25 @@ dependencies = [ [[package]] name = "xcursor" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a0ccd7b4a5345edfcd0c3535718a4e9ff7798ffc536bb5b5a0e26ff84732911" +checksum = "d491ee231a51ae64a5b762114c3ac2104b967aadba1de45c86ca42cf051513b7" [[package]] name = "xdg-home" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21e5a325c3cb8398ad6cf859c1135b25dd29e186679cf2da7581d9679f63b38e" +checksum = "ca91dcf8f93db085f3a0a29358cd0b9d670915468f4290e8b85d118a34211ab8" dependencies = [ "libc", - "winapi", + "windows-sys 0.52.0", ] [[package]] name = "xkeysym" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" +checksum = "b9cc00251562a284751c9973bace760d86c0276c471b4be569fe6b068ee97a56" [[package]] name = "yaml-rust" @@ -7808,16 +8157,16 @@ dependencies = [ [[package]] name = "zbus" -version = "4.2.2" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989c3977a7aafa97b12b9a35d21cdcff9b0d2289762b14683f45d66b1ba6c48f" +checksum = "851238c133804e0aa888edf4a0229481c753544ca12a60fd1c3230c8a500fe40" dependencies = [ "async-broadcast", "async-executor", "async-fs 2.1.2", - "async-io 2.3.2", - "async-lock 3.3.0", - "async-process 2.2.2", + "async-io 2.3.3", + "async-lock 3.4.0", + "async-process 2.2.3", "async-recursion", "async-task", "async-trait", @@ -7828,7 +8177,7 @@ dependencies = [ "futures-sink", "futures-util", "hex", - "nix 0.28.0", + "nix 0.29.0", "ordered-stream", "rand 0.8.5", "serde", @@ -7846,14 +8195,14 @@ dependencies = [ [[package]] name = "zbus_macros" -version = "4.2.2" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe9de53245dcf426b7be226a4217dd5e339080e5d46e64a02d6e5dcbf90fca1" +checksum = "8d5a3f12c20bd473be3194af6b49d50d7bb804ef3192dc70eddedb26b85d9da7" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", "zvariant_utils", ] @@ -7870,22 +8219,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -7905,7 +8254,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] [[package]] @@ -7973,27 +8322,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", @@ -8016,18 +8365,18 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec866b44a2a1fd6133d363f073ca1b179f438f99e7e5bfb1e33f7181facfe448" +checksum = "16099418600b4d8f028622f73ff6e3deaabdff330fb9a2a131dea781ee8b0768" dependencies = [ "zune-core", ] [[package]] name = "zvariant" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aa6d31a02fbfb602bfde791de7fedeb9c2c18115b3d00f3a36e489f46ffbbc7" +checksum = "1724a2b330760dc7d2a8402d841119dc869ef120b139d29862d6980e9c75bfc9" dependencies = [ "endi", "enumflags2", @@ -8038,14 +8387,14 @@ dependencies = [ [[package]] name = "zvariant_derive" -version = "4.1.1" +version = "4.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642bf1b6b6d527988b3e8193d20969d53700a36eac734d21ae6639db168701c8" +checksum = "55025a7a518ad14518fb243559c058a2e5b848b015e31f1d90414f36e3317859" dependencies = [ "proc-macro-crate 3.1.0", "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", "zvariant_utils", ] @@ -8057,5 +8406,5 @@ checksum = "fc242db087efc22bd9ade7aa7809e4ba828132edc312871584a6b4391bdf8786" dependencies = [ "proc-macro2", "quote", - "syn 2.0.65", + "syn 2.0.71", ] diff --git a/clash-nyanpasu/backend/tauri/Cargo.toml b/clash-nyanpasu/backend/tauri/Cargo.toml index e4a544d04c..c92579a900 100644 --- a/clash-nyanpasu/backend/tauri/Cargo.toml +++ b/clash-nyanpasu/backend/tauri/Cargo.toml @@ -1,11 +1,11 @@ [package] -name = "clash-verge" +name = "clash-nyanpasu" version = "0.1.0" description = "clash verge" authors = { workspace = true } license = { workspace = true } repository = { workspace = true } -default-run = "clash-verge" +default-run = "clash-nyanpasu" edition = { workspace = true } build = "build.rs" @@ -13,8 +13,11 @@ build = "build.rs" tauri-build = { version = "1", features = [] } serde = "1" simd-json = "0.13" +chrono = "0.4" +rustc_version = "0.4" [dependencies] +nyanpasu-utils = { git = "https://github.com/LibNyanpasu/nyanpasu-utils" } which = "6" anyhow = "1.0" dirs = "5.0.1" @@ -100,6 +103,10 @@ test-log = { version = "0.2.16", features = ["trace"] } md-5 = "0.10.6" hex = "0.4" rand = "0.8" +colored = "2.1.0" +timeago = "0.4" +ansi-str = "0.8" +humansize = "2.1.3" [target.'cfg(target_os = "macos")'.dependencies] cocoa = "0.25.0" diff --git a/clash-nyanpasu/backend/tauri/build.rs b/clash-nyanpasu/backend/tauri/build.rs index 0e31e146e6..eb8b848f60 100644 --- a/clash-nyanpasu/backend/tauri/build.rs +++ b/clash-nyanpasu/backend/tauri/build.rs @@ -1,5 +1,7 @@ +use chrono::{DateTime, SecondsFormat, Utc}; +use rustc_version::version_meta; use serde::Deserialize; -use std::fs::read; +use std::{env, fs::read, process::Command}; #[derive(Deserialize)] struct PackageJson { version: String, // we only need the version @@ -9,5 +11,60 @@ fn main() { let mut pkg_json = read("../../package.json").unwrap(); let pkg_json: PackageJson = simd_json::from_slice(&mut pkg_json).unwrap(); println!("cargo:rustc-env=NYANPASU_VERSION={}", pkg_json.version); + // Git Information + let output = Command::new("git") + .args([ + "show", + "--pretty=format:'%H,%cn,%cI'", + "--no-patch", + "--no-notes", + ]) + .output() + .unwrap(); + let command_args: Vec = String::from_utf8(output.stdout) + .unwrap() + .replace('\'', "") + .split(',') + .map(String::from) + .collect(); + println!("cargo:rustc-env=COMMIT_HASH={}", command_args[0]); + println!("cargo:rustc-env=COMMIT_AUTHOR={}", command_args[1]); + let commit_date = DateTime::parse_from_rfc3339(command_args[2].as_str()) + .unwrap() + .with_timezone(&Utc) + .to_rfc3339_opts(SecondsFormat::Millis, true); + println!("cargo:rustc-env=COMMIT_DATE={}", commit_date); + + // Build Date + let build_date = Utc::now().to_rfc3339_opts(SecondsFormat::Millis, true); + println!("cargo:rustc-env=BUILD_DATE={}", build_date); + + // Build Profile + println!( + "cargo:rustc-env=BUILD_PROFILE={}", + match env::var("PROFILE").unwrap().as_str() { + "release" => "Release", + "debug" => "Debug", + _ => "Unknown", + } + ); + // Build Platform + println!( + "cargo:rustc-env=BUILD_PLATFORM={}", + env::var("TARGET").unwrap() + ); + // Rustc Version & LLVM Version + let rustc_version = version_meta().unwrap(); + println!( + "cargo:rustc-env=RUSTC_VERSION={}", + rustc_version.short_version_string + ); + println!( + "cargo:rustc-env=LLVM_VERSION={}", + match rustc_version.llvm_version { + Some(v) => v.to_string(), + None => "Unknown".to_string(), + } + ); tauri_build::build() } diff --git a/clash-nyanpasu/backend/tauri/src/cmds.rs b/clash-nyanpasu/backend/tauri/src/cmds.rs index 19d9ab5a9d..b11f15c1fd 100644 --- a/clash-nyanpasu/backend/tauri/src/cmds.rs +++ b/clash-nyanpasu/backend/tauri/src/cmds.rs @@ -3,7 +3,9 @@ use crate::{ core::{tasks::jobs::ProfilesJobGuard, updater::ManifestVersionLatest, *}, feat, ret_err, utils::{ - candy, dirs, help, + candy, + collect::EnvInfo, + dirs, help, resolve::{self, save_window_state}, }, wrap_err, @@ -372,6 +374,11 @@ pub async fn update_proxy_provider(name: String) -> CmdResult<()> { Ok(()) } +#[tauri::command] +pub fn collect_envs<'a>() -> CmdResult> { + Ok(wrap_err!(crate::utils::collect::collect_envs())?) +} + #[cfg(windows)] #[tauri::command] pub fn get_custom_app_dir() -> CmdResult> { diff --git a/clash-nyanpasu/backend/tauri/src/consts.rs b/clash-nyanpasu/backend/tauri/src/consts.rs new file mode 100644 index 0000000000..8d774d61c0 --- /dev/null +++ b/clash-nyanpasu/backend/tauri/src/consts.rs @@ -0,0 +1,30 @@ +use once_cell::sync::Lazy; + +#[derive(Debug, serde::Serialize, Clone)] +pub struct BuildInfo { + pub app_name: &'static str, + pub app_version: &'static str, + pub pkg_version: &'static str, + pub commit_hash: &'static str, + pub commit_author: &'static str, + pub commit_date: &'static str, + pub build_date: &'static str, + pub build_profile: &'static str, + pub build_platform: &'static str, + pub rustc_version: &'static str, + pub llvm_version: &'static str, +} + +pub static BUILD_INFO: Lazy = Lazy::new(|| BuildInfo { + app_name: env!("CARGO_PKG_NAME"), + app_version: env!("CARGO_PKG_VERSION"), + pkg_version: env!("NYANPASU_VERSION"), + commit_hash: env!("COMMIT_HASH"), + commit_author: env!("COMMIT_AUTHOR"), + commit_date: env!("COMMIT_DATE"), + build_date: env!("BUILD_DATE"), + build_profile: env!("BUILD_PROFILE"), + build_platform: env!("BUILD_PLATFORM"), + rustc_version: env!("RUSTC_VERSION"), + llvm_version: env!("LLVM_VERSION"), +}); diff --git a/clash-nyanpasu/backend/tauri/src/core/commands/migrate.rs b/clash-nyanpasu/backend/tauri/src/core/commands/migrate.rs new file mode 100644 index 0000000000..16aff864fa --- /dev/null +++ b/clash-nyanpasu/backend/tauri/src/core/commands/migrate.rs @@ -0,0 +1,79 @@ +#[cfg(target_os = "windows")] +pub fn migrate_home_dir_handler(target_path: &str) -> anyhow::Result<()> { + use crate::utils::{self, dirs}; + use anyhow::Context; + use deelevate::{PrivilegeLevel, Token}; + use std::{path::PathBuf, process::Command, str::FromStr, thread, time::Duration}; + use sysinfo::System; + use tauri::utils::platform::current_exe; + println!("target path {}", target_path); + + let token = Token::with_current_process()?; + if let PrivilegeLevel::NotPrivileged = token.privilege_level()? { + eprintln!("Please run this command as admin to prevent authority issue."); + std::process::exit(1); + } + + let current_home_dir = dirs::app_home_dir()?; + let target_home_dir = PathBuf::from_str(target_path)?; + + // 1. waiting for app exited + println!("waiting for app exited."); + let placeholder = dirs::get_single_instance_placeholder(); + let mut single_instance: single_instance::SingleInstance; + loop { + single_instance = single_instance::SingleInstance::new(&placeholder) + .context("failed to create single instance")?; + if single_instance.is_single() { + break; + } + thread::sleep(Duration::from_secs(1)); + } + + // 2. kill all related processes. + let related_names = [ + "clash-verge-service", + "clash-nyanpasu-service", // for upcoming v1.6.x + "clash-rs", + "mihomo", + "mihomo-alpha", + "clash", + ]; + let sys = System::new_all(); + 'outer: for process in sys.processes().values() { + let mut process_name = process.name(); + if process_name.ends_with(".exe") { + process_name = &process_name[..process_name.len() - 4]; // remove .exe + } + for name in related_names.iter() { + if process_name.ends_with(name) { + println!( + "Process found: {} should be killed. killing...", + process_name + ); + if !process.kill() { + eprintln!("failed to kill {}.", process_name) + } + continue 'outer; + } + } + } + + // 3. do config migrate and update the registry. + utils::init::do_config_migration(¤t_home_dir, &target_home_dir)?; + utils::winreg::set_app_dir(target_home_dir.as_path())?; + println!("migration finished. starting application..."); + drop(single_instance); // release single instance lock + + let app_path = current_exe()?; + thread::spawn(move || { + Command::new(app_path).spawn().unwrap(); + }); + thread::sleep(Duration::from_secs(5)); + Ok(()) +} + +#[cfg(not(target_os = "windows"))] +pub fn migrate_home_dir_handler(_target_path: &str) -> anyhow::Result<()> { + Ok(()) +} diff --git a/clash-nyanpasu/backend/tauri/src/core/commands/mod.rs b/clash-nyanpasu/backend/tauri/src/core/commands/mod.rs index 6ea67d8471..babd11cd59 100644 --- a/clash-nyanpasu/backend/tauri/src/core/commands/mod.rs +++ b/clash-nyanpasu/backend/tauri/src/core/commands/mod.rs @@ -6,9 +6,15 @@ use tauri::utils::platform::current_exe; use crate::utils; +mod migrate; + #[derive(Parser, Debug)] -#[command(name = "clash-nyanpasu", version, about, long_about = None)] +#[command(name = "clash-nyanpasu", version, about, long_about = None, disable_version_flag = true)] +/// Clash Nyanpasu is a GUI client for Clash. pub struct Cli { + /// Print the version + #[clap(short = 'v', long, default_value = "false")] + version: bool, #[command(subcommand)] command: Option, #[arg(raw = true)] @@ -17,9 +23,12 @@ pub struct Cli { #[derive(Subcommand, Debug)] enum Commands { - #[command(about = "Migrate home directory to another path.")] - MigrateHomeDir { target_path: String }, - #[command(about = "A launch bridge to resolve the delay exit issue.")] + /// Migrate home directory to another path. + MigrateHomeDir { + target_path: String, + }, + Collect, + /// A launch bridge to resolve the delay exit issue. Launch { #[arg(raw = true)] args: Vec, @@ -40,11 +49,14 @@ impl Drop for DelayedExitGuard { pub fn parse() -> anyhow::Result<()> { let cli = Cli::parse(); + if cli.version { + print_version_info(); + } if let Some(commands) = &cli.command { let guard = DelayedExitGuard::new(); match commands { Commands::MigrateHomeDir { target_path } => { - self::handler::migrate_home_dir_handler(target_path).unwrap(); + migrate::migrate_home_dir_handler(target_path).unwrap(); } Commands::Launch { args } => { let _ = utils::init::check_singleton().unwrap(); @@ -64,6 +76,10 @@ pub fn parse() -> anyhow::Result<()> { // args.extend(vec!["--".to_string()]); std::process::Command::new(path).args(args).spawn().unwrap(); } + Commands::Collect => { + let envs = crate::utils::collect::collect_envs().unwrap(); + println!("{:#?}", envs); + } } drop(guard); std::process::exit(0); @@ -71,84 +87,75 @@ pub fn parse() -> anyhow::Result<()> { Ok(()) // bypass } -mod handler { - #[cfg(target_os = "windows")] - pub fn migrate_home_dir_handler(target_path: &str) -> anyhow::Result<()> { - use crate::utils::{self, dirs}; - use anyhow::Context; - use deelevate::{PrivilegeLevel, Token}; - use std::{path::PathBuf, process::Command, str::FromStr, thread, time::Duration}; - use sysinfo::System; - use tauri::utils::platform::current_exe; - println!("target path {}", target_path); +fn print_version_info() { + use crate::consts::*; + use ansi_str::AnsiStr; + use chrono::{DateTime, Utc}; + use colored::*; + use timeago::Formatter; + let build_info = &BUILD_INFO; - let token = Token::with_current_process()?; - if let PrivilegeLevel::NotPrivileged = token.privilege_level()? { - eprintln!("Please run this command as admin to prevent authority issue."); - std::process::exit(1); - } + let now = Utc::now(); + let formatter = Formatter::new(); + let commit_time = formatter.convert_chrono( + DateTime::parse_from_rfc3339(build_info.commit_date).unwrap(), + now, + ); + let commit_time_width = commit_time.len() + build_info.commit_date.len() + 3; + let build_time = formatter.convert_chrono( + DateTime::parse_from_rfc3339(build_info.build_date).unwrap(), + now, + ); + let build_time_width = build_time.len() + build_info.build_date.len() + 3; + let commit_info_width = build_info.commit_hash.len() + build_info.commit_author.len() + 4; + let col_width = commit_info_width + .max(commit_time_width) + .max(build_time_width) + .max(build_info.build_platform.len()) + .max(build_info.rustc_version.len()) + .max(build_info.llvm_version.len()) + + 2; + let header_width = col_width + 16; + println!( + "{} v{} ({} Build)\n", + build_info.app_name, + build_info.pkg_version, + build_info.build_profile.yellow() + ); + println!("╭{:─^width$}╮", " Build Information ", width = header_width); - let current_home_dir = dirs::app_home_dir()?; - let target_home_dir = PathBuf::from_str(target_path)?; + let mut line = format!( + "{} by {}", + build_info.commit_hash.green(), + build_info.commit_author.blue() + ); - // 1. waiting for app exited - println!("waiting for app exited."); - let placeholder = dirs::get_single_instance_placeholder(); - let mut single_instance: single_instance::SingleInstance; - loop { - single_instance = single_instance::SingleInstance::new(&placeholder) - .context("failed to create single instance")?; - if single_instance.is_single() { - break; - } - thread::sleep(Duration::from_secs(1)); - } + let mut pad = col_width - line.ansi_strip().len(); + println!("│{:>14}: {}{}│", "Commit Info", line, " ".repeat(pad)); - // 2. kill all related processes. - let related_names = [ - "clash-verge-service", - "clash-nyanpasu-service", // for upcoming v1.6.x - "clash-rs", - "mihomo", - "mihomo-alpha", - "clash", - ]; - let sys = System::new_all(); - 'outer: for process in sys.processes().values() { - let mut process_name = process.name(); - if process_name.ends_with(".exe") { - process_name = &process_name[..process_name.len() - 4]; // remove .exe - } - for name in related_names.iter() { - if process_name.ends_with(name) { - println!( - "Process found: {} should be killed. killing...", - process_name - ); - if !process.kill() { - eprintln!("failed to kill {}.", process_name) - } - continue 'outer; - } - } - } + line = format!("{} ({})", commit_time.red(), build_info.commit_date.cyan()); + pad = col_width - line.ansi_strip().len(); + println!("│{:>14}: {}{}│", "Commit Time", line, " ".repeat(pad)); - // 3. do config migrate and update the registry. - utils::init::do_config_migration(¤t_home_dir, &target_home_dir)?; - utils::winreg::set_app_dir(target_home_dir.as_path())?; - println!("migration finished. starting application..."); - drop(single_instance); // release single instance lock + line = format!("{} ({})", build_time.red(), build_info.build_date.cyan()); + pad = col_width - line.ansi_strip().len(); + println!("│{:>14}: {}{}│", "Build Time", line, " ".repeat(pad)); - let app_path = current_exe()?; - thread::spawn(move || { - Command::new(app_path).spawn().unwrap(); - }); - thread::sleep(Duration::from_secs(5)); - Ok(()) - } - - #[cfg(not(target_os = "windows"))] - pub fn migrate_home_dir_handler(_target_path: &str) -> anyhow::Result<()> { - Ok(()) - } + println!( + "│{:>14}: {:14}: {:14}: {: std::io::Result<()> { cmds::select_proxy, cmds::update_proxy_provider, cmds::restart_application, + cmds::collect_envs, ]); #[cfg(target_os = "macos")] diff --git a/clash-nyanpasu/backend/tauri/src/utils/collect.rs b/clash-nyanpasu/backend/tauri/src/utils/collect.rs new file mode 100644 index 0000000000..a1861a94f9 --- /dev/null +++ b/clash-nyanpasu/backend/tauri/src/utils/collect.rs @@ -0,0 +1,93 @@ +use std::{borrow::Cow, collections::HashMap}; + +use crate::consts::{BuildInfo, BUILD_INFO}; +use humansize::{SizeFormatter, BINARY}; +use nyanpasu_utils::core::{ClashCoreType, CoreType}; +use serde::Serialize; +use sysinfo::System; + +#[derive(Debug, Serialize)] +pub struct DeviceInfo<'a> { + /// Device name, such as "Intel Core i5-8250U CPU @ 1.60GHz x 8" + pub cpu: Vec>, + /// GPU name, such as "Intel UHD Graphics 620 (Kabylake GT2)" + // pub gpu: Cow<'a, str>, + /// Memory size in bytes + pub memory: Cow<'a, str>, +} + +#[derive(Debug, Serialize)] +pub struct EnvInfo<'a> { + pub os: Cow<'a, str>, + pub arch: Cow<'a, str>, + pub core: CoreInfo<'a>, + pub device: DeviceInfo<'a>, + pub build_info: Cow<'a, BuildInfo>, + // TODO: add service info + // pub service_info: xxx +} + +pub type CoreInfo<'a> = HashMap, Cow<'a, str>>; + +pub fn collect_envs<'a>() -> Result, std::io::Error> { + let mut system = sysinfo::System::new_all(); + system.refresh_all(); + + let device = DeviceInfo { + cpu: { + let mut cpus: Vec<(u64, &str, i32)> = Vec::new(); + for cpu in system.cpus().iter() { + let item = cpus.iter_mut().find(|(_, name, _)| name == &cpu.brand()); + match item { + Some((_, _, count)) => *count += 1, + None => cpus.push((cpu.frequency(), cpu.brand(), 1)), + } + } + cpus.iter() + .map(|(freq, name, count)| { + Cow::Owned(format!( + "{} @ {:.2}GHz x {}", + name, + *freq as f64 / 1000.0, + count + )) + }) + .collect() + }, + memory: Cow::Owned(SizeFormatter::new(system.total_memory(), BINARY).to_string()), + }; + + let mut core = HashMap::new(); + for c in CoreType::get_supported_cores() { + let name: &str = c.as_ref(); + let command = tauri::api::process::Command::new_sidecar(name) + .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))?; + let output = command + .args(if matches!(c, CoreType::Clash(ClashCoreType::ClashRust)) { + ["-V"] + } else { + ["-v"] + }) + .output() + .expect("failed to execute sidecar command"); + core.insert( + Cow::Borrowed(name), + Cow::Owned(output.stdout.replace("\n\n", " ").trim().to_owned()), + ); + } + Ok(EnvInfo { + os: Cow::Owned( + format!( + "{} {}", + System::long_os_version().unwrap_or("".to_string()), + System::kernel_version().unwrap_or("".to_string()), + ) + .trim() + .to_owned(), + ), + arch: Cow::Owned(System::cpu_arch().unwrap_or("".to_string())), + core, + device, + build_info: Cow::Borrowed(&BUILD_INFO), + }) +} diff --git a/clash-nyanpasu/backend/tauri/src/utils/mod.rs b/clash-nyanpasu/backend/tauri/src/utils/mod.rs index e8b6b9fc93..b88411187c 100644 --- a/clash-nyanpasu/backend/tauri/src/utils/mod.rs +++ b/clash-nyanpasu/backend/tauri/src/utils/mod.rs @@ -10,3 +10,5 @@ pub mod tmpl; pub mod downloader; #[cfg(windows)] pub mod winreg; + +pub mod collect; diff --git a/clash-nyanpasu/frontend/interface/service/tauri.ts b/clash-nyanpasu/frontend/interface/service/tauri.ts index 23658264cb..82451993fc 100644 --- a/clash-nyanpasu/frontend/interface/service/tauri.ts +++ b/clash-nyanpasu/frontend/interface/service/tauri.ts @@ -1,13 +1,14 @@ import { invoke } from "@tauri-apps/api/tauri"; +import { ManifestVersion } from "./core"; import { ClashConfig, ClashInfo, - VergeConfig, + EnvInfos, Profile, - SystemProxy, Proxies, + SystemProxy, + VergeConfig, } from "./types"; -import { ManifestVersion } from "./core"; export const getNyanpasuConfig = async () => { return await invoke("get_verge_config"); @@ -186,3 +187,7 @@ export const updateProxyProvider = async (name: string) => { export const save_window_size_state = async () => { return await invoke("save_window_size_state"); }; + +export const collect_envs = async () => { + return await invoke("collect_envs"); +}; diff --git a/clash-nyanpasu/frontend/interface/service/types.ts b/clash-nyanpasu/frontend/interface/service/types.ts index dd4ae816d5..906433f920 100644 --- a/clash-nyanpasu/frontend/interface/service/types.ts +++ b/clash-nyanpasu/frontend/interface/service/types.ts @@ -206,3 +206,14 @@ export interface Memory { inuse: number; oslimit: number; } + +export interface EnvInfos { + os: string; + arch: string; + core: { [key: string]: string }; + device: { + cpu: Array; + memory: string; + }; + build_info: { [key: string]: string }; +} diff --git a/clash-nyanpasu/frontend/nyanpasu/package.json b/clash-nyanpasu/frontend/nyanpasu/package.json index eeda7e5946..46c8892e1e 100644 --- a/clash-nyanpasu/frontend/nyanpasu/package.json +++ b/clash-nyanpasu/frontend/nyanpasu/package.json @@ -56,7 +56,7 @@ "@vitejs/plugin-react-swc": "3.7.0", "clsx": "2.1.1", "sass": "1.77.8", - "shiki": "1.10.3", + "shiki": "1.11.0", "tailwindcss-textshadow": "2.1.3", "vite": "5.3.4", "vite-plugin-monaco-editor": "1.1.3", diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/dashboard/data-panel.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/dashboard/data-panel.tsx index eb14486b64..7551339213 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/components/dashboard/data-panel.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/dashboard/data-panel.tsx @@ -1,4 +1,11 @@ import Dataline, { DatalineProps } from "@/components/dashboard/dataline"; +import { + ArrowDownward, + ArrowUpward, + MemoryOutlined, + SettingsEthernet, +} from "@mui/icons-material"; +import Grid from "@mui/material/Unstable_Grid2"; import { Connection, Memory, @@ -8,24 +15,17 @@ import { } from "@nyanpasu/interface"; import { useInterval } from "ahooks"; import { useState } from "react"; -import { - ArrowDownward, - ArrowUpward, - MemoryOutlined, - SettingsEthernet, -} from "@mui/icons-material"; -import Grid from "@mui/material/Unstable_Grid2"; import { useTranslation } from "react-i18next"; export const DataPanel = () => { const { t } = useTranslation(); const [traffic, setTraffice] = useState( - new Array(16).fill({ up: 0, down: 0 }), + new Array(20).fill({ up: 0, down: 0 }), ); const [memory, setMemory] = useState( - new Array(16).fill({ inuse: 0 }), + new Array(20).fill({ inuse: 0 }), ); const [connection, setConnection] = useState< @@ -35,7 +35,7 @@ export const DataPanel = () => { connections: number; }[] >( - new Array(16).fill({ + new Array(20).fill({ downloadTotal: 0, uploadTotal: 0, connections: 0, diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-dialog.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-dialog.tsx new file mode 100644 index 0000000000..9714a0b653 --- /dev/null +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-dialog.tsx @@ -0,0 +1,138 @@ +import { NotificationType, useNotification } from "@/hooks/use-notification"; +import { Typography } from "@mui/material"; +import { useNyanpasu } from "@nyanpasu/interface"; +import { BaseDialog, BaseDialogProps } from "@nyanpasu/ui"; +import { useLockFn, useMemoizedFn } from "ahooks"; +import { useEffect, useMemo, useRef, useState } from "react"; +import { useTranslation } from "react-i18next"; +import HotkeyInput from "./hotkey-input"; + +export interface HotkeyDialogProps extends Omit {} + +const HOTKEY_FUNC = [ + "open_or_close_dashboard", + "clash_mode_rule", + "clash_mode_global", + "clash_mode_direct", + "clash_mode_script", + "toggle_system_proxy", + "enable_system_proxy", + "disable_system_proxy", + "toggle_tun_mode", + "enable_tun_mode", + "disable_tun_mode", +]; + +export default function HotkeyDialog({ + open, + onClose, + children, + ...rest +}: HotkeyDialogProps) { + const { t } = useTranslation(); + + const { nyanpasuConfig, setNyanpasuConfig } = useNyanpasu(); + + const [hotkeyMap, setHotkeyMap] = useState>({}); + const hotkeyMapRef = useRef>({}); + // 检查是否有快捷键重复 + const [duplicateItems, setDuplicateItems] = useState([]); + useEffect(() => { + if (open) { + const map = {} as typeof hotkeyMap; + nyanpasuConfig?.hotkeys?.forEach((text) => { + const [func, key] = text.split(",").map((i) => i.trim()); + if (!func || !key) return; + map[func] = key + .split("+") + .map((e) => e.trim()) + .map((k) => (k === "PLUS" ? "+" : k)); + }); + setHotkeyMap(map); + setDuplicateItems([]); + } + }, [open]); + const isDuplicated = useMemo(() => !!duplicateItems.length, [duplicateItems]); + + const onBlurCb = useMemoizedFn( + (e: React.FocusEvent, func: string) => { + console.log(func); + const keys = Object.values(hotkeyMapRef.current).flat().filter(Boolean); + const set = new Set(keys); + if (keys.length !== set.size) { + setDuplicateItems([...duplicateItems, func]); + } else { + setDuplicateItems(duplicateItems.filter((e) => e !== func)); + } + }, + ); + + const saveState = useLockFn(async () => { + const hotkeys = Object.entries(hotkeyMap) + .map(([func, keys]) => { + if (!func || !keys?.length) return ""; + + const key = keys + .map((k) => k.trim()) + .filter(Boolean) + .map((k) => (k === "+" ? "PLUS" : k)) + .join("+"); + + if (!key) return ""; + return `${func},${key}`; + }) + .filter(Boolean); + + try { + await setNyanpasuConfig({ hotkeys }); + } catch (err: any) { + useNotification({ + title: t("Error"), + body: err.message || err.toString(), + type: NotificationType.Error, + }); + } + }); + + // 自动保存 + useEffect(() => { + if (!duplicateItems.length && open) { + saveState(); + } + }, [hotkeyMap, duplicateItems, open]); + + const onSave = () => { + saveState().then(() => { + onClose?.(); + }); + }; + + return ( + + {children} +
+ {HOTKEY_FUNC.map((func) => ( +
+ {t(func)} + { + const map = { ...hotkeyMapRef.current, [func]: v }; + hotkeyMapRef.current = map; + setHotkeyMap(map); + }} + /> +
+ ))} +
+
+ ); +} diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss new file mode 100644 index 0000000000..1aa856e22a --- /dev/null +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss @@ -0,0 +1,20 @@ +.wrapper { + .input { + &:hover { + + .items { + border-color: var(--input-hover-border-color); + } + } + + &:focus { + + .items { + border-color: var(--input-focus-border-color); + border-width: 2px; + } + } + } + + .items { + border-color: var(--border-color); + } +} diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss.d.ts b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss.d.ts new file mode 100644 index 0000000000..255564212e --- /dev/null +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.module.scss.d.ts @@ -0,0 +1,6 @@ +declare const classNames: { + readonly wrapper: "wrapper"; + readonly input: "input"; + readonly items: "items"; +}; +export default classNames; diff --git a/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.tsx b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.tsx new file mode 100644 index 0000000000..fc12f5705f --- /dev/null +++ b/clash-nyanpasu/frontend/nyanpasu/src/components/setting/modules/hotkey-input.tsx @@ -0,0 +1,103 @@ +import { parseHotkey } from "@/utils/parse-hotkey"; +import { DeleteRounded } from "@mui/icons-material"; +import { alpha, IconButton, useTheme } from "@mui/material"; +import Kbd from "@nyanpasu/ui/materialYou/components/kbd"; +import clsx from "clsx"; +import { CSSProperties, useRef, useState } from "react"; +import styles from "./hotkey-input.module.scss"; + +export interface Props extends React.HTMLAttributes { + isDuplicate?: boolean; + value?: string[]; + onValueChange?: (value: string[]) => void; + func: string; + onBlurCb?: (e: React.FocusEvent, func: string) => void; +} + +export default function HotkeyInput({ + isDuplicate = false, + value, + children, + func, + onValueChange, + onBlurCb, + // native + className, + ...rest +}: Props) { + const theme = useTheme(); + + const changeRef = useRef([]); + const [keys, setKeys] = useState(value || []); + return ( +
+
+ { + const ret = changeRef.current.slice(); + if (ret.length) { + onValueChange?.(ret); + changeRef.current = []; + } + }} + onKeyDown={(e) => { + const evt = e.nativeEvent; + e.preventDefault(); + e.stopPropagation(); + const key = parseHotkey(evt.key); + if (key === "UNIDENTIFIED") return; + + changeRef.current = [...new Set([...changeRef.current, key])]; + setKeys(changeRef.current); + }} + onBlur={(e) => { + onBlurCb?.(e, func); + }} + {...rest} + /> +
+ {keys.map((key) => ( + + {key} + + ))} +
+
+ + { + onValueChange?.([]); + setKeys([]); + onBlurCb?.({} as any, func); + }} + > + + +
+ ); +} diff --git a/clash-nyanpasu/frontend/nyanpasu/src/pages/settings.tsx b/clash-nyanpasu/frontend/nyanpasu/src/pages/settings.tsx index e9b3af41c8..4170982478 100644 --- a/clash-nyanpasu/frontend/nyanpasu/src/pages/settings.tsx +++ b/clash-nyanpasu/frontend/nyanpasu/src/pages/settings.tsx @@ -1,12 +1,15 @@ -import { GitHub } from "@mui/icons-material"; -import { IconButton } from "@mui/material"; +import HotkeyDialog from "@/components/setting/modules/hotkey-dialog"; +import { formatEnvInfos } from "@/utils"; +import { Feedback, GitHub, Keyboard } from "@mui/icons-material"; import Masonry from "@mui/lab/Masonry"; -import { useLockFn } from "ahooks"; -import { useTranslation } from "react-i18next"; +import { IconButton } from "@mui/material"; +import { collect_envs } from "@nyanpasu/interface"; import { BasePage } from "@nyanpasu/ui"; import { open } from "@tauri-apps/api/shell"; +import { useLockFn } from "ahooks"; import { motion } from "framer-motion"; -import { lazy, Suspense } from "react"; +import React, { lazy, Suspense } from "react"; +import { useTranslation } from "react-i18next"; const asyncComponents = [ () => import("@/components/setting/setting-system-proxy"), @@ -41,11 +44,54 @@ const GithubIcon = () => { ); }; +const FeedbackIcon = () => { + const toFeedback = useLockFn(async () => { + const envs = await collect_envs(); + const formattedEnv = encodeURIComponent( + formatEnvInfos(envs) + .split("\n") + .map((v) => `> ${v}`) + .join("\n"), + ); + return open( + "https://github.com/LibNyanpasu/clash-nyanpasu/issues/new?assignees=&labels=T%3A+Bug%2CS%3A+Untriaged&projects=&template=bug_report.yaml&env_infos=" + + formattedEnv, + ); + }); + return ( + + + + ); +}; + +// FIXME: it should move to a proper place +const HotkeyButton = () => { + const [open, setOpen] = React.useState(false); + return ( + <> + setOpen(false)} /> + setOpen(true)}> + + + + ); +}; + export default function SettingPage() { const { t } = useTranslation(); return ( - }> + + + + + + } + > { return false; }; + +export function formatEnvInfos(envs: EnvInfos) { + let result = "----------- System -----------\n"; + result += `OS: ${envs.os}\n`; + result += `Arch: ${envs.arch}\n`; + result += `----------- Device -----------\n`; + for (const cpu of envs.device.cpu) { + result += `CPU: ${cpu}\n`; + } + result += `Memory: ${envs.device.memory}\n`; + result += `----------- Core -----------\n`; + for (const key in envs.core) { + result += `${key}: \`${envs.core[key]}\`\n`; + } + result += `----------- Build Info -----------\n`; + for (const k of Object.keys(envs.build_info) as string[]) { + const key = k + .split("_") + .map((v) => v.charAt(0).toUpperCase() + v.slice(1)) + .join(" "); + result += `${key}: ${envs.build_info[k]}\n`; + } + return result; +} diff --git a/clash-nyanpasu/frontend/ui/chart/sparkline.tsx b/clash-nyanpasu/frontend/ui/chart/sparkline.tsx index 056d04e667..80ea2c5961 100644 --- a/clash-nyanpasu/frontend/ui/chart/sparkline.tsx +++ b/clash-nyanpasu/frontend/ui/chart/sparkline.tsx @@ -1,7 +1,7 @@ -import { CSSProperties, FC, useEffect, useRef } from "react"; -import * as d3 from "d3"; import { alpha, useTheme } from "@mui/material"; - +import * as d3 from "d3"; +import { interpolatePath } from "d3-interpolate-path"; +import { CSSProperties, FC, useEffect, useRef } from "react"; interface SparklineProps { data: number[]; className?: string; @@ -82,9 +82,26 @@ export const Sparkline: FC = ({ data, className, style }) => { xScale.domain([0, data.length - 1]); yScale.domain([0, d3.max(data) ?? 0]); - svg.select(".area").datum(data).attr("d", area); + const t = svg.transition().duration(750).ease(d3.easeCubic); + svg + .select(".area") + .datum(data) + .transition(t as any) + .attrTween("d", function (d) { + const previous = d3.select(this).attr("d"); + const current = area(d); + return interpolatePath(previous, current as string); + }); - svg.select(".line").datum(data).attr("d", line); + svg + .select(".line") + .datum(data) + .transition(t as any) + .attrTween("d", function (d) { + const previous = d3.select(this).attr("d"); + const current = line(d); + return interpolatePath(previous, current as string); + }); }; updateChart(); diff --git a/clash-nyanpasu/frontend/ui/materialYou/components/baseDialog/index.tsx b/clash-nyanpasu/frontend/ui/materialYou/components/baseDialog/index.tsx index 178e0ee40d..29aa09b3af 100644 --- a/clash-nyanpasu/frontend/ui/materialYou/components/baseDialog/index.tsx +++ b/clash-nyanpasu/frontend/ui/materialYou/components/baseDialog/index.tsx @@ -1,6 +1,12 @@ -import { Button, Divider } from "@mui/material"; +import { useClickPosition } from "@/hooks"; +import { cn } from "@/utils"; import LoadingButton from "@mui/lab/LoadingButton"; +import { Button, Divider } from "@mui/material"; import { useTheme } from "@mui/material/styles"; +import * as Dialog from "@radix-ui/react-dialog"; +import { useLockFn } from "ahooks"; +import useDebounceFn from "ahooks/lib/useDebounceFn"; +import { AnimatePresence, motion } from "framer-motion"; import { CSSProperties, ReactNode, @@ -8,14 +14,7 @@ import { useLayoutEffect, useState, } from "react"; -import { AnimatePresence, motion } from "framer-motion"; -import React from "react"; -import useDebounceFn from "ahooks/lib/useDebounceFn"; -import { useLockFn } from "ahooks"; import { useTranslation } from "react-i18next"; -import * as Dialog from "@radix-ui/react-dialog"; -import { cn } from "@/utils"; -import { useClickPosition } from "@/hooks"; export interface BaseDialogProps { title: ReactNode; @@ -208,3 +207,5 @@ export const BaseDialog = ({ ); }; + +export const BaseDialogTrigger = Dialog.Trigger; diff --git a/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss new file mode 100644 index 0000000000..2f5011fc6a --- /dev/null +++ b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss @@ -0,0 +1,18 @@ +.kbd { + padding-right: 0.4em; + padding-left: 0.4em; + font-family: SFMono-Regular, Menlo, Monaco, Consolas, monospace; + font-weight: bold; + white-space: nowrap; + background-color: #edf2f7; + border-color: #e2e8f0; + border-style: solid; + border-width: 1px; + border-bottom-width: 3px; + border-radius: 0.375rem; + + &.dark { + background-color: rgb(255 255 255 / 6%); + border-color: rgb(255 255 255 / 16%); + } +} diff --git a/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss.d.ts b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss.d.ts new file mode 100644 index 0000000000..bcd7b72bfa --- /dev/null +++ b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.module.scss.d.ts @@ -0,0 +1,5 @@ +declare const classNames: { + readonly kbd: "kbd"; + readonly dark: "dark"; +}; +export default classNames; diff --git a/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.tsx b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.tsx new file mode 100644 index 0000000000..f23e277cac --- /dev/null +++ b/clash-nyanpasu/frontend/ui/materialYou/components/kbd/index.tsx @@ -0,0 +1,25 @@ +import clsx from "clsx"; + +export type Props = React.DetailedHTMLProps< + React.HTMLAttributes, + HTMLElement +>; + +import { useTheme } from "@mui/material"; +import styles from "./index.module.scss"; + +export default function Kbd({ className, children, ...rest }: Props) { + const theme = useTheme(); + return ( + + {children} + + ); +} diff --git a/clash-nyanpasu/frontend/ui/package.json b/clash-nyanpasu/frontend/ui/package.json index 8b10e56626..fd930adf75 100644 --- a/clash-nyanpasu/frontend/ui/package.json +++ b/clash-nyanpasu/frontend/ui/package.json @@ -20,7 +20,9 @@ "react-i18next": "15.0.0" }, "devDependencies": { + "@types/d3-interpolate-path": "2.0.3", "clsx": "2.1.1", + "d3-interpolate-path": "2.3.0", "sass": "1.77.8", "tailwind-merge": "2.4.0", "typescript-plugin-css-modules": "5.1.0" diff --git a/clash-nyanpasu/manifest/version.json b/clash-nyanpasu/manifest/version.json index 01aa61c9f8..15a13a1597 100644 --- a/clash-nyanpasu/manifest/version.json +++ b/clash-nyanpasu/manifest/version.json @@ -2,7 +2,7 @@ "manifest_version": 1, "latest": { "mihomo": "v1.18.6", - "mihomo_alpha": "alpha-28794c6", + "mihomo_alpha": "alpha-fd5b537", "clash_rs": "v0.1.20", "clash_premium": "2023-09-05-gdcc8d87" }, @@ -36,5 +36,5 @@ "darwin-x64": "clash-darwin-amd64-n{}.gz" } }, - "updated_at": "2024-07-19T22:20:42.715Z" + "updated_at": "2024-07-21T22:19:53.628Z" } diff --git a/clash-nyanpasu/package.json b/clash-nyanpasu/package.json index 3d9e3290a2..d70cb8efe7 100644 --- a/clash-nyanpasu/package.json +++ b/clash-nyanpasu/package.json @@ -109,7 +109,7 @@ "tsx": "4.16.2", "typescript": "5.5.3" }, - "packageManager": "pnpm@9.5.0", + "packageManager": "pnpm@9.6.0", "engines": { "node": "22.5.1" }, diff --git a/clash-nyanpasu/pnpm-lock.yaml b/clash-nyanpasu/pnpm-lock.yaml index d5dace43d1..36db1f95ba 100644 --- a/clash-nyanpasu/pnpm-lock.yaml +++ b/clash-nyanpasu/pnpm-lock.yaml @@ -301,8 +301,8 @@ importers: specifier: 1.77.8 version: 1.77.8 shiki: - specifier: 1.10.3 - version: 1.10.3 + specifier: 1.11.0 + version: 1.11.0 tailwindcss-textshadow: specifier: 2.1.3 version: 2.1.3 @@ -367,9 +367,15 @@ importers: specifier: 15.0.0 version: 15.0.0(i18next@23.12.2)(react-dom@19.0.0-rc-df783f9ea1-20240708(react@19.0.0-rc-df783f9ea1-20240708))(react@19.0.0-rc-df783f9ea1-20240708) devDependencies: + '@types/d3-interpolate-path': + specifier: 2.0.3 + version: 2.0.3 clsx: specifier: 2.1.1 version: 2.1.1 + d3-interpolate-path: + specifier: 2.3.0 + version: 2.3.0 sass: specifier: 1.77.8 version: 1.77.8 @@ -1751,8 +1757,8 @@ packages: cpu: [x64] os: [win32] - '@shikijs/core@1.10.3': - resolution: {integrity: sha512-D45PMaBaeDHxww+EkcDQtDAtzv00Gcsp72ukBtaLSmqRvh0WgGMq3Al0rl1QQBZfuneO75NXMIzEZGFitThWbg==} + '@shikijs/core@1.11.0': + resolution: {integrity: sha512-VbEhDAhT/2ozO0TPr5/ZQBO/NWLqtk4ZiBf6NplYpF38mKjNfMMied5fNEfIfYfN+cdKvhDB4VMcKvG/g9c3zg==} '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} @@ -2076,6 +2082,9 @@ packages: '@types/d3-hierarchy@3.1.7': resolution: {integrity: sha512-tJFtNoYBtRtkNysX1Xq4sxtjK8YgoWUNpIiUee0/jHGRwqvzYxkq0hGVbbOGSz+JgFxxRu4K8nb3YpG3CMARtg==} + '@types/d3-interpolate-path@2.0.3': + resolution: {integrity: sha512-EmFAmzvZN9vmYfUEOLOQj/PWXkUKrMp0iGElacDIcYj3N2zFJ2Mk5DiL8J4fKYnnyQdcYOixABJx7TaIc4GcdA==} + '@types/d3-interpolate@3.0.4': resolution: {integrity: sha512-mgLPETlrpVV1YRJIglr4Ez47g7Yxjl1lj7YKsiMCb27VJH9W8NVM6Bb9d8kkpG/uAQS5AmbA48q2IAolKKo1MA==} @@ -2854,6 +2863,9 @@ packages: resolution: {integrity: sha512-FX/9frcub54beBdugHjDCdikxThEqjnR93Qt7PvQTOHxyiNCAlvMrHhclk3cD5VeAaq9fxmfRp+CnWw9rEMBuA==} engines: {node: '>=12'} + d3-interpolate-path@2.3.0: + resolution: {integrity: sha512-tZYtGXxBmbgHsIc9Wms6LS5u4w6KbP8C09a4/ZYc4KLMYYqub57rRBUgpUr2CIarIrJEpdAWWxWQvofgaMpbKQ==} + d3-interpolate@3.0.1: resolution: {integrity: sha512-3bYs1rOD33uo8aqJfKP3JWPAibgw8Zm2+L9vBKEHJ2Rg+viTR7o5Mmv5mZcieN+FRYaAOWX5SJATX6k1PWz72g==} engines: {node: '>=12'} @@ -5318,8 +5330,8 @@ packages: shell-quote@1.8.1: resolution: {integrity: sha512-6j1W9l1iAs/4xYBI1SYOVZyFcCis9b4KCLQ8fgAGG07QvzaRLVVRQvAy85yNmmZSjYjg4MWh4gNvlPujU/5LpA==} - shiki@1.10.3: - resolution: {integrity: sha512-eneCLncGuvPdTutJuLyUGS8QNPAVFO5Trvld2wgEq1e002mwctAhJKeMGWtWVXOIEzmlcLRqcgPSorR6AVzOmQ==} + shiki@1.11.0: + resolution: {integrity: sha512-NqH/O1zRHvnuk/WfSL6b7+DtI7/kkMMSQGlZhm9DyzSU+SoIHhaw/fBZMr+zp9R8KjdIzkk3JKSC6hORuGDyng==} side-channel@1.0.6: resolution: {integrity: sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==} @@ -7316,7 +7328,7 @@ snapshots: '@rollup/rollup-win32-x64-msvc@4.17.2': optional: true - '@shikijs/core@1.10.3': + '@shikijs/core@1.11.0': dependencies: '@types/hast': 3.0.4 @@ -7602,6 +7614,8 @@ snapshots: '@types/d3-hierarchy@3.1.7': {} + '@types/d3-interpolate-path@2.0.3': {} + '@types/d3-interpolate@3.0.4': dependencies: '@types/d3-color': 3.1.3 @@ -8480,6 +8494,8 @@ snapshots: d3-hierarchy@3.1.2: {} + d3-interpolate-path@2.3.0: {} + d3-interpolate@3.0.1: dependencies: d3-color: 3.1.0 @@ -11239,9 +11255,9 @@ snapshots: shell-quote@1.8.1: {} - shiki@1.10.3: + shiki@1.11.0: dependencies: - '@shikijs/core': 1.10.3 + '@shikijs/core': 1.11.0 '@types/hast': 3.0.4 side-channel@1.0.6: diff --git a/lede/config/Config-build.in b/lede/config/Config-build.in index 49f40bb000..5425ab0568 100644 --- a/lede/config/Config-build.in +++ b/lede/config/Config-build.in @@ -152,7 +152,7 @@ menu "Global build settings" default n help Adds -g3 to the CFLAGS. - + config USE_GC_SECTIONS bool prompt "Dead code and data elimination for all packages (EXPERIMENTAL)" @@ -191,7 +191,6 @@ menu "Global build settings" help This will install binaries stripped using strip from binutils. - config USE_SSTRIP bool "sstrip" depends on !USE_GLIBC @@ -218,6 +217,7 @@ menu "Global build settings" config STRIP_KERNEL_EXPORTS bool "Strip unnecessary exports from the kernel image" + depends on !LINUX_6_6 help Reduces kernel size by stripping unused kernel exports from the kernel image. Note that this might make the kernel incompatible with any kernel @@ -283,6 +283,8 @@ menu "Global build settings" bool "Regular" config PKG_CC_STACKPROTECTOR_STRONG bool "Strong" + config PKG_CC_STACKPROTECTOR_ALL + bool "All" endchoice choice diff --git a/lede/config/Config-images.in b/lede/config/Config-images.in index f0627874ea..39e7f84ba2 100644 --- a/lede/config/Config-images.in +++ b/lede/config/Config-images.in @@ -157,7 +157,7 @@ menu "Target Images" depends on TARGET_ROOTFS_SQUASHFS default 64 if LOW_MEMORY_FOOTPRINT default 1024 if (SMALL_FLASH && !LOW_MEMORY_FOOTPRINT) - default 1024 + default 256 help Select squashfs block size, must be one of: 4, 8, 16, 32, 64, 128, 256, 512, 1024 @@ -202,17 +202,19 @@ menu "Target Images" depends on TARGET_x86 depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 + select PACKAGE_grub2-bios-setup default n config GRUB_EFI_IMAGES bool "Build GRUB EFI images" - depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 || TARGET_phytium_armv8 + depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 || TARGET_phytium depends on TARGET_ROOTFS_EXT4FS || TARGET_ROOTFS_JFFS2 || TARGET_ROOTFS_SQUASHFS select PACKAGE_grub2 if TARGET_x86 select PACKAGE_grub2-efi if TARGET_x86 select PACKAGE_grub2-bios-setup if TARGET_x86 select PACKAGE_grub2-efi-arm if TARGET_armvirt select PACKAGE_grub2-efi-arm if TARGET_phytium_armv8 + select PACKAGE_grub2-efi-loongarch64 if TARGET_loongarch64 select PACKAGE_kmod-fs-vfat default y @@ -221,11 +223,6 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES default y - config GRUB_SERIAL - string "Serial port device" - depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default "ttyS0" - config GRUB_BAUDRATE int "Serial port baud rate" depends on GRUB_IMAGES || GRUB_EFI_IMAGES @@ -234,7 +231,8 @@ menu "Target Images" config GRUB_FLOWCONTROL bool "Use RTE/CTS on serial console" - depends on GRUB_SERIAL != "" + depends on GRUB_IMAGES || GRUB_EFI_IMAGES + depends on TARGET_SERIAL != "" default n config GRUB_BOOTOPTS @@ -277,9 +275,8 @@ menu "Target Images" config VMDK_IMAGES bool "Build VMware image files (VMDK)" - depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 + depends on TARGET_x86 || TARGET_armvirt depends on GRUB_IMAGES || GRUB_EFI_IMAGES - default y select PACKAGE_kmod-e1000 config VHDX_IMAGES @@ -288,29 +285,35 @@ menu "Target Images" depends on GRUB_IMAGES || GRUB_EFI_IMAGES select PACKAGE_kmod-e1000 + config TARGET_SERIAL + string "Serial port device" + depends on TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 + default "ttyS0" + config TARGET_IMAGES_GZIP bool "GZip images" - depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_loongarch64 || TARGET_malta + depends on TARGET_ROOTFS_EXT4FS || TARGET_x86 || TARGET_armvirt || TARGET_malta || TARGET_loongarch64 default y comment "Image Options" source "target/linux/*/image/Config.in" + source "target/linux/*/*/image/Config.in" config TARGET_KERNEL_PARTSIZE int "Kernel partition size (in MiB)" depends on USES_BOOT_PART default 8 if TARGET_apm821xx_sata default 64 if TARGET_bcm27xx - default 32 if TARGET_rockchip default 128 if TARGET_armvirt + default 32 if TARGET_rockchip default 16 config TARGET_ROOTFS_PARTSIZE int "Root filesystem partition size (in MiB)" depends on USES_ROOTFS_PART || TARGET_ROOTFS_EXT4FS default 232 if TARGET_loongarch64 - default 400 if TARGET_x86 + default 448 if TARGET_mediatek || TARGET_x86 default 160 help Select the root filesystem partition size. diff --git a/lede/config/Config-kernel.in b/lede/config/Config-kernel.in index f7a8d51817..69e3fc9252 100644 --- a/lede/config/Config-kernel.in +++ b/lede/config/Config-kernel.in @@ -47,12 +47,12 @@ config KERNEL_MIPS_FP_SUPPORT config KERNEL_ARM_PMU bool - default n + default y if TARGET_armvirt depends on (arm || aarch64) config KERNEL_ARM_PMUV3 bool - default y if TARGET_armsr_armv8 + default y if TARGET_armvirt depends on (arm_v7 || aarch64) && LINUX_6_6 config KERNEL_RISCV_PMU @@ -163,7 +163,7 @@ config KERNEL_UBSAN_TRAP config KERNEL_KASAN bool "Compile the kernel with KASan: runtime memory debugger" select KERNEL_SLUB_DEBUG - depends on (x86_64 || aarch64) + depends on (x86_64 || aarch64 || arm || powerpc || riscv64) help Enables kernel address sanitizer - runtime memory debugger, designed to find out-of-bounds accesses and use-after-free bugs. @@ -176,16 +176,6 @@ config KERNEL_KASAN Currently CONFIG_KASAN doesn't work with CONFIG_DEBUG_SLAB (the resulting kernel does not boot). -config KERNEL_KASAN_EXTRA - bool "KAsan: extra checks" - depends on KERNEL_KASAN && KERNEL_DEBUG_KERNEL - help - This enables further checks in the kernel address sanitizer, for now - it only includes the address-use-after-scope check that can lead - to excessive kernel stack usage, frame size warnings and longer - compile time. - https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81715 has more - config KERNEL_KASAN_VMALLOC bool "Back mappings in vmalloc space with real shadow memory" depends on KERNEL_KASAN @@ -204,16 +194,73 @@ config KERNEL_KASAN_VMALLOC will have no effect. if KERNEL_KASAN - config KERNEL_KASAN_GENERIC - def_bool y +choice + prompt "KASAN mode" + depends on KERNEL_KASAN + default KERNEL_KASAN_GENERIC + help + KASAN has three modes: + + 1. Generic KASAN (supported by many architectures, enabled with + CONFIG_KASAN_GENERIC, similar to userspace ASan), + 2. Software Tag-Based KASAN (arm64 only, based on software memory + tagging, enabled with CONFIG_KASAN_SW_TAGS, similar to userspace + HWASan), and + 3. Hardware Tag-Based KASAN (arm64 only, based on hardware memory + tagging, enabled with CONFIG_KASAN_HW_TAGS). + +config KERNEL_KASAN_GENERIC + bool "Generic KASAN" + select KERNEL_SLUB_DEBUG + help + Enables Generic KASAN. + + Consumes about 1/8th of available memory at kernel start and adds an + overhead of ~50% for dynamic allocations. + The performance slowdown is ~x3. + +config KERNEL_KASAN_SW_TAGS + bool "Software Tag-Based KASAN" + depends on aarch64 + select KERNEL_SLUB_DEBUG + help + Enables Software Tag-Based KASAN. + + Supported only on arm64 CPUs and relies on Top Byte Ignore. + + Consumes about 1/16th of available memory at kernel start and + add an overhead of ~20% for dynamic allocations. + + May potentially introduce problems related to pointer casting and + comparison, as it embeds a tag into the top byte of each pointer. + +config KERNEL_KASAN_HW_TAGS + bool "Hardware Tag-Based KASAN" + depends on aarch64 + select KERNEL_SLUB_DEBUG + select KERNEL_ARM64_MTE + help + Enables Hardware Tag-Based KASAN. + + Supported only on arm64 CPUs starting from ARMv8.5 and relies on + Memory Tagging Extension and Top Byte Ignore. + + Consumes about 1/32nd of available memory. + + May potentially introduce problems related to pointer casting and + comparison, as it embeds a tag into the top byte of each pointer. + +endchoice + + config KERNEL_ARM64_MTE + def_bool n - config KERNEL_KASAN_SW_TAGS - def_bool n endif choice prompt "Instrumentation type" depends on KERNEL_KASAN + depends on !KERNEL_KASAN_HW_TAGS default KERNEL_KASAN_OUTLINE config KERNEL_KASAN_OUTLINE @@ -390,7 +437,6 @@ config KERNEL_DEBUG_INFO This will compile your kernel and modules with debug information. config KERNEL_DEBUG_INFO_BTF - bool "Enable additional BTF type information" default n depends on !HOST_OS_MACOS @@ -403,6 +449,20 @@ config KERNEL_DEBUG_INFO_BTF Required to run BPF CO-RE applications. +config KERNEL_DEBUG_INFO_BTF_MODULES + def_bool y + depends on KERNEL_DEBUG_INFO_BTF + +config KERNEL_MODULE_ALLOW_BTF_MISMATCH + bool "Allow loading modules with non-matching BTF type info" + depends on KERNEL_DEBUG_INFO_BTF_MODULES + help + For modules whose split BTF does not match vmlinux, load without + BTF rather than refusing to load. The default behavior with + module BTF enabled is to reject modules with such mismatches; + this option will still load module BTF where possible but ignore + it when a mismatch is found. + config KERNEL_DEBUG_INFO_REDUCED bool "Reduce debugging information" default y @@ -428,6 +488,10 @@ config KERNEL_FRAME_WARN Setting this too low will cause a lot of warnings. Setting it to 0 disables the warning. +# KERNEL_DEBUG_LL symbols must have the default value set as otherwise +# KConfig wont evaluate them unless KERNEL_EARLY_PRINTK is selected +# which means that buildroot wont override the DEBUG_LL symbols in target +# kernel configurations and lead to devices that dont have working console config KERNEL_DEBUG_LL_UART_NONE bool default n @@ -502,8 +566,8 @@ config KERNEL_BPF_EVENTS config KERNEL_BPF_KPROBE_OVERRIDE bool - default n depends on KERNEL_KPROBES + default n config KERNEL_AIO bool "Compile the kernel with asynchronous IO support" @@ -511,7 +575,8 @@ config KERNEL_AIO config KERNEL_IO_URING bool "Compile the kernel with io_uring support" - default y if !SMALL_FLASH + depends on !SMALL_FLASH + default y if (x86_64 || aarch64) config KERNEL_FHANDLE bool "Compile the kernel with support for fhandle syscalls" @@ -586,6 +651,18 @@ config KERNEL_SOFTLOCKUP_DETECTOR chance to run. The current stack trace is displayed upon detection and the system will stay locked up. +config KERNEL_HARDLOCKUP_DETECTOR + bool "Compile the kernel with detect Hard Lockups" + depends on KERNEL_DEBUG_KERNEL + help + Say Y here to enable the kernel to act as a watchdog to detect + hard lockups. + + Hardlockups are bugs that cause the CPU to loop in kernel mode + for more than 10 seconds, without letting other interrupts have a + chance to run. The current stack trace is displayed upon detection + and the system will stay locked up. + config KERNEL_DETECT_HUNG_TASK bool "Compile the kernel with detect Hung Tasks" depends on KERNEL_DEBUG_KERNEL @@ -635,10 +712,23 @@ config KERNEL_PRINTK_TIME default y config KERNEL_SLUB_DEBUG - bool + bool "Enable SLUB debugging support" + help + This enables various debugging features: + - Accepts "slub_debug" kernel parameter + - Provides caches debugging options (e.g. tracing, validating) + - Adds /sys/kernel/slab/ attrs for reading amounts of *objects* + - Enables /proc/slabinfo support + - Prints info when running out of memory + + Enabling this can result in a significant increase of code size. config KERNEL_SLUB_DEBUG_ON - bool + depends on KERNEL_SLUB_DEBUG + bool "Boot kernel with basic caches debugging enabled" + help + This enables by default sanity_checks, red_zone, poison and store_user + debugging options for all caches. config KERNEL_SLABINFO select KERNEL_SLUB_DEBUG @@ -1083,13 +1173,6 @@ if KERNEL_IP_MROUTE endif -config KERNEL_MPTCP - bool "Enable IPv4 MultiPath TCP support" - default y - depends on !(LINUX_4_4||LINUX_5_4) - help - IPv4 MultiPath TCP to kernel support. - # # IPv6 configuration # @@ -1131,14 +1214,6 @@ if KERNEL_IPV6 config KERNEL_LWTUNNEL_BPF def_bool n - config KERNEL_MPTCP_IPV6 - bool "Enable IPv6 MultiPath TCP support" - default y - depends on KERNEL_MPTCP - depends on !(LINUX_4_4||LINUX_5_4) - help - IPv6 MultiPath TCP to kernel support. - endif # @@ -1153,7 +1228,6 @@ config KERNEL_NET_L3_MASTER_DEV config KERNEL_XDP_SOCKETS bool "XDP sockets support" - default y if KERNEL_DEBUG_INFO_BTF help XDP sockets allows a channel between XDP programs and userspace applications. diff --git a/lede/package/kernel/mt76/Makefile b/lede/package/kernel/mt76/Makefile index a28afcb924..6db6619639 100644 --- a/lede/package/kernel/mt76/Makefile +++ b/lede/package/kernel/mt76/Makefile @@ -14,7 +14,12 @@ PKG_SOURCE_DATE:=2022-12-22 PKG_SOURCE_VERSION:=5b509e80384ab019ac11aa90c81ec0dbb5b0d7f2 PKG_MIRROR_HASH:=6fc25df4d28becd010ff4971b23731c08b53e69381a9e4c868091899712f78a9 PATCH_DIR:=./patches-5.4 -else ifndef ($(filter on,$(CONFIG_LINUX_6_1) $(CONFIG_LINUX_6_6)),) +else ifdef CONFIG_LINUX_6_1 +PKG_SOURCE_DATE:=2024-04-04 +PKG_SOURCE_VERSION:=8f301a5c5fe3d998b50666bde1d35d412833be89 +PKG_MIRROR_HASH:=49291145ccceeac2964c9a43a46bed88298e5c1da63c6f3c2c1f6b3c1902a61e +PATCH_DIR:=./patches-6.x +else ifdef CONFIG_LINUX_6_6 PKG_SOURCE_DATE:=2024-04-04 PKG_SOURCE_VERSION:=8f301a5c5fe3d998b50666bde1d35d412833be89 PKG_MIRROR_HASH:=49291145ccceeac2964c9a43a46bed88298e5c1da63c6f3c2c1f6b3c1902a61e diff --git a/lede/package/kernel/mt76/patches-6.x/002-mt7603-fix-mixed-code.patch b/lede/package/kernel/mt76/patches-6.x/002-mt7603-fix-mixed-code.patch new file mode 100644 index 0000000000..92befe4afa --- /dev/null +++ b/lede/package/kernel/mt76/patches-6.x/002-mt7603-fix-mixed-code.patch @@ -0,0 +1,33 @@ +From 513c131c6309712a51502870b041f45b4bd6a6d4 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 17 May 2024 13:51:22 +0200 +Subject: [PATCH] mt76: mt7603: fix mixed declarations and code + +Move the qid variable declaration further up + +Fixes: b473c0e47f04 ("wifi: mt76: mt7603: fix tx queue of loopback packets") +Signed-off-by: Felix Fietkau +--- + mt7603/dma.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/mt7603/dma.c ++++ b/mt7603/dma.c +@@ -29,7 +29,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev + struct ieee80211_sta *sta; + struct mt7603_sta *msta; + struct mt76_wcid *wcid; +- u8 tid = 0, hwq = 0; ++ u8 qid, tid = 0, hwq = 0; + void *priv; + int idx; + u32 val; +@@ -57,7 +57,7 @@ mt7603_rx_loopback_skb(struct mt7603_dev + if (ieee80211_is_data_qos(hdr->frame_control)) { + tid = *ieee80211_get_qos_ctl(hdr) & + IEEE80211_QOS_CTL_TAG1D_MASK; +- u8 qid = tid_to_ac[tid]; ++ qid = tid_to_ac[tid]; + hwq = wmm_queue_map[qid]; + skb_set_queue_mapping(skb, qid); + } else if (ieee80211_is_data(hdr->frame_control)) { diff --git a/lede/package/kernel/mt76/patches-6.x/002-wifi-mt76-mt7915-fix-oops.patch b/lede/package/kernel/mt76/patches-6.x/003-wifi-mt76-mt7915-fix-oops.patch similarity index 100% rename from lede/package/kernel/mt76/patches-6.x/002-wifi-mt76-mt7915-fix-oops.patch rename to lede/package/kernel/mt76/patches-6.x/003-wifi-mt76-mt7915-fix-oops.patch diff --git a/mihomo/adapter/outboundgroup/loadbalance.go b/mihomo/adapter/outboundgroup/loadbalance.go index 4cb0db004f..738ed15479 100644 --- a/mihomo/adapter/outboundgroup/loadbalance.go +++ b/mihomo/adapter/outboundgroup/loadbalance.go @@ -205,7 +205,6 @@ func strategyStickySessions(url string) strategyFn { proxy := proxies[nowIdx] if proxy.AliveForTestUrl(url) { if nowIdx != idx { - lruCache.Delete(key) lruCache.Set(key, nowIdx) } @@ -215,7 +214,6 @@ func strategyStickySessions(url string) strategyFn { } } - lruCache.Delete(key) lruCache.Set(key, 0) return proxies[0] } diff --git a/mihomo/common/lru/lrucache.go b/mihomo/common/lru/lrucache.go index 6f32ed18b1..35f605b10c 100644 --- a/mihomo/common/lru/lrucache.go +++ b/mihomo/common/lru/lrucache.go @@ -223,6 +223,10 @@ func (c *LruCache[K, V]) Delete(key K) { c.mu.Lock() defer c.mu.Unlock() + c.delete(key) +} + +func (c *LruCache[K, V]) delete(key K) { if le, ok := c.cache[key]; ok { c.deleteElement(le) } @@ -255,6 +259,34 @@ func (c *LruCache[K, V]) Clear() error { return nil } +// Compute either sets the computed new value for the key or deletes +// the value for the key. When the delete result of the valueFn function +// is set to true, the value will be deleted, if it exists. When delete +// is set to false, the value is updated to the newValue. +// The ok result indicates whether value was computed and stored, thus, is +// present in the map. The actual result contains the new value in cases where +// the value was computed and stored. +func (c *LruCache[K, V]) Compute( + key K, + valueFn func(oldValue V, loaded bool) (newValue V, delete bool), +) (actual V, ok bool) { + c.mu.Lock() + defer c.mu.Unlock() + + if el := c.get(key); el != nil { + actual, ok = el.value, true + } + if newValue, del := valueFn(actual, ok); del { + if ok { // data not in cache, so needn't delete + c.delete(key) + } + return lo.Empty[V](), false + } else { + c.set(key, newValue) + return newValue, true + } +} + type entry[K comparable, V any] struct { key K value V diff --git a/mihomo/common/queue/queue.go b/mihomo/common/queue/queue.go index cb58e2f5a2..d1b6beebe5 100644 --- a/mihomo/common/queue/queue.go +++ b/mihomo/common/queue/queue.go @@ -59,8 +59,8 @@ func (q *Queue[T]) Copy() []T { // Len returns the number of items in this queue. func (q *Queue[T]) Len() int64 { - q.lock.Lock() - defer q.lock.Unlock() + q.lock.RLock() + defer q.lock.RUnlock() return int64(len(q.items)) } diff --git a/mihomo/common/utils/callback.go b/mihomo/common/utils/callback.go index df950d3a81..ad734c0fd6 100644 --- a/mihomo/common/utils/callback.go +++ b/mihomo/common/utils/callback.go @@ -17,8 +17,8 @@ func NewCallback[T any]() *Callback[T] { } func (c *Callback[T]) Register(item func(T)) io.Closer { - c.mutex.RLock() - defer c.mutex.RUnlock() + c.mutex.Lock() + defer c.mutex.Unlock() element := c.list.PushBack(item) return &callbackCloser[T]{ element: element, diff --git a/mihomo/component/sniffer/dispatcher.go b/mihomo/component/sniffer/dispatcher.go index 97bf162969..4438638dad 100644 --- a/mihomo/component/sniffer/dispatcher.go +++ b/mihomo/component/sniffer/dispatcher.go @@ -5,7 +5,6 @@ import ( "fmt" "net" "net/netip" - "sync" "time" "github.com/metacubex/mihomo/common/lru" @@ -30,7 +29,6 @@ type SnifferDispatcher struct { forceDomain *trie.DomainSet skipSNI *trie.DomainSet skipList *lru.LruCache[string, uint8] - rwMux sync.RWMutex forceDnsMapping bool parsePureIp bool } @@ -85,14 +83,11 @@ func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata return false } - sd.rwMux.RLock() dst := fmt.Sprintf("%s:%d", metadata.DstIP, metadata.DstPort) if count, ok := sd.skipList.Get(dst); ok && count > 5 { log.Debugln("[Sniffer] Skip sniffing[%s] due to multiple failures", dst) - defer sd.rwMux.RUnlock() return false } - sd.rwMux.RUnlock() if host, err := sd.sniffDomain(conn, metadata); err != nil { sd.cacheSniffFailed(metadata) @@ -104,9 +99,7 @@ func (sd *SnifferDispatcher) TCPSniff(conn *N.BufferedConn, metadata *C.Metadata return false } - sd.rwMux.RLock() sd.skipList.Delete(dst) - sd.rwMux.RUnlock() sd.replaceDomain(metadata, host, overrideDest) return true @@ -176,14 +169,13 @@ func (sd *SnifferDispatcher) sniffDomain(conn *N.BufferedConn, metadata *C.Metad } func (sd *SnifferDispatcher) cacheSniffFailed(metadata *C.Metadata) { - sd.rwMux.Lock() dst := fmt.Sprintf("%s:%d", metadata.DstIP, metadata.DstPort) - count, _ := sd.skipList.Get(dst) - if count <= 5 { - count++ - } - sd.skipList.Set(dst, count) - sd.rwMux.Unlock() + sd.skipList.Compute(dst, func(oldValue uint8, loaded bool) (newValue uint8, delete bool) { + if oldValue <= 5 { + oldValue++ + } + return oldValue, false + }) } func NewCloseSnifferDispatcher() (*SnifferDispatcher, error) { diff --git a/mihomo/config/config.go b/mihomo/config/config.go index ae82ac3f7e..f58709c9c0 100644 --- a/mihomo/config/config.go +++ b/mihomo/config/config.go @@ -96,6 +96,7 @@ type Controller struct { ExternalControllerTLS string `json:"-"` ExternalControllerUnix string `json:"-"` ExternalUI string `json:"-"` + ExternalDohServer string `json:"-"` Secret string `json:"-"` } @@ -322,6 +323,7 @@ type RawConfig struct { ExternalUI string `yaml:"external-ui"` ExternalUIURL string `yaml:"external-ui-url" json:"external-ui-url"` ExternalUIName string `yaml:"external-ui-name" json:"external-ui-name"` + ExternalDohServer string `yaml:"external-doh-server"` Secret string `yaml:"secret"` Interface string `yaml:"interface-name"` RoutingMark int `yaml:"routing-mark"` @@ -697,6 +699,7 @@ func parseGeneral(cfg *RawConfig) (*General, error) { Secret: cfg.Secret, ExternalControllerUnix: cfg.ExternalControllerUnix, ExternalControllerTLS: cfg.ExternalControllerTLS, + ExternalDohServer: cfg.ExternalDohServer, }, UnifiedDelay: cfg.UnifiedDelay, Mode: cfg.Mode, diff --git a/mihomo/docs/config.yaml b/mihomo/docs/config.yaml index 9c51bc10b3..4e4b9b16ef 100644 --- a/mihomo/docs/config.yaml +++ b/mihomo/docs/config.yaml @@ -70,6 +70,10 @@ external-ui: /path/to/ui/folder/ external-ui-name: xd external-ui-url: "https://github.com/MetaCubeX/metacubexd/archive/refs/heads/gh-pages.zip" +# 在RESTful API端口上开启DOH服务器 +# !!!该URL不会验证secret, 如果开启请自行保证安全问题 !!! +external-doh-server: /dns-query + # interface-name: en0 # 设置出口网卡 # 全局 TLS 指纹,优先低于 proxy 内的 client-fingerprint diff --git a/mihomo/hub/hub.go b/mihomo/hub/hub.go index 38779e13b6..57c91aaef9 100644 --- a/mihomo/hub/hub.go +++ b/mihomo/hub/hub.go @@ -50,11 +50,12 @@ func Parse(options ...Option) error { if cfg.General.ExternalController != "" { go route.Start(cfg.General.ExternalController, cfg.General.ExternalControllerTLS, - cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.LogLevel == log.DEBUG) + cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.ExternalDohServer, + cfg.General.LogLevel == log.DEBUG) } if cfg.General.ExternalControllerUnix != "" { - go route.StartUnix(cfg.General.ExternalControllerUnix, cfg.General.LogLevel == log.DEBUG) + go route.StartUnix(cfg.General.ExternalControllerUnix, cfg.General.ExternalDohServer, cfg.General.LogLevel == log.DEBUG) } executor.ApplyConfig(cfg, true) diff --git a/mihomo/hub/route/doh.go b/mihomo/hub/route/doh.go new file mode 100644 index 0000000000..5f993c021d --- /dev/null +++ b/mihomo/hub/route/doh.go @@ -0,0 +1,67 @@ +package route + +import ( + "context" + "encoding/base64" + "io" + "net/http" + + "github.com/metacubex/mihomo/component/resolver" + + "github.com/go-chi/render" +) + +func dohRouter() http.Handler { + return http.HandlerFunc(dohHandler) +} + +func dohHandler(w http.ResponseWriter, r *http.Request) { + if resolver.DefaultResolver == nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("DNS section is disabled")) + return + } + + if r.Header.Get("Accept") != "application/dns-message" { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("invalid accept header")) + return + } + + var dnsData []byte + var err error + switch r.Method { + case "GET": + dnsData, err = base64.RawURLEncoding.DecodeString(r.URL.Query().Get("dns")) + case "POST": + if r.Header.Get("Content-Type") != "application/dns-message" { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError("invalid content-type")) + return + } + dnsData, err = io.ReadAll(r.Body) + _ = r.Body.Close() + default: + render.Status(r, http.StatusMethodNotAllowed) + render.JSON(w, r, newError("method not allowed")) + return + } + if err != nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError(err.Error())) + return + } + + ctx, cancel := context.WithTimeout(context.Background(), resolver.DefaultDNSTimeout) + defer cancel() + + dnsData, err = resolver.RelayDnsPacket(ctx, dnsData, dnsData) + if err != nil { + render.Status(r, http.StatusInternalServerError) + render.JSON(w, r, newError(err.Error())) + return + } + + render.Status(r, http.StatusOK) + render.Data(w, r, dnsData) +} diff --git a/mihomo/hub/route/server.go b/mihomo/hub/route/server.go index c28782b9c3..165c7c6970 100644 --- a/mihomo/hub/route/server.go +++ b/mihomo/hub/route/server.go @@ -50,7 +50,7 @@ func SetUIPath(path string) { uiPath = C.Path.Resolve(path) } -func router(isDebug bool, withAuth bool) *chi.Mux { +func router(isDebug bool, withAuth bool, dohServer string) *chi.Mux { r := chi.NewRouter() corsM := cors.New(cors.Options{ AllowedOrigins: []string{"*"}, @@ -104,11 +104,15 @@ func router(isDebug bool, withAuth bool) *chi.Mux { }) }) } + if len(dohServer) > 0 && dohServer[0] == '/' { + r.Mount(dohServer, dohRouter()) + } + return r } func Start(addr string, tlsAddr string, secret string, - certificate, privateKey string, isDebug bool) { + certificate, privateKey string, dohServer string, isDebug bool) { if serverAddr != "" { return } @@ -133,7 +137,7 @@ func Start(addr string, tlsAddr string, secret string, serverAddr = l.Addr().String() log.Infoln("RESTful API tls listening at: %s", serverAddr) tlsServe := &http.Server{ - Handler: router(isDebug, true), + Handler: router(isDebug, true, dohServer), TLSConfig: &tls.Config{ Certificates: []tls.Certificate{c}, }, @@ -152,13 +156,13 @@ func Start(addr string, tlsAddr string, secret string, serverAddr = l.Addr().String() log.Infoln("RESTful API listening at: %s", serverAddr) - if err = http.Serve(l, router(isDebug, true)); err != nil { + if err = http.Serve(l, router(isDebug, true, dohServer)); err != nil { log.Errorln("External controller serve error: %s", err) } } -func StartUnix(addr string, isDebug bool) { +func StartUnix(addr string, dohServer string, isDebug bool) { addr = C.Path.Resolve(addr) dir := filepath.Dir(addr) @@ -186,7 +190,7 @@ func StartUnix(addr string, isDebug bool) { serverAddr = l.Addr().String() log.Infoln("RESTful API unix listening at: %s", serverAddr) - if err = http.Serve(l, router(isDebug, false)); err != nil { + if err = http.Serve(l, router(isDebug, false, dohServer)); err != nil { log.Errorln("External controller unix serve error: %s", err) } } diff --git a/naiveproxy/src/net/tools/naive/naive_proxy_delegate.cc b/naiveproxy/src/net/tools/naive/naive_proxy_delegate.cc index 3c246d06f2..c52ed7b4cc 100644 --- a/naiveproxy/src/net/tools/naive/naive_proxy_delegate.cc +++ b/naiveproxy/src/net/tools/naive/naive_proxy_delegate.cc @@ -160,6 +160,8 @@ std::optional NaiveProxyDelegate::GetProxyChainPaddingType( // protocols. if (proxy_chain.is_direct()) return PaddingType::kNone; + if (proxy_chain.Last().is_socks()) + return PaddingType::kNone; return padding_type_by_server_[proxy_chain.Last()]; } diff --git a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua index 04b70f30fe..a541021315 100644 --- a/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua +++ b/openwrt-passwall/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua @@ -203,8 +203,10 @@ if has_singbox then o.rmempty = false o = s:option(Value, "geoip_url", translate("Custom geoip URL")) - o.default = "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" - o:value("https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db") + o.default = "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db" + o:value("https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db") + o:value("https://github.com/1715173329/sing-geoip/releases/latest/download/geoip.db") + o:value("https://github.com/lyc8503/sing-box-rules/releases/latest/download/geoip.db") o.rmempty = false o = s:option(Value, "geosite_path", translate("Custom geosite Path")) @@ -212,8 +214,10 @@ if has_singbox then o.rmempty = false o = s:option(Value, "geosite_url", translate("Custom geosite URL")) - o.default = "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" - o:value("https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db") + o.default = "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db" + o:value("https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db") + o:value("https://github.com/1715173329/sing-geosite/releases/latest/download/geosite.db") + o:value("https://github.com/lyc8503/sing-box-rules/releases/latest/download/geosite.db") o.rmempty = false o = s:option(Button, "_remove_resource", translate("Remove resource files")) diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/AddressSpaceType.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/AddressSpaceType.cs deleted file mode 100644 index 8dfa4303f5..0000000000 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/AddressSpaceType.cs +++ /dev/null @@ -1,10 +0,0 @@ -namespace Ryujinx.HLE.HOS.Kernel.Memory -{ - enum AddressSpaceType - { - Addr32Bits = 0, - Addr36Bits = 1, - Addr32BitsNoMap = 2, - Addr39Bits = 3, - } -} diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs index 58bbc0dbfb..bf2bbb97b1 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Memory/KPageTableBase.cs @@ -58,11 +58,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory public ulong AslrRegionStart { get; private set; } public ulong AslrRegionEnd { get; private set; } -#pragma warning disable IDE0052 // Remove unread private member private ulong _heapCapacity; -#pragma warning restore IDE0052 public ulong PhysicalMemoryUsage { get; private set; } + public ulong AliasRegionExtraSize { get; private set; } private readonly KMemoryBlockManager _blockManager; @@ -98,30 +97,21 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory _reservedAddressSpaceSize = reservedAddressSpaceSize; } - private static readonly int[] _addrSpaceSizes = { 32, 36, 32, 39 }; - public Result InitializeForProcess( - AddressSpaceType addrSpaceType, - bool aslrEnabled, + ProcessCreationFlags flags, bool fromBack, MemoryRegion memRegion, ulong address, ulong size, KMemoryBlockSlabManager slabManager) { - if ((uint)addrSpaceType > (uint)AddressSpaceType.Addr39Bits) - { - throw new ArgumentException($"AddressSpaceType bigger than {(uint)AddressSpaceType.Addr39Bits}: {(uint)addrSpaceType}", nameof(addrSpaceType)); - } - _contextId = Context.ContextIdManager.GetId(); ulong addrSpaceBase = 0; - ulong addrSpaceSize = 1UL << _addrSpaceSizes[(int)addrSpaceType]; + ulong addrSpaceSize = 1UL << GetAddressSpaceWidth(flags); Result result = CreateUserAddressSpace( - addrSpaceType, - aslrEnabled, + flags, fromBack, addrSpaceBase, addrSpaceSize, @@ -138,6 +128,22 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory return result; } + private static int GetAddressSpaceWidth(ProcessCreationFlags flags) + { + switch (flags & ProcessCreationFlags.AddressSpaceMask) + { + case ProcessCreationFlags.AddressSpace32Bit: + case ProcessCreationFlags.AddressSpace32BitWithoutAlias: + return 32; + case ProcessCreationFlags.AddressSpace64BitDeprecated: + return 36; + case ProcessCreationFlags.AddressSpace64Bit: + return 39; + } + + throw new ArgumentException($"Invalid process flags {flags}", nameof(flags)); + } + private struct Region { public ulong Start; @@ -147,8 +153,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory } private Result CreateUserAddressSpace( - AddressSpaceType addrSpaceType, - bool aslrEnabled, + ProcessCreationFlags flags, bool fromBack, ulong addrSpaceStart, ulong addrSpaceEnd, @@ -168,9 +173,11 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory ulong stackAndTlsIoStart; ulong stackAndTlsIoEnd; - switch (addrSpaceType) + AliasRegionExtraSize = 0; + + switch (flags & ProcessCreationFlags.AddressSpaceMask) { - case AddressSpaceType.Addr32Bits: + case ProcessCreationFlags.AddressSpace32Bit: aliasRegion.Size = 0x40000000; heapRegion.Size = 0x40000000; stackRegion.Size = 0; @@ -183,7 +190,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory stackAndTlsIoEnd = 0x40000000; break; - case AddressSpaceType.Addr36Bits: + case ProcessCreationFlags.AddressSpace64BitDeprecated: aliasRegion.Size = 0x180000000; heapRegion.Size = 0x180000000; stackRegion.Size = 0; @@ -196,7 +203,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory stackAndTlsIoEnd = 0x80000000; break; - case AddressSpaceType.Addr32BitsNoMap: + case ProcessCreationFlags.AddressSpace32BitWithoutAlias: aliasRegion.Size = 0; heapRegion.Size = 0x80000000; stackRegion.Size = 0; @@ -209,7 +216,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory stackAndTlsIoEnd = 0x40000000; break; - case AddressSpaceType.Addr39Bits: + case ProcessCreationFlags.AddressSpace64Bit: if (_reservedAddressSpaceSize < addrSpaceEnd) { int addressSpaceWidth = (int)ulong.Log2(_reservedAddressSpaceSize); @@ -218,8 +225,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory heapRegion.Size = 0x180000000; stackRegion.Size = 1UL << (addressSpaceWidth - 8); tlsIoRegion.Size = 1UL << (addressSpaceWidth - 3); - CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment); - codeRegionSize = BitUtils.AlignUp(endAddr, RegionAlignment) - CodeRegionStart; + CodeRegionStart = BitUtils.AlignDown(address, RegionAlignment); + codeRegionSize = BitUtils.AlignUp(endAddr, RegionAlignment) - CodeRegionStart; stackAndTlsIoStart = 0; stackAndTlsIoEnd = 0; AslrRegionStart = 0x8000000; @@ -239,9 +246,16 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory stackAndTlsIoStart = 0; stackAndTlsIoEnd = 0; } + + if (flags.HasFlag(ProcessCreationFlags.EnableAliasRegionExtraSize)) + { + AliasRegionExtraSize = addrSpaceEnd / 8; + aliasRegion.Size += AliasRegionExtraSize; + } break; + default: - throw new ArgumentException($"AddressSpaceType bigger than {(uint)AddressSpaceType.Addr39Bits}: {(uint)addrSpaceType}", nameof(addrSpaceType)); + throw new ArgumentException($"Invalid process flags {flags}", nameof(flags)); } CodeRegionEnd = CodeRegionStart + codeRegionSize; @@ -266,6 +280,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory ulong aslrMaxOffset = mapAvailableSize - mapTotalSize; + bool aslrEnabled = flags.HasFlag(ProcessCreationFlags.EnableAslr); + _aslrEnabled = aslrEnabled; AddrSpaceStart = addrSpaceStart; @@ -725,7 +741,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Memory { address = 0; - if (size > HeapRegionEnd - HeapRegionStart) + if (size > HeapRegionEnd - HeapRegionStart || size > _heapCapacity) { return KernelResult.OutOfMemory; } diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs index 6008548be8..422f03c649 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcess.cs @@ -126,8 +126,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process _contextFactory = contextFactory ?? new ProcessContextFactory(); _customThreadStart = customThreadStart; - AddressSpaceType addrSpaceType = (AddressSpaceType)((int)(creationInfo.Flags & ProcessCreationFlags.AddressSpaceMask) >> (int)ProcessCreationFlags.AddressSpaceShift); - Pid = KernelContext.NewKipId(); if (Pid == 0 || Pid >= KernelConstants.InitialProcessId) @@ -137,8 +135,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process InitializeMemoryManager(creationInfo.Flags); - bool aslrEnabled = creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr); - ulong codeAddress = creationInfo.CodeAddress; ulong codeSize = (ulong)creationInfo.CodePagesCount * KPageTableBase.PageSize; @@ -148,9 +144,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process : KernelContext.SmallMemoryBlockSlabManager; Result result = MemoryManager.InitializeForProcess( - addrSpaceType, - aslrEnabled, - !aslrEnabled, + creationInfo.Flags, + !creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr), memRegion, codeAddress, codeSize, @@ -234,8 +229,6 @@ namespace Ryujinx.HLE.HOS.Kernel.Process : KernelContext.SmallMemoryBlockSlabManager; } - AddressSpaceType addrSpaceType = (AddressSpaceType)((int)(creationInfo.Flags & ProcessCreationFlags.AddressSpaceMask) >> (int)ProcessCreationFlags.AddressSpaceShift); - Pid = KernelContext.NewProcessId(); if (Pid == ulong.MaxValue || Pid < KernelConstants.InitialProcessId) @@ -245,16 +238,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Process InitializeMemoryManager(creationInfo.Flags); - bool aslrEnabled = creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr); - ulong codeAddress = creationInfo.CodeAddress; ulong codeSize = codePagesCount * KPageTableBase.PageSize; Result result = MemoryManager.InitializeForProcess( - addrSpaceType, - aslrEnabled, - !aslrEnabled, + creationInfo.Flags, + !creationInfo.Flags.HasFlag(ProcessCreationFlags.EnableAslr), memRegion, codeAddress, codeSize, @@ -309,8 +299,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process private Result ParseProcessInfo(ProcessCreationInfo creationInfo) { // Ensure that the current kernel version is equal or above to the minimum required. - uint requiredKernelVersionMajor = (uint)Capabilities.KernelReleaseVersion >> 19; - uint requiredKernelVersionMinor = ((uint)Capabilities.KernelReleaseVersion >> 15) & 0xf; + uint requiredKernelVersionMajor = Capabilities.KernelReleaseVersion >> 19; + uint requiredKernelVersionMinor = (Capabilities.KernelReleaseVersion >> 15) & 0xf; if (KernelContext.EnableVersionChecks) { @@ -519,12 +509,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process return result; } -#pragma warning disable CA1822 // Mark member as static private void GenerateRandomEntropy() { // TODO. } -#pragma warning restore CA1822 public Result Start(int mainThreadPriority, ulong stackSize) { @@ -1182,5 +1170,10 @@ namespace Ryujinx.HLE.HOS.Kernel.Process // TODO return false; } + + public bool IsSvcPermitted(int svcId) + { + return Capabilities.IsSvcPermitted(svcId); + } } } diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs index 314aadf36e..ebab67bb85 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/KProcessCapabilities.cs @@ -8,6 +8,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process { class KProcessCapabilities { + private const int SvcMaskElementBits = 8; + public byte[] SvcAccessMask { get; } public byte[] IrqAccessMask { get; } @@ -22,7 +24,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process public KProcessCapabilities() { // length / number of bits of the underlying type - SvcAccessMask = new byte[KernelConstants.SupervisorCallCount / 8]; + SvcAccessMask = new byte[KernelConstants.SupervisorCallCount / SvcMaskElementBits]; IrqAccessMask = new byte[0x80]; } @@ -208,7 +210,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Process return KernelResult.MaximumExceeded; } - SvcAccessMask[svcId / 8] |= (byte)(1 << (svcId & 7)); + SvcAccessMask[svcId / SvcMaskElementBits] |= (byte)(1 << (svcId % SvcMaskElementBits)); } break; @@ -324,5 +326,13 @@ namespace Ryujinx.HLE.HOS.Kernel.Process return mask << (int)min; } + + public bool IsSvcPermitted(int svcId) + { + int index = svcId / SvcMaskElementBits; + int mask = 1 << (svcId % SvcMaskElementBits); + + return (uint)svcId < KernelConstants.SupervisorCallCount && (SvcAccessMask[index] & mask) != 0; + } } } diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationFlags.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationFlags.cs index f0e43e0236..1b62a29d4a 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationFlags.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/Process/ProcessCreationFlags.cs @@ -29,6 +29,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process PoolPartitionMask = 0xf << PoolPartitionShift, OptimizeMemoryAllocation = 1 << 11, + DisableDeviceAddressSpaceMerge = 1 << 12, + EnableAliasRegionExtraSize = 1 << 13, All = Is64Bit | @@ -38,6 +40,8 @@ namespace Ryujinx.HLE.HOS.Kernel.Process IsApplication | DeprecatedUseSecureMemory | PoolPartitionMask | - OptimizeMemoryAllocation, + OptimizeMemoryAllocation | + DisableDeviceAddressSpaceMerge | + EnableAliasRegionExtraSize, } } diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs index c0db821054..cbaae87804 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/InfoType.cs @@ -21,14 +21,17 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall SystemResourceSizeTotal, SystemResourceSizeUsed, ProgramId, - // NOTE: Added in 4.0.0, removed in 5.0.0. - InitialProcessIdRange, + InitialProcessIdRange, // NOTE: Added in 4.0.0, removed in 5.0.0. UserExceptionContextAddress, TotalNonSystemMemorySize, UsedNonSystemMemorySize, IsApplication, FreeThreadCount, ThreadTickCount, + IsSvcPermitted, + IoRegionHint, + AliasRegionExtraSize, + MesosphereCurrentProcess = 65001, } } diff --git a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs index 8f104b0b7d..2f487243d9 100644 --- a/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs +++ b/ryujinx/src/Ryujinx.HLE/HOS/Kernel/SupervisorCall/Syscall.cs @@ -84,6 +84,17 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidSize; } + if (info.Flags.HasFlag(ProcessCreationFlags.EnableAliasRegionExtraSize)) + { + if ((info.Flags & ProcessCreationFlags.AddressSpaceMask) != ProcessCreationFlags.AddressSpace64Bit || + info.SystemResourcePagesCount <= 0) + { + return KernelResult.InvalidState; + } + + // TODO: Check that we are in debug mode. + } + if (info.Flags.HasFlag(ProcessCreationFlags.OptimizeMemoryAllocation) && !info.Flags.HasFlag(ProcessCreationFlags.IsApplication)) { @@ -139,7 +150,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return handleTable.GenerateHandle(process, out handle); } -#pragma warning disable CA1822 // Mark member as static public Result StartProcess(int handle, int priority, int cpuCore, ulong mainThreadStackSize) { KProcess process = KernelStatic.GetCurrentProcess().HandleTable.GetObject(handle); @@ -172,17 +182,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x5f)] -#pragma warning disable CA1822 // Mark member as static public Result FlushProcessDataCache(int processHandle, ulong address, ulong size) { // FIXME: This needs to be implemented as ARMv7 doesn't have any way to do cache maintenance operations on EL0. // As we don't support (and don't actually need) to flush the cache, this is stubbed. return Result.Success; } -#pragma warning restore CA1822 // IPC @@ -256,7 +263,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x22)] -#pragma warning disable CA1822 // Mark member as static public Result SendSyncRequestWithUserBuffer( [PointerSized] ulong messagePtr, [PointerSized] ulong messageSize, @@ -306,7 +312,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } -#pragma warning restore CA1822 [Svc(0x23)] public Result SendAsyncRequestWithUserBuffer( @@ -896,7 +901,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(2)] -#pragma warning disable CA1822 // Mark member as static public Result SetMemoryPermission([PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission) { if (!PageAligned(address)) @@ -928,10 +932,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return currentProcess.MemoryManager.SetMemoryPermission(address, size, permission); } -#pragma warning restore CA1822 [Svc(3)] -#pragma warning disable CA1822 // Mark member as static public Result SetMemoryAttribute( [PointerSized] ulong address, [PointerSized] ulong size, @@ -979,10 +981,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } -#pragma warning restore CA1822 [Svc(4)] -#pragma warning disable CA1822 // Mark member as static public Result MapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size) { if (!PageAligned(src | dst)) @@ -1018,10 +1018,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return process.MemoryManager.Map(dst, src, size); } -#pragma warning restore CA1822 [Svc(5)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapMemory([PointerSized] ulong dst, [PointerSized] ulong src, [PointerSized] ulong size) { if (!PageAligned(src | dst)) @@ -1057,7 +1055,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return process.MemoryManager.Unmap(dst, src, size); } -#pragma warning restore CA1822 [Svc(6)] public Result QueryMemory([PointerSized] ulong infoPtr, [PointerSized] out ulong pageInfo, [PointerSized] ulong address) @@ -1074,7 +1071,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } -#pragma warning disable CA1822 // Mark member as static public Result QueryMemory(out MemoryInfo info, out ulong pageInfo, ulong address) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -1094,10 +1090,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x13)] -#pragma warning disable CA1822 // Mark member as static public Result MapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission) { if (!PageAligned(address)) @@ -1143,10 +1137,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall currentProcess, permission); } -#pragma warning restore CA1822 [Svc(0x14)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapSharedMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size) { if (!PageAligned(address)) @@ -1186,7 +1178,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall size, currentProcess); } -#pragma warning restore CA1822 [Svc(0x15)] public Result CreateTransferMemory(out int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission) @@ -1253,7 +1244,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x51)] -#pragma warning disable CA1822 // Mark member as static public Result MapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size, KMemoryPermission permission) { if (!PageAligned(address)) @@ -1299,10 +1289,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall currentProcess, permission); } -#pragma warning restore CA1822 [Svc(0x52)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapTransferMemory(int handle, [PointerSized] ulong address, [PointerSized] ulong size) { if (!PageAligned(address)) @@ -1342,10 +1330,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall size, currentProcess); } -#pragma warning restore CA1822 [Svc(0x2c)] -#pragma warning disable CA1822 // Mark member as static public Result MapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size) { if (!PageAligned(address)) @@ -1380,10 +1366,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return process.MemoryManager.MapPhysicalMemory(address, size); } -#pragma warning restore CA1822 [Svc(0x2d)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapPhysicalMemory([PointerSized] ulong address, [PointerSized] ulong size) { if (!PageAligned(address)) @@ -1418,7 +1402,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return process.MemoryManager.UnmapPhysicalMemory(address, size); } -#pragma warning restore CA1822 [Svc(0x4b)] public Result CreateCodeMemory(out int handle, [PointerSized] ulong address, [PointerSized] ulong size) @@ -1462,7 +1445,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x4c)] -#pragma warning disable CA1822 // Mark member as static public Result ControlCodeMemory( int handle, CodeMemoryOperation op, @@ -1540,10 +1522,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidEnumValue; } } -#pragma warning restore CA1822 [Svc(0x73)] -#pragma warning disable CA1822 // Mark member as static public Result SetProcessMemoryPermission( int handle, ulong src, @@ -1584,10 +1564,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return targetProcess.MemoryManager.SetProcessMemoryPermission(src, size, permission); } -#pragma warning restore CA1822 [Svc(0x74)] -#pragma warning disable CA1822 // Mark member as static public Result MapProcessMemory( [PointerSized] ulong dst, int handle, @@ -1643,10 +1621,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return dstProcess.MemoryManager.MapPages(dst, pageList, MemoryState.ProcessMemory, KMemoryPermission.ReadAndWrite); } -#pragma warning restore CA1822 [Svc(0x75)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapProcessMemory( [PointerSized] ulong dst, int handle, @@ -1691,10 +1667,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x77)] -#pragma warning disable CA1822 // Mark member as static public Result MapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size) { if (!PageAligned(dst) || !PageAligned(src)) @@ -1731,10 +1705,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return targetProcess.MemoryManager.MapProcessCodeMemory(dst, src, size); } -#pragma warning restore CA1822 [Svc(0x78)] -#pragma warning disable CA1822 // Mark member as static public Result UnmapProcessCodeMemory(int handle, ulong dst, ulong src, ulong size) { if (!PageAligned(dst) || !PageAligned(src)) @@ -1771,7 +1743,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return targetProcess.MemoryManager.UnmapProcessCodeMemory(dst, src, size); } -#pragma warning restore CA1822 private static bool PageAligned(ulong address) { @@ -1781,7 +1752,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall // System [Svc(0x7b)] -#pragma warning disable CA1822 // Mark member as static public Result TerminateProcess(int handle) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -1810,15 +1780,12 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } -#pragma warning restore CA1822 [Svc(7)] -#pragma warning disable CA1822 // Mark member as static public void ExitProcess() { KernelStatic.GetCurrentProcess().TerminateCurrentProcess(); } -#pragma warning restore CA1822 [Svc(0x11)] public Result SignalEvent(int handle) @@ -1911,7 +1878,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x26)] -#pragma warning disable CA1822 // Mark member as static public void Break(ulong reason) { KThread currentThread = KernelStatic.GetCurrentThread(); @@ -1937,10 +1903,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall Logger.Debug?.Print(LogClass.KernelSvc, "Debugger triggered."); } } -#pragma warning restore CA1822 [Svc(0x27)] -#pragma warning disable CA1822 // Mark member as static public void OutputDebugString([PointerSized] ulong strPtr, [PointerSized] ulong size) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -1949,7 +1913,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall Logger.Warning?.Print(LogClass.KernelSvc, str); } -#pragma warning restore CA1822 [Svc(0x29)] public Result GetInfo(out ulong value, InfoType id, int handle, long subId) @@ -1978,6 +1941,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall case InfoType.UsedNonSystemMemorySize: case InfoType.IsApplication: case InfoType.FreeThreadCount: + case InfoType.AliasRegionExtraSize: { if (subId != 0) { @@ -2006,22 +1970,19 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall value = process.MemoryManager.AliasRegionStart; break; case InfoType.AliasRegionSize: - value = (process.MemoryManager.AliasRegionEnd - - process.MemoryManager.AliasRegionStart); + value = process.MemoryManager.AliasRegionEnd - process.MemoryManager.AliasRegionStart; break; case InfoType.HeapRegionAddress: value = process.MemoryManager.HeapRegionStart; break; case InfoType.HeapRegionSize: - value = (process.MemoryManager.HeapRegionEnd - - process.MemoryManager.HeapRegionStart); + value = process.MemoryManager.HeapRegionEnd - process.MemoryManager.HeapRegionStart; break; case InfoType.TotalMemorySize: value = process.GetMemoryCapacity(); break; - case InfoType.UsedMemorySize: value = process.GetMemoryUsage(); break; @@ -2029,7 +1990,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall case InfoType.AslrRegionAddress: value = process.MemoryManager.GetAddrSpaceBaseAddr(); break; - case InfoType.AslrRegionSize: value = process.MemoryManager.GetAddrSpaceSize(); break; @@ -2038,20 +1998,17 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall value = process.MemoryManager.StackRegionStart; break; case InfoType.StackRegionSize: - value = (process.MemoryManager.StackRegionEnd - - process.MemoryManager.StackRegionStart); + value = process.MemoryManager.StackRegionEnd - process.MemoryManager.StackRegionStart; break; case InfoType.SystemResourceSizeTotal: value = process.PersonalMmHeapPagesCount * KPageTableBase.PageSize; break; - case InfoType.SystemResourceSizeUsed: if (process.PersonalMmHeapPagesCount != 0) { value = process.MemoryManager.GetMmUsedPages() * KPageTableBase.PageSize; } - break; case InfoType.ProgramId: @@ -2065,7 +2022,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall case InfoType.TotalNonSystemMemorySize: value = process.GetMemoryCapacityWithoutPersonalMmHeap(); break; - case InfoType.UsedNonSystemMemorySize: value = process.GetMemoryUsageWithoutPersonalMmHeap(); break; @@ -2084,10 +2040,12 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall { value = 0; } + break; + case InfoType.AliasRegionExtraSize: + value = process.MemoryManager.AliasRegionExtraSize; break; } - break; } @@ -2104,7 +2062,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } value = KernelStatic.GetCurrentProcess().Debug ? 1UL : 0UL; - break; } @@ -2136,7 +2093,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall value = (uint)resLimHandle; } - break; } @@ -2155,7 +2111,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } value = (ulong)KTimeManager.ConvertHostTicksToTicks(_context.Schedulers[currentCore].TotalIdleTimeTicks); - break; } @@ -2174,7 +2129,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall KProcess currentProcess = KernelStatic.GetCurrentProcess(); value = currentProcess.RandomEntropy[subId]; - break; } @@ -2220,7 +2174,22 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall value = (ulong)KTimeManager.ConvertHostTicksToTicks(totalTimeRunning); } + break; + } + case InfoType.IsSvcPermitted: + { + if (handle != 0) + { + return KernelResult.InvalidHandle; + } + + if (subId != 0x36) + { + return KernelResult.InvalidCombination; + } + + value = KernelStatic.GetCurrentProcess().IsSvcPermitted((int)subId) ? 1UL : 0UL; break; } @@ -2231,7 +2200,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidHandle; } - if ((ulong)subId != 0) + if (subId != 0) { return KernelResult.InvalidCombination; } @@ -2246,8 +2215,7 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } - value = (ulong)outHandle; - + value = (uint)outHandle; break; } @@ -2398,7 +2366,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x30)] -#pragma warning disable CA1822 // Mark member as static public Result GetResourceLimitLimitValue(out long limitValue, int handle, LimitableResource resource) { limitValue = 0; @@ -2419,10 +2386,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x31)] -#pragma warning disable CA1822 // Mark member as static public Result GetResourceLimitCurrentValue(out long limitValue, int handle, LimitableResource resource) { limitValue = 0; @@ -2443,10 +2408,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x37)] -#pragma warning disable CA1822 // Mark member as static public Result GetResourceLimitPeakValue(out long peak, int handle, LimitableResource resource) { peak = 0; @@ -2467,7 +2430,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x7d)] public Result CreateResourceLimit(out int handle) @@ -2480,7 +2442,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x7e)] -#pragma warning disable CA1822 // Mark member as static public Result SetResourceLimitLimitValue(int handle, LimitableResource resource, long limitValue) { if (resource >= LimitableResource.Count) @@ -2497,7 +2458,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return resourceLimit.SetLimitValue(resource, limitValue); } -#pragma warning restore CA1822 // Thread @@ -2577,7 +2537,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(9)] -#pragma warning disable CA1822 // Mark member as static public Result StartThread(int handle) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -2604,17 +2563,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidHandle; } } -#pragma warning restore CA1822 [Svc(0xa)] -#pragma warning disable CA1822 // Mark member as static public void ExitThread() { KThread currentThread = KernelStatic.GetCurrentThread(); currentThread.Exit(); } -#pragma warning restore CA1822 [Svc(0xb)] public void SleepThread(long timeout) @@ -2641,7 +2597,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0xc)] -#pragma warning disable CA1822 // Mark member as static public Result GetThreadPriority(out int priority, int handle) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -2661,10 +2616,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidHandle; } } -#pragma warning restore CA1822 [Svc(0xd)] -#pragma warning disable CA1822 // Mark member as static public Result SetThreadPriority(int handle, int priority) { // TODO: NPDM check. @@ -2682,10 +2635,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0xe)] -#pragma warning disable CA1822 // Mark member as static public Result GetThreadCoreMask(out int preferredCore, out ulong affinityMask, int handle) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -2707,10 +2658,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidHandle; } } -#pragma warning restore CA1822 [Svc(0xf)] -#pragma warning disable CA1822 // Mark member as static public Result SetThreadCoreMask(int handle, int preferredCore, ulong affinityMask) { KProcess currentProcess = KernelStatic.GetCurrentProcess(); @@ -2758,18 +2707,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return thread.SetCoreAndAffinityMask(preferredCore, affinityMask); } -#pragma warning restore CA1822 [Svc(0x10)] -#pragma warning disable CA1822 // Mark member as static public int GetCurrentProcessorNumber() { return KernelStatic.GetCurrentThread().CurrentCore; } -#pragma warning restore CA1822 [Svc(0x25)] -#pragma warning disable CA1822 // Mark member as static public Result GetThreadId(out ulong threadUid, int handle) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -2789,10 +2734,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return KernelResult.InvalidHandle; } } -#pragma warning restore CA1822 [Svc(0x32)] -#pragma warning disable CA1822 // Mark member as static public Result SetThreadActivity(int handle, bool pause) { KProcess process = KernelStatic.GetCurrentProcess(); @@ -2816,10 +2759,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return thread.SetActivity(pause); } -#pragma warning restore CA1822 [Svc(0x33)] -#pragma warning disable CA1822 // Mark member as static public Result GetThreadContext3([PointerSized] ulong address, int handle) { KProcess currentProcess = KernelStatic.GetCurrentProcess(); @@ -2853,7 +2794,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return result; } -#pragma warning restore CA1822 // Thread synchronization @@ -2986,7 +2926,6 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall } [Svc(0x1a)] -#pragma warning disable CA1822 // Mark member as static public Result ArbitrateLock(int ownerHandle, [PointerSized] ulong mutexAddress, int requesterHandle) { if (IsPointingInsideKernel(mutexAddress)) @@ -3003,10 +2942,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return currentProcess.AddressArbiter.ArbitrateLock(ownerHandle, mutexAddress, requesterHandle); } -#pragma warning restore CA1822 [Svc(0x1b)] -#pragma warning disable CA1822 // Mark member as static public Result ArbitrateUnlock([PointerSized] ulong mutexAddress) { if (IsPointingInsideKernel(mutexAddress)) @@ -3023,10 +2960,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return currentProcess.AddressArbiter.ArbitrateUnlock(mutexAddress); } -#pragma warning restore CA1822 [Svc(0x1c)] -#pragma warning disable CA1822 // Mark member as static public Result WaitProcessWideKeyAtomic( [PointerSized] ulong mutexAddress, [PointerSized] ulong condVarAddress, @@ -3056,10 +2991,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall handle, timeout); } -#pragma warning restore CA1822 [Svc(0x1d)] -#pragma warning disable CA1822 // Mark member as static public Result SignalProcessWideKey([PointerSized] ulong address, int count) { KProcess currentProcess = KernelStatic.GetCurrentProcess(); @@ -3068,10 +3001,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall return Result.Success; } -#pragma warning restore CA1822 [Svc(0x34)] -#pragma warning disable CA1822 // Mark member as static public Result WaitForAddress([PointerSized] ulong address, ArbitrationType type, int value, long timeout) { if (IsPointingInsideKernel(address)) @@ -3102,10 +3033,8 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall _ => KernelResult.InvalidEnumValue, }; } -#pragma warning restore CA1822 [Svc(0x35)] -#pragma warning disable CA1822 // Mark member as static public Result SignalToAddress([PointerSized] ulong address, SignalType type, int value, int count) { if (IsPointingInsideKernel(address)) @@ -3131,17 +3060,14 @@ namespace Ryujinx.HLE.HOS.Kernel.SupervisorCall _ => KernelResult.InvalidEnumValue, }; } -#pragma warning restore CA1822 [Svc(0x36)] -#pragma warning disable CA1822 // Mark member as static public Result SynchronizePreemptionState() { KernelStatic.GetCurrentThread().SynchronizePreemptionState(); return Result.Success; } -#pragma warning restore CA1822 // Not actual syscalls, used by HLE services and such. diff --git a/shadowsocks-rust/Cargo.lock b/shadowsocks-rust/Cargo.lock index 856111ef27..06cd011890 100644 --- a/shadowsocks-rust/Cargo.lock +++ b/shadowsocks-rust/Cargo.lock @@ -3586,18 +3586,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", diff --git a/sing-box/common/process/searcher_darwin.go b/sing-box/common/process/searcher_darwin.go index de8d3b3b73..4344c7061b 100644 --- a/sing-box/common/process/searcher_darwin.go +++ b/sing-box/common/process/searcher_darwin.go @@ -60,12 +60,12 @@ func findProcessName(network string, ip netip.Addr, port int) (string, error) { isIPv4 := ip.Is4() - value, err := syscall.Sysctl(spath) + value, err := unix.SysctlRaw(spath) if err != nil { return "", err } - buf := []byte(value) + buf := value // from darwin-xnu/bsd/netinet/in_pcblist.c:get_pcblist_n // size/offset are round up (aligned) to 8 bytes in darwin diff --git a/sing-box/docs/changelog.md b/sing-box/docs/changelog.md index 85e83e4ed1..8cd3b5d438 100644 --- a/sing-box/docs/changelog.md +++ b/sing-box/docs/changelog.md @@ -2,12 +2,16 @@ icon: material/alert-decagram --- +#### 1.10.0-alpha.23 + +* Fixes and improvements + #### 1.10.0-alpha.22 * Optimize memory usages of rule-sets **1** * Fixes and improvements -**1** +**1**: See [Source Format](/configuration/rule-set/source-format/#version). diff --git a/sing-box/go.mod b/sing-box/go.mod index 6695b4b818..8e00f36b3e 100644 --- a/sing-box/go.mod +++ b/sing-box/go.mod @@ -26,7 +26,7 @@ require ( github.com/sagernet/gvisor v0.0.0-20240428053021-e691de28565f github.com/sagernet/quic-go v0.45.1-beta.2 github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 - github.com/sagernet/sing v0.5.0-alpha.12.0.20240717075530-332e47007567 + github.com/sagernet/sing v0.5.0-alpha.13 github.com/sagernet/sing-dns v0.3.0-beta.10 github.com/sagernet/sing-mux v0.2.0 github.com/sagernet/sing-quic v0.2.0-beta.12 diff --git a/sing-box/go.sum b/sing-box/go.sum index 2fef8989ae..f7d163896e 100644 --- a/sing-box/go.sum +++ b/sing-box/go.sum @@ -115,8 +115,8 @@ github.com/sagernet/quic-go v0.45.1-beta.2/go.mod h1:+N3FqM9DAzOWfe64uxXuBejVJwX github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691 h1:5Th31OC6yj8byLGkEnIYp6grlXfo1QYUfiYFGjewIdc= github.com/sagernet/reality v0.0.0-20230406110435-ee17307e7691/go.mod h1:B8lp4WkQ1PwNnrVMM6KyuFR20pU8jYBD+A4EhJovEXU= github.com/sagernet/sing v0.2.18/go.mod h1:OL6k2F0vHmEzXz2KW19qQzu172FDgSbUSODylighuVo= -github.com/sagernet/sing v0.5.0-alpha.12.0.20240717075530-332e47007567 h1:Sus0pCYn5KPOQmArXdRTtrml6XccSzV87FkFTDqATtU= -github.com/sagernet/sing v0.5.0-alpha.12.0.20240717075530-332e47007567/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= +github.com/sagernet/sing v0.5.0-alpha.13 h1:fpR4TFZfu/9V3LbHSAnnnwcaXGMF8ijmAAPoY2WHSKw= +github.com/sagernet/sing v0.5.0-alpha.13/go.mod h1:ARkL0gM13/Iv5VCZmci/NuoOlePoIsW0m7BWfln/Hak= github.com/sagernet/sing-dns v0.3.0-beta.10 h1:Js61EjQXVpcu2VDegWEQTH1isCcVwJju8WEHYgG4tQ0= github.com/sagernet/sing-dns v0.3.0-beta.10/go.mod h1:nXE6EYMXahB5DV3AcXYbFfuorqF7tbQ86kxweSxRKM4= github.com/sagernet/sing-mux v0.2.0 h1:4C+vd8HztJCWNYfufvgL49xaOoOHXty2+EAjnzN3IYo= diff --git a/sing-box/option/json.go b/sing-box/option/json.go index 07580e9f7b..775141d5aa 100644 --- a/sing-box/option/json.go +++ b/sing-box/option/json.go @@ -1,8 +1,6 @@ package option import ( - "bytes" - "github.com/sagernet/sing/common" E "github.com/sagernet/sing/common/exceptions" "github.com/sagernet/sing/common/json" @@ -69,7 +67,5 @@ func UnmarshallExcluded(inputContent []byte, parentObject any, object any) error if err != nil { return err } - decoder := json.NewDecoder(bytes.NewReader(inputContent)) - decoder.DisallowUnknownFields() - return decoder.Decode(object) + return json.UnmarshalDisallowUnknownFields(inputContent, object) } diff --git a/sing-box/option/types.go b/sing-box/option/types.go index 83fee8f05a..b17f222248 100644 --- a/sing-box/option/types.go +++ b/sing-box/option/types.go @@ -128,12 +128,12 @@ func (l Listable[T]) MarshalJSON() ([]byte, error) { } func (l *Listable[T]) UnmarshalJSON(content []byte) error { - err := json.Unmarshal(content, (*[]T)(l)) + err := json.UnmarshalDisallowUnknownFields(content, (*[]T)(l)) if err == nil { return nil } var singleItem T - newError := json.Unmarshal(content, &singleItem) + newError := json.UnmarshalDisallowUnknownFields(content, &singleItem) if newError != nil { return E.Errors(err, newError) } diff --git a/sing-box/option/udp_over_tcp.go b/sing-box/option/udp_over_tcp.go index e8a7a9726e..b496017a41 100644 --- a/sing-box/option/udp_over_tcp.go +++ b/sing-box/option/udp_over_tcp.go @@ -26,5 +26,5 @@ func (o *UDPOverTCPOptions) UnmarshalJSON(bytes []byte) error { if err == nil { return nil } - return json.Unmarshal(bytes, (*_UDPOverTCPOptions)(o)) + return json.UnmarshalDisallowUnknownFields(bytes, (*_UDPOverTCPOptions)(o)) } diff --git a/small/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua b/small/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua index 04b70f30fe..a541021315 100644 --- a/small/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua +++ b/small/luci-app-passwall/luasrc/model/cbi/passwall/client/other.lua @@ -203,8 +203,10 @@ if has_singbox then o.rmempty = false o = s:option(Value, "geoip_url", translate("Custom geoip URL")) - o.default = "https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db" - o:value("https://github.com/SagerNet/sing-geoip/releases/latest/download/geoip.db") + o.default = "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db" + o:value("https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geoip.db") + o:value("https://github.com/1715173329/sing-geoip/releases/latest/download/geoip.db") + o:value("https://github.com/lyc8503/sing-box-rules/releases/latest/download/geoip.db") o.rmempty = false o = s:option(Value, "geosite_path", translate("Custom geosite Path")) @@ -212,8 +214,10 @@ if has_singbox then o.rmempty = false o = s:option(Value, "geosite_url", translate("Custom geosite URL")) - o.default = "https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db" - o:value("https://github.com/SagerNet/sing-geosite/releases/latest/download/geosite.db") + o.default = "https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db" + o:value("https://github.com/MetaCubeX/meta-rules-dat/releases/download/latest/geosite.db") + o:value("https://github.com/1715173329/sing-geosite/releases/latest/download/geosite.db") + o:value("https://github.com/lyc8503/sing-box-rules/releases/latest/download/geosite.db") o.rmempty = false o = s:option(Button, "_remove_resource", translate("Remove resource files")) diff --git a/small/v2ray-geodata/Makefile b/small/v2ray-geodata/Makefile index 5fc03b9162..b08e6fa25b 100644 --- a/small/v2ray-geodata/Makefile +++ b/small/v2ray-geodata/Makefile @@ -30,7 +30,7 @@ define Download/geosite HASH:=873ad7f4ad185ba7a70c5addbfd064703f22a7a8e4e21e4114a8ea98da7dd5ad endef -GEOSITE_IRAN_VER:=202407201213 +GEOSITE_IRAN_VER:=202407220030 GEOSITE_IRAN_FILE:=iran.dat.$(GEOSITE_IRAN_VER) define Download/geosite-ir URL:=https://github.com/bootmortis/iran-hosted-domains/releases/download/$(GEOSITE_IRAN_VER)/ diff --git a/small/xray-core/Makefile b/small/xray-core/Makefile index 9506b1da46..6c0099d50d 100644 --- a/small/xray-core/Makefile +++ b/small/xray-core/Makefile @@ -1,12 +1,12 @@ include $(TOPDIR)/rules.mk PKG_NAME:=xray-core -PKG_VERSION:=1.8.20 +PKG_VERSION:=1.8.21 PKG_RELEASE:=1 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE_URL:=https://codeload.github.com/XTLS/Xray-core/tar.gz/v$(PKG_VERSION)? -PKG_HASH:=602b04dc305086c3a1206395858e4eff6ccdffc799556521f1d830b3bc715fbc +PKG_HASH:=464636c323c20cd17a6e10d6fdf0120f0a84096f1c66c0ab4851141d238a1a0b PKG_MAINTAINER:=Tianling Shen PKG_LICENSE:=MPL-2.0 diff --git a/trojan-rs/Cargo.lock b/trojan-rs/Cargo.lock index 592b12e5c6..84bd9efa48 100644 --- a/trojan-rs/Cargo.lock +++ b/trojan-rs/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -43,47 +43,48 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -91,13 +92,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -113,15 +114,42 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" + +[[package]] +name = "aws-lc-rs" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ae74d9bd0a7530e8afd1770739ad34b36838829d6ad61818f9230f683f5ad77" +dependencies = [ + "aws-lc-sys", + "mirai-annotations", + "paste", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e89b6941c2d1a7045538884d6e760ccfffdf8e1ffc2613d8efa74305e1f3752" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "libc", + "paste", +] [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -145,9 +173,32 @@ dependencies = [ [[package]] name = "base64" -version = "0.21.7" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "bindgen" +version = "0.69.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +dependencies = [ + "bitflags 2.6.0", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.72", + "which", +] [[package]] name = "bitflags" @@ -157,9 +208,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -172,9 +223,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -184,9 +235,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "c2rust-bitfields" @@ -210,13 +261,23 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" dependencies = [ + "jobserver", "libc", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -225,23 +286,34 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.33" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] name = "clap" -version = "4.5.1" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -249,9 +321,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -261,27 +333,36 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" + +[[package]] +name = "cmake" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +dependencies = [ + "cc", +] [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "convert_case" @@ -319,9 +400,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -356,9 +437,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -372,15 +453,15 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "defmt" -version = "0.3.5" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2d011b2fee29fb7d659b83c43fce9a2cb4df453e16d441a51448e448f3f98" +checksum = "a99dd22262668b887121d4672af5a64b238f026099f1a2a1b322066c9ecfe9e0" dependencies = [ "bitflags 1.3.2", "defmt-macros", @@ -388,37 +469,37 @@ dependencies = [ [[package]] name = "defmt-macros" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54f0216f6c5acb5ae1a47050a6645024e6edafc2ee32d421955eccfef12ef92e" +checksum = "e3a9f309eff1f79b3ebdf252954d90ae440599c26c2c553fe87a2d17195f2dcb" dependencies = [ "defmt-parser", "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "defmt-parser" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "269924c02afd7f94bc4cecbfa5c379f6ffcf9766b3408fe63d22c728654eccd0" +checksum = "ff4a5fefe330e8d7f31b16a318f9ce81000d8e35e69b93eae154d16d2278f70f" dependencies = [ "thiserror", ] [[package]] name = "derive_more" -version = "0.99.17" +version = "0.99.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" +checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] @@ -444,10 +525,16 @@ dependencies = [ ] [[package]] -name = "either" -version = "1.9.0" +name = "dunce" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "enum-as-inner" @@ -455,10 +542,10 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -473,18 +560,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" -dependencies = [ - "log", -] - -[[package]] -name = "env_logger" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05e7cf40684ae96ade6232ed84582f40ce0a66efcd43a5117aef610534f8e0b8" +checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" dependencies = [ "anstream", "anstyle", @@ -493,6 +571,16 @@ dependencies = [ "log", ] +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "fern" version = "0.6.2" @@ -512,7 +600,7 @@ checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.4.1", "windows-sys 0.52.0", ] @@ -525,6 +613,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "fsevent-sys" version = "4.1.0" @@ -590,7 +684,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -635,9 +729,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -646,9 +740,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "glob" @@ -682,10 +776,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] -name = "hermit-abi" -version = "0.3.4" +name = "heck" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hex" @@ -694,10 +794,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "httparse" -version = "1.8.0" +name = "home" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "httparse" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "humantime" @@ -707,9 +816,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" +checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -776,10 +885,11 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "ipset" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "757a52302b4bde2b9dbaf94534b5b1ee0e611b3deab0142eb07da5526ad8f00c" +checksum = "b55e5cdda6ba5ce9cdb3bdaacbd0c142d6535be5249fa10c00d9c90b14069e57" dependencies = [ + "bindgen", "cc", "derive_more", "ipset_derive", @@ -793,9 +903,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4db6d64e879badf39e93df3831cb2902d290a2db61f8a46f299a681a2a601e0" dependencies = [ "quote", - "syn 2.0.48", + "syn 2.0.72", ] +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -806,10 +922,28 @@ dependencies = [ ] [[package]] -name = "js-sys" -version = "0.3.67" +name = "itertools" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + +[[package]] +name = "jobserver" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +dependencies = [ + "libc", +] + +[[package]] +name = "js-sys" +version = "0.3.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -836,31 +970,43 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libloading" -version = "0.8.1" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c571b676ddfc9a8c12f1f3d3085a7b163966a8fd8098a90640953ce5f6170161" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-targets 0.52.6", ] [[package]] -name = "lock_api" -version = "0.4.11" +name = "linux-raw-sys" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + +[[package]] +name = "lock_api" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -868,9 +1014,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "managed" @@ -879,10 +1025,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ca88d725a0a943b096803bd34e73a4437208b6077654cc4ecb2947a5f91618d" [[package]] -name = "memchr" -version = "2.7.1" +name = "matchers" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + +[[package]] +name = "memchr" +version = "2.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memoffset" @@ -894,19 +1049,25 @@ dependencies = [ ] [[package]] -name = "miniz_oxide" -version = "0.7.1" +name = "minimal-lexical" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", @@ -914,6 +1075,25 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4929e1f84c5e54c3ec6141cd5d8b5a5c055f031f80cf78f2072920173cb4d880" +dependencies = [ + "hermit-abi", + "libc", + "log", + "wasi", + "windows-sys 0.52.0", +] + +[[package]] +name = "mirai-annotations" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9be0862c1b3f26a88803c4a49de6889c10e608b3ee9344e6ef5b45fb37ad3d1" + [[package]] name = "nix" version = "0.23.2" @@ -933,13 +1113,23 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43794a0ace135be66a25d3ae77d41b91615fb68ae937f904090203e81f755b65" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "notify" version = "6.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6205bd8bb1e454ad2e27422015fb5e4f2bcc7e08fa8f27058670d208324a4d2d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "crossbeam-channel", "filetime", "fsevent-sys", @@ -947,16 +1137,26 @@ dependencies = [ "kqueue", "libc", "log", - "mio", + "mio 0.8.11", "walkdir", "windows-sys 0.48.0", ] [[package]] -name = "num-traits" -version = "0.2.17" +name = "nu-ansi-term" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "77a8165726e8236064dbb45459242600304b42a5ea24ee2948e18e023bf7ba84" +dependencies = [ + "overload", + "winapi", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] @@ -973,9 +1173,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -987,10 +1187,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] -name = "parking_lot" -version = "0.12.1" +name = "overload" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + +[[package]] +name = "parking_lot" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -998,17 +1204,23 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.5.3", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1017,9 +1229,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1029,39 +1241,39 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pnet_base" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "872e46346144ebf35219ccaa64b1dffacd9c6f188cd7d012bd6977a2a838f42e" +checksum = "fe4cf6fb3ab38b68d01ab2aea03ed3d1132b4868fa4e06285f29f16da01c5f4c" dependencies = [ "no-std-net", ] [[package]] name = "pnet_macros" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a780e80005c2e463ec25a6e9f928630049a10b43945fea83207207d4a7606f4" +checksum = "688b17499eee04a0408aca0aa5cba5fc86401d7216de8a63fdf7a4c227871804" dependencies = [ "proc-macro2", "quote", "regex", - "syn 1.0.109", + "syn 2.0.72", ] [[package]] name = "pnet_macros_support" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d932134f32efd7834eb8b16d42418dac87086347d1bc7d142370ef078582bc" +checksum = "eea925b72f4bd37f8eab0f221bbe4c78b63498350c983ffa9dd4bcde7e030f56" dependencies = [ "pnet_base", ] [[package]] name = "pnet_packet" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bde678bbd85cb1c2d99dc9fc596e57f03aa725f84f3168b0eaf33eeccb41706" +checksum = "a9a005825396b7fe7a38a8e288dbc342d5034dac80c15212436424fef8ea90ba" dependencies = [ "glob", "pnet_base", @@ -1075,6 +1287,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "prettyplease" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +dependencies = [ + "proc-macro2", + "syn 2.0.72", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1101,18 +1323,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -1149,9 +1371,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -1177,33 +1399,57 @@ dependencies = [ ] [[package]] -name = "regex" -version = "1.10.3" +name = "redox_syscall" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "regex" +version = "1.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.7", + "regex-syntax 0.8.4", ] [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", +] + +[[package]] +name = "regex-automata" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.4", ] [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "regex-syntax" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reopen" @@ -1217,32 +1463,39 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin", "untrusted", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "ringbuf" -version = "0.3.3" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79abed428d1fd2a128201cec72c5f6938e2da607c6f3745f769fabea399d950a" +checksum = "5c65e4c865bc3d2e3294493dff0acf7e6c259d066e34e22059fa9c39645c3636" dependencies = [ "crossbeam-utils", ] [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_version" @@ -1254,12 +1507,27 @@ dependencies = [ ] [[package]] -name = "rustls" -version = "0.22.2" +name = "rustix" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e87c9956bd9807afa1f77e0f7594af32566e830e088a5576d27c5b6f30f49d41" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustls" +version = "0.23.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +dependencies = [ + "aws-lc-rs", "log", + "once_cell", "ring", "rustls-pki-types", "rustls-webpki", @@ -1269,9 +1537,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.0" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c333bb734fcdedcea57de1602543590f545f127dc8b533324318fd492c5c70b" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ "base64", "rustls-pki-types", @@ -1279,16 +1547,17 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.3.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048a63e5b3ac996d78d402940b5fa47973d2d080c6c6fffa1d0f19c4445310b7" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" -version = "0.102.1" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4ca26037c909dedb327b48c3327d0ba91d3dd3c4e05dad328f210ffb68e95b" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -1311,9 +1580,9 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "semver" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" [[package]] name = "sha2" @@ -1326,6 +1595,21 @@ dependencies = [ "digest", ] +[[package]] +name = "sharded-slab" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" +dependencies = [ + "lazy_static", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook" version = "0.1.17" @@ -1338,9 +1622,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -1356,9 +1640,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smoltcp" @@ -1378,12 +1662,12 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1400,21 +1684,21 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "surge-ping" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af341b2be485d647b5dc4cfb2da99efac35b5c95748a08fb7233480fedc5ead3" +checksum = "efbf95ce4c7c5b311d2ce3f088af2b93edef0f09727fa50fbe03c7a979afce77" dependencies = [ "hex", "parking_lot", @@ -1439,9 +1723,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -1450,50 +1734,61 @@ dependencies = [ [[package]] name = "test-log" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6159ab4116165c99fc88cce31f99fa2c9dbe08d3691cb38da02fc3b45f357d2b" +checksum = "3dffced63c2b5c7be278154d76b479f9f9920ed34e7574201407f0b14e2bbb93" dependencies = [ - "env_logger 0.10.2", + "env_logger", "test-log-macros", + "tracing-subscriber", ] [[package]] name = "test-log-macros" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba277e77219e9eea169e8508942db1bf5d8a41ff2db9b20aab5a5aadc9fa25d" +checksum = "5999e24eaa32083191ba4e425deb75cdf25efefabe5aaccb7446dd0d4122a3f5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", ] [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1506,14 +1801,14 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", "libc", - "mio", + "mio 0.8.11", "num_cpus", "parking_lot", "pin-project-lite", @@ -1525,20 +1820,20 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ "rustls", "rustls-pki-types", @@ -1547,9 +1842,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -1577,7 +1872,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", ] [[package]] @@ -1587,6 +1882,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" +dependencies = [ + "log", + "once_cell", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +dependencies = [ + "matchers", + "nu-ansi-term", + "once_cell", + "regex", + "sharded-slab", + "thread_local", + "tracing", + "tracing-core", + "tracing-log", ] [[package]] @@ -1603,18 +1927,18 @@ dependencies = [ "crossbeam", "derive_more", "dns-lookup", - "env_logger 0.11.1", + "env_logger", "fern", "futures", "hex", "httparse", "ipset", - "itertools", + "itertools 0.13.0", "lazy_static", "libc", "libloading", "log", - "mio", + "mio 1.0.0", "notify", "rand", "rayon", @@ -1683,9 +2007,9 @@ checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -1698,9 +2022,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna 0.5.0", @@ -1709,9 +2033,15 @@ dependencies = [ [[package]] name = "utf8parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" [[package]] name = "version_check" @@ -1721,9 +2051,9 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -1737,9 +2067,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1747,24 +2077,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1772,22 +2102,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.72", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "webpki" @@ -1801,18 +2131,30 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.0" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] [[package]] -name = "widestring" -version = "1.0.2" +name = "which" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix", +] + +[[package]] +name = "widestring" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -1832,11 +2174,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] @@ -1852,7 +2194,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -1861,7 +2203,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -1879,7 +2221,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", ] [[package]] @@ -1899,17 +2241,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -1920,9 +2263,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1932,9 +2275,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1944,9 +2287,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1956,9 +2305,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1968,9 +2317,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1980,9 +2329,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1992,9 +2341,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -2031,6 +2380,20 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.72", +] diff --git a/trojan-rs/Cargo.toml b/trojan-rs/Cargo.toml index 53a2b5da22..0a87258908 100644 --- a/trojan-rs/Cargo.toml +++ b/trojan-rs/Cargo.toml @@ -8,27 +8,27 @@ edition = "2021" [dependencies] clap = { version = "4.5", features = ["derive", "cargo", "env"] } -mio = { version = "0.8", features = ["net", "os-poll"] } +mio = { version = "1.0", features = ["net", "os-poll"] } log = "0.4" chrono = "0.4" libc = "0.2" -rustls = { version = "0.22", features = [] } +rustls = { version = "0.23", features = ["ring"] } sha2 = "0.10" -bytes = "1.5" +bytes = "1.6" dns-lookup = "2.0" cfg-if = "1.0" webpki-roots = "0.26" webpki = "0.22" socket2 = "0.5" -rayon = "1.8" +rayon = "1.10" rustls-pemfile = "2.1" -lazy_static = "1.4" +lazy_static = "1.5" derive_more = "0.99" libloading = "0.8" crossbeam = "0.8" trust-dns-proto = "0.23" -widestring = "1.0" -itertools = "0.12" +widestring = "1.1" +itertools = "0.13" smoltcp = { version = "0.11" } backtrace = "0.3" hex = "0.4" @@ -37,11 +37,11 @@ tokio = { version = "1.36", features = ["full"] } rand = "0.8" test-log = "0.2" notify = "6.1" -ringbuf = "0.3" -httparse = "1.8" +ringbuf = "0.4" +httparse = "1.9" async_smoltcp = { path = "async_smoltcp" } -tokio-rustls = "0.25" -rustls-pki-types = "1.3" +tokio-rustls = "0.26" +rustls-pki-types = "1.7" futures = "0.3" [dev-dependencies] @@ -54,7 +54,7 @@ winapi = { version = "0.3", features = ["netioapi", "impl-debug", "impl-default" [target.'cfg(not(windows))'.dependencies] backtrace-on-stack-overflow = "0.3" -ipset = { version = "0.6" } +ipset = { version = "0.7" } [dependencies.fern] version = "0.6" diff --git a/trojan-rs/src/aproxy/mod.rs b/trojan-rs/src/aproxy/mod.rs index cefa7421f1..bc235687ea 100644 --- a/trojan-rs/src/aproxy/mod.rs +++ b/trojan-rs/src/aproxy/mod.rs @@ -1,12 +1,13 @@ use std::{ net::{IpAddr, SocketAddr}, - sync::{atomic::AtomicBool, Arc}, + sync::{Arc, atomic::AtomicBool}, }; +use ipset::types::AddOption; use rustls::{ client::danger::{HandshakeSignatureValid, ServerCertVerified, ServerCertVerifier}, - crypto::ring::default_provider, - ClientConfig, DigitallySignedStruct, Error, RootCertStore, SignatureScheme, + ClientConfig, + crypto::ring::default_provider, DigitallySignedStruct, Error, RootCertStore, SignatureScheme, }; use rustls_pki_types::{CertificateDer, ServerName, UnixTime}; use tokio::{ @@ -173,7 +174,7 @@ async fn wait_until_stop(running: Arc, ip: IpAddr) { .await; match proxy_data .no_bypass_session - .add(ip, Some(timeout as u32 + 5)) + .add(ip, vec![AddOption::Timeout(timeout as u32 + 5)]) { Ok(ret) => { if !ret { @@ -209,7 +210,7 @@ pub async fn init_tls_conn( for ip in &ips { if !proxy_data.server_ips.contains(&ip.ip()) { proxy_data.server_ips.push(ip.ip()); - if let Err(err) = proxy_data.bypass_session.add(ip.ip(), None) { + if let Err(err) = proxy_data.bypass_session.add(ip.ip(), vec![]) { log::error!("add ip:{} to session failed:{}", ip, err); } } diff --git a/trojan-rs/src/aproxy/profiler.rs b/trojan-rs/src/aproxy/profiler.rs index 6f34bb1fe8..3ed13017a8 100644 --- a/trojan-rs/src/aproxy/profiler.rs +++ b/trojan-rs/src/aproxy/profiler.rs @@ -8,11 +8,14 @@ use std::{ use bytes::{Buf, BufMut, BytesMut}; use itertools::Itertools; use rand::random; -use ringbuf::{HeapRb, Rb}; +use ringbuf::{ + HeapRb, + traits::{Consumer, Observer, RingBuffer}, +}; use rustls_pki_types::ServerName; -use surge_ping::{Client, ConfigBuilder, PingIdentifier, PingSequence, Pinger, ICMP}; +use surge_ping::{Client, ConfigBuilder, ICMP, Pinger, PingIdentifier, PingSequence}; use tokio::{ - io::{split, AsyncReadExt, AsyncWriteExt, ReadHalf}, + io::{AsyncReadExt, AsyncWriteExt, ReadHalf, split}, net::TcpStream, spawn, sync::mpsc::{self, UnboundedReceiver, UnboundedSender}, @@ -111,7 +114,7 @@ async fn start_response(mut receiver: UnboundedReceiver<(IpAddr, bool)>, name: S cfg_if::cfg_if! { if #[cfg(unix)] { if let Err(err) = if add { - session.add(ip, None) + session.add(ip, vec![]) } else { session.del(ip) } { @@ -256,8 +259,8 @@ async fn check_server(host: String, timeout: u64, ip_timeout: u64) { total_ping += cond.ping as usize; total_lost += cond.lost as usize; } - let avg_ping = total_ping / rb.len(); - let avg_lost = total_lost / rb.len(); + let avg_ping = total_ping / rb.occupied_len(); + let avg_lost = total_lost / rb.occupied_len(); log::error!( "average proxy server status, ip:{} ping:{}, lost:{}", ip, @@ -448,7 +451,7 @@ pub async fn run_profiler( let mut ips1 = Vec::new(); let mut ips0 = Vec::new(); - for (key, group) in &set.iter().group_by(|(_ip, pr)| { + for (key, group) in &set.iter().chunk_by(|(_ip, pr)| { if pr.is_complete() { if pr.sent || pr.is_no_bypass() { 2 //already sent diff --git a/trojan-rs/src/main.rs b/trojan-rs/src/main.rs index 44f3fb6e44..eb56124d1d 100644 --- a/trojan-rs/src/main.rs +++ b/trojan-rs/src/main.rs @@ -5,6 +5,7 @@ use std::panic; use backtrace::Backtrace; +use rustls::crypto::ring::default_provider; use crate::config::{Mode, OPTIONS}; @@ -50,6 +51,8 @@ fn main() { } } })); + let provider = default_provider(); + provider.install_default().unwrap(); if let Err(err) = match OPTIONS.mode { Mode::Proxy(_) => { log::warn!( diff --git a/trojan-rs/src/proxy/net_profiler.rs b/trojan-rs/src/proxy/net_profiler.rs index 6db7076a82..f5b2a9ec3a 100644 --- a/trojan-rs/src/proxy/net_profiler.rs +++ b/trojan-rs/src/proxy/net_profiler.rs @@ -12,8 +12,11 @@ use dns_lookup::lookup_host; use itertools::Itertools; use mio::{event::Event, Poll, Token}; use rand::random; -use ringbuf::{HeapRb, Rb}; -use surge_ping::{Client, ConfigBuilder, PingIdentifier, PingSequence, ICMP}; +use ringbuf::{ + HeapRb, + traits::{Consumer, Observer, RingBuffer}, +}; +use surge_ping::{Client, ConfigBuilder, ICMP, PingIdentifier, PingSequence}; use tokio::{ runtime::{Builder, Runtime}, sync::mpsc::{self, UnboundedReceiver, UnboundedSender}, @@ -127,7 +130,7 @@ async fn start_response(mut receiver: UnboundedReceiver<(IpAddr, bool)>, name: S cfg_if::cfg_if! { if #[cfg(unix)] { if let Err(err) = if add { - session.add(ip, None) + session.add(ip, vec![]) } else { session.del(ip) } { @@ -251,8 +254,8 @@ async fn check_server(host: String, timeout: u64, ip_timeout: u64) { total_ping += cond.ping as usize; total_lost += cond.lost as usize; } - let avg_ping = total_ping / rb.len(); - let avg_lost = total_lost / rb.len(); + let avg_ping = total_ping / rb.occupied_len(); + let avg_lost = total_lost / rb.occupied_len(); if let Err(err) = CONDITION.write().map(|mut cond| { cond.lost = avg_lost as u8; @@ -444,7 +447,7 @@ impl NetProfiler { let mut ips1 = Vec::new(); let mut ips0 = Vec::new(); - for (key, group) in &self.set.iter().group_by(|(_ip, pr)| { + for (key, group) in &self.set.iter().chunk_by(|(_ip, pr)| { if pr.is_complete() { if pr.sent || pr.is_no_bypass() { 2 //already sent diff --git a/v2rayng/V2rayNG/app/build.gradle.kts b/v2rayng/V2rayNG/app/build.gradle.kts index 7894058256..8cff84c732 100644 --- a/v2rayng/V2rayNG/app/build.gradle.kts +++ b/v2rayng/V2rayNG/app/build.gradle.kts @@ -11,8 +11,8 @@ android { applicationId = "com.v2ray.ang" minSdk = 21 targetSdk = 34 - versionCode = 577 - versionName = "1.8.33" + versionCode = 578 + versionName = "1.8.34" multiDexEnabled = true splits.abi { reset() diff --git a/v2rayu/V2rayU.xcodeproj/project.pbxproj b/v2rayu/V2rayU.xcodeproj/project.pbxproj index 914c39dce0..a723121826 100644 --- a/v2rayu/V2rayU.xcodeproj/project.pbxproj +++ b/v2rayu/V2rayU.xcodeproj/project.pbxproj @@ -834,7 +834,7 @@ CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 4.2.3; + CURRENT_PROJECT_VERSION = 4.2.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; @@ -846,7 +846,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 4.2.3; + MARKETING_VERSION = 4.2.4; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU; PRODUCT_NAME = "$(TARGET_NAME)"; @@ -872,7 +872,7 @@ CODE_SIGN_STYLE = Manual; COMBINE_HIDPI_IMAGES = YES; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 4.2.3; + CURRENT_PROJECT_VERSION = 4.2.4; DEFINES_MODULE = YES; DEVELOPMENT_TEAM = ""; "DEVELOPMENT_TEAM[sdk=macosx*]" = ""; @@ -884,7 +884,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = 11.0; - MARKETING_VERSION = 4.2.3; + MARKETING_VERSION = 4.2.4; ONLY_ACTIVE_ARCH = NO; PRODUCT_BUNDLE_IDENTIFIER = net.yanue.V2rayU; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/v2rayu/V2rayU/Import.swift b/v2rayu/V2rayU/Import.swift index 89b4e2cf35..3c2785c49b 100644 --- a/v2rayu/V2rayU/Import.swift +++ b/v2rayu/V2rayU/Import.swift @@ -316,9 +316,6 @@ class ImportUri { if vmess.security.isEmpty { vmess.security = "none" } - if vmess.flow.isEmpty { - vmess.flow = "xtls-rprx-vision" - } if vmess.sni.count == 0 { vmess.sni = vmess.address } diff --git a/v2rayu/V2rayU/Uri.swift b/v2rayu/V2rayU/Uri.swift index 1a0a25ee6d..62dc08573d 100644 --- a/v2rayu/V2rayU/Uri.swift +++ b/v2rayu/V2rayU/Uri.swift @@ -583,9 +583,6 @@ class VlessUri { break case "flow": self.flow = item.value as! String - if self.flow.isEmpty { - self.flow = "xtls-rprx-vision" - } break case "encryption": self.encryption = item.value as! String diff --git a/v2rayu/V2rayU/v2ray/V2rayConfig.swift b/v2rayu/V2rayU/v2ray/V2rayConfig.swift index ce0993929f..6790119f2b 100644 --- a/v2rayu/V2rayU/v2ray/V2rayConfig.swift +++ b/v2rayu/V2rayU/v2ray/V2rayConfig.swift @@ -770,9 +770,6 @@ class V2rayConfig: NSObject { user.id = val["id"].stringValue user.flow = val["flow"].stringValue user.encryption = val["encryption"].stringValue - if user.flow.isEmpty { - user.flow = "xtls-rprx-vision" - } if user.encryption.isEmpty { user.encryption = "none" } diff --git a/xray-core/.github/workflows/docker.yml b/xray-core/.github/workflows/docker.yml index 793d274884..89a0b69382 100644 --- a/xray-core/.github/workflows/docker.yml +++ b/xray-core/.github/workflows/docker.yml @@ -19,7 +19,7 @@ jobs: uses: docker/metadata-action@v5 with: images: ghcr.io/${{ github.repository_owner }}/xray-core - flavor: latest=true + flavor: latest=auto tags: | type=sha type=ref,event=branch diff --git a/xray-core/core/core.go b/xray-core/core/core.go index 262cf5f316..077b26380c 100644 --- a/xray-core/core/core.go +++ b/xray-core/core/core.go @@ -21,7 +21,7 @@ import ( var ( Version_x byte = 1 Version_y byte = 8 - Version_z byte = 20 + Version_z byte = 21 ) var ( diff --git a/xray-core/transport/internet/splithttp/client.go b/xray-core/transport/internet/splithttp/client.go index 2a467d7dab..8330d5d749 100644 --- a/xray-core/transport/internet/splithttp/client.go +++ b/xray-core/transport/internet/splithttp/client.go @@ -94,6 +94,10 @@ func (c *DefaultDialerClient) OpenDownload(ctx context.Context, baseURL string) gotDownResponse.Close() }() + if c.isH3 { + gotConn.Close() + } + // we want to block Dial until we know the remote address of the server, // for logging purposes <-gotConn.Wait() diff --git a/yass/CMakeLists.txt b/yass/CMakeLists.txt index 87af272b6a..1749eb6859 100644 --- a/yass/CMakeLists.txt +++ b/yass/CMakeLists.txt @@ -1976,8 +1976,10 @@ else() if (CMAKE_SYSTEM_NAME STREQUAL "Linux" OR ANDROID OR OHOS) include_directories(third_party/lss) endif() - if (APPLE AND COMPILER_CLANG) - link_libraries("-framework Foundation" "-framework SystemConfiguration") + + # TODO use $ for cmake >= 3.24 + if (APPLE) + link_libraries(-Wl,-framework,CoreFoundation) endif() endif() @@ -2301,6 +2303,11 @@ if (ABSL_BUILD_TESTING) set(GMOCK_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googletest/googlemock/include) set(GMOCK_MAIN_LIBRARY absl_gmock_main) endif() +if (MSVC_CRT_LINKAGE STREQUAL "dynamic") + set(ABSL_MSVC_STATIC_RUNTIME OFF CACHE BOOL "") +else() + set(ABSL_MSVC_STATIC_RUNTIME ON CACHE BOOL "") +endif() add_subdirectory(third_party/abseil-cpp EXCLUDE_FROM_ALL) set(SUPPORT_LIBS @@ -4009,6 +4016,11 @@ if (USE_MIMALLOC) target_link_libraries(yass_core PUBLIC ${MIMALLOC_LIB}) endif() +if (APPLE) + target_link_libraries(yass_core PUBLIC -Wl,-framework,Foundation) + target_link_libraries(yass_core PUBLIC -Wl,-framework,SystemConfiguration) +endif() + target_include_directories(yass_core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googleurl-override ${CMAKE_CURRENT_SOURCE_DIR}/third_party/googleurl/polyfills @@ -4809,8 +4821,6 @@ if (GUI) # ======================= # YassPacketTunnel extensions # ======================= - find_library(NetworkExtension_LIBRARY NetworkExtension REQUIRED) - set(PLUGIN_SRC src/ios/utils.h src/ios/utils.mm @@ -4838,7 +4848,7 @@ if (GUI) ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/ios/extensions) target_compile_options(network-extension PRIVATE -fapplication-extension -fmodules -gmodules -fobjc-arc --start-no-unused-arguments -fobjc-weak --end-no-unused-arguments) - target_link_libraries(network-extension PRIVATE ${NetworkExtension_LIBRARY}) + target_link_libraries(network-extension PRIVATE -Wl,-framework,NetworkExtension) set_target_properties(network-extension PROPERTIES LINK_OPTIONS -fapplication-extension -e _NSExtensionMain -fobjc-arc -fobjc-link-runtime) set_target_properties(network-extension PROPERTIES @@ -4893,7 +4903,7 @@ if (GUI) target_link_libraries(network-extension PRIVATE ${Security_LIBRARY}) target_link_libraries(network-extension PRIVATE yass_cli_lib) - target_link_libraries(${APP_NAME} PRIVATE ${NetworkExtension_LIBRARY}) + target_link_libraries(${APP_NAME} PRIVATE -Wl,-framework,NetworkExtension) endif() if (NOT CMAKE_SKIP_INSTALL_RULES) diff --git a/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java b/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java index e2aebe9e33..1b5e026af7 100644 --- a/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java +++ b/yass/android/yass/src/main/java/it/gui/yass/MainActivity.java @@ -7,6 +7,7 @@ import android.app.Dialog; import android.app.UiModeManager; import android.content.Context; import android.content.Intent; +import android.content.SharedPreferences; import android.content.pm.ApplicationInfo; import android.net.ConnectivityManager; import android.net.wifi.WifiManager; @@ -14,7 +15,6 @@ import android.os.Build; import android.os.Bundle; import android.os.Handler; import android.os.ParcelFileDescriptor; -import android.preference.PreferenceManager; import android.util.Log; import android.view.View; import android.widget.ArrayAdapter; @@ -23,15 +23,17 @@ import android.widget.EditText; import android.widget.Spinner; import android.widget.TextView; +import androidx.activity.result.ActivityResultLauncher; +import androidx.activity.result.contract.ActivityResultContracts; import androidx.appcompat.app.AppCompatActivity; import androidx.appcompat.app.AppCompatDelegate; +import androidx.preference.PreferenceManager; import java.io.IOException; import java.net.InetAddress; import java.net.UnknownHostException; import java.nio.ByteBuffer; import java.nio.ByteOrder; -import java.util.HashMap; import java.util.Locale; import java.util.Timer; import java.util.TimerTask; @@ -50,18 +52,24 @@ public class MainActivity extends AppCompatActivity { } private final YassVpnService vpnService = new YassVpnService(); - private final int VPN_REQUEST_CODE = 10000; - private final int SETTINGS_REQUEST_CODE = 10001; private final Handler handler = new Handler(); + private final ActivityResultLauncher optionActivityResultLauncher = registerForActivityResult( + new ActivityResultContracts.StartActivityForResult(), + result -> { + }); private NativeMachineState state = NativeMachineState.STOPPED; private Timer mRefreshTimer; private int nativeLocalPort = 0; private long tun2proxyPtr = 0; private Thread tun2proxyThread; + // You can do the assignment inside onAttach or onCreate, i.e, before the activity is displayed + private final ActivityResultLauncher vpnActivityResultLauncher = registerForActivityResult( + new ActivityResultContracts.StartActivityForResult(), + result -> onVpnActivityResult(result.getResultCode())); private static String humanReadableByteCountBin(long bytes) { if (bytes < 1024) { - return String.format("%d B/s", bytes); + return String.format(self.getLocale(), "%d B/s", bytes); } long value = bytes; String ci = "KMGTPE"; @@ -70,7 +78,7 @@ public class MainActivity extends AppCompatActivity { value >>= 10; ++cPos; } - return String.format("%5.2f %c/s", value / 1024.0, ci.charAt(cPos)); + return String.format(self.getLocale(), "%5.2f %c/s", value / 1024.0, ci.charAt(cPos)); } @Override @@ -144,14 +152,14 @@ public class MainActivity extends AppCompatActivity { loadSettingsFromNativeCurrentIp(); - HashMap preferences = (HashMap) PreferenceManager.getDefaultSharedPreferences(getApplicationContext()).getAll(); + SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext()); + + { + boolean is_enabled = preferences.getBoolean(YassSettingsFragment.EnablePostQuantumKyberPreferenceKey, false); + Log.d("Preferences", String.format(getLocale(), "Preferences: Post Quantumn Kyber: %b", is_enabled)); + YassUtils.setEnablePostQuantumKyber(is_enabled); + } - preferences.forEach((key, value) -> { - Log.d("Preferences", String.format("Loading Preferences: %s -> %s", key, value)); - if (key.equals(YassSettingsFragment.EnablePostQuantumKyberPreferenceKey)) { - YassUtils.setEnablePostQuantumKyber((Boolean) value); - } - }); Button stopButton = findViewById(R.id.stopButton); stopButton.setEnabled(false); @@ -223,9 +231,9 @@ public class MainActivity extends AppCompatActivity { Intent intent = YassVpnService.prepare(getApplicationContext()); if (intent == null) { - onActivityResult(VPN_REQUEST_CODE, RESULT_OK, null); + onVpnActivityResult(RESULT_OK); } else { - startActivityForResult(intent, VPN_REQUEST_CODE); + vpnActivityResultLauncher.launch(intent); } } @@ -255,13 +263,11 @@ public class MainActivity extends AppCompatActivity { } else { Log.v(YASS_TAG, String.format("yass thr started with port %d", local_port)); } - this.runOnUiThread(new Runnable() { - public void run() { - if (error_msg != null) { - onNativeStartFailedOnUIThread(error_msg, false); - } else { - onNativeStartedOnUIThread(local_port); - } + this.runOnUiThread(() -> { + if (error_msg != null) { + onNativeStartFailedOnUIThread(error_msg, false); + } else { + onNativeStartedOnUIThread(local_port); } }); } @@ -271,33 +277,23 @@ public class MainActivity extends AppCompatActivity { @SuppressWarnings("unused") private void onNativeStopped() { Log.v(YASS_TAG, "yass thr stopped"); - this.runOnUiThread(new Runnable() { - public void run() { - state = NativeMachineState.STOPPED; - Button startButton = findViewById(R.id.startButton); - startButton.setEnabled(true); + this.runOnUiThread(() -> { + state = NativeMachineState.STOPPED; + Button startButton = findViewById(R.id.startButton); + startButton.setEnabled(true); - TextView statusTextView = findViewById(R.id.statusTextView); - statusTextView.setText(String.format(getString(R.string.status_stopped), YassUtils.getServerHost(), YassUtils.getServerPort())); - } + TextView statusTextView = findViewById(R.id.statusTextView); + statusTextView.setText(String.format(getString(R.string.status_stopped), YassUtils.getServerHost(), YassUtils.getServerPort())); }); } - @Override - protected void onActivityResult(int requestCode, int resultCode, Intent data) { - if (requestCode == SETTINGS_REQUEST_CODE) { - return; - } - if (requestCode == VPN_REQUEST_CODE && resultCode == RESULT_OK) { + protected void onVpnActivityResult(int resultCode) { + if (resultCode == RESULT_OK) { onStartVpn(); return; } - if (requestCode == VPN_REQUEST_CODE) { - Log.e(TAG, "vpn service intent not allowed"); - onNativeStartFailedOnUIThread(String.format(getString(R.string.status_started_with_error_msg), "No permission to create VPN service"), true); - return; - } - super.onActivityResult(requestCode, resultCode, data); + Log.e(TAG, "vpn service intent not allowed"); + onNativeStartFailedOnUIThread(String.format(getString(R.string.status_started_with_error_msg), "No permission to create VPN service"), true); } public void onStartVpn() { @@ -404,7 +400,7 @@ public class MainActivity extends AppCompatActivity { public void onOptionsClicked(View view) { // opening a new intent to open settings activity. Intent intent = new Intent(MainActivity.this, SettingsActivity.class); - startActivityForResult(intent, SETTINGS_REQUEST_CODE); + optionActivityResultLauncher.launch(intent); } private native long tun2ProxyInit(String proxy_url, int tun_fd, int tun_mtu, int log_level, boolean dns_over_tcp); @@ -427,19 +423,16 @@ public class MainActivity extends AppCompatActivity { TimerTask mRefreshTimerTask = new TimerTask() { @Override public void run() { - handler.post(new Runnable() { - @Override - public void run() { - if (state != NativeMachineState.STARTED) { - return; - } - long[] result = getRealtimeTransferRate(); - TextView statusTextView = findViewById(R.id.statusTextView); - statusTextView.setText(String.format(getString(R.string.status_started_with_rate), - result[0], - humanReadableByteCountBin(result[1]), - humanReadableByteCountBin(result[2]))); + handler.post(() -> { + if (state != NativeMachineState.STARTED) { + return; } + long[] result = getRealtimeTransferRate(); + TextView statusTextView = findViewById(R.id.statusTextView); + statusTextView.setText(String.format(getString(R.string.status_started_with_rate), + result[0], + humanReadableByteCountBin(result[1]), + humanReadableByteCountBin(result[2]))); }); } diff --git a/yass/android/yass/src/main/java/it/gui/yass/YassVpnService.java b/yass/android/yass/src/main/java/it/gui/yass/YassVpnService.java index 6310f89025..af083adc0f 100644 --- a/yass/android/yass/src/main/java/it/gui/yass/YassVpnService.java +++ b/yass/android/yass/src/main/java/it/gui/yass/YassVpnService.java @@ -12,11 +12,11 @@ import android.util.Log; public class YassVpnService extends VpnService { private static final String TAG = "YassVpnService"; - public static int DEFAULT_MTU = 1500; - private static String PRIVATE_VLAN4_CLIENT = "172.19.0.1"; - private static String PRIVATE_VLAN4_GATEWAY = "172.19.0.2"; - private static String PRIVATE_VLAN6_CLIENT = "fdfe:dcba:9876::1"; - private static String PRIVATE_VLAN6_GATEWAY = "fdfe:dcba:9876::2"; + public static final int DEFAULT_MTU = 1500; + private static final String PRIVATE_VLAN4_CLIENT = "172.19.0.1"; + private static final String PRIVATE_VLAN4_GATEWAY = "172.19.0.2"; + private static final String PRIVATE_VLAN6_CLIENT = "fdfe:dcba:9876::1"; + private static final String PRIVATE_VLAN6_GATEWAY = "fdfe:dcba:9876::2"; public ParcelFileDescriptor connect(String session_name, Context context, int local_port) { Builder builder = new Builder(); @@ -56,12 +56,7 @@ public class YassVpnService extends VpnService { @Override public void onRevoke() { Log.e(TAG, "onRevoke"); - MainActivity.self.runOnUiThread(new Runnable() { - @Override - public void run() { - MainActivity.self.onStopVpn(); - } - }); + MainActivity.self.runOnUiThread(() -> MainActivity.self.onStopVpn()); // super.onRevoke() is invoked in onStopVpn } } diff --git a/yass/third_party/googletest/BUILD.bazel b/yass/third_party/googletest/BUILD.bazel index e407ae29f4..0306468e7f 100644 --- a/yass/third_party/googletest/BUILD.bazel +++ b/yass/third_party/googletest/BUILD.bazel @@ -138,19 +138,19 @@ cc_library( }), deps = select({ ":has_absl": [ - "@com_google_absl//absl/container:flat_hash_set", - "@com_google_absl//absl/debugging:failure_signal_handler", - "@com_google_absl//absl/debugging:stacktrace", - "@com_google_absl//absl/debugging:symbolize", - "@com_google_absl//absl/flags:flag", - "@com_google_absl//absl/flags:parse", - "@com_google_absl//absl/flags:reflection", - "@com_google_absl//absl/flags:usage", - "@com_google_absl//absl/strings", - "@com_google_absl//absl/types:any", - "@com_google_absl//absl/types:optional", - "@com_google_absl//absl/types:variant", - "@com_googlesource_code_re2//:re2", + "@abseil-cpp//absl/container:flat_hash_set", + "@abseil-cpp//absl/debugging:failure_signal_handler", + "@abseil-cpp//absl/debugging:stacktrace", + "@abseil-cpp//absl/debugging:symbolize", + "@abseil-cpp//absl/flags:flag", + "@abseil-cpp//absl/flags:parse", + "@abseil-cpp//absl/flags:reflection", + "@abseil-cpp//absl/flags:usage", + "@abseil-cpp//absl/strings", + "@abseil-cpp//absl/types:any", + "@abseil-cpp//absl/types:optional", + "@abseil-cpp//absl/types:variant", + "@re2//:re2", ], "//conditions:default": [], }) + select({ diff --git a/yass/third_party/googletest/MODULE.bazel b/yass/third_party/googletest/MODULE.bazel index b179fe93bb..8df73fba23 100644 --- a/yass/third_party/googletest/MODULE.bazel +++ b/yass/third_party/googletest/MODULE.bazel @@ -40,14 +40,12 @@ module( # Please keep the versions in sync with the versions in the WORKSPACE file. bazel_dep(name = "abseil-cpp", - version = "20240116.2", - repo_name = "com_google_absl") + version = "20240116.2") bazel_dep(name = "platforms", version = "0.0.10") bazel_dep(name = "re2", - repo_name = "com_googlesource_code_re2", version = "2024-07-02") bazel_dep(name = "rules_python", diff --git a/yass/third_party/googletest/WORKSPACE b/yass/third_party/googletest/WORKSPACE index 218e6c2e8c..63f76813ce 100644 --- a/yass/third_party/googletest/WORKSPACE +++ b/yass/third_party/googletest/WORKSPACE @@ -1,4 +1,34 @@ -workspace(name = "com_google_googletest") +# Copyright 2024 Google Inc. +# All Rights Reserved. +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following disclaimer +# in the documentation and/or other materials provided with the +# distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived from +# this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +workspace(name = "googletest") load("//:googletest_deps.bzl", "googletest_deps") googletest_deps() diff --git a/yass/third_party/googletest/googletest_deps.bzl b/yass/third_party/googletest/googletest_deps.bzl index 65fc48c364..281af5c06f 100644 --- a/yass/third_party/googletest/googletest_deps.bzl +++ b/yass/third_party/googletest/googletest_deps.bzl @@ -6,17 +6,17 @@ load("//:fake_fuchsia_sdk.bzl", "fake_fuchsia_sdk") def googletest_deps(): """Loads common dependencies needed to use the googletest library.""" - if not native.existing_rule("com_googlesource_code_re2"): + if not native.existing_rule("re2"): http_archive( - name = "com_googlesource_code_re2", + name = "re2", sha256 = "eb2df807c781601c14a260a507a5bb4509be1ee626024cb45acbd57cb9d4032b", strip_prefix = "re2-2024-07-02", urls = ["https://github.com/google/re2/releases/download/2024-07-02/re2-2024-07-02.tar.gz"], ) - if not native.existing_rule("com_google_absl"): + if not native.existing_rule("abseil-cpp"): http_archive( - name = "com_google_absl", + name = "abseil-cpp", sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc", strip_prefix = "abseil-cpp-20240116.2", urls = ["https://github.com/abseil/abseil-cpp/releases/download/20240116.2/abseil-cpp-20240116.2.tar.gz"], diff --git a/yass/third_party/sqlite/CMakeLists.txt b/yass/third_party/sqlite/CMakeLists.txt index a42b0c4cb5..59b9bcafbe 100644 --- a/yass/third_party/sqlite/CMakeLists.txt +++ b/yass/third_party/sqlite/CMakeLists.txt @@ -281,8 +281,8 @@ set(sqlite_chromium_configuration_flags target_compile_definitions(sqlite PUBLIC ${sqlite_chromium_configuration_flags}) if (APPLE) - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -framework CoreFoundation -framework CoreServices") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreFoundation -framework CoreServices") + target_link_libraries(sqlite PRIVATE -Wl,-framework,CoreFoundation) + target_link_libraries(sqlite PRIVATE -Wl,-framework,CoreServices) endif() if (ANDROID)