jso-protector 0.2.0 → 0.4.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/index.js CHANGED
@@ -39,6 +39,7 @@ const JS_CONFUSER_OPTION_KEYS = [
39
39
  "stringCompression",
40
40
  "stringConcealing",
41
41
  "stringEncoding",
42
+ "stringSplitting",
42
43
  "target"
43
44
  ];
44
45
 
@@ -66,6 +67,7 @@ const JS_CONFUSER_DETECT_KEYS = [
66
67
  "stringCompression",
67
68
  "stringConcealing",
68
69
  "stringEncoding",
70
+ "stringSplitting",
69
71
  "variableMasking"
70
72
  ];
71
73
 
@@ -173,12 +175,34 @@ function translateJavascriptObfuscatorOptions(sourceOptions = {}, overrides = {}
173
175
  }
174
176
 
175
177
  mapBooleanOption(source, "stringArray", translated.options, "MoveStrings");
178
+ mapBooleanOption(source, "stringArrayIndexShift", translated.options, "StringArrayIndexShift");
179
+ mapBooleanOption(source, "stringArrayShuffle", translated.options, "StringArrayShuffle");
180
+ mapBooleanOption(source, "stringArrayRotate", translated.options, "StringArrayRotate");
181
+ if (source.stringArrayIndexesType !== undefined) translated.options.StringArrayIndexesType = normalizeStringArrayIndexesType(source.stringArrayIndexesType).join("\n");
182
+ mapBooleanOption(source, "stringArrayCallsTransform", translated.options, "StringArrayCallsTransform");
183
+ if (source.stringArrayCallsTransformThreshold !== undefined) translated.options.StringArrayCallsTransformThreshold = normalizeProbability(source.stringArrayCallsTransformThreshold, "stringArrayCallsTransformThreshold");
184
+ if (source.stringArrayWrappersCount !== undefined) translated.options.StringArrayWrappersCount = normalizeIntegerRange(source.stringArrayWrappersCount, "stringArrayWrappersCount", 0, 10);
185
+ mapExplicitBooleanOption(source, "stringArrayWrappersChainedCalls", translated.options, "StringArrayWrappersChainedCalls");
186
+ if (source.stringArrayWrappersParametersMaxCount !== undefined) translated.options.StringArrayWrappersParametersMaxCount = normalizeIntegerRange(source.stringArrayWrappersParametersMaxCount, "stringArrayWrappersParametersMaxCount", 2, 5);
187
+ if (source.stringArrayWrappersType !== undefined) translated.options.StringArrayWrappersType = normalizeStringArrayWrappersType(source.stringArrayWrappersType);
188
+ mapBooleanOption(source, "transformObjectKeys", translated.options, "TransformObjectKeys");
189
+ mapBooleanOption(source, "splitStrings", translated.options, "SplitStrings");
190
+ if (source.splitStringsChunkLength !== undefined) translated.options.SplitStringsChunkLength = normalizeSplitStringsChunkLength(source.splitStringsChunkLength);
176
191
  mapBooleanOption(source, "unicodeEscapeSequence", translated.options, "EncodeStrings");
177
192
  mapBooleanOption(source, "controlFlowFlattening", translated.options, "DeepObfuscate");
178
193
  mapBooleanOption(source, "controlFlowFlattening", translated.options, "FlatTransform");
179
194
  mapBooleanOption(source, "deadCodeInjection", translated.options, "AddDeadCode");
180
195
  mapBooleanOption(source, "renameGlobals", translated.options, "RenameGlobals");
181
196
  mapBooleanOption(source, "renameProperties", translated.options, "RenameMembers");
197
+ mapExplicitBooleanOption(source, "selfDefending", translated.options, "SelfDefending");
198
+ mapExplicitBooleanOption(source, "debugProtection", translated.options, "DebugProtection");
199
+ if (source.debugProtectionInterval !== undefined) translated.options.DebugProtectionIntervalMilliseconds = normalizeDebugProtectionInterval(source.debugProtectionInterval);
200
+ mapExplicitBooleanOption(source, "disableConsoleOutput", translated.options, "DisableConsoleOutput");
201
+ mapExplicitBooleanOption(source, "numbersToExpressions", translated.options, "EncodeNumbers");
202
+ if (source.domainLockRedirectUrl !== undefined) translated.options.LockDomainRedirectUrl = normalizeRuntimeRedirectUrl(source.domainLockRedirectUrl);
203
+ if (source.seed !== undefined) translated.options.Seed = normalizeSeedValue(source.seed);
204
+ if (source.reservedStrings !== undefined) translated.options.ReservedStrings = normalizeReservedStringPatterns(source.reservedStrings).join("\n");
205
+ if (source.forceTransformStrings !== undefined) translated.options.ForceTransformStrings = normalizeReservedStringPatterns(source.forceTransformStrings, "forceTransformStrings").join("\n");
182
206
 
