Skip to content

fix(deps): Remove nosleep plugin and update dependencies - #114

Merged
YueMiyuki merged 4 commits into
masterfrom
next-dev
Jun 21, 2026
Merged

fix(deps): Remove nosleep plugin and update dependencies#114
YueMiyuki merged 4 commits into
masterfrom
next-dev

Conversation

@YueMiyuki

@YueMiyuki YueMiyuki commented Jun 21, 2026

Copy link
Copy Markdown
Owner

Summary by cubic

Rebuilt browser cookie import with native, cross‑browser decryptors and migrated Rust logging to tracing. Adds a Windows elevation flow for Chrome v20 app‑bound cookies, removes the nosleep plugin and unused Tauri capabilities, bumps Rust MSRV to 1.85, and updates deps.

  • New Features

    • Native cookie extractor for Chromium/Firefox/Safari with OS‑level decryption and host filtering; hidden CLI extract-cookies for elevated runs on Windows.
    • import_browser_cookies returns "ELEVATION_REQUIRED" to trigger UAC retry on Windows.
  • Refactors

    • Switched from log to tracing across engine/BT/CLI/NAPI; removed tauri-plugin-nosleep-api and related UI/command code; trimmed Tauri capabilities (dropped fs/process/os/notification).
    • Dependency updates: @tauri-apps/api 2.11.1, @tauri-apps/cli 2.11.3, @lucide/vue 1.21.0, reka-ui 2.10.0, @types/node 26, suppaftp 9; Rust MSRV -> 1.85.

Written for commit ad9d09b. Summary will update on new commits.

Review in cubic

Summary by CodeRabbit

  • New Features
    • Added cookie extraction for Chrome/Chromium, Firefox, and Safari, including optional host filtering and browser-specific decryption/master-key handling.
    • Added a CLI extract-cookies subcommand to output cookies by browser and URL, with Windows elevation flow when required.
  • Chores
    • Migrated app and engine logging from log to tracing.
    • Updated dependency/toolchain versions.
    • Reduced default Tauri permissions and removed no-sleep plugin integration from both the backend and UI.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

The PR rewrites cookie extraction from a rookie-backed façade to per-browser SQLite readers (Chromium, Firefox, Safari) with per-OS decryption (Windows AES-GCM/DPAPI, macOS Keychain/AES-CBC, Linux D-Bus/AES-CBC), adds a CLI extract-cookies subcommand and Windows UAC elevation path, removes tauri-plugin-nosleep and consolidates sleep inhibit into a single on_download_status_change command, strips filesystem/process/OS/notification capabilities, and migrates all log::* calls to tracing::* across the workspace.

Changes

Cookie Extraction Rewrite

