feat(un-jsx): inline constant tag inlining (#129)
feat(un-jsx): improve jsx constant tag inlining
test: update test cases
refactor(un-jsx): remove array inlining
refactor(un-jsx): remove ternary inlining
refactor(un-jsx): rewrite the implementation of constant tag variable inlining
Co-authored-by: Pionxzh pionxzh@csie.io
Wakaru
Wakaru is the Javascript decompiler for modern frontend. It brings back the original code from a bundled and transpiled source.
Demo
See live demo for detailed examples.
Features
Unminify
Converts transpiled code back to its readable form and restores downgraded syntaxes.
Supports the following transpilers:
Read the documentation for more information.
Unpacker
Converts bundled JavaScript into separated modules
Supports the following bundlers:
Try it out
Test the tool and see it in action at Playground.
🖥 Using the CLI
Interactive mode
By default, the CLI will run in interactive mode and guide you through the process.
You can also pass options to skip some steps in the interactive mode.
Options
Run
npx @wakaru/cli --help
to see the full list of options.--output
"out"
--force
false
--concurrency
1
--perf
false
--perf-output
--concurrency
can be used to speed up the process. But please aware that the process might OOM if the input file is too large.Non-interactive mode
If you want to run the CLI in non-interactive mode, you can specify the feature by passing the feature name as the first argument.
unpacker
andunminify
will run only the corresponding feature.all
will run bothunpacker
andunminify
sequentially.These options are only available in
all
mode.--unpacker-output
"out/unpack"
--unminify-output
"out/unminify"
When running a single feature (either
unpacker
orunminify
), the CLI will only uses the path specified in the--output
option. This means that, unlike in theall
mode where subdirectories (out/unpack
andout/unminify
) are automatically created within the output directory, in single feature mode, the output files are placed directly in the specified--output
directory without any additional subdirectories.📦 Using the API
Click to expand
@wakaru/unpacker
@wakaru/unminify
You can check all the rules at /unminify/src/transformations/index.ts.
Please aware that this project is still in early development. The API might change in the future.
And the bundle size of these packages are huge. It might be reduced in the future. Use with caution on the browser (Yes, like the playground, it can run on the browser ✨).
Legal Disclaimer
Usage of
wakaru
for attacking targets without prior mutual consent is illegal. It is the end user’s responsibility to obey all applicable local, state and federal laws. Developers assume no liability and are not responsible for any misuse or damage caused by this program.License
MIT