183
207
  if (source.stringArrayEncoding !== undefined) {
184
208
  const encodings = Array.isArray(source.stringArrayEncoding) ? source.stringArrayEncoding : [source.stringArrayEncoding];
@@ -189,8 +213,10 @@ function translateJavascriptObfuscatorOptions(sourceOptions = {}, overrides = {}
189
213
  }
190
214
  }
191
215
 
192
- if (source.stringArrayThreshold !== undefined && Number(source.stringArrayThreshold) > 0) {
193
- translated.options.MoveStrings = true;
216
+ if (source.stringArrayThreshold !== undefined) {
217
+ const threshold = normalizeProbability(source.stringArrayThreshold, "stringArrayThreshold");
218
+ translated.options.StringArrayThreshold = threshold;
219
+ if (source.stringArray !== false) translated.options.MoveStrings = threshold > 0;
194
220
  }
195
221
 
196
222
  if (source.deadCodeInjectionThreshold !== undefined) {
@@ -280,10 +306,12 @@ function translateJsConfuserOptions(sourceOptions = {}, overrides = {}) {
280
306
  mapBooleanOption(source, "stringEncoding", translated.options, "EncodeStrings");
281
307
  mapBooleanOption(source, "stringConcealing", translated.options, "EncryptStrings");
282
308
  mapBooleanOption(source, "duplicateLiteralsRemoval", translated.options, "MoveStrings");
309
+ mapJsConfuserEnablementOption(source, "stringSplitting", translated.options, "SplitStrings");
283
310
  mapBooleanOption(source, "controlFlowFlattening", translated.options, "DeepObfuscate");
284
311
  mapBooleanOption(source, "controlFlowFlattening", translated.options, "FlatTransform");
285
312
  mapBooleanOption(source, "deadCode", translated.options, "AddDeadCode");
286
313
  mapBooleanOption(source, "globalConcealing", translated.options, "RenameGlobals");
314
+ mapExplicitBooleanOption(source, "hexadecimalNumbers", translated.options, "EncodeNumbers");
287
315
 
288
316
  if (source.stringCompression === true || source.minify === true || source.compact === true) {
289
317
  translated.options.SelfCompression = true;
@@ -317,22 +345,23 @@ function translateJsConfuserOptions(sourceOptions = {}, overrides = {}) {
317
345
  translated.options.LockDateValue = formatLockDateValue(lock.endDate);
318
346
  }
319
347
  if (lock && lock.antiDebug !== undefined) {
320
- translated.jsConfuserLockAntiDebug = lock.antiDebug;
348
+ translated.options.DebugProtection = jsConfuserLockEnabled(lock.antiDebug);
321
349
  }
322
350
  if (lock && lock.integrity !== undefined) {
323
- translated.jsConfuserLockIntegrity = lock.integrity;
351
+ translated.options.SelfDefending = jsConfuserLockEnabled(lock.integrity);
324
352
  }
325
353
  if (lock && lock.selfDefending !== undefined) {
326
- translated.jsConfuserLockSelfDefending = lock.selfDefending;
354
+ translated.options.SelfDefending = jsConfuserLockEnabled(lock.selfDefending) || translated.options.SelfDefending === true;
327
355
  }
328
356
  if (lock && lock.startDate !== undefined) {
329
- translated.jsConfuserLockStartDate = formatLockDateValue(lock.startDate);
357
+ translated.options.LockStartDate = true;
358
+ translated.options.LockStartDateValue = formatLockDateValue(lock.startDate);
330
359
  }
331
360
  if (lock && lock.countermeasures !== undefined) {
332
361
  translated.jsConfuserLockCountermeasures = formatReviewString(lock.countermeasures);
333
362
  }
334
363
  if (lock && lock.tamperProtection !== undefined) {
335
- translated.jsConfuserLockTamperProtection = lock.tamperProtection;
364
+ translated.options.AntiMonkeyPatching = jsConfuserLockEnabled(lock.tamperProtection);
336
365
  }
337
366
 
338
367
  return {
@@ -345,6 +374,10 @@ function translateJsConfuserOptions(sourceOptions = {}, overrides = {}) {
345
374
  };
346
375
  }
347
376
 
377
+ function jsConfuserLockEnabled(value) {
378
+ return value === true || (typeof value === "number" && Number.isFinite(value) && value > 0);
379
+ }
380
+
348
381
  function formatLockDateValue(value) {
349
382
  const text = String(value || "").trim();
350
383
  if (/^\d{8}$/.test(text)) return text;
@@ -367,6 +400,89 @@ function mapBooleanOption(source, sourceKey, target, targetKey) {
367
400
  if (source[sourceKey] === true) target[targetKey] = true;
368
401
  }
369
402
 
403
+ function mapExplicitBooleanOption(source, sourceKey, target, targetKey) {
404
+ if (typeof source[sourceKey] === "boolean") target[targetKey] = source[sourceKey];
405
+ }
406
+
407
+ function mapJsConfuserEnablementOption(source, sourceKey, target, targetKey) {
408
+ const value = source[sourceKey];
409
+ if (typeof value === "function") throw new Error(`${sourceKey} selector functions require manual migration review`);
410
+ if (typeof value === "boolean") target[targetKey] = value;
411
+ else if (typeof value === "number" && Number.isFinite(value) && value >= 0) target[targetKey] = value > 0;
412
+ }
413
+
414
+ function normalizeDebugProtectionInterval(value) {
415
+ const number = Number(value);
416
+ if (!Number.isInteger(number) || number < 0 || (number > 0 && number < 100) || number > 60000) {
417
+ throw new Error("debugProtectionInterval must be 0 or an integer from 100 through 60000 milliseconds");
418
+ }
419
+ return number;
420
+ }
421
+
422
+ function normalizeRuntimeRedirectUrl(value) {
423
+ const text = String(value || "").trim();
424
+ const safeRelative = text.startsWith("/") && !text.startsWith("//") && !text.includes("\\");
425
+ let safeAbsolute = false;
426
+ try {
427
+ const parsed = new URL(text);
428
+ safeAbsolute = parsed.protocol === "https:" || parsed.protocol === "http:";
429
+ } catch { }
430
+ if (!safeRelative && !safeAbsolute) throw new Error("domainLockRedirectUrl must be an HTTP(S) URL or same-origin root-relative path");
431
+ return text;
432
+ }
433
+
434
+ function normalizeSeedValue(value) {
435
+ if ((typeof value !== "string" && typeof value !== "number") || (typeof value === "number" && !Number.isFinite(value))) {
436
+ throw new Error("seed must be a finite number or non-empty string");
437
+ }
438
+ const text = String(value).trim();
439
+ if (!text) throw new Error("seed must be a finite number or non-empty string");
440
+ return text;
441
+ }
442
+
443
+ function normalizeSplitStringsChunkLength(value) {
444
+ const number = Number(value);
445
+ if (!Number.isInteger(number) || number < 1 || number > 1024) throw new Error("splitStringsChunkLength must be an integer from 1 through 1024");
446
+ return number;
447
+ }
448
+
449
+ function normalizeProbability(value, label) {
450
+ const number = Number(value);
451
+ if (!Number.isFinite(number) || number < 0 || number > 1) throw new Error(`${label} must be a number from 0 through 1`);
452
+ return number;
453
+ }
454
+
455
+ function normalizeIntegerRange(value, label, minimum, maximum) {
456
+ const number = Number(value);
457
+ if (!Number.isInteger(number) || number < minimum || number > maximum) throw new Error(`${label} must be an integer from ${minimum} through ${maximum}`);
458
+ return number;
459
+ }
460
+
461
+ function normalizeStringArrayWrappersType(value) {
462
+ const normalized = String(value || "").trim().toLowerCase();
463
+ if (normalized !== "variable" && normalized !== "function") throw new Error("stringArrayWrappersType supports only variable or function");
464
+ return normalized;
465
+ }
466
+
467
+ function normalizeReservedStringPatterns(value, label = "reservedStrings") {
468
+ const raw = Array.isArray(value) ? value : String(value || "").split(",");
469
+ const patterns = raw.map((item) => String(item).trim()).filter(Boolean);
470
+ if (patterns.length > 100) throw new Error(`${label} accepts at most 100 patterns`);
471
+ if (patterns.some((pattern) => pattern.length > 512)) throw new Error(`${label} patterns must be at most 512 characters`);
472
+ return patterns;
473
+ }
474
+
475
+ function normalizeStringArrayIndexesType(value) {
476
+ const values = Array.isArray(value) ? value : [value];
477
+ if (!values.length) throw new Error("stringArrayIndexesType must include at least one supported value");
478
+ const supported = new Set(["hexadecimal-number", "hexadecimal-numeric-string"]);
479
+ const normalized = values.map((item) => String(item).trim().toLowerCase());
480
+ if (normalized.some((item) => !supported.has(item))) {
481
+ throw new Error("stringArrayIndexesType supports only hexadecimal-number and hexadecimal-numeric-string");
482
+ }
483
+ return [...new Set(normalized)];
484
+ }
485
+
370
486
  function ensureProtectionConfig(options) {
371
487
  if (options && options.__jsoMergedConfig) return options;
372
488
  return createProtectionConfig(options || {});
@@ -525,13 +641,20 @@ async function protectFiles(options = {}) {
525
641
  throw new Error("No matching input files found.");
526
642
  }
527
643
 
528
- const request = core.buildRequestFromItems(plan.config, plan.protection.items);
529
- const result = await core.protectItems(plan.config, request.Items);
530
-
531
- core.writeResults(plan.files, result, plan.protection.transforms, plan.config);
644
+ let result;
645
+ let manifestTransforms = plan.protection.transforms;
646
+ if (core.hasNamedSets(plan.config)) {
647
+ const grouped = await core.protectGroupedFiles(plan.config, plan.files);
648
+ result = grouped.result;
649
+ manifestTransforms = grouped.transforms;
650
+ } else {
651
+ const request = core.buildRequestFromItems(plan.config, plan.protection.items);
652
+ result = await core.protectItems(plan.config, request.Items);
653
+ core.writeResults(plan.files, result, plan.protection.transforms, plan.config);
654
+ }
532
655
  core.copyAssets(plan.assets);
533
656
 
534
- const manifest = core.buildProtectionManifest(plan.config, plan.files, plan.assets, result, plan.protection.transforms);
657
+ const manifest = core.buildProtectionManifest(plan.config, plan.files, plan.assets, result, manifestTransforms);
535
658
  core.assertSizeBudgets(manifest, plan.config);
536
659
  core.writeManifest(plan.config.manifest, manifest);
537
660
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "$schema": "./jso.config.schema.json",
3
- "endpoint": "https://www.javascriptobfuscator.com/HttpApi.ashx",
3
+ "endpoint": "https://javascriptobfuscator.com/HttpApi.ashx",
4
4
  "apiKey": "$JSO_API_KEY",
5
5
  "apiPassword": "$JSO_API_PASSWORD",
6
6
  "projectName": "browser-release",
@@ -48,7 +48,7 @@
48
48
  "endpoint": {
49
49
  "type": "string",
50
50
  "format": "uri",
51
- "default": "https://www.javascriptobfuscator.com/HttpApi.ashx"
51
+ "default": "https://javascriptobfuscator.com/HttpApi.ashx"
52
52
  },
53
53
  "apiKey": {
54
54
  "type": "string",
@@ -93,7 +93,8 @@
93
93
  "stringArrayThreshold": {
94
94
  "type": "number",
95
95
  "minimum": 0,
96
- "description": "javascript-obfuscator compatibility option that enables MoveStrings when greater than zero."
96
+ "maximum": 1,
97
+ "description": "Direct javascript-obfuscator mapping to StringArrayThreshold. Applies per-unique-literal probability and is reproducible under Seed."
97
98
  },
98
99
  "unicodeEscapeSequence": {
99
100
  "type": "boolean",
@@ -141,25 +142,29 @@
141
142
  },
142
143
  "debugProtection": {
143
144
  "type": "boolean",
144
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
145
+ "description": "javascript-obfuscator compatibility option mapped directly to the hosted DebugProtection engine guard. Runtime behavior must still be smoke-tested."
145
146
  },
146
147
  "debugProtectionInterval": {
147
- "type": "number",
148
+ "type": "integer",
148
149
  "minimum": 0,
149
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
150
+ "maximum": 60000,
151
+ "description": "javascript-obfuscator compatibility interval mapped directly to DebugProtectionIntervalMilliseconds. Use 0 or 100-60000 milliseconds."
150
152
  },
151
153
  "disableConsoleOutput": {
152
154
  "type": "boolean",
153
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
155
+ "description": "javascript-obfuscator compatibility option mapped directly to DisableConsoleOutput."
154
156
  },
155
157
  "domainLockRedirectUrl": {
156
158
  "type": "string",
157
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
159
+ "minLength": 1,
160
+ "maxLength": 2048,
161
+ "description": "javascript-obfuscator compatibility option mapped directly to the domain-lock-specific LockDomainRedirectUrl after safe-scheme validation."
158
162
  },
159
163
  "forceTransformStrings": {
160
164
  "type": "array",
161
- "items": { "type": "string" },
162
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
165
+ "maxItems": 100,
166
+ "items": { "type": "string", "maxLength": 512 },
167
+ "description": "javascript-obfuscator compatibility regex patterns mapped directly to ForceTransformStrings. Matching literals override ReservedStrings and pass through enabled string transforms."
163
168
  },
164
169
  "identifiersDictionary": {
165
170
  "type": "array",
@@ -188,7 +193,7 @@
188
193
  },
189
194
  "numbersToExpressions": {
190
195
  "type": "boolean",
191
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
196
+ "description": "Approximate javascript-obfuscator compatibility mapping to EncodeNumbers. Numeric literals are obscured, but generated expression shape is not preserved."
192
197
  },
193
198
  "renamePropertiesMode": {
194
199
  "type": "string",
@@ -196,8 +201,9 @@
196
201
  },
197
202
  "reservedStrings": {
198
203
  "type": "array",
199
- "items": { "type": "string" },
200
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
204
+ "maxItems": 100,
205
+ "items": { "type": "string", "maxLength": 512 },
206
+ "description": "javascript-obfuscator compatibility regex patterns mapped directly to ReservedStrings. Matching literals remain verbatim outside MoveStrings and EncodeStrings; each pattern is limited to 512 characters."
201
207
  },
202
208
  "seed": {
203
209
  "type": ["string", "number"],
@@ -205,7 +211,7 @@
205
211
  },
206
212
  "selfDefending": {
207
213
  "type": "boolean",
208
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
214
+ "description": "javascript-obfuscator compatibility option mapped directly to the hosted SelfDefending engine guard. Runtime behavior must still be smoke-tested."
209
215
  },
210
216
  "simplify": {
211
217
  "type": "boolean",
@@ -237,58 +243,63 @@
237
243
  },
238
244
  "splitStrings": {
239
245
  "type": "boolean",
240
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
246
+ "description": "javascript-obfuscator compatibility option mapped directly to SplitStrings. Eligible literals are emitted as fixed-length concatenated chunks."
241
247
  },
242
248
  "splitStringsChunkLength": {
243
- "type": "number",
244
- "minimum": 0,
245
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
249
+ "type": "integer",
250
+ "minimum": 1,
251
+ "maximum": 1024,
252
+ "description": "Chunk length mapped directly to SplitStringsChunkLength; defaults to 10 when omitted."
246
253
  },
247
254
  "stringArrayCallsTransform": {
248
255
  "type": "boolean",
249
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
256
+ "description": "Direct javascript-obfuscator mapping to StringArrayCallsTransform. Adds secondary index-table indirection."
250
257
  },
251
258
  "stringArrayCallsTransformThreshold": {
252
259
  "type": "number",
253
260
  "minimum": 0,
254
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
261
+ "maximum": 1,
262
+ "description": "Direct javascript-obfuscator mapping to StringArrayCallsTransformThreshold. Applies per-lookup indirection probability."
255
263
  },
256
264
  "stringArrayIndexShift": {
257
265
  "type": "boolean",
258
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
266
+ "description": "Approximate javascript-obfuscator mapping to StringArrayIndexShift. Adds a nonzero table offset; vendor-specific randomized magnitude is not reproduced."
267
+ },
268
+ "stringArrayShuffle": {
269
+ "type": "boolean",
270
+ "description": "Direct javascript-obfuscator mapping to StringArrayShuffle. Randomizes moved-string table order while preserving lookups."
259
271
  },
260
272
  "stringArrayIndexesType": {
261
273
  "oneOf": [
262
- { "type": "string" },
263
- { "type": "array", "items": { "type": "string" } }
274
+ { "type": "string", "enum": ["hexadecimal-number", "hexadecimal-numeric-string"] },
275
+ { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "enum": ["hexadecimal-number", "hexadecimal-numeric-string"] } }
264
276
  ],
265
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
277
+ "description": "Direct javascript-obfuscator mapping to StringArrayIndexesType. Supports numeric and numeric-string hexadecimal lookups."
266
278
  },
267
279
  "stringArrayRotate": {
268
280
  "type": "boolean",
269
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
270
- },
271
- "stringArrayShuffle": {
272
- "type": "boolean",
273
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
281
+ "description": "Direct javascript-obfuscator mapping to StringArrayRotate. Cyclically rotates moved-string table order by a per-build offset."
274
282
  },
275
283
  "stringArrayWrappersChainedCalls": {
276
284
  "type": "boolean",
277
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
285
+ "description": "Direct mapping controlling whether native string-table wrappers delegate through predecessors."
278
286
  },
279
287
  "stringArrayWrappersCount": {
280
- "type": "number",
288
+ "type": "integer",
281
289
  "minimum": 0,
282
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
290
+ "maximum": 10,
291
+ "description": "Approximate mapping to 0-10 native root-level wrappers; competitor per-scope placement is not reproduced."
283
292
  },
284
293
  "stringArrayWrappersParametersMaxCount": {
285
- "type": "number",
286
- "minimum": 0,
287
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
294
+ "type": "integer",
295
+ "minimum": 2,
296
+ "maximum": 5,
297
+ "description": "Direct mapping for function-wrapper parameter count ceiling."
288
298
  },
289
299
  "stringArrayWrappersType": {
290
300
  "type": "string",
291
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
301
+ "enum": ["variable", "function"],
302
+ "description": "Direct mapping selecting variable aliases or function wrappers."
292
303
  },
293
304
  "ignoreImports": {
294
305
  "type": "boolean",
@@ -296,7 +307,7 @@
296
307
  },
297
308
  "transformObjectKeys": {
298
309
  "type": "boolean",
299
- "description": "javascript-obfuscator review-only compatibility field. Accepted for migration review."
310
+ "description": "Approximate mapping to TransformObjectKeys. Safe identifier and quoted data keys move into computed lookups; semantic-sensitive keys remain literal."
300
311
  },
301
312
  "webPreset": {
302
313
  "type": "string",
@@ -345,6 +356,15 @@
345
356
  "type": "boolean",
346
357
  "description": "Convenience alias for options.KeepComment."
347
358
  },
359
+ "targetVersion": {
360
+ "type": "string",
361
+ "enum": ["es5", "modern"],
362
+ "description": "Convenience alias for options.TargetVersion. es5 (default) down-levels ES2015+ syntax; modern keeps native syntax for current browsers."
363
+ },
364
+ "downlevelIteration": {
365
+ "type": "boolean",
366
+ "description": "Convenience alias for options.DownlevelIteration: spec-faithful ES5 for-of lowering (lazy stepping + IteratorClose), at a per-step cost on arrays. No effect when targetVersion is modern."
367
+ },
348
368
  "protectObjectDeclaration": {
349
369
  "type": "boolean",
350
370
  "description": "Convenience alias for options.ReorderCodeObjectDeclare."
@@ -386,30 +406,92 @@
386
406
  "type": "string",
387
407
  "description": "Convenience alias for options.LockDateMsg."
388
408
  },
409
+ "selfHealing": {
410
+ "type": "boolean",
411
+ "description": "Convenience alias for options.SelfHealing. Requires SelfDefending and is browser-only."
412
+ },
413
+ "selfDefendingIntervalSeconds": {
414
+ "type": "integer",
415
+ "minimum": 1,
416
+ "maximum": 86400,
417
+ "description": "Convenience alias for options.SelfDefendingIntervalSeconds. Repeats browser integrity checks; omit for invocation-only checks."
418
+ },
419
+ "debugProtectionIntervalMilliseconds": {
420
+ "type": "integer",
421
+ "minimum": 0,
422
+ "maximum": 60000,
423
+ "description": "Native debug timing interval. Use 0 to disable periodic timing probes or 100-60000 milliseconds."
424
+ },
425
+ "selfHealingMaxAttempts": {
426
+ "type": "integer",
427
+ "minimum": 1,
428
+ "maximum": 10,
429
+ "description": "Convenience alias for options.SelfHealingMaxAttempts."
430
+ },
431
+ "antiMonkeyPatching": {
432
+ "type": "boolean",
433
+ "description": "Convenience alias for options.AntiMonkeyPatching. Browser-only."
434
+ },
435
+ "antiMonkeyPatchingCleanRealm": {
436
+ "type": "boolean",
437
+ "description": "Convenience alias for options.AntiMonkeyPatchingCleanRealm."
438
+ },
439
+ "antiMonkeyPatchingIncludeGlobals": {
440
+ "type": "string",
441
+ "description": "Comma/newline-separated dotted API paths added to the anti-monkey-patching watch list."
442
+ },
443
+ "antiMonkeyPatchingExcludeGlobals": {
444
+ "type": "string",
445
+ "description": "Comma/newline-separated dotted API paths removed from the anti-monkey-patching watch list."
446
+ },
447
+ "runtimeDefenseAction": {
448
+ "type": "string",
449
+ "enum": ["throw", "blank", "redirect", "reload", "callback", "degrade"],
450
+ "description": "Convenience alias for options.RuntimeDefenseAction."
451
+ },
452
+ "runtimeDefenseCallback": {
453
+ "type": "string",
454
+ "minLength": 1,
455
+ "maxLength": 512,
456
+ "description": "Convenience alias for options.RuntimeDefenseCallback. Dotted global callback path."
457
+ },
458
+ "runtimeDefenseRedirectUrl": {
459
+ "type": "string",
460
+ "minLength": 1,
461
+ "maxLength": 2048,
462
+ "description": "Convenience alias for options.RuntimeDefenseRedirectUrl. Use HTTP(S) or a same-origin root-relative path."
463
+ },
389
464
  "jsConfuserLockAntiDebug": {
390
465
  "oneOf": [
391
466
  { "type": "boolean" },
392
467
  { "type": "number", "minimum": 0 }
393
468
  ],
394
- "description": "JS-Confuser review-only compatibility field. Preserves lock.antiDebug intent for manual review."
469
+ "description": "Approximate JS-Confuser compatibility mapping to DebugProtection. Numeric probability values collapse to enabled/disabled."
470
+ },
471
+ "stringSplitting": {
472
+ "oneOf": [
473
+ { "type": "boolean" },
474
+ { "type": "number", "minimum": 0, "maximum": 1 }
475
+ ],
476
+ "description": "Approximate JS-Confuser compatibility mapping to SplitStrings. Numeric probability collapses to enabled when greater than zero; selector functions require manual migration review."
395
477
  },
396
478
  "jsConfuserLockIntegrity": {
397
479
  "oneOf": [
398
480
  { "type": "boolean" },
399
481
  { "type": "number", "minimum": 0 }
400
482
  ],
401
- "description": "JS-Confuser review-only compatibility field. Preserves lock.integrity intent for manual review."
483
+ "description": "Approximate JS-Confuser compatibility mapping to SelfDefending. Numeric probability values collapse to enabled/disabled."
402
484
  },
403
485
  "jsConfuserLockSelfDefending": {
404
486
  "oneOf": [
405
487
  { "type": "boolean" },
406
488
  { "type": "number", "minimum": 0 }
407
489
  ],
408
- "description": "JS-Confuser review-only compatibility field. Preserves lock.selfDefending intent for manual review."
490
+ "description": "Approximate JS-Confuser compatibility mapping to SelfDefending. Numeric probability values collapse to enabled/disabled."
409
491
  },
410
492
  "jsConfuserLockStartDate": {
411
493
  "type": "string",
412
- "description": "JS-Confuser review-only compatibility field. Preserves lock.startDate intent for manual review."
494
+ "description": "Approximate JS-Confuser compatibility mapping to LockStartDate and LockStartDateValue."
413
495
  },
414
496
  "jsConfuserLockCountermeasures": {
415
497
  "type": "string",
@@ -420,7 +502,7 @@
420
502
  { "type": "boolean" },
421
503
  { "type": "number", "minimum": 0 }
422
504
  ],
423
- "description": "JS-Confuser review-only compatibility field. Preserves lock.tamperProtection intent for manual review."
505
+ "description": "Approximate JS-Confuser compatibility mapping to AntiMonkeyPatching. Numeric probability values collapse to enabled/disabled."
424
506
  },
425
507
  "assetExclude": {
426
508
  "type": "array",
@@ -431,6 +513,15 @@
431
513
  "type": "boolean",
432
514
  "default": false
433
515
  },
516
+ "local": {
517
+ "type": "boolean",
518
+ "default": false,
519
+ "description": "Protect on this machine with the bundled jso-local executable instead of sending source to the hosted API. Windows only; a source-free plan check still runs online."
520
+ },
521
+ "localExe": {
522
+ "type": "string",
523
+ "description": "Path to cli/jso-local.exe from the Windows desktop download. Defaults to JSO_LOCAL_EXE, then the usual install locations."
524
+ },
434
525
  "reservedNames": {
435
526
  "type": "array",
436
527
  "items": { "type": "string" },
@@ -513,6 +604,20 @@
513
604
  "properties": {
514
605
  "EncodeStrings": { "type": "boolean" },
515
606
  "MoveStrings": { "type": "boolean" },
607
+ "SplitStrings": { "type": "boolean" },
608
+ "SplitStringsChunkLength": { "type": "integer", "minimum": 1, "maximum": 1024 },
609
+ "StringArrayIndexShift": { "type": "boolean" },
610
+ "StringArrayShuffle": { "type": "boolean" },
611
+ "StringArrayRotate": { "type": "boolean" },
612
+ "StringArrayIndexesType": { "type": "string", "pattern": "^(hexadecimal-number|hexadecimal-numeric-string)(\\n(hexadecimal-number|hexadecimal-numeric-string))*$" },
613
+ "StringArrayThreshold": { "type": "number", "minimum": 0, "maximum": 1 },
614
+ "StringArrayCallsTransform": { "type": "boolean" },
615
+ "StringArrayCallsTransformThreshold": { "type": "number", "minimum": 0, "maximum": 1 },
616
+ "StringArrayWrappersCount": { "type": "integer", "minimum": 0, "maximum": 10 },
617
+ "StringArrayWrappersChainedCalls": { "type": "boolean" },
618
+ "StringArrayWrappersParametersMaxCount": { "type": "integer", "minimum": 2, "maximum": 5 },
619
+ "StringArrayWrappersType": { "type": "string", "enum": ["variable", "function"] },
620
+ "TransformObjectKeys": { "type": "boolean" },
516
621
  "ReplaceNames": { "type": "boolean" },
517
622
  "RenameGlobals": { "type": "boolean" },
518
623
  "RenameMembers": { "type": "boolean" },
@@ -541,7 +646,24 @@
541
646
  "LockDomainMsg": { "type": "string" },
542
647
  "LockDate": { "type": "boolean" },
543
648
  "LockDateValue": { "type": "string", "pattern": "^[0-9]{8}$" },
544
- "LockDateMsg": { "type": "string" }
649
+ "LockDateMsg": { "type": "string" },
650
+ "LockStartDate": { "type": "boolean" },
651
+ "LockStartDateValue": { "type": "string", "pattern": "^[0-9]{8}$" },
652
+ "LockStartDateMsg": { "type": "string" },
653
+ "LockBrowser": { "type": "boolean" },
654
+ "LockBrowserList": { "type": "string" },
655
+ "LockBrowserMsg": { "type": "string" },
656
+ "LockOS": { "type": "boolean" },
657
+ "LockOSList": { "type": "string" },
658
+ "LockOSMsg": { "type": "string" },
659
+ "SelfDefending": { "type": "boolean" },
660
+ "SelfHealing": { "type": "boolean" },
661
+ "SelfHealingMaxAttempts": { "type": "integer", "minimum": 1, "maximum": 10 },
662
+ "AntiMonkeyPatching": { "type": "boolean" },
663
+ "AntiMonkeyPatchingCleanRealm": { "type": "boolean" },
664
+ "AntiMonkeyPatchingIncludeGlobals": { "type": "string" },
665
+ "AntiMonkeyPatchingExcludeGlobals": { "type": "string" },
666
+ "RuntimeDefenseAction": { "type": "string", "enum": ["throw", "blank", "redirect", "reload", "callback", "degrade"] }
545
667
  }
546
668
  }
547
669
  }