Repository navigation
Arena/214db6d6 cloakjs - #2
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.