Skip to content

Parse current OnlineHashCrack API response format - #95

Merged
zalexdev merged 1 commit into
zalexdev:mainfrom
Loukious:fix/ohc-upload-parser
Sep 22, 2026
Merged

zalexdev merged 1 commit into
zalexdev:mainfrom
Loukious:fix/ohc-upload-parser

Conversation

@Loukious

@Loukious Loukious commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

The upload parser expects a response format OnlineHashCrack no longer
uses, so successful uploads are reported as failures.

From the app's debug log DB on a test device, a real upload response:

{"notice":"...","next_steps":"Results are available in your
OnlineHashCrack dashboard: https://onlinehashcrack.com/tasks",
"accepted":{"count":1,"hashes":["WPA*02*..."]},
"skipped":{"count":0,"reason":"already_sent","hashes":[]},
"rejected":{"count":0,"hashes":[]}}

The upload itself succeeded (accepted count 1, the hash landed in the
user's OHC dashboard) — but parseUploadResult() only recognizes the
legacy {"success":true,"message":...} shape. It matched nothing, fell
through every branch, and the app toasted a generic upload-failed
message with no detail.

Recognize the current format in the JSON branch:

  • accepted.count > 0 -> SUCCESS
  • skipped.count > 0 -> ALREADY (with the skip reason, e.g. already_sent)
  • otherwise -> FAILED with the rejected reason

The legacy success-flag path is kept for older/other response shapes,
and the non-JSON text fallbacks (already/success/uploaded keywords)
are unchanged.

The OHC upload API no longer returns a success boolean + message; it
responds with accepted/skipped/rejected count objects (e.g.
{\accepted\:{\count\:1,...},\skipped\:0,\rejected\:0}).
parseUploadResult() matched none of that, so a successful upload was
reported to the user as a failure with an empty message.

Recognize the new format (accepted>0 = success, skipped>0 = already
sent, otherwise rejected reason) while keeping the legacy success-flag
path for older responses.
@zalexdev
zalexdev merged commit 0c494e3 into zalexdev:main Sep 22, 2026
1 check passed
zalexdev added a commit that referenced this pull request Oct 3, 2026
Two files needed hands; the rest merged as-is.

RootlessEngine: #101 added chipsetDriverHint() in the same place the
dialogs refactor put the javadoc and @OverRide on usb(). Both kept.

WiFIAdapter, handshake attack: took our side, which no longer declares
the `clients` list the refactor removed, plus #92's !isInternalDeauthEnabled()
guard.

WiFIAdapter, type 7: #92 patched the old outputtext version of this block,
which our side had already rewritten against AttackMonitor. Reapplied the
intent -- the internal radio is refused only while the toggle is off, and
the refusal now names the setting instead of claiming the hardware cannot
inject.
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.

2 participants