jscrambler 8.9.4 → 8.10.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # jscrambler
2
2
 
3
+ ## 8.10.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [70319c8]: prevent sending generateAlias option default value to incompatible versions
8
+
9
+ ## 8.10.0
10
+
11
+ ### Minor Changes
12
+
13
+ - [dd01e7b]: Added generate alias config option
14
+
3
15
  ## 8.9.4
4
16
 
5
17
  ### Patch Changes
package/README.md CHANGED
@@ -145,6 +145,7 @@ Options:
145
145
  --save-src <bool> Protection should save application sources (default: true)
146
146
  --protection-report <string> (version 8.4 and above) Protection id for the metadata report
147
147
  --use-global-names-on-modules <bool> (version 8.5 and above) Force the usage of more complex names on modules (default: false)
148
+ --generate-alias <bool> Generate alias for the transformations (default: true)
148
149
  -h, --help output usage information
149
150
  ```
150
151
 
@@ -106,7 +106,7 @@ const validateBeforeProtection = function () {
106
106
  });
107
107
  return beforeProtectionArray;
108
108
  };
109
- _commander.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'Jscrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--base-path <path>', 'Base Path').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--instrument', 'Instrument file(s) before start profiling. ATTENTION: previous profiling information will be deleted').option('--start-profiling', 'Starts profiling (assumes an already instrumented application)').option('--stop-profiling', 'Stops profiling').option('--code-hardening-threshold <threshold>', 'Set code hardening file size threshold. Format: {value}{unit="b,kb,mb"}. Example: 200kb', validateCodeHardeningThreshold).option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--utc <bool>', 'Set UTC as the request time zone. Otherwise it uses the local time zone (default: true)', validateBool('utc')).option('--tolerate-minification <bool>', "Don't detect minification as malicious tampering (default: true)", validateBool('tolerate-minification')).option('--use-profiling-data <bool>', "(version 6.2 only) Protection should use the existing profiling data (default: true)", validateBool('use-profiling-data')).option('--profiling-data-mode <mode>', "(version 6.3 and above) Select profiling mode (default: automatic)", validateProfilingDataMode).option('--remove-profiling-data', "Removes the current application profiling information").option('--use-app-classification <bool>', '(version 6.3 and above) Protection should use Application Classification metadata when protecting (default: true)', validateBool('--use-app-classification')).option('--input-symbol-table <file>', '(version 6.3 and above) Protection should use symbol table when protecting. (default: no file)').option('--output-symbol-table <id>', '(version 6.3 and above) Download output symbol table (json)').option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').option('--skip-sources', 'Prevent source files from being updated').option('--force-app-environment <environment>', "(version 7.1 and above) Override application's environment detected automatically. Possible values: ".concat(availableEnvironments.toString()), validateForceAppEnvironment).option('--ensure-code-annotation <bool>', "(version 7.3 and above) Fail protection if no annotations are found on the source code (default: false)", validateBool('ensure-code-annotation')).option('-n <number>', "(version 7.2 and above) Create multiple protections at once.").option('--delete-protection-on-success <bool>', 'Deletes the protection files after they have been protected and downloaded (default: false)', validateBool('--delete-protection-on-success')).option('--mode <mode>', "(version 8.4 and above) Define protection mode. Possible values: automatic, manual (default: manual)", validateMode).option('--save-src <bool>', 'Protection should save application sources (default: true)', validateBool('--save-src')).option('--protection-report <string>', '(version 8.4 and above) Protection id for the metadata report').option('--use-global-names-on-modules <bool>', '(version 8.5 and above) Force the usage of more complex names on modules').option('--balance', '(version 8.4 and above) Gets the balance of the user').parse(process.argv);
109
+ _commander.default.version(require('../../package.json').version).usage('[options] <file ...>').option('-a, --access-key <accessKey>', 'Access key').option('-c, --config <config>', 'Jscrambler configuration options').option('-H, --host <host>', 'Hostname').option('-i, --application-id <id>', 'Application ID').option('-o, --output-dir <dir>', 'Output directory').option('-p, --port <port>', 'Port').option('--base-path <path>', 'Base Path').option('--protocol <protocol>', 'Protocol (http or https)').option('--cafile <path>', 'Internal certificate authority').option('-C, --cwd <dir>', 'Current Working Directory').option('-s, --secret-key <secretKey>', 'Secret key').option('-m, --source-maps <id>', 'Download source maps').option('-R, --randomization-seed <seed>', 'Set randomization seed').option('--instrument', 'Instrument file(s) before start profiling. ATTENTION: previous profiling information will be deleted').option('--start-profiling', 'Starts profiling (assumes an already instrumented application)').option('--stop-profiling', 'Stops profiling').option('--code-hardening-threshold <threshold>', 'Set code hardening file size threshold. Format: {value}{unit="b,kb,mb"}. Example: 200kb', validateCodeHardeningThreshold).option('--recommended-order <bool>', 'Use recommended order', validateBool('recommended-order')).option('-W, --werror <bool>', 'Set werror flag value (default: true)', validateBool('werror')).option('--utc <bool>', 'Set UTC as the request time zone. Otherwise it uses the local time zone (default: true)', validateBool('utc')).option('--tolerate-minification <bool>', "Don't detect minification as malicious tampering (default: true)", validateBool('tolerate-minification')).option('--use-profiling-data <bool>', "(version 6.2 only) Protection should use the existing profiling data (default: true)", validateBool('use-profiling-data')).option('--profiling-data-mode <mode>', "(version 6.3 and above) Select profiling mode (default: automatic)", validateProfilingDataMode).option('--remove-profiling-data', "Removes the current application profiling information").option('--use-app-classification <bool>', '(version 6.3 and above) Protection should use Application Classification metadata when protecting (default: true)', validateBool('--use-app-classification')).option('--input-symbol-table <file>', '(version 6.3 and above) Protection should use symbol table when protecting. (default: no file)').option('--output-symbol-table <id>', '(version 6.3 and above) Download output symbol table (json)').option('--jscramblerVersion <version>', 'Use a specific Jscrambler version').option('--debugMode', 'Protect in debug mode').option('--skip-sources', 'Prevent source files from being updated').option('--force-app-environment <environment>', "(version 7.1 and above) Override application's environment detected automatically. Possible values: ".concat(availableEnvironments.toString()), validateForceAppEnvironment).option('--ensure-code-annotation <bool>', "(version 7.3 and above) Fail protection if no annotations are found on the source code (default: false)", validateBool('ensure-code-annotation')).option('-n <number>', "(version 7.2 and above) Create multiple protections at once.").option('--delete-protection-on-success <bool>', 'Deletes the protection files after they have been protected and downloaded (default: false)', validateBool('--delete-protection-on-success')).option('--mode <mode>', "(version 8.4 and above) Define protection mode. Possible values: automatic, manual (default: manual)", validateMode).option('--save-src <bool>', 'Protection should save application sources (default: true)', validateBool('--save-src')).option('--protection-report <string>', '(version 8.4 and above) Protection id for the metadata report').option('--use-global-names-on-modules <bool>', '(version 8.5 and above) Force the usage of more complex names on modules').option('--balance', '(version 8.4 and above) Gets the balance of the user').option('--generate-alias <bool>', '(version 8.5 and above) Generate alias for the transformations (default: true)', validateBool('--generate-alias')).parse(process.argv);
110
110
  let globSrc, filesSrc, config;
111
111
 
112
112
  // If -c, --config file was provided
@@ -193,6 +193,15 @@ if (_commander.default.saveSrc) {
193
193
  } else {
194
194
  config.saveSrc = config.saveSrc !== false;
195
195
  }
196
+
197
+ // ensure generateAlias is only sent on v8.5 and above
198
+ if (Number(config.jscramblerVersion) >= 8.5) {
199
+ if (_commander.default.generateAlias) {
200
+ config.generateAlias = _commander.default.generateAlias !== 'false';
201
+ } else {
202
+ config.generateAlias = config.generateAlias !== false;
203
+ }
204
+ }
196
205
  globSrc = config.filesSrc;
197
206
  // If src paths have been provided
198
207
  if (_commander.default.args.length > 0) {
@@ -277,7 +286,8 @@ const {
277
286
  mode,
278
287
  saveSrc,
279
288
  globalNamesPrefix,
280
- useGlobalNamesOnModules
289
+ useGlobalNamesOnModules,
290
+ generateAlias
281
291
  } = config;
282
292
  const params = config.params;
283
293
  const incompatibleOptions = ['sourceMaps', 'instrument', 'startProfiling', 'stopProfiling'];
@@ -420,7 +430,8 @@ if (_commander.default.balance) {
420
430
  mode,
421
431
  saveSrc,
422
432
  globalNamesPrefix,
423
- useGlobalNamesOnModules
433
+ useGlobalNamesOnModules,
434
+ generateAlias
424
435
  });
425
436
  try {
426
437
  if (typeof werror !== 'undefined') {
package/dist/index.js CHANGED
@@ -285,7 +285,8 @@ var _default = exports.default = {
285
285
  mode,
286
286
  saveSrc,
287
287
  globalNamesPrefix,
288
- useGlobalNamesOnModules
288
+ useGlobalNamesOnModules,
289
+ generateAlias
289
290
  } = finalConfig;
290
291
  const {
291
292
  accessKey,
@@ -376,7 +377,8 @@ var _default = exports.default = {
376
377
  ensureCodeAnnotation,
377
378
  useProfilingData,
378
379
  useRecommendedOrder,
379
- mode
380
+ mode,
381
+ generateAlias
380
382
  };
381
383
  for (const prop in dataToValidate) {
382
384
  const value = dataToValidate[prop];
@@ -411,7 +413,8 @@ var _default = exports.default = {
411
413
  forceAppEnvironment,
412
414
  mode,
413
415
  globalNamesPrefix,
414
- useGlobalNamesOnModules
416
+ useGlobalNamesOnModules,
417
+ generateAlias
415
418
  });
416
419
  if (finalConfig.inputSymbolTable) {
417
420
  const inputSymbolTableContents = await _fs.default.promises.readFile(finalConfig.inputSymbolTable, 'utf-8');
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "jscrambler",
3
3
  "description": "Jscrambler Code Integrity API client.",
4
- "version": "8.9.4",
4
+ "version": "8.10.1",
5
5
  "homepage": "https://github.com/jscrambler/jscrambler",
6
6
  "author": "Jscrambler <support@jscrambler.com>",
7
7
  "repository": {