mirror of
https://github.com/javascript-obfuscator/javascript-obfuscator
synced 2026-08-09 12:42:29 +00:00
String array now stored as a function to make self defending possible
This commit is contained in:
@@ -33,6 +33,12 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
|
||||
@initializable()
|
||||
private stringArrayName!: string;
|
||||
|
||||
/**
|
||||
* @type {string}
|
||||
*/
|
||||
@initializable()
|
||||
private stringArrayFunctionName!: string;
|
||||
|
||||
/**
|
||||
* @param {TIdentifierNamesGeneratorFactory} identifierNamesGeneratorFactory
|
||||
* @param {ICustomCodeHelperFormatter} customCodeHelperFormatter
|
||||
@@ -59,13 +65,16 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
|
||||
|
||||
/**
|
||||
* @param {IStringArrayStorage} stringArrayStorage
|
||||
* @param {string} stringArrayFunctionName
|
||||
* @param {string} stringArrayName
|
||||
*/
|
||||
public initialize (
|
||||
stringArrayStorage: IStringArrayStorage,
|
||||
stringArrayFunctionName: string,
|
||||
stringArrayName: string
|
||||
): void {
|
||||
this.stringArrayStorage = stringArrayStorage;
|
||||
this.stringArrayFunctionName = stringArrayFunctionName;
|
||||
this.stringArrayName = stringArrayName;
|
||||
}
|
||||
|
||||
@@ -83,6 +92,7 @@ export class StringArrayCodeHelper extends AbstractCustomCodeHelper {
|
||||
protected override getCodeHelperTemplate (): string {
|
||||
return this.customCodeHelperFormatter.formatTemplate(StringArrayTemplate(), {
|
||||
stringArrayName: this.stringArrayName,
|
||||
stringArrayFunctionName: this.stringArrayFunctionName,
|
||||
stringArrayStorageItems: this.getEncodedStringArrayStorageItems()
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user