Custom Obfuscation Problem

I’d like to use custom obfuscation settings but are running into issues. When using a full set of options, the compilation throws an error, obfuscation couldn’t be performed, probably due to an error in my code. Strangely no error in the logfile, no further compilation has been possible afterwards, even when switching back to the presets, until Appstudio got restartet.

Same code.js with the same settings on https://obfuscator.io/ gets processed without any issues and works properly.

Tried to find out if one of my options would cause the problem, but even the simplest manifest like:

{
"compact":true,
"selfDefending":true
}

doesn’t work in Appstudio, this time it showed an error, log attached.
appstudio-latest.log (1.4 KB)

Try modifying your obfuscation settings as follows:

{
"stringArrayEncoding": [],
"compact":true,
"selfDefending":true
}

(We’ve fixed this in the next build so it isn’t necessary)

Thanks, this works, but my settings are actually much more extensive and throw the mentioned error about a syntax error in my code, while obfusction work on the website:

{
"compact":true,
"selfDefending":true,
"disableConsoleOutput":true,
"debugProtection":true,
"debugProtectionInterval":2000,
"splitStrings":false,
"splitStringsChunkLength":10,
"splitStringsChunkLengthEnabled":false,
"stringArray":true,
"stringArrayRotate":true,
"stringArrayRotateEnabled":true,
"stringArrayShuffle":true,
"stringArrayShuffleEnabled":true,
"simplify":true,
"stringArrayThreshold":1,
"stringArrayThresholdEnabled":true,
"stringArrayIndexesType":["hexadecimal-number"],
"stringArrayIndexShift":true,
"stringArrayCallsTransform":false,
"stringArrayCallsTransformThreshold":0.5,
"stringArrayEncoding":["base64"],
"stringArrayEncodingEnabled":true,
"stringArrayWrappersCount":1,
"stringArrayWrappersChainedCalls":true,
"stringArrayWrappersParametersMaxCount":2,
"stringArrayWrappersType":"variable",
"numbersToExpressions":false,
"sourceMap":false,
"sourceMapMode":"off",
"sourceMapBaseUrl":"",
"sourceMapFileName":"",
"domainLock":[".myDomain.com"],
"domainLockRedirectUrl":"about:blank",
"domainLockEnabled":true,
"forceTransformStrings":[],
"reservedNames":[],
"reservedStrings":[],
"seed":0,
"controlFlowFlatteningThreshold":1,
"controlFlowFlattening":true,
"deadCodeInjectionThreshold":0.4,
"deadCodeInjection":true,
"unicodeEscapeSequence":false,
"renameGlobals":false,
"renameProperties":false,
"renamePropertiesMode":"safe",
"target":"browser",
"identifierNamesGenerator":"hexadecimal",
"identifiersDictionary":[],
"identifiersPrefix":"",
"transformObjectKeys":true,
"ignoreImports":false,
"rotateStringArray":true,
"rotateStringArrayEnabled":true,
"shuffleStringArray":true,
"shuffleStringArrayEnabled":true,
"sourceMapSeparate":false
}

Internally, I can see a bit more about the error:

sourceMapMode must be one of the following values: inline, separate

See the docs.

I took those values from obfuscator.io’s session state.
Tried with value ‘inline’, but still the same error :frowning_face:

Is there no way to show more details of build errors in the log?

I made the same change here and it worked:

{
"compact":true,
"selfDefending":true,
"disableConsoleOutput":true,
"debugProtection":true,
"debugProtectionInterval":2000,
"splitStrings":false,
"splitStringsChunkLength":10,
"splitStringsChunkLengthEnabled":false,
"stringArray":true,
"stringArrayRotate":true,
"stringArrayRotateEnabled":true,
"stringArrayShuffle":true,
"stringArrayShuffleEnabled":true,
"simplify":true,
"stringArrayThreshold":1,
"stringArrayThresholdEnabled":true,
"stringArrayIndexesType":["hexadecimal-number"],
"stringArrayIndexShift":true,
"stringArrayCallsTransform":false,
"stringArrayCallsTransformThreshold":0.5,
"stringArrayEncoding":["base64"],
"stringArrayEncodingEnabled":true,
"stringArrayWrappersCount":1,
"stringArrayWrappersChainedCalls":true,
"stringArrayWrappersParametersMaxCount":2,
"stringArrayWrappersType":"variable",
"numbersToExpressions":false,
"sourceMap":false,
"sourceMapMode":"inline",
"sourceMapBaseUrl":"",
"sourceMapFileName":"",
"domainLock":[".myDomain.com"],
"domainLockRedirectUrl":"about:blank",
"domainLockEnabled":true,
"forceTransformStrings":[],
"reservedNames":[],
"reservedStrings":[],
"seed":0,
"controlFlowFlatteningThreshold":1,
"controlFlowFlattening":true,
"deadCodeInjectionThreshold":0.4,
"deadCodeInjection":true,
"unicodeEscapeSequence":false,
"renameGlobals":false,
"renameProperties":false,
"renamePropertiesMode":"safe",
"target":"browser",
"identifierNamesGenerator":"hexadecimal",
"identifiersDictionary":[],
"identifiersPrefix":"",
"transformObjectKeys":true,
"ignoreImports":false,
"rotateStringArray":true,
"rotateStringArrayEnabled":true,
"shuffleStringArray":true,
"shuffleStringArrayEnabled":true,
"sourceMapSeparate":false
}

Tried the exact settings but no success: error message, browser opens and code.js is without obfuscation.
AS then reacts very slow, like something is still running in the background, have to restart.

Where can I send you the link to my source so you can try yourself?

I also exited and restarted AppStudio - maybe that will help.

I certainly did that too, so it can’t be the cause.
I’d like to send you my source so you can see what’s happening, since there show now errors in the log - which I believe is strange as well

Sure, I’ll give it a try.