Skip to content

Arena/214db6d6 cloakjs - #2

Merged
johanbeytell1 merged 2 commits into
mainfrom
arena/214db6d6-cloakjs
Oct 11, 2026
Merged

johanbeytell1 merged 2 commits into
mainfrom
arena/214db6d6-cloakjs

Conversation

@johanbeytell1

Copy link
Copy Markdown
Member

No description provided.

Arena Agent and others added 2 commits October 11, 2026 16:46
extreme is no longer a copy of high (the 1.2.0 presets were byte-identical
after defaults were applied). It now adds identifier escaping, codepoint-safe
string splitting, decoy string-array entries, maximum flattening/dead-code
amounts and a recurring debugger trap.

Library changes:
- scope-aware identifier mangling: parameters (defaults, rest), catch
  bindings, class names, named function expressions and template
  substitutions; a spelling is renamed only when every occurrence lies inside
  a scope that declares it, so globals owned by other scripts stay intact
- property names, object keys/shorthand, method and field names, labels,
  destructuring patterns, module specifiers and string keys are never touched
- self-contained string decoder: own Base64 + alphabet substitution + RC4 +
  UTF-8 handling, no atob/Uint8Array/TextDecoder required by generated code
- control-flow flattening inside function bodies (nested bodies first), with a
  shuffled case layout, a sequence array that fixes execution order and decoy
  cases that can never be selected; hoisting/scoping-sensitive statements and
  the final top-level statement are kept out of dispatchers
- opaque predicates verified at obfuscation time, richer unreachable decoy
  blocks, static template literals encrypted like strings
- self-defending prelude hashes generated functions (whitespace-insensitive)
  and throws Error("Unexpected token") when they are patched
- typed option validation, seeded reproducible output, per-run stats that
  report the techniques actually applied, clearer warnings

Docs and build:
- README rewritten for 1.3.0: preset ladder, full option table, technique
  notes, behaviour caveats (selfDefending vs. re-minification, module syntax,
  debug protection) and the npm note — the `cloakjs` package on npm is an
  unrelated AOP/Proxy library, so the README points at the repo and jsDelivr
  and never tells anyone to install it
- test suite expanded to 40 behavioural tests (every preset, option matrix,
  generators/classes/private fields/destructuring/ASI, guard tampering)
- cloakjs.min.js regenerated with Terser 5.44.0; the workflow runs the tests,
  rebuilds and verifies the minified file before committing it

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
- explain exactly what extreme adds over high, and that nested function bodies
  are flattened before the bodies that contain them
- note that generated code runs in a bare sandbox (TextDecoder/Uint8Array are
  optional fast paths, atob is not used at all)
- correct the identifier escaping example (the escaper emits \uXXXX only)
- clarify the completion-value row and the workflow description

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@johanbeytell1
johanbeytell1 merged commit 329938a into main Oct 11, 2026
1 check passed
@johanbeytell1
johanbeytell1 deleted the arena/214db6d6-cloakjs branch October 11, 2026 17:15
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