Layer / File(s) Summary
Dependencies, path utilities, and timestamp helpers
src-tauri/risuko-cookies/Cargo.toml, src-tauri/risuko-cookies/src/utils/*, src-tauri/risuko-cookies/src/utils/paths.rs, src-tauri/risuko-cookies/src/utils/time.rs
Adds eyre, glob, tempfile, rusqlite, and per-OS crypto crates (aes, cbc, cipher, pbkdf2, sha1, hmac, aes-gcm, windows-sys, security-framework, zbus). Introduces cross-platform path expansion/glob helpers and WebKit/Safari timestamp converters.
Browser backends: Chromium, Firefox, Safari
src-tauri/risuko-cookies/src/browser/mod.rs, src-tauri/risuko-cookies/src/browser/chromium.rs, src-tauri/risuko-cookies/src/browser/firefox.rs, src-tauri/risuko-cookies/src/browser/safari.rs
Adds Cookie and BrowserConfig types for Chromium-family (Chrome/Edge/Brave/Vivaldi/Opera/Arc), Firefox-family (Firefox/LibreWolf/Zen), and macOS Safari. Each backend implements extract_cookies with SQLite DB copy, domain-coverage filtering, optional host matching, and tracing instrumentation.
OS-specific master-key extraction and cookie decryption
src-tauri/risuko-cookies/src/platform/mod.rs, src-tauri/risuko-cookies/src/platform/windows.rs, src-tauri/risuko-cookies/src/platform/macos.rs, src-tauri/risuko-cookies/src/platform/linux.rs
Windows: AES-256-GCM (v10), elevation stub (v20), DPAPI fallback, Local State JSON key extraction. macOS: AES-128-CBC v10 with Keychain. Linux: AES-128-CBC v10 with D-Bus Secret Service. Defines ELEVATION_REQUIRED constant.
risuko-cookies lib.rs façade rewrite
src-tauri/risuko-cookies/src/lib.rs
Removes rookie, adds ELEVATION_REQUIRED re-export, rewrites list_browsers/cookies_for_host/cookies_for_url to dispatch to per-browser extract_cookies, adds HostCookies serde container, removes RFC6265 post-filter helpers.
CLI extract-cookies subcommand
src-tauri/src/cli/mod.rs, src-tauri/src/cli/commands.rs
Adds ExtractCookies(ExtractCookiesArgs) with --browser, --url, --out flags. Adds async command implementation writing JSON to file or stdout.
cookie_cmds: ELEVATION_REQUIRED handling and Windows UAC elevation
src-tauri/src/commands/cookie_cmds.rs, src-tauri/src/lib.rs
import_browser_cookies intercepts ELEVATION_REQUIRED errors. Adds Windows-only elevate module that relaunches the binary via ShellExecuteExW runas, reads a temporary JSON output file, and deserializes HostCookies. Registers import_browser_cookies_elevated in the Tauri command table.

nosleep Removal and Sleep Inhibit Consolidation

Layer / File(s) Summary
Dependency, capability, and plugin removal
package.json, src-tauri/Cargo.toml, src-tauri/capabilities/default.json, src-tauri/capabilities/desktop.json, src-tauri/src/lib.rs
Removes tauri-plugin-nosleep from Cargo.toml Unix deps, nosleep:* from desktop.json, and fs/process/os/notification permissions from default.json. Drops corresponding plugins from the Tauri builder and removes set_sleep_inhibit_flag from the invoke handler.
Sleep inhibit command consolidation and frontend simplification
src-tauri/src/commands/event_cmds.rs, src/renderer/components/Native/EngineClient.vue
Replaces set_sleep_inhibit_flag with on_download_status_change in event_cmds.rs. EngineClient.vue removes nosleep plugin import, noSleepSource state, and branching logic—setNoSleepState now only invokes on_download_status_change.

log → tracing Migration

Layer / File(s) Summary
Cargo: remove log, add tracing
src-tauri/Cargo.toml, src-tauri/risuko-bt/Cargo.toml, src-tauri/risuko-cli/Cargo.toml, src-tauri/risuko-engine/Cargo.toml, src-tauri/risuko-napi/Cargo.toml
Removes log from workspace and per-crate Cargo.toml files; adds tracing = "0.1" to each affected crate. Also bumps suppaftp 8→9.
log→tracing in risuko-bt and risuko-engine
src-tauri/risuko-bt/src/*, src-tauri/risuko-engine/src/**/*
Mechanical replacement of log::* macros with tracing::* across all modules in risuko-bt and risuko-engine. One log::log_enabled! guard replaced with tracing::enabled!.
log→tracing in the Tauri app layer
src-tauri/src/bridge.rs, src-tauri/src/cli/headless.rs, src-tauri/src/commands/*, src-tauri/src/lib.rs, src-tauri/src/managers/*, src-tauri/src/state.rs, src-tauri/risuko-napi/src/lib.rs
Mechanical replacement of log::* macros with tracing::* across the Tauri application crate and risuko-napi.

Sequence Diagram(s)

sequenceDiagram
    participant Renderer
    participant import_browser_cookies
    participant cookies_for_url
    participant platform_decrypt
    participant elevate_module

    Renderer->>import_browser_cookies: invoke("import_browser_cookies", {browser, url})
    import_browser_cookies->>cookies_for_url: cookies_for_url(browser, url)
    cookies_for_url->>platform_decrypt: extract_master_key + decrypt_value
    alt v20 encrypted (admin Chrome)
        platform_decrypt-->>cookies_for_url: Err(ELEVATION_REQUIRED)
        cookies_for_url-->>import_browser_cookies: Err("risuko:elevation-required")
        import_browser_cookies-->>Renderer: Err("ELEVATION_REQUIRED")
        Renderer->>import_browser_cookies: invoke("import_browser_cookies_elevated")
        import_browser_cookies->>elevate_module: elevate::import_elevated(browser, url)
        elevate_module->>elevate_module: ShellExecuteExW runas extract-cookies --out tmpfile
        elevate_module-->>import_browser_cookies: HostCookies
        import_browser_cookies-->>Renderer: ImportedCookies
    else normal decryption succeeds
        platform_decrypt-->>cookies_for_url: Vec<Cookie>
        cookies_for_url-->>import_browser_cookies: HostCookies
        import_browser_cookies-->>Renderer: ImportedCookies
    end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

  • YueMiyuki/Risuko#83: Modifies the same src-tauri/Cargo.toml and Tauri capability JSON files to adjust tauri-plugin-nosleep / nosleep:* wiring for non-Android vs desktop targets, directly overlapping with this PR's nosleep removal.
  • YueMiyuki/Risuko#85: Both PRs touch the Tauri sleep-inhibition setup by modifying related desktop capability permissions and the integration points for tauri-plugin-nosleep, so the changes overlap at the same UI/plugin/capability level.
  • YueMiyuki/Risuko#57: Main PR's removal of the sleep-inhibition path directly changes the same sleep-inhibit integration points that PR #57 adds for the new /health panel, affecting the overall inhibit behavior coordination.

Poem

🐇 Hop, hop! The rookie is gone at last,
Each browser's cookie jar cracked open fast,
AES keys from D-Bus and Keychain gleam,
The nosleep plugin fades like a fading dream.
log::warn! replaced by tracing's glow,
This bunny's code review says: let it go! 🍪

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Remove nosleep plugin and update dependencies' directly summarizes the main changes—removing the nosleep plugin and updating dependencies—which are the primary objectives of the PR.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 6

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src-tauri/risuko-cookies/Cargo.toml`:
- Line 36: The aes-gcm dependency in the Cargo.toml file is pinned to a release
candidate version (0.11.0-rc.4) which should be avoided in production. Update
the aes-gcm dependency version from "0.11.0-rc.4" to "0.10.3" (the latest stable
release) while maintaining the existing features configuration ["aes", "alloc"].

In `@src-tauri/risuko-cookies/src/browser/chromium.rs`:
- Around line 217-233: The SELECT statement at line 217 is missing the `value`
column, and the row parsing logic skips any cookies where `encrypted_value` is
empty, discarding valid plaintext cookies. To fix this, add the `value` column
to the SELECT query, then update the `parse_row` function to capture both
`encrypted_value` and `value` columns. Modify the condition that checks
`raw.raw_value.is_empty()` to implement fallback logic: use the decrypted
`encrypted_value` when available, otherwise fall back to the plaintext `value`
column, and only skip the row when both columns are empty. Apply the same
changes to the similar code block mentioned in the "Also applies to" range.

In `@src-tauri/risuko-cookies/src/browser/firefox.rs`:
- Around line 110-123: The else branch in the cookie_covers_host function
incorrectly treats non-dot-prefixed cookie hosts as domain cookies that cover
subdomains. Host-only cookies without a leading dot should only match the exact
host. Remove the subdomain matching logic from the else branch by replacing the
condition `r == c || r.ends_with(&format!(".{c}"))` with just `r == c` to ensure
host-only cookies match only the exact request host.

In `@src-tauri/risuko-cookies/src/browser/safari.rs`:
- Around line 24-41: The current approach incorrectly uses defaults export which
outputs plist format, but then attempts to open the result as a SQLite database
with Connection::open(), which will fail since Safari's Cookies.binarycookies is
a proprietary binary format. Replace the defaults export command and
NamedTempFile approach with a dedicated binary cookie parser library that can
directly parse the Cookies.binarycookies format. Also ensure the command output
status is checked before proceeding to detect failures earlier. Consider using a
crate designed specifically for parsing Safari's binary cookie format rather
than attempting format conversion through defaults export.

In `@src-tauri/risuko-cookies/src/platform/linux.rs`:
- Around line 74-75: The OpenSession method is being called on the Collection
proxy at lines 74-75, but OpenSession is a method on the
org.freedesktop.Secret.Service interface located at /org/freedesktop/secrets,
not on Collection. Create a separate Service proxy using the zbus connection and
the /org/freedesktop/secrets path, then call the OpenSession method with
parameters ("plain", empty zvariant Value) on this Service proxy instead of on
the current Collection proxy to fix the D-Bus method-not-found error.

In `@src-tauri/risuko-cookies/src/utils/time.rs`:
- Around line 14-19: The safari_to_unix function has a unit mismatch issue where
it adds a seconds offset (978_307_200) directly to the timestamp value before
dividing by 1_000_000_000, treating the timestamp as if it's in nanoseconds. To
fix this in the function body, reorder the operations so that the timestamp is
first converted from nanoseconds to seconds by dividing by 1_000_000_000, and
then the Safari epoch offset (978_307_200 seconds) is added to produce the
correct UNIX timestamp in seconds.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 615a002b-c20d-407f-801e-1b9669d34189

📥 Commits

Reviewing files that changed from the base of the PR and between 70be12d and 4f144fa.

⛔ Files ignored due to path filters (2)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (65)
  • package.json
  • src-tauri/Cargo.toml
  • src-tauri/capabilities/default.json
  • src-tauri/capabilities/desktop.json
  • src-tauri/risuko-bt/Cargo.toml
  • src-tauri/risuko-bt/src/dht.rs
  • src-tauri/risuko-bt/src/lsd.rs
  • src-tauri/risuko-bt/src/magnet.rs
  • src-tauri/risuko-bt/src/peer/connection.rs
  • src-tauri/risuko-bt/src/session.rs
  • src-tauri/risuko-bt/src/torrent.rs
  • src-tauri/risuko-bt/src/upnp.rs
  • src-tauri/risuko-cli/Cargo.toml
  • src-tauri/risuko-cookies/Cargo.toml
  • src-tauri/risuko-cookies/src/browser/chromium.rs
  • src-tauri/risuko-cookies/src/browser/firefox.rs
  • src-tauri/risuko-cookies/src/browser/mod.rs
  • src-tauri/risuko-cookies/src/browser/safari.rs
  • src-tauri/risuko-cookies/src/lib.rs
  • src-tauri/risuko-cookies/src/platform/linux.rs
  • src-tauri/risuko-cookies/src/platform/macos.rs
  • src-tauri/risuko-cookies/src/platform/mod.rs
  • src-tauri/risuko-cookies/src/platform/windows.rs
  • src-tauri/risuko-cookies/src/utils/mod.rs
  • src-tauri/risuko-cookies/src/utils/paths.rs
  • src-tauri/risuko-cookies/src/utils/time.rs
  • src-tauri/risuko-engine/Cargo.toml
  • src-tauri/risuko-engine/src/config/mod.rs
  • src-tauri/risuko-engine/src/engine/cookie_store.rs
  • src-tauri/risuko-engine/src/engine/dns.rs
  • src-tauri/risuko-engine/src/engine/ed2k/download.rs
  • src-tauri/risuko-engine/src/engine/ed2k/server.rs
  • src-tauri/risuko-engine/src/engine/manager.rs
  • src-tauri/risuko-engine/src/engine/mod.rs
  • src-tauri/risuko-engine/src/engine/options.rs
  • src-tauri/risuko-engine/src/engine/rpc.rs
  • src-tauri/risuko-engine/src/engine/rss/mod.rs
  • src-tauri/risuko-engine/src/engine/session.rs
  • src-tauri/risuko-engine/src/engine/ssh_known_hosts.rs
  • src-tauri/risuko-engine/src/engine/torrent.rs
  • src-tauri/risuko-engine/src/engine/upload/manager.rs
  • src-tauri/risuko-engine/src/engine/upload/s3.rs
  • src-tauri/risuko-engine/src/engine/upload/sftp.rs
  • src-tauri/risuko-engine/src/engine/upload/webdav.rs
  • src-tauri/risuko-engine/src/traits.rs
  • src-tauri/risuko-napi/Cargo.toml
  • src-tauri/risuko-napi/src/lib.rs
  • src-tauri/src/bridge.rs
  • src-tauri/src/cli/commands.rs
  • src-tauri/src/cli/headless.rs
  • src-tauri/src/cli/mod.rs
  • src-tauri/src/commands/android_intent.rs
  • src-tauri/src/commands/app_cmds.rs
  • src-tauri/src/commands/completion_script_cmds.rs
  • src-tauri/src/commands/cookie_cmds.rs
  • src-tauri/src/commands/engine_cmds.rs
  • src-tauri/src/commands/event_cmds.rs
  • src-tauri/src/commands/file_cmds.rs
  • src-tauri/src/commands/rss_cmds.rs
  • src-tauri/src/commands/upload_cmds.rs
  • src-tauri/src/lib.rs
  • src-tauri/src/managers/flyout.rs
  • src-tauri/src/managers/vault.rs
  • src-tauri/src/state.rs
  • src/renderer/components/Native/EngineClient.vue
💤 Files with no reviewable changes (2)
  • src-tauri/capabilities/default.json
  • src-tauri/risuko-cli/Cargo.toml

hmac = "0.13"

[target.'cfg(target_os = "windows")'.dependencies]
aes-gcm = { version = "0.11.0-rc.4", features = ["aes", "alloc"] }

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🌐 Web query:

What is the latest stable version of the aes-gcm Rust crate?

💡 Result:

As of June 21, 2026, the latest stable version of the aes-gcm Rust crate is 0.10.3 [1][2][3]. While newer release candidate versions (such as 0.11.0-rc.4) are available on crates.io, they are not considered stable releases [1][3].

Citations:


Consider using stable aes-gcm 0.10.3 instead of release candidate 0.11.0-rc.4.

The dependency pins aes-gcm = "0.11.0-rc.4", a pre-release version. The latest stable release is 0.10.3, which is suitable for AES-256-GCM decryption. Avoid RC versions in production dependencies unless the RC-specific features are essential, as they may introduce breaking changes before final release.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/risuko-cookies/Cargo.toml` at line 36, The aes-gcm dependency in
the Cargo.toml file is pinned to a release candidate version (0.11.0-rc.4) which
should be avoided in production. Update the aes-gcm dependency version from
"0.11.0-rc.4" to "0.10.3" (the latest stable release) while maintaining the
existing features configuration ["aes", "alloc"].

Comment thread src-tauri/risuko-cookies/src/browser/chromium.rs Outdated
Comment on lines +110 to +123
// Modern Firefox stores domain cookies without a leading dot
fn cookie_covers_host(request_host: &str, cookie_host: &str) -> bool {
let r = request_host.to_lowercase();
let c = cookie_host.to_lowercase();

if c.starts_with('.') {
// Older Firefox: domain cookie with explicit leading dot
let domain = &c[1..];
r == domain || r.ends_with(&format!(".{domain}"))
} else {
// Modern Firefox: bare domain is a domain cookie (covers subdomains)
r == c || r.ends_with(&format!(".{c}"))
}
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🌐 Web query:

In current Firefox moz_cookies, how are host-only cookies represented in the host field, and is a non-leading-dot host always a domain cookie that should match subdomains?

💡 Result:

In the Firefox moz_cookies table, the host field stores the hostname for which a cookie is set [1][2]. Host-only cookies—those restricted to the exact host that set them—are represented in the host field as the full hostname without a leading dot [3][4][5]. Conversely, domain cookies (which are allowed to be sent to subdomains) are typically represented by including a leading dot in the host string (e.g., .example.com) [4][5][6]. Regarding your second question, a non-leading-dot host is not necessarily a domain cookie [4][5]. In Firefox, the presence of a leading dot is the primary indicator used to explicitly mark a cookie as a domain cookie [4][6]. A hostname without a leading dot is treated as a host-only cookie, meaning it should only be sent to the exact host that set it, not its subdomains [3][7][4]. Firefox uses this distinction to enforce scoping rules, where cookies lacking the leading dot are restricted to the specific host, while those with the leading dot (provided they meet valid domain requirements) are scoped to the domain and its subdomains [7][6][8].

Citations:


Fix host-only cookie matching logic.

The code incorrectly treats non-dot-prefixed hosts as domain cookies. In Firefox, host-only cookies (without leading dot) should match only the exact host, not subdomains. Update the else branch to use only r == c instead of r == c || r.ends_with(&format!(".{c}")).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/risuko-cookies/src/browser/firefox.rs` around lines 110 - 123, The
else branch in the cookie_covers_host function incorrectly treats
non-dot-prefixed cookie hosts as domain cookies that cover subdomains. Host-only
cookies without a leading dot should only match the exact host. Remove the
subdomain matching logic from the else branch by replacing the condition `r == c
|| r.ends_with(&format!(".{c}"))` with just `r == c` to ensure host-only cookies
match only the exact request host.

Comment thread src-tauri/risuko-cookies/src/browser/safari.rs Outdated
Comment thread src-tauri/risuko-cookies/src/platform/linux.rs Outdated
Comment on lines +14 to +19
pub fn safari_to_unix(timestamp: u64) -> Option<u64> {
if timestamp == 0 {
return None;
}
Some((timestamp + 978_307_200) / 1_000_000_000)
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Safari timestamp conversion is using mixed units.

Line 18 adds a seconds offset to a nanoseconds value before dividing, which produces incorrect UNIX expiry values.

Proposed fix
 #[cfg(target_os = "macos")]
 pub fn safari_to_unix(timestamp: u64) -> Option<u64> {
     if timestamp == 0 {
         return None;
     }
-    Some((timestamp + 978_307_200) / 1_000_000_000)
+    let secs_since_2001 = timestamp / 1_000_000_000;
+    secs_since_2001.checked_add(978_307_200)
 }
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
pub fn safari_to_unix(timestamp: u64) -> Option<u64> {
if timestamp == 0 {
return None;
}
Some((timestamp + 978_307_200) / 1_000_000_000)
}
pub fn safari_to_unix(timestamp: u64) -> Option<u64> {
if timestamp == 0 {
return None;
}
let secs_since_2001 = timestamp / 1_000_000_000;
secs_since_2001.checked_add(978_307_200)
}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/risuko-cookies/src/utils/time.rs` around lines 14 - 19, The
safari_to_unix function has a unit mismatch issue where it adds a seconds offset
(978_307_200) directly to the timestamp value before dividing by 1_000_000_000,
treating the timestamp as if it's in nanoseconds. To fix this in the function
body, reorder the operations so that the timestamp is first converted from
nanoseconds to seconds by dividing by 1_000_000_000, and then the Safari epoch
offset (978_307_200 seconds) is added to produce the correct UNIX timestamp in
seconds.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 67 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src-tauri/risuko-cookies/src/platform/macos.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/platform/macos.rs:29">
P1: macOS v10 cookie format parsed incorrectly: IV is not embedded after `v10`. This will fail/decode garbage for valid Chromium cookies.</violation>
</file>

<file name="src-tauri/risuko-cookies/src/browser/safari.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/browser/safari.rs:69">
P3: Domain matching logic is duplicated instead of shared. Future fixes may diverge across browsers and produce inconsistent filtering.</violation>
</file>

<file name="src-tauri/risuko-cookies/Cargo.toml">

<violation number="1" location="src-tauri/risuko-cookies/Cargo.toml:31">
P1: New crypto dependency versions require a higher Rust MSRV than the project’s documented minimum. This can break builds for users/CI pinned to Rust 1.77.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread src-tauri/risuko-cookies/src/utils/time.rs Outdated
Comment on lines +29 to +30
let iv: [u8; 16] = data[3..19].try_into()?;
let ciphertext = &data[19..];

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: macOS v10 cookie format parsed incorrectly: IV is not embedded after v10. This will fail/decode garbage for valid Chromium cookies.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src-tauri/risuko-cookies/src/platform/macos.rs, line 29:

<comment>macOS v10 cookie format parsed incorrectly: IV is not embedded after `v10`. This will fail/decode garbage for valid Chromium cookies.</comment>

<file context>
@@ -0,0 +1,48 @@
+    }
+
+    // v10 format: "v10" + 16-byte IV + ciphertext
+    let iv: [u8; 16] = data[3..19].try_into()?;
+    let ciphertext = &data[19..];
+
</file context>
Suggested change
let iv: [u8; 16] = data[3..19].try_into()?;
let ciphertext = &data[19..];
let iv = [b' '; 16];
let ciphertext = &data[3..];

Comment thread src-tauri/risuko-cookies/src/browser/safari.rs Outdated
aes = "0.9"
cbc = { version = "0.2", features = ["alloc"] }
cipher = { version = "0.5", features = ["alloc", "block-padding"] }
pbkdf2 = "0.13"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: New crypto dependency versions require a higher Rust MSRV than the project’s documented minimum. This can break builds for users/CI pinned to Rust 1.77.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src-tauri/risuko-cookies/Cargo.toml, line 31:

<comment>New crypto dependency versions require a higher Rust MSRV than the project’s documented minimum. This can break builds for users/CI pinned to Rust 1.77.</comment>

<file context>
@@ -13,8 +13,34 @@ name = "risuko_cookies"
+aes = "0.9"
+cbc = { version = "0.2", features = ["alloc"] }
+cipher = { version = "0.5", features = ["alloc", "block-padding"] }
+pbkdf2 = "0.13"
+sha1 = "0.11"
+hmac = "0.13"
</file context>

}

#[cfg(target_os = "macos")]
fn cookie_covers_host(request_host: &str, cookie_domain: &str) -> bool {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Domain matching logic is duplicated instead of shared. Future fixes may diverge across browsers and produce inconsistent filtering.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src-tauri/risuko-cookies/src/browser/safari.rs, line 69:

<comment>Domain matching logic is duplicated instead of shared. Future fixes may diverge across browsers and produce inconsistent filtering.</comment>

<file context>
@@ -0,0 +1,126 @@
+}
+
+#[cfg(target_os = "macos")]
+fn cookie_covers_host(request_host: &str, cookie_domain: &str) -> bool {
+    let r = request_host.to_lowercase();
+    let c = cookie_domain.to_lowercase();
</file context>

@YueMiyuki YueMiyuki changed the title fix(deps): Fix rust dep issues fix(deps): Remove nosleep plugin and update dependencies Jun 21, 2026
@coderabbitai coderabbitai Bot added the next The "next" steps label Jun 21, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src-tauri/risuko-cookies/src/browser/chromium.rs`:
- Line 325: The `expires` field assignment with the `webkit_to_unix` function is
casting a signed i64 value directly to u64 without first validating that it is
non-negative. When `expires_utc` is negative (e.g., -1), the cast wraps to a
very large u64 value, bypassing the zero check inside `webkit_to_unix` and
producing an incorrect far-future timestamp instead of returning None. Add a
check before the `as u64` cast on the value from `row.get::<_, i64>(7)` to
validate that it is positive, and return None or handle the invalid case
appropriately rather than allowing the cast to silently wrap negative values to
large positive numbers.

In `@src-tauri/risuko-cookies/src/browser/safari.rs`:
- Around line 102-161: The Safari binarycookies format uses mixed endianness
where page content and cookie records must be parsed as little-endian instead of
big-endian. In the parse_page function, change from_be_bytes to from_le_bytes
for the num_cookies field read from page[4..8] and for the cookie_offset field
read in the loop at page[off..off + 4]. In the parse_cookie function, change
from_be_bytes to from_le_bytes for all the field reads: flags at cookie[4..8],
url_offset at cookie[12..16], name_offset at cookie[16..20], path_offset at
cookie[20..24], value_offset at cookie[24..28], and the expiry f64 bytes at
cookie[28..36]. This ensures all page-level and cookie record data is correctly
interpreted using little-endian byte ordering.

In `@src-tauri/risuko-cookies/src/platform/linux.rs`:
- Around line 81-82: The OpenSession method call at line 81-82 in the linux.rs
platform module is attempting to deserialize the return value directly to
OwnedObjectPath, but according to the freedesktop.org Secret Service
specification, OpenSession returns a tuple of (Variant output, ObjectPath
result). Change the type annotation for session_path to deserialize the full
tuple type instead of just the ObjectPath component, then destructure the
returned tuple to extract only the ObjectPath element (the second part of the
tuple) that is needed for subsequent operations.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f4731895-d8dd-4618-b74b-35672df4a4d5

📥 Commits

Reviewing files that changed from the base of the PR and between 4f144fa and 6e8f59c.

⛔ Files ignored due to path filters (1)
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • src-tauri/Cargo.toml
  • src-tauri/risuko-cookies/src/browser/chromium.rs
  • src-tauri/risuko-cookies/src/browser/safari.rs
  • src-tauri/risuko-cookies/src/platform/linux.rs
  • src-tauri/risuko-cookies/src/utils/time.rs

Comment thread src-tauri/risuko-cookies/src/browser/chromium.rs Outdated
Comment on lines +102 to +161
#[cfg(target_os = "macos")]
fn parse_page(page: &[u8], cookies: &mut Vec<RawSafariCookie>) -> Result<()> {
if page.len() < 8 {
bail!("page too short");
}

let num_cookies = u32::from_be_bytes(page[4..8].try_into().unwrap()) as usize;
if num_cookies == 0 {
return Ok(());
}

let header_size = 8 + num_cookies * 4;
if page.len() < header_size {
bail!("page header truncated");
}

for i in 0..num_cookies {
let off = 8 + i * 4;
let cookie_offset = u32::from_be_bytes(page[off..off + 4].try_into().unwrap()) as usize;
if cookie_offset >= page.len() {
bail!("cookie offset out of bounds");
}
parse_cookie(&page[cookie_offset..], cookies)?;
}

Ok(())
}

#[cfg(target_os = "macos")]
fn parse_cookie(cookie: &[u8], cookies: &mut Vec<RawSafariCookie>) -> Result<()> {
if cookie.len() < 44 {
bail!("cookie record too short");
}

let flags = u32::from_be_bytes(cookie[4..8].try_into().unwrap());
let url_offset = u32::from_be_bytes(cookie[12..16].try_into().unwrap()) as usize;
let name_offset = u32::from_be_bytes(cookie[16..20].try_into().unwrap()) as usize;
let path_offset = u32::from_be_bytes(cookie[20..24].try_into().unwrap()) as usize;
let value_offset = u32::from_be_bytes(cookie[24..28].try_into().unwrap()) as usize;

let expiry_bytes: [u8; 8] = cookie[28..36].try_into().unwrap();
let expiry = f64::from_be_bytes(expiry_bytes);

let domain = read_cstr(cookie, url_offset)?;
let name = read_cstr(cookie, name_offset)?;
let path = read_cstr(cookie, path_offset)?;
let value = read_cstr(cookie, value_offset)?;

cookies.push(RawSafariCookie {
name,
value,
domain,
path,
secure: (flags & 0x01) != 0,
http_only: (flags & 0x04) != 0,
expires: time::safari_to_unix(expiry),
});

Ok(())
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🌐 Web query:

Safari Cookies.binarycookies binary format endianness specification

💡 Result:

The Safari Cookies.binarycookies file format does not use a single endianness; it is a mixed-endian format [1]. The file utilizes both big-endian and little-endian byte ordering depending on the specific section and data field [1][2]. General Endianness Structure: 1. File Header and Page Indexing (Big-Endian): The top-level file structure, including the file signature ("cook"), the page count, and the array of page sizes, uses big-endian byte order [1][3][4][2]. 2. Page Content and Cookie Records (Little-Endian): Once inside individual pages, the data structures switch to little-endian [1][3][4][2]. This includes the page header signature (which is a constant 0x00000100), the number of cookies within the page, the cookie offsets, and all fields within the individual cookie records (such as cookie size, flags, string offsets, and expiration/creation timestamps) [1][5][2]. Key Technical Specifications: - File Signature: The 4-byte magic number is 0x636f6f6b ("cook") [1][4]. - Page Header Signature: The page start is marked by 0x00000100 [1][5][6]. - Integer Types: Integers in the file header are 32-bit big-endian [1][2], while integers within the cookie records are 32-bit little-endian [1][3][2]. - Timestamps: Date and time values are represented as 64-bit little-endian floats (Cocoa timestamps), counting seconds since 00:00:00 UTC on January 1, 2001 [1][3][2]. - Checksum: A checksum, often calculated by summing 32-bit integers at 4-byte intervals across pages, is typically stored in big-endian format in the file header section [3][4][2]. This mixed-endian architecture is consistent across authoritative technical documentation and community-maintained specifications for the format [1][3][2].

Citations:


🏁 Script executed:

# Verify the parse_binary_cookies function to confirm file-level endianness handling
cd src-tauri/risuko-cookies && head -100 src/browser/safari.rs | tail -40

Repository: YueMiyuki/Risuko

Length of output: 1088


Safari binarycookies format uses mixed endianness—page headers and cookie records must be parsed as little-endian, not big-endian.

Apple's Cookies.binarycookies format uses mixed byte ordering: the file header (magic "cook", page count, page offsets) is big-endian, but all page content and cookie records are little-endian. The current code reads all fields as big-endian, causing incorrect parsing of cookie count, field offsets, flags, and expiry timestamps.

The parse_binary_cookies function correctly handles the file-level big-endian format, but parse_page and parse_cookie must use from_le_bytes() instead of from_be_bytes() for their respective fields.

Proposed fix
 fn parse_page(page: &[u8], cookies: &mut Vec<RawSafariCookie>) -> Result<()> {
     if page.len() < 8 {
         bail!("page too short");
     }

-    let num_cookies = u32::from_be_bytes(page[4..8].try_into().unwrap()) as usize;
+    let num_cookies = u32::from_le_bytes(page[4..8].try_into().unwrap()) as usize;
     if num_cookies == 0 {
         return Ok(());
     }

     let header_size = 8 + num_cookies * 4;
     if page.len() < header_size {
         bail!("page header truncated");
     }

     for i in 0..num_cookies {
         let off = 8 + i * 4;
-        let cookie_offset = u32::from_be_bytes(page[off..off + 4].try_into().unwrap()) as usize;
+        let cookie_offset = u32::from_le_bytes(page[off..off + 4].try_into().unwrap()) as usize;
         if cookie_offset >= page.len() {
             bail!("cookie offset out of bounds");
         }
         parse_cookie(&page[cookie_offset..], cookies)?;
     }

     Ok(())
 }

 fn parse_cookie(cookie: &[u8], cookies: &mut Vec<RawSafariCookie>) -> Result<()> {
     if cookie.len() < 44 {
         bail!("cookie record too short");
     }

-    let flags = u32::from_be_bytes(cookie[4..8].try_into().unwrap());
-    let url_offset = u32::from_be_bytes(cookie[12..16].try_into().unwrap()) as usize;
-    let name_offset = u32::from_be_bytes(cookie[16..20].try_into().unwrap()) as usize;
-    let path_offset = u32::from_be_bytes(cookie[20..24].try_into().unwrap()) as usize;
-    let value_offset = u32::from_be_bytes(cookie[24..28].try_into().unwrap()) as usize;
+    let flags = u32::from_le_bytes(cookie[4..8].try_into().unwrap());
+    let url_offset = u32::from_le_bytes(cookie[12..16].try_into().unwrap()) as usize;
+    let name_offset = u32::from_le_bytes(cookie[16..20].try_into().unwrap()) as usize;
+    let path_offset = u32::from_le_bytes(cookie[20..24].try_into().unwrap()) as usize;
+    let value_offset = u32::from_le_bytes(cookie[24..28].try_into().unwrap()) as usize;

     let expiry_bytes: [u8; 8] = cookie[28..36].try_into().unwrap();
-    let expiry = f64::from_be_bytes(expiry_bytes);
+    let expiry = f64::from_le_bytes(expiry_bytes);

     let domain = read_cstr(cookie, url_offset)?;
     let name = read_cstr(cookie, name_offset)?;
     let path = read_cstr(cookie, path_offset)?;
     let value = read_cstr(cookie, value_offset)?;

     cookies.push(RawSafariCookie {
         name,
         value,
         domain,
         path,
         secure: (flags & 0x01) != 0,
         http_only: (flags & 0x04) != 0,
         expires: time::safari_to_unix(expiry),
     });

     Ok(())
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src-tauri/risuko-cookies/src/browser/safari.rs` around lines 102 - 161, The
Safari binarycookies format uses mixed endianness where page content and cookie
records must be parsed as little-endian instead of big-endian. In the parse_page
function, change from_be_bytes to from_le_bytes for the num_cookies field read
from page[4..8] and for the cookie_offset field read in the loop at
page[off..off + 4]. In the parse_cookie function, change from_be_bytes to
from_le_bytes for all the field reads: flags at cookie[4..8], url_offset at
cookie[12..16], name_offset at cookie[16..20], path_offset at cookie[20..24],
value_offset at cookie[24..28], and the expiry f64 bytes at cookie[28..36]. This
ensures all page-level and cookie record data is correctly interpreted using
little-endian byte ordering.

Comment thread src-tauri/risuko-cookies/src/platform/linux.rs Outdated

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5 issues found across 6 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src-tauri/risuko-cookies/src/browser/safari.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/browser/safari.rs:69">
P3: Domain matching logic is duplicated instead of shared. Future fixes may diverge across browsers and produce inconsistent filtering.</violation>

<violation number="2" location="src-tauri/risuko-cookies/src/browser/safari.rs:92">
P1: Binarycookies header entries are page sizes, not absolute offsets. Treating them as offsets makes the parser jump to wrong positions and miss/fail cookie extraction.</violation>

<violation number="3" location="src-tauri/risuko-cookies/src/browser/safari.rs:108">
P1: The parser uses wrong endianness/layout for Safari page and cookie records. Decoded counts/offsets/expiry become garbage, causing out-of-bounds errors or incorrect cookie data.</violation>
</file>

<file name="src-tauri/risuko-cookies/src/platform/macos.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/platform/macos.rs:29">
P1: macOS v10 cookie format parsed incorrectly: IV is not embedded after `v10`. This will fail/decode garbage for valid Chromium cookies.</violation>
</file>

<file name="src-tauri/risuko-cookies/Cargo.toml">

<violation number="1" location="src-tauri/risuko-cookies/Cargo.toml:31">
P1: New crypto dependency versions require a higher Rust MSRV than the project’s documented minimum. This can break builds for users/CI pinned to Rust 1.77.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

bail!("page too short");
}

let num_cookies = u32::from_be_bytes(page[4..8].try_into().unwrap()) as usize;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: The parser uses wrong endianness/layout for Safari page and cookie records. Decoded counts/offsets/expiry become garbage, causing out-of-bounds errors or incorrect cookie data.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src-tauri/risuko-cookies/src/browser/safari.rs, line 108:

<comment>The parser uses wrong endianness/layout for Safari page and cookie records. Decoded counts/offsets/expiry become garbage, causing out-of-bounds errors or incorrect cookie data.</comment>

<file context>
@@ -65,6 +55,123 @@ pub fn extract_cookies(host: Option<&str>) -> Result<Vec<Cookie>> {
+        bail!("page too short");
+    }
+
+    let num_cookies = u32::from_be_bytes(page[4..8].try_into().unwrap()) as usize;
+    if num_cookies == 0 {
+        return Ok(());
</file context>

let mut cookies = Vec::new();
for i in 0..num_pages {
let off = 8 + i * 4;
let page_offset = u32::from_be_bytes(data[off..off + 4].try_into().unwrap()) as usize;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1: Binarycookies header entries are page sizes, not absolute offsets. Treating them as offsets makes the parser jump to wrong positions and miss/fail cookie extraction.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At src-tauri/risuko-cookies/src/browser/safari.rs, line 92:

<comment>Binarycookies header entries are page sizes, not absolute offsets. Treating them as offsets makes the parser jump to wrong positions and miss/fail cookie extraction.</comment>

<file context>
@@ -65,6 +55,123 @@ pub fn extract_cookies(host: Option<&str>) -> Result<Vec<Cookie>> {
+    let mut cookies = Vec::new();
+    for i in 0..num_pages {
+        let off = 8 + i * 4;
+        let page_offset = u32::from_be_bytes(data[off..off + 4].try_into().unwrap()) as usize;
+        if page_offset >= data.len() {
+            bail!("page offset out of bounds");
</file context>

Comment thread src-tauri/risuko-cookies/src/browser/chromium.rs Outdated
Comment thread src-tauri/risuko-cookies/src/browser/chromium.rs Outdated
Comment thread src-tauri/risuko-cookies/src/utils/time.rs Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src-tauri/risuko-cookies/src/browser/chromium.rs`:
- Around line 253-269: The error handling for decrypt failures in the Err(e)
branch and the no_key branch are incorrectly falling back to plaintext or raw
encrypted bytes as cookie values, which can corrupt cookies and break elevation
retry logic. Instead of always using plaintext_value or raw_value as fallback,
only use plaintext_value when the cookie has no encrypted_value in the first
place. When decryption fails for an encrypted cookie, do not import that cookie
value at all to preserve the elevation retry contract; the fallback logic should
only apply when encrypted_value is empty, not when decryption errors occur.

In `@src-tauri/risuko-cookies/src/utils/time.rs`:
- Around line 18-19: The cast to u64 on the result of the timestamp calculation
does not validate that the value is finite before conversion, which allows NaN
and infinity values to be silently converted to 0 or u64::MAX, causing incorrect
cookie expiry handling. Before casting the unix timestamp value to u64, add a
check to ensure the floating point value is finite (not NaN, not positive
infinity, not negative infinity) and return None if the value is not finite,
similar to how the existing code validates timestamp <= 0.0.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f20e5025-6bd1-4e08-95ac-c76f4974e393

📥 Commits

Reviewing files that changed from the base of the PR and between 6e8f59c and ebb5785.

⛔ Files ignored due to path filters (1)
  • src-tauri/Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (4)
  • src-tauri/risuko-cookies/src/browser/chromium.rs
  • src-tauri/risuko-cookies/src/browser/safari.rs
  • src-tauri/risuko-cookies/src/platform/linux.rs
  • src-tauri/risuko-cookies/src/utils/time.rs
💤 Files with no reviewable changes (1)
  • src-tauri/risuko-cookies/src/browser/safari.rs

Comment thread src-tauri/risuko-cookies/src/browser/chromium.rs
Comment thread src-tauri/risuko-cookies/src/utils/time.rs

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="src-tauri/risuko-cookies/src/browser/safari.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/browser/safari.rs:69">
P3: Domain matching logic is duplicated instead of shared. Future fixes may diverge across browsers and produce inconsistent filtering.</violation>

<violation number="2" location="src-tauri/risuko-cookies/src/browser/safari.rs:92">
P1: Binarycookies header entries are page sizes, not absolute offsets. Treating them as offsets makes the parser jump to wrong positions and miss/fail cookie extraction.</violation>

<violation number="3" location="src-tauri/risuko-cookies/src/browser/safari.rs:108">
P1: The parser uses wrong endianness/layout for Safari page and cookie records. Decoded counts/offsets/expiry become garbage, causing out-of-bounds errors or incorrect cookie data.</violation>
</file>

<file name="src-tauri/risuko-cookies/src/platform/macos.rs">

<violation number="1" location="src-tauri/risuko-cookies/src/platform/macos.rs:29">
P1: macOS v10 cookie format parsed incorrectly: IV is not embedded after `v10`. This will fail/decode garbage for valid Chromium cookies.</violation>
</file>

<file name="src-tauri/risuko-cookies/Cargo.toml">

<violation number="1" location="src-tauri/risuko-cookies/Cargo.toml:31">
P1: New crypto dependency versions require a higher Rust MSRV than the project’s documented minimum. This can break builds for users/CI pinned to Rust 1.77.</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src-tauri/risuko-cookies/src/utils/time.rs
@YueMiyuki
YueMiyuki merged commit 31d7296 into master Jun 21, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next The "next" steps

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant