Commit Graph

342 Commits

  • feat(clippy): cognitive-complexity rule (#5215)
    * feat(config): enhance configuration initialization and validation process
    
    * refactor(profile): streamline profile update logic and enhance error handling
    
    * refactor(config): simplify profile item checks and streamline update flag processing
    
    * refactor(disney_plus): add cognitive complexity allowance for check_disney_plus function
    
    * refactor(enhance): restructure configuration and profile item handling for improved clarity and maintainability
    
    * refactor(tray): add cognitive complexity allowance for create_tray_menu function
    
    * refactor(config): add cognitive complexity allowance for patch_config function
    
    * refactor(profiles): simplify item removal logic by introducing take_item_file_by_uid helper function
    
    * refactor(profile): add new validation logic for profile configuration syntax
    
    * refactor(profiles): improve formatting and readability of take_item_file_by_uid function
    
    * refactor(cargo): change cognitive complexity level from warn to deny
    
    * refactor(cargo): ensure cognitive complexity is denied in Cargo.toml
    
    * refactor(i18n): clean up imports and improve code readability
    refactor(proxy): simplify system proxy toggle logic
    refactor(service): remove unnecessary `as_str()` conversion in error handling
    refactor(tray): modularize tray menu creation for better maintainability
    
    * refactor(tray): update menu item text handling to use references for improved performance
  • chore(deps): update cargo dependencies (#5217)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • feat: add signal handling for graceful shutdown on Windows and Unix (#5023)
    * feat: add signal handling for graceful shutdown on Windows and Unix
    
    Co-authored-by: oomeow <oomeow@outlook.com>
    
    * chore: update Cargo.lock
    
    * fix(windows): restore shutdown hook build by enabling missing Win32 APIs and removing stray tracing call
    
    Includes the required windows-sys feature expansions and replaces a leftover tracing reference so the Windows shutdown hook builds successfully.
    
    * fix: add deprecation warnings for encrypt_data and decrypt_data functions
    
    ---------
    
    Co-authored-by: oomeow <oomeow@outlook.com>
    Co-authored-by: Slinetrac <realakayuki@gmail.com>
  • chore(deps): update cargo dependencies (#5210)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update cargo dependencies (#5169)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • refactor: replace unwrap_or with unwrap_or_else for improved error handling (#5163)
    In Rust, the `or` and `or_else` methods have distinct behavioral differences. The `or` method always eagerly evaluates its argument and executes any associated function calls. This can lead to unnecessary performance costs—especially in expensive operations like string processing or file handling—and may even trigger unintended side effects.
    
    In contrast, `or_else` evaluates its closure lazily, only when necessary. Introducing a Clippy lint to disallow `or` sacrifices a bit of code simplicity but ensures predictable behavior and enforces lazy evaluation for better performance.
  • perf: utilize smartstring for string handling (#5149)
    * perf: utilize smartstring for string handling
    
    - Updated various modules to replace standard String with smartstring::alias::String for improved performance and memory efficiency.
    - Adjusted string manipulations and conversions throughout the codebase to ensure compatibility with the new smartstring type.
    - Enhanced readability and maintainability by using `.into()` for conversions where applicable.
    - Ensured that all instances of string handling in configuration, logging, and network management leverage the benefits of smartstring.
    
    * fix: replace wrap_err with stringify_err for better error handling in UWP tool invocation
    
    * refactor: update import path for StringifyErr and adjust string handling in sysopt
    
    * fix: correct import path for CmdResult in UWP module
    
    * fix: update argument type for execute_sysproxy_command to use std::string::String
    
    * fix: add missing CmdResult import in UWP platform module
    
    * fix: improve string handling and error messaging across multiple files
    
    * style: format code for improved readability and consistency across multiple files
    
    * fix: remove unused file
  • chore(deps): update rust crate boa_engine to 0.21.0 (#5159)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • build: optimize release profile for better performance
    Upstream Tauri fixed the stack overflow in the invoke handler
    (https://github.com/tauri-apps/tauri/pull/14170) in v2.9.0,
    so we can safely use opt-level 3 now.
  • chore(deps): update cargo dependencies (#5141)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate gethostname to 1.1.0 (#5065)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate getrandom to 0.3.4 (#5064)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate tokio to 1.48.0 (#5063)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • feat: add Clippy alias commands and improve build process for Clippy integration (#5055)
    * feat: add Clippy alias commands and improve build process for Clippy integration
    
    * fix(lint-clippy): update Clippy run command to use working directory for src-tauri
  • chore(deps): update cargo dependencies (#5048)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • Squashed commit of the following:
    commit 2a9f2f20e9c6d88c2f96fd40589740e1f236f64a
    Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
    Date:   Mon Oct 13 11:07:31 2025 +0800
    
        fix: improve message handling in CommandEvent logging with CompactString
    
    commit c77fc18accefeaf471594035d61bd13e235c87d6
    Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
    Date:   Mon Oct 13 10:47:16 2025 +0800
    
        fix: optimize shared writer locking in CommandEvent handling
    
    commit d5286ee5f1612f17b7a97eead84d430669816d98
    Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
    Date:   Mon Oct 13 10:30:19 2025 +0800
    
        feat: integrate CompactString for improved logging and dependency management
    
    commit 951fb2b120ce159c00dc57d43c5a519990f34cee
    Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
    Date:   Mon Oct 13 09:39:29 2025 +0800
    
        refactor: remove write_sidecar_log function and streamline logging in CommandEvent handling
    
    commit fd48d66c55a2c62fd32741fd3c65cc06d4cc693f
    Author: Tunglies <77394545+Tunglies@users.noreply.github.com>
    Date:   Mon Oct 13 09:38:05 2025 +0800
    
        Revert "refactor(core): stabilize 'static backing for sidecar logging"
    
        This reverts commit fe7eb59f18.
  • Revert "fix: improve Service connection method and permissions for Windows and Unix"
    This reverts commit 601e99f0b5.
    
    Revert "refactor: clash-verge-rev-service-ipc (#4841)"
    
    This reverts commit 5370bd45ed.
  • refactor: clash-verge-rev-service-ipc (#4841)
    * feat: update service installation scripts and IPC integration
    
    - Updated `Cargo.toml` to use version 2.0.8 of `clash_verge_service_ipc` with "client" feature.
    - Renamed service installation and uninstallation scripts in `post-install.sh` and `pre-remove.sh`.
    - Removed `service_ipc` module and refactored IPC handling in `service.rs` to use the new `clash_verge_service_ipc` directly.
    - Adjusted service version checking and core management to align with the new IPC structure.
    - Simplified directory checks in `dirs.rs` and updated logging configurations in `init.rs`.
    - Updated Linux configuration file to reflect new script names.
    - Enhanced service installer hook to manage state more effectively.
    
    * refactor: simplify ClashConfig instantiation and remove unused service log file function
    
    * feat: update clash_verge_service_ipc to version 2.0.9 and enhance service initialization logging
    
    * chore: update clash_verge_service_ipc to version 2.0.10 and refactor async service manager initialization
    
    * fix: update clash_verge_service_ipc to version 2.0.11 and improve service manager initialization
    
    * fix: increase sleep duration for socket readiness check to improve stability
    
    * fix: update clash_verge_service_ipc to version 2.0.12 and kode-bridge to version 0.3.4; refactor service management and IPC path checks
    
    * fix: update clash_verge_service_ipc to version 2.0.13; refactor service connection and initialization logic
  • chore(deps): update rust crate regex to 1.12.1 (#5017)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate libc to 0.2.177 (#5003)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate zip to v6 (#5000)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate flexi_logger to 0.31.7 (#4986)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update rust crate flexi_logger to 0.31.6 (#4979)
    * chore(deps): update rust crate flexi_logger to 0.31.6
    
    * chore: up lock
    
    ---------
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Slinetrac <realakayuki@gmail.com>
  • refactor: invock mihomo api by use tauri-plugin-mihomo (#4926)
    * feat: add tauri-plugin-mihomo
    
    * refactor: invock mihomo api by use tauri-plugin-mihomo
    
    * chore: todo
    
    * chore: update
    
    * chore: update
    
    * chore: update
    
    * chore: update
    
    * fix: incorrect delay status and update pretty config
    
    * chore: update
    
    * chore: remove cache
    
    * chore: update
    
    * chore: update
    
    * fix: app freezed when change group proxy
    
    * chore: update
    
    * chore: update
    
    * chore: add rustfmt.toml to tauri-plugin-mihomo
    
    * chore: happy clippy
    
    * refactor: connect mihomo websocket
    
    * chore: update
    
    * chore: update
    
    * fix: parse bigint to number
    
    * chore: update
    
    * Revert "fix: parse bigint to number"
    
    This reverts commit 74c006522e.
    
    * chore: use number instead of bigint
    
    * chore: cleanup
    
    * fix: rule data not refresh when switch profile
    
    * chore: update
    
    * chore: cleanup
    
    * chore: update
    
    * fix: traffic graph data display
    
    * feat: add ipc connection pool
    
    * chore: update
    
    * chore: clippy
    
    * fix: incorrect delay status
    
    * fix: typo
    
    * fix: empty proxies tray menu
    
    * chore: clippy
    
    * chore: import tauri-plugin-mihomo by using git repo
    
    * chore: cleanup
    
    * fix: mihomo api
    
    * fix: incorrect delay status
    
    * chore: update tauri-plugin-mihomo dep
    
    chore: update
  • chore(deps): update rust crate flexi_logger to 0.31.5 (#4965)
    * chore(deps): update rust crate flexi_logger to 0.31.5
    
    * chore: up lock
    
    ---------
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Slinetrac <realakayuki@gmail.com>
  • chore(deps): update cargo dependencies (#4899)
    * chore(deps): update cargo dependencies
    
    * chore: up lock
    
    ---------
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    Co-authored-by: Slinetrac <realakayuki@gmail.com>
  • chore(deps): update cargo dependencies (#4842)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • chore(deps): update cargo dependencies (#4796)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • fix: Cargo.toml dependencies option (#4805)
    * chore: update cargo lock
    
    * refactor: streamline dependency declarations in Cargo.toml
    
    * refactor: reorder import statements and comment out Cargo.toml version update
    
    * fix: enable Cargo version update in release script and update tauri-plugin-devtools dependency
  • refactor: enhance logging system and add new development commands (#4803)
    * refactor: enhance logging system and add new development commands
    
    * refactor: add cfg-if dependency and improve logging configuration
  • refactor: clash-verge-service management (#4674)
    * refactor: clash-verge-service management
    
    * fix: correct service state checks in ProxyControlSwitches component
    refactor: improve logging in service state update functions
    
    * fix: add missing async handler for Windows and adjust logging import for macOS
    
    * fix: streamline logging imports and add missing async handler for Windows
    
    * refactor: remove unused useServiceStateSync hook and update imports in _layout
    
    * refactor: remove unused useServiceStateSync import and clean up code in ProxyControlSwitches and _layout
    
    * refactor: simplify service status checks and reduce wait time in useServiceInstaller hook
    
    * refactor: remove unnecessary logging statements in service checks and IPC connection
    
    * refactor: extract SwitchRow component for better code organization and readability
    
    * refactor: enhance service state management and update related mutations in layout
    
    * refactor: streamline core stopping logic and improve IPC connection logging
    
    * refactor: consolidate service uninstallation logic and improve error handling
    
    * fix: simplify conditional statements in CoreManager and service functions
    
    * feat: add backoff dependency and implement retry strategy for IPC requests
    
    * refactor: remove redundant Windows conditional and improve error handling in IPC tests
    
    * test: improve error handling in IPC tests for message signing and verification
    
    * fix: adjust IPC backoff retry parameters
    
    * refactor: Remove service state tracking and related logic from service management
    
    * feat: Enhance service status handling with logging and running mode updates
    
    * fix: Improve service status handling with enhanced error logging
    
    * fix: Ensure proper handling of service operations with error propagation
    
    * refactor: Simplify service operation execution and enhance service status handling
    
    * fix: Improve error message formatting in service operation execution and simplify service status retrieval
    
    * refactor: Replace Cache with CacheProxy in multiple modules and update CacheEntry to be generic
    
    * fix: Remove unnecessary success message from config validation
    
    * refactor: Comment out logging statements in service version check and IPC request handling
  • chore(deps): update cargo dependencies (#4687)
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
  • edition 2024 (#4702)
    * feat: update Cargo.toml for 2024 edition and optimize release profiles
    
    * feat: refactor environment variable settings for Linux and improve code organization
    
    * Refactor conditional statements to use `&&` for improved readability
    
    - Updated multiple files to combine nested `if let` statements using `&&` for better clarity and conciseness.
    - This change enhances the readability of the code by reducing indentation levels and making the conditions more straightforward.
    - Affected files include: media_unlock_checker.rs, profile.rs, clash.rs, profiles.rs, async_proxy_query.rs, core.rs, handle.rs, hotkey.rs, service.rs, timer.rs, tray/mod.rs, merge.rs, seq.rs, config.rs, proxy.rs, window.rs, general.rs, dirs.rs, i18n.rs, init.rs, network.rs, and window.rs in the resolve module.
    
    * refactor: streamline conditional checks using `&&` for improved readability
    
    * fix: update release profile settings for panic behavior and optimization
    
    * fix: adjust optimization level in Cargo.toml and reorder imports in lightweight.rs
  • feat: update Cargo.toml for 2024 edition and optimize release profiles (#4681)
    * feat: update Cargo.toml for 2024 edition and optimize release profiles
    
    * feat: refactor environment variable settings for Linux and improve code organization
    
    * Refactor conditional statements to use `&&` for improved readability
    
    - Updated multiple files to combine nested `if let` statements using `&&` for better clarity and conciseness.
    - This change enhances the readability of the code by reducing indentation levels and making the conditions more straightforward.
    - Affected files include: media_unlock_checker.rs, profile.rs, clash.rs, profiles.rs, async_proxy_query.rs, core.rs, handle.rs, hotkey.rs, service.rs, timer.rs, tray/mod.rs, merge.rs, seq.rs, config.rs, proxy.rs, window.rs, general.rs, dirs.rs, i18n.rs, init.rs, network.rs, and window.rs in the resolve module.
    
    * refactor: streamline conditional checks using `&&` for improved readability