Commit Graph

30 Commits

  • 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>
  • 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
  • fix: simplify conditional checks and improve async handler usage across multiple files (#5156)
    * fix: simplify conditional checks and improve async handler usage across multiple files
    
    * fix: add missing AsyncHandler import in find_processes_by_name function
    
    * fix: remove redundant AsyncHandler import in find_processes_by_name function
  • 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
  • Refactor logging macros to remove print control parameter
    - Updated logging macros to eliminate the boolean parameter for print control, simplifying the logging calls throughout the codebase.
    - Adjusted all logging calls in various modules (lib.rs, lightweight.rs, help.rs, init.rs, logging.rs, resolve/mod.rs, resolve/scheme.rs, resolve/ui.rs, resolve/window.rs, server.rs, singleton.rs, window_manager.rs) to reflect the new macro structure.
    - Ensured consistent logging behavior across the application by standardizing the logging format.
  • 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
  • fix: implement proper error handling for "Restart App" failures (#4951)
    * fix: implement proper error handling for "Restart App" failures
    
    * fix: make clippy happy
  • fix(init): ensure runtime config is ready before core manager startup (#4942)
    * fix(init): ensure runtime config is ready before core manager startup
    
    * refactor: simplify verify_config_initialization function
  • 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: window handle usage (#4788)
    * refactor: Remove unused UI reset function and streamline window creation logic
    
    * refactor: Remove debug print statements and streamline lightweight mode initialization
    
    * fix: Ensure tray status refresh during silent startup and lightweight mode entry is independent of window creation
    
    * refactor: Simplify window creation process and remove debug print statements
  • 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
  • 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
  • refactor: restructure async initialization and standardize logging system
    ### Major Improvements
    
    - **Async initialization refactoring**: Complete async migration of init_config, improving app startup performance and stability
      - Change init_work_config from blocking to async execution
      - Optimize error handling for directory creation and config file initialization
      - Enhance structure and robustness of initialization process
    
    - **Logging system standardization**: Unify usage of project's built-in logging! macro
      - Replace all log::info!/warn!/error!/debug! with logging!(level, Type::Setup, true, ...) format
      - Maintain consistency in log categorization and formatting
      - Improve convenience for log tracking and debugging
    
    ### Technical Optimizations
    
    - **Error handling improvements**: Remove crate::log_err! macro, use standard Result error propagation
    - **Directory management optimization**: Refactor ensure_directories function with clearer directory creation logic
    - **Config initialization enhancement**: Separate initialize_config_files function for better code maintainability
    - **Async task management**: Use AsyncHandler::spawn to optimize background log cleanup tasks
    
    ### Bug Fixes
    
    - Fix potential race conditions in async config initialization
    - Improve error feedback and logging during app startup
    - Enhance error handling for DNS config and resource file initialization
    
    ### Updates
    
    - Update wording in UPDATELOG.md issue descriptions
  • refactor: enhance async initialization and streamline setup process (#4560)
    * feat: Implement DNS management for macOS
    
    - Added `set_public_dns` and `restore_public_dns` functions in `dns.rs` to manage system DNS settings.
    - Introduced `resolve` module to encapsulate DNS and scheme resolution functionalities.
    - Implemented `resolve_scheme` function in `scheme.rs` to handle deep links and profile imports.
    - Created UI readiness management in `ui.rs` to track and update UI loading states.
    - Developed window management logic in `window.rs` to handle window creation and visibility.
    - Added initial loading overlay script in `window_script.rs` for better user experience during startup.
    - Updated server handling in `server.rs` to integrate new resolve functionalities.
    - Refactored window creation calls in `window_manager.rs` to use the new window management logic.
    
    * refactor: streamline asynchronous handling in config and resolve setup
    
    * Revert "refactor: streamline asynchronous handling in config and resolve setup"
    
    This reverts commit 23d7dc86d5.
    
    * fix: optimize asynchronous memory handling
    
    * fix: enhance task logging by adding size check for special cases
    
    * refactor: enhance async initialization and streamline setup process
    
    * refactor: optimize async setup by consolidating initialization tasks
    
    * chore: update changelog for Mihomo(Meta) kernel upgrade to v1.19.13
    
    * fix: improve startup phase initialization performance
    
    * refactor: optimize file read/write performance to reduce application wait time
    
    * refactor: simplify app instance exit logic and adjust system proxy guard initialization
    
    * refactor: change resolve_setup_async to synchronous execution for improved performance
    
    * refactor: update resolve_setup_async to accept AppHandle for improved initialization flow
    
    * refactor: remove unnecessary initialization of portable flag in run function
    
    * refactor: consolidate async initialization tasks into a single blocking call for improved execution flow
    
    * refactor: optimize resolve_setup_async by restructuring async tasks for improved concurrency
    
    * refactor: streamline resolve_setup_async and embed_server for improved async handling
    
    * refactor: separate synchronous and asynchronous setup functions for improved clarity
    
    * refactor: simplify async notification handling and remove redundant network manager initialization
    
    * refactor: enhance async handling in proxy request cache and window creation logic
    
    * refactor: improve code formatting and readability in ProxyRequestCache
    
    * refactor: adjust singleton check timeout and optimize trace size conditions
    
    * refactor: update TRACE_SPECIAL_SIZE to include additional size condition
    
    * refactor: update kode-bridge dependency to version 0.2.1-rc2
    
    * refactor: replace RwLock with AtomicBool for UI readiness and implement event-driven monitoring
    
    * refactor: convert async functions to synchronous for window management
    
    * Update src-tauri/src/utils/resolve/window.rs
    
    * fix: handle missing app_handle in create_window function
    
    * Update src-tauri/src/module/lightweight.rs