relative / synchrony

javascript-obfuscator cleaner & deobfuscator
https://deobfuscate.relative.im/
GNU General Public License v3.0
840 stars 108 forks source link

break long lines #131

Closed 3052 closed 9 months ago

3052 commented 9 months ago

using this input:

const c=n.a.get("API.lemonade.url"),d=n.a.get("API.lemonade.urlLinear"),u=n.a.get("API.lemonade.urlVod"),p=n.a.get("API.lemonade.platform"),m=n.a.get("API.lemonade.timeout");

I get this output:

const c = n.a.get('API.lemonade.url'), d = n.a.get('API.lemonade.urlLinear'), u = n.a.get('API.lemonade.urlVod'), p = n.a.get('API.lemonade.platform'), m = n.a.get('API.lemonade.timeout');

using another tool, I get:

const c = n.a.get("API.lemonade.url"),
  d = n.a.get("API.lemonade.urlLinear"),
  u = n.a.get("API.lemonade.urlVod"),
  p = n.a.get("API.lemonade.platform"),
  m = n.a.get("API.lemonade.timeout");

https://richsnapp.com/tools/code-unmangler

or with another tool, I get:

const c = n.a.get('API.lemonade.url');
const d = n.a.get('API.lemonade.urlLinear');
const u = n.a.get('API.lemonade.urlVod');
const p = n.a.get('API.lemonade.platform');
const m = n.a.get('API.lemonade.timeout');

https://restringer.tech

is is possible for Synchrony to also break long lines?

relative commented 9 months ago

You can use prettier to reformat the deobfuscated script

npm install --global prettier
prettier --print-width 80 --write script.cleaned.js

--print-width 80 sets the desired line length --write replaces script.cleaned.js on disk

3052 commented 9 months ago

I am aware that other tools are available, I am wanting this option to be built into synchrony if possible, similar to the other tools above

relative commented 9 months ago

I removed prettier from the tool in 2.4.4 to reduce complexity

It is possible to achieve the same result as prettier --print-width 80 --write script.cleaned.js by modifying src/cli.js and invoking prettier before the fs.writeFile call on L87

3052 commented 9 months ago

no thanks, I will just use one of the alternatives I listed above