javascript-obfuscator 5.0.1 → 5.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/CLAUDE.md +2 -2
- package/CODE_OF_CONDUCT.md +1 -1
- package/README.md +214 -31
- package/dist/index.browser.js +46 -2
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cli.js +24 -2
- package/dist/index.cli.js.map +1 -1
- package/dist/index.js +24 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -6
- package/typings/src/analyzers/scope-analyzer/ScopeAnalyzer.d.ts +3 -0
- package/typings/src/enums/node-transformers/preparing-transformers/obfuscating-guards/ObfuscatingGuard.d.ts +1 -0
- package/typings/src/interfaces/pro-api/IProApiClient.d.ts +1 -0
- package/typings/src/node-transformers/control-flow-transformers/control-flow-replacers/LogicalExpressionControlFlowReplacer.d.ts +1 -0
- package/typings/src/node-transformers/converting-transformers/ClassFieldTransformer.d.ts +1 -1
- package/typings/src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.d.ts +1 -3
- package/typings/src/node-transformers/preparing-transformers/obfuscating-guards/ProcessEnvObfuscationGuard.d.ts +8 -0
- package/typings/src/utils/EscapeSequenceEncoder.d.ts +1 -0
- package/dist/index.browser.js.LICENSE.txt +0 -45
- package/dist/index.cli.js.LICENSE.txt +0 -23
- package/dist/index.js.LICENSE.txt +0 -23
- package/dist/index_debug.js +0 -14907
- package/dist/index_debug.js.LICENSE.txt +0 -23
- package/dist/index_debug.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "javascript-obfuscator",
|
|
3
|
-
"version": "5.0
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "JavaScript obfuscator",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"obfuscator",
|
|
@@ -129,12 +129,9 @@
|
|
|
129
129
|
"prepare": "husky install"
|
|
130
130
|
},
|
|
131
131
|
"author": {
|
|
132
|
-
"name": "
|
|
132
|
+
"name": "Timofei Kachalov"
|
|
133
133
|
},
|
|
134
|
-
"contributors": [
|
|
135
|
-
"Timofey Kachalov (https://github.com/sanex3339)",
|
|
136
|
-
"Dmitry Zamotkin (https://github.com/zamotkin)"
|
|
137
|
-
],
|
|
134
|
+
"contributors": ["Timofei Kachalov (https://github.com/sanex3339)", "Dmitry Zamotkin (https://github.com/zamotkin)"],
|
|
138
135
|
"license": "BSD-2-Clause",
|
|
139
136
|
"packageManager": "yarn@1.22.21+sha512.ca75da26c00327d26267ce33536e5790f18ebd53266796fbb664d2a4a5116308042dd8ee7003b276a20eace7d3c5561c3577bdd71bcb67071187af124779620a"
|
|
140
137
|
}
|
|
@@ -10,5 +10,8 @@ export declare class ScopeAnalyzer implements IScopeAnalyzer {
|
|
|
10
10
|
private static isRootNode;
|
|
11
11
|
analyze(astTree: ESTree.Node): void;
|
|
12
12
|
acquireScope(node: ESTree.Node): eslintScope.Scope;
|
|
13
|
+
private fixAnnexBFunctionHoisting;
|
|
14
|
+
private linkThroughReferences;
|
|
13
15
|
private sanitizeScopes;
|
|
16
|
+
private walkScopes;
|
|
14
17
|
}
|
|
@@ -4,5 +4,6 @@ export declare enum ObfuscatingGuard {
|
|
|
4
4
|
ForceTransformStringObfuscatingGuard = "ForceTransformStringObfuscatingGuard",
|
|
5
5
|
IgnoredImportObfuscatingGuard = "IgnoredImportObfuscatingGuard",
|
|
6
6
|
ImportMetaObfuscationGuard = "ImportMetaObfuscationGuard",
|
|
7
|
+
ProcessEnvObfuscationGuard = "ProcessEnvObfuscationGuard",
|
|
7
8
|
ReservedStringObfuscatingGuard = "ReservedStringObfuscatingGuard"
|
|
8
9
|
}
|
|
@@ -10,4 +10,5 @@ export declare class LogicalExpressionControlFlowReplacer extends ExpressionWith
|
|
|
10
10
|
constructor(controlFlowCustomNodeFactory: TControlFlowCustomNodeFactory, identifierNamesGeneratorFactory: TIdentifierNamesGeneratorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
11
11
|
replace(logicalExpressionNode: ESTree.LogicalExpression, parentNode: ESTree.Node, controlFlowStorage: IControlFlowStorage): ESTree.Node;
|
|
12
12
|
private checkForProhibitedExpressions;
|
|
13
|
+
private expressionContainsProhibitedNodes;
|
|
13
14
|
}
|
|
@@ -5,7 +5,7 @@ import { IVisitor } from '../../interfaces/node-transformers/IVisitor';
|
|
|
5
5
|
import { NodeTransformationStage } from '../../enums/node-transformers/NodeTransformationStage';
|
|
6
6
|
import { AbstractNodeTransformer } from '../AbstractNodeTransformer';
|
|
7
7
|
export declare class ClassFieldTransformer extends AbstractNodeTransformer {
|
|
8
|
-
private static readonly
|
|
8
|
+
private static readonly ignoredName;
|
|
9
9
|
constructor(randomGenerator: IRandomGenerator, options: IOptions);
|
|
10
10
|
getVisitor(nodeTransformationStage: NodeTransformationStage): IVisitor | null;
|
|
11
11
|
transformNode(classFieldNode: ESTree.MethodDefinition | ESTree.PropertyDefinition, parentNode: ESTree.Node): ESTree.Node;
|
package/typings/src/node-transformers/converting-transformers/ObjectExpressionKeysTransformer.d.ts
CHANGED
|
@@ -10,11 +10,9 @@ export declare class ObjectExpressionKeysTransformer extends AbstractNodeTransfo
|
|
|
10
10
|
private static readonly objectExpressionExtractorNames;
|
|
11
11
|
private readonly objectExpressionExtractorFactory;
|
|
12
12
|
constructor(objectExpressionExtractorFactory: TObjectExpressionExtractorFactory, randomGenerator: IRandomGenerator, options: IOptions);
|
|
13
|
+
private static checkProhibitedPatterns;
|
|
13
14
|
private static isProhibitedObjectExpressionNode;
|
|
14
|
-
private static getReferencedIdentifierName;
|
|
15
|
-
private static isReferencedIdentifierName;
|
|
16
15
|
private static isProhibitedArrowFunctionExpression;
|
|
17
|
-
private static isObjectExpressionWithCallExpression;
|
|
18
16
|
private static isProhibitedSequenceExpression;
|
|
19
17
|
getVisitor(nodeTransformationStage: NodeTransformationStage): IVisitor | null;
|
|
20
18
|
transformNode(objectExpressionNode: ESTree.ObjectExpression, parentNode: ESTree.Node): ESTree.Node;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as ESTree from 'estree';
|
|
2
|
+
import { IObfuscatingGuard } from '../../../interfaces/node-transformers/preparing-transformers/obfuscating-guards/IObfuscatingGuard';
|
|
3
|
+
import { ObfuscatingGuardResult } from '../../../enums/node/ObfuscatingGuardResult';
|
|
4
|
+
export declare class ProcessEnvObfuscationGuard implements IObfuscatingGuard {
|
|
5
|
+
private static isProcessEnvMemberExpression;
|
|
6
|
+
private static isPartOfProcessEnvChain;
|
|
7
|
+
check(node: ESTree.Node): ObfuscatingGuardResult;
|
|
8
|
+
}
|
|
@@ -2,6 +2,7 @@ import { IEscapeSequenceEncoder } from '../interfaces/utils/IEscapeSequenceEncod
|
|
|
2
2
|
export declare class EscapeSequenceEncoder implements IEscapeSequenceEncoder {
|
|
3
3
|
private static readonly ASCIICharactersRegExp;
|
|
4
4
|
private static readonly forceEscapeCharactersRegExp;
|
|
5
|
+
private static readonly replaceRegExp;
|
|
5
6
|
private readonly stringsCache;
|
|
6
7
|
encode(string: string, encodeAllSymbols: boolean): string;
|
|
7
8
|
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
* Determine if an object is a Buffer
|
|
3
|
-
*
|
|
4
|
-
* @author Feross Aboukhadijeh <https://feross.org>
|
|
5
|
-
* @license MIT
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
/*!
|
|
9
|
-
Copyright (C) 2016-2024 Timofey Kachalov <sanex3339@yandex.ru>
|
|
10
|
-
|
|
11
|
-
Redistribution and use in source and binary forms, with or without
|
|
12
|
-
modification, are permitted provided that the following conditions are met:
|
|
13
|
-
|
|
14
|
-
* Redistributions of source code must retain the above copyright
|
|
15
|
-
notice, this list of conditions and the following disclaimer.
|
|
16
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
17
|
-
notice, this list of conditions and the following disclaimer in the
|
|
18
|
-
documentation and/or other materials provided with the distribution.
|
|
19
|
-
|
|
20
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
23
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
24
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
25
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
26
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
27
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
28
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
29
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
/*! *****************************************************************************
|
|
33
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
34
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
35
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
36
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
37
|
-
|
|
38
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
39
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
40
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
41
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
42
|
-
|
|
43
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
44
|
-
and limitations under the License.
|
|
45
|
-
***************************************************************************** */
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
Copyright (C) 2016-2024 Timofey Kachalov <sanex3339@yandex.ru>
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
|
6
|
-
|
|
7
|
-
* Redistributions of source code must retain the above copyright
|
|
8
|
-
notice, this list of conditions and the following disclaimer.
|
|
9
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
-
notice, this list of conditions and the following disclaimer in the
|
|
11
|
-
documentation and/or other materials provided with the distribution.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
16
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
17
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
22
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
-
*/
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
Copyright (C) 2016-2024 Timofey Kachalov <sanex3339@yandex.ru>
|
|
3
|
-
|
|
4
|
-
Redistribution and use in source and binary forms, with or without
|
|
5
|
-
modification, are permitted provided that the following conditions are met:
|
|
6
|
-
|
|
7
|
-
* Redistributions of source code must retain the above copyright
|
|
8
|
-
notice, this list of conditions and the following disclaimer.
|
|
9
|
-
* Redistributions in binary form must reproduce the above copyright
|
|
10
|
-
notice, this list of conditions and the following disclaimer in the
|
|
11
|
-
documentation and/or other materials provided with the distribution.
|
|
12
|
-
|
|
13
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
14
|
-
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
15
|
-
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
16
|
-
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
|
|
17
|
-
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
18
|
-
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
19
|
-
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
|
|
20
|
-
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
21
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
22
|
-
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
23
|
-
*/
|