Skip to content

Fix decryption flags for created WC24 tasks - #6

Merged
ColinGamez merged 1 commit into
mainfrom
agent/fix-created-wc24-decryption
Jul 24, 2026
Merged

Fix decryption flags for created WC24 tasks#6
ColinGamez merged 1 commit into
mainfrom
agent/fix-created-wc24-decryption

Conversation

@ColinGamez

@ColinGamez ColinGamez commented Jul 24, 2026

Copy link
Copy Markdown
Owner

What changed

  • apply the native 0xA channel-content flags when JWC24 creates an AES-OFB WC24 task
  • make created-task reconciliation repair incorrect flags instead of treating the task as configured
  • keep unsigned and raw task flag behavior separate

Root cause

The new daily header.bin task was created with flags 0x0, while HBNJ's
working native epg.bin and str.bin tasks both use 0xA. Dolphin downloaded
the header but wrote its AES ciphertext directly into the VFF, so TV no Tomo
could not parse the new 12-entry genre table.

Validation

  • slot 12 reprovisioned from 0x0 to 0xA
  • live VFF header restored from the validated LZ10/HDPK payload
  • cached header independently reports 12 genres
  • active EPG, string, and header tasks all report flags 0xA
  • Python compilation and diff checks passed

Summary by Sourcery

Correct WC24 task flag handling for newly created AES-encrypted channel-content tasks and their reconciliation.

Bug Fixes:

  • Ensure AES-OFB WC24 tasks are created with native encrypted channel-content flags so IOS decrypts content before writing to VFF.
  • Update created-task reconciliation to repair incorrect flags instead of treating misconfigured tasks as already configured.

Enhancements:

  • Centralize WC24 task flag selection logic to keep unsigned and encrypted task behaviors distinct and consistent across creation and reconciliation.

@sourcery-ai

sourcery-ai Bot commented Jul 24, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Adjust WC24 task flag derivation for created AES-OFB channel-content tasks and reconcile existing tasks by repairing mismatched flags rather than assuming they are correctly configured.

Sequence diagram for WC24 task creation and flag reconciliation

sequenceDiagram
    actor User
    participant provision
    participant _write_task
    participant _created_task_flags

    User->>provision: provision(path, manifest, apply)
    provision->>_write_task: _write_task(data, manifest, task)
    _write_task->>_created_task_flags: _created_task_flags(task)
    _created_task_flags-->>_write_task: flags (UNSIGNED_FLAG | ENCRYPTED_CHANNEL_FLAGS | 0)
    _write_task-->>provision: task entry written

    provision->>_created_task_flags: _created_task_flags(task)
    _created_task_flags-->>provision: expected_flags

    provision-->>User: [current.flags == expected_flags and task.mode == create]
    provision-->>User: [bool(current.flags & UNSIGNED_FLAG) == task.unsigned and task.mode != create]
Loading

File-Level Changes

Change Details Files
Derive flags for newly created WC24 tasks from task properties, including AES-OFB encrypted channel-content tasks.
  • Introduce ENCRYPTED_CHANNEL_FLAGS constant documenting native encrypted channel-content flag behavior.
  • Add _created_task_flags helper that maps unsigned and AES-OFB envelope properties to the correct flag value.
  • Use _created_task_flags in task writing instead of directly checking the unsigned property.
jwc24/dl_list.py
Update WC24 provisioning reconciliation logic so created tasks are considered correct only when their flags match the expected created-task flags, while preserving existing unsigned-flag checks for non-create modes.
  • Compute expected_flags using _created_task_flags for each task during provisioning.
  • Change reconciliation condition to require exact flag match for create-mode tasks.
  • Retain the previous unsigned-flag bitmask check for non-create modes to keep behaviors separate.
jwc24/dl_list.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@ColinGamez
ColinGamez marked this pull request as ready for review July 24, 2026 03:08
@ColinGamez
ColinGamez merged commit 522069f into main Jul 24, 2026
3 checks passed
@ColinGamez
ColinGamez deleted the agent/fix-created-wc24-decryption branch July 24, 2026 03:08

@sourcery-ai sourcery-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.

Hey - I've left some high level feedback:

  • The new _created_task_flags helper currently special-cases only unsigned and wc24-aes-ofb envelopes; consider making the envelope values an explicit enum/constant set and documenting or handling other envelope types to avoid silently defaulting to 0 for future encrypted modes.
  • The flag reconciliation condition in provision combines full equality for create mode with a bitwise UNSIGNED_FLAG check for other modes, which is a bit hard to read; you could refactor this into named helper functions or intermediate variables to make the different matching strategies clearer.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The new `_created_task_flags` helper currently special-cases only `unsigned` and `wc24-aes-ofb` envelopes; consider making the envelope values an explicit enum/constant set and documenting or handling other envelope types to avoid silently defaulting to `0` for future encrypted modes.
- The flag reconciliation condition in `provision` combines full equality for `create` mode with a bitwise UNSIGNED_FLAG check for other modes, which is a bit hard to read; you could refactor this into named helper functions or intermediate variables to make the different matching strategies clearer.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant