mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
0.13.0 release
This commit is contained in:
+1
-1
@@ -6,7 +6,7 @@ v0.13.0
|
||||
* **New option:** `identifierNamesGenerator` allows to set identifier names generator (`hexadecimal` or `mangled`).
|
||||
* **Breaking change:** all CLI options were renamed to `kebab-case` format (`--disableConsoleOutout` -> `--disable-console-output`).
|
||||
* Implemented custom `mangle` option algorithm without `esmangle`; fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/110
|
||||
* Comments with `@license`, `@preserve` and `javascript-obfuscator` words won't be removed from obfuscated code.
|
||||
* Comments with `@license` and `@preserve` words won't be removed from obfuscated code.
|
||||
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/147
|
||||
* Fixed https://github.com/javascript-obfuscator/javascript-obfuscator/issues/149
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<!--
|
||||
Title: JavaScript Obfuscator
|
||||
Description: A powerful obfuscator for JavaScript and Node.js.
|
||||
Author: sanex3339
|
||||
Author: Timofey Kachalov
|
||||
-->
|
||||
|
||||
# JavaScript obfuscator for Node.js
|
||||
@@ -24,6 +24,8 @@ Example of obfuscated code: [gist.github.com](https://gist.github.com/sanex3339/
|
||||
* Gulp: [gulp-javascript-obfuscator](https://github.com/javascript-obfuscator/gulp-javascript-obfuscator)
|
||||
* Grunt: [grunt-contrib-obfuscator](https://github.com/javascript-obfuscator/grunt-contrib-obfuscator)
|
||||
* Rollup: [rollup-plugin-javascript-obfuscator](https://github.com/javascript-obfuscator/rollup-plugin-javascript-obfuscator)
|
||||
* Weex: [weex-devtool](https://www.npmjs.com/package/weex-devtool)
|
||||
* Malta: [malta-js-obfuscator](https://github.com/fedeghe/malta-js-obfuscator)
|
||||
|
||||
[](https://badge.fury.io/js/javascript-obfuscator)
|
||||
[](https://travis-ci.org/javascript-obfuscator/javascript-obfuscator)
|
||||
@@ -31,12 +33,14 @@ Example of obfuscated code: [gist.github.com](https://gist.github.com/sanex3339/
|
||||
[](#backers)
|
||||
[](#sponsors)
|
||||
|
||||
*NOTE! the README on the master branch might not match that of the latest stable release!*
|
||||
|
||||
If this project helps you, you can support it:
|
||||
#####You can support this project by donating:
|
||||
* (Bitcoin) 1EnQsZc35CjVy92HN9gZXHjjMnqiW6BsGF
|
||||
* (OpenCollective) https://opencollective.com/javascript-obfuscator
|
||||
|
||||
Big thanks to all supporters!
|
||||
|
||||
#####*NOTE! the README on the master branch might not match that of the latest stable release!*
|
||||
|
||||
## :warning: Important
|
||||
##### Obfuscate only the code that belongs to you.
|
||||
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "javascript-obfuscator",
|
||||
"version": "0.13.0-dev.5",
|
||||
"version": "0.13.0",
|
||||
"description": "JavaScript obfuscator",
|
||||
"keywords": [
|
||||
"obfuscator",
|
||||
@@ -26,7 +26,7 @@
|
||||
"escodegen-wallaby": "1.6.15",
|
||||
"esprima": "4.0.0",
|
||||
"estraverse": "4.2.0",
|
||||
"inversify": "4.6.0",
|
||||
"inversify": "4.8.0",
|
||||
"md5": "2.2.1",
|
||||
"mkdirp": "0.5.1",
|
||||
"opencollective": "1.0.3",
|
||||
@@ -63,7 +63,7 @@
|
||||
"pre-commit": "1.2.2",
|
||||
"sinon": "4.1.3",
|
||||
"threads": "^0.10.0",
|
||||
"ts-node": "4.0.1",
|
||||
"ts-node": "4.0.2",
|
||||
"tslint": "5.8.0",
|
||||
"tslint-eslint-rules": "4.1.1",
|
||||
"tslint-language-service": "0.9.7",
|
||||
|
||||
@@ -15,7 +15,7 @@ export class CommentsTransformer extends AbstractNodeTransformer {
|
||||
/**
|
||||
* @type {string[]}
|
||||
*/
|
||||
private static preservedWords: string[] = ['@license', '@preserve', 'javascript-obfuscator'];
|
||||
private static preservedWords: string[] = ['@license', '@preserve'];
|
||||
|
||||
/**
|
||||
* @param {IRandomGenerator} randomGenerator
|
||||
@@ -33,7 +33,7 @@ export class CommentsTransformer extends AbstractNodeTransformer {
|
||||
*/
|
||||
public getVisitor (): IVisitor {
|
||||
return {
|
||||
enter: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
|
||||
leave: (node: ESTree.Node, parentNode: ESTree.Node | null) => {
|
||||
if (parentNode && NodeGuards.isNodeWithComments(node)) {
|
||||
return this.transformNode(node, parentNode);
|
||||
}
|
||||
|
||||
+14
-15
@@ -60,8 +60,11 @@ export class NodeUtils {
|
||||
|
||||
Object
|
||||
.keys(node)
|
||||
.filter((property: string) => property !== 'parentNode')
|
||||
.forEach((property: string): void => {
|
||||
if (property === 'parentNode') {
|
||||
return;
|
||||
}
|
||||
|
||||
const value: any = (<TObject>node)[property];
|
||||
|
||||
let clonedValue: any | null;
|
||||
@@ -103,15 +106,11 @@ export class NodeUtils {
|
||||
* @returns {string}
|
||||
*/
|
||||
public static convertStructureToCode (structure: ESTree.Node[]): string {
|
||||
let code: string = '';
|
||||
|
||||
structure.forEach((node: ESTree.Node) => {
|
||||
code += escodegen.generate(node, {
|
||||
return structure.reduce((code: string, node: ESTree.Node) => {
|
||||
return code + escodegen.generate(node, {
|
||||
sourceMapWithCode: true
|
||||
}).code;
|
||||
});
|
||||
|
||||
return code;
|
||||
}, '');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -120,15 +119,15 @@ export class NodeUtils {
|
||||
* @returns {NodeGuards}
|
||||
*/
|
||||
public static getBlockStatementNodeByIndex (node: ESTree.Node, index: number = 0): ESTree.Node {
|
||||
if (NodeGuards.isNodeHasBlockStatement(node)) {
|
||||
if (node.body[index] === undefined) {
|
||||
throw new ReferenceError(`Wrong index \`${index}\`. Block-statement body length is \`${node.body.length}\``);
|
||||
}
|
||||
|
||||
return node.body[index];
|
||||
if (!NodeGuards.isNodeHasBlockStatement(node)) {
|
||||
throw new TypeError('The specified node have no a block-statement');
|
||||
}
|
||||
|
||||
throw new TypeError('The specified node have no a block-statement');
|
||||
if (node.body[index] === undefined) {
|
||||
throw new ReferenceError(`Wrong index \`${index}\`. Block-statement body length is \`${node.body.length}\``);
|
||||
}
|
||||
|
||||
return node.body[index];
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
-1
@@ -82,7 +82,6 @@ describe('CommentsTransformer', () => {
|
||||
` *\\* *test\\n` +
|
||||
` *\\*\\/\\n` +
|
||||
`var *test *= *0x1;` +
|
||||
`\\/\\/javascript-obfuscator\\n` +
|
||||
` *\\/\\*\\* *@preserved *\\*\\/$` +
|
||||
``);
|
||||
|
||||
|
||||
-1
@@ -6,5 +6,4 @@
|
||||
//abc
|
||||
var test = 1;
|
||||
//cde
|
||||
//javascript-obfuscator
|
||||
/** @preserved */
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
(function () {
|
||||
var foo = 1;
|
||||
|
||||
// javascript-obfuscator:disable
|
||||
var bar = 2;
|
||||
|
||||
// javascript-obfuscator:enable
|
||||
var baz = 3;
|
||||
})();
|
||||
@@ -2,10 +2,6 @@
|
||||
# yarn lockfile v1
|
||||
|
||||
|
||||
"@types/arrify@^1.0.1":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/arrify/-/arrify-1.0.2.tgz#4a6856b9bfd4713c781df95349c6b15db60d4de1"
|
||||
|
||||
"@types/chai@4.0.10":
|
||||
version "4.0.10"
|
||||
resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.0.10.tgz#0eb222c7353adde8e0980bea04165d4d3b6afef3"
|
||||
@@ -20,10 +16,6 @@
|
||||
dependencies:
|
||||
commander "*"
|
||||
|
||||
"@types/diff@^3.2.1":
|
||||
version "3.2.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/diff/-/diff-3.2.2.tgz#4d6f45537322a7a420d353a0939513c7e96d14a6"
|
||||
|
||||
"@types/escodegen@0.0.6":
|
||||
version "0.0.6"
|
||||
resolved "https://registry.yarnpkg.com/@types/escodegen/-/escodegen-0.0.6.tgz#5230a9ce796e042cda6f086dbf19f22ea330659c"
|
||||
@@ -50,11 +42,7 @@
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/minimist@^1.2.0":
|
||||
version "1.2.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6"
|
||||
|
||||
"@types/mkdirp@0.5.2", "@types/mkdirp@^0.5.0":
|
||||
"@types/mkdirp@0.5.2":
|
||||
version "0.5.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.5.2.tgz#503aacfe5cc2703d5484326b1b27efa67a339c1f"
|
||||
dependencies:
|
||||
@@ -72,20 +60,10 @@
|
||||
version "8.5.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.1.tgz#4ec3020bcdfe2abffeef9ba3fbf26fca097514b5"
|
||||
|
||||
"@types/node@^8.0.27":
|
||||
version "8.5.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.0.tgz#c5be22ffc84b221466fc8dfc0d6b1f88060808ef"
|
||||
|
||||
"@types/sinon@4.1.2":
|
||||
version "4.1.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-4.1.2.tgz#9085db9cc3288b0f12daceee20a26c4afd9c2dcd"
|
||||
|
||||
"@types/source-map-support@^0.4.0":
|
||||
version "0.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/source-map-support/-/source-map-support-0.4.0.tgz#a62a1866614af68c888173c001481f242aaf148b"
|
||||
dependencies:
|
||||
"@types/node" "*"
|
||||
|
||||
"@types/string-template@1.0.2":
|
||||
version "1.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@types/string-template/-/string-template-1.0.2.tgz#363b273c9b456705e3111e3571e9248f6474eba4"
|
||||
@@ -98,18 +76,10 @@
|
||||
version "0.0.30"
|
||||
resolved "https://registry.yarnpkg.com/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz#9aa30c04db212a9a0649d6ae6fd50accc40748a1"
|
||||
|
||||
"@types/v8flags@types/npm-v8flags#de224ae1cd5fd7dbb4e7158a6cc7a29e5315930d":
|
||||
version "2.0.0"
|
||||
resolved "https://codeload.github.com/types/npm-v8flags/tar.gz/de224ae1cd5fd7dbb4e7158a6cc7a29e5315930d"
|
||||
|
||||
"@types/webpack-env@1.13.3":
|
||||
version "1.13.3"
|
||||
resolved "https://registry.yarnpkg.com/@types/webpack-env/-/webpack-env-1.13.3.tgz#0ecbe70f87341767793774d3683b51aa3246434c"
|
||||
|
||||
"@types/yn@types/npm-yn#ca75f6c82940fae6a06fb41d2d37a6aa9b4ea8e9":
|
||||
version "2.0.0"
|
||||
resolved "https://codeload.github.com/types/npm-yn/tar.gz/ca75f6c82940fae6a06fb41d2d37a6aa9b4ea8e9"
|
||||
|
||||
abbrev@1, abbrev@1.0.x:
|
||||
version "1.0.9"
|
||||
resolved "https://registry.yarnpkg.com/abbrev/-/abbrev-1.0.9.tgz#91b4792588a7738c25f35dd6f63752a2f8776135"
|
||||
@@ -2003,9 +1973,9 @@ invariant@^2.2.2:
|
||||
dependencies:
|
||||
loose-envify "^1.0.0"
|
||||
|
||||
inversify@4.6.0:
|
||||
version "4.6.0"
|
||||
resolved "https://registry.yarnpkg.com/inversify/-/inversify-4.6.0.tgz#49abb2ee8fce3c99e1e94f01f36df77c3bfeba75"
|
||||
inversify@4.8.0:
|
||||
version "4.8.0"
|
||||
resolved "https://registry.yarnpkg.com/inversify/-/inversify-4.8.0.tgz#750c3c204ee9fe9a7529062dc6196c69d05fee7e"
|
||||
|
||||
invert-kv@^1.0.0:
|
||||
version "1.0.0"
|
||||
@@ -3678,18 +3648,10 @@ trim-right@^1.0.1:
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
|
||||
|
||||
ts-node@4.0.1:
|
||||
version "4.0.1"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.0.1.tgz#4d368088b50c382d78285c029784ea0f32a4eb5c"
|
||||
ts-node@4.0.2:
|
||||
version "4.0.2"
|
||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-4.0.2.tgz#cb3d039b9898fdc79ad09ab7e69c84564c8c41ee"
|
||||
dependencies:
|
||||
"@types/arrify" "^1.0.1"
|
||||
"@types/diff" "^3.2.1"
|
||||
"@types/minimist" "^1.2.0"
|
||||
"@types/mkdirp" "^0.5.0"
|
||||
"@types/node" "^8.0.27"
|
||||
"@types/source-map-support" "^0.4.0"
|
||||
"@types/v8flags" types/npm-v8flags#de224ae1cd5fd7dbb4e7158a6cc7a29e5315930d
|
||||
"@types/yn" types/npm-yn#ca75f6c82940fae6a06fb41d2d37a6aa9b4ea8e9
|
||||
arrify "^1.0.0"
|
||||
chalk "^2.3.0"
|
||||
diff "^3.1.0"
|
||||
|
||||
Reference in New Issue
Block a user