You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm a little confused with the readme file.
If I use the renameGlobals=true parameter, it renames globals, and functions. ok.
If I have a function that is called from another script, the call is broken. ok.
So I have to exclude it from the renaming list with reservedNames. ok.
The problem is that doing this, it is not obfuscated.
Is there a way so I can rename it, at obfuscation, without touching the source code ?
For example, saying that this string THISFUNCTION, should always be renamed with this TiHiIiSiFiUiNiCiTiIiOiN or with ghfdffgfhdfjghdfgjdsfhgf when obfuscated.
This way, when I obfuscate any script, I can keep the function call by maintaining some coherence.
Same thing for globals.
note that THISFUNCTION can be a function name, and of course a string corresponding to a javascript call.
hmm, that means what we can do something like REPLACE function inside obfuscator?
Like:
// config{"identifierNamesCache": {_date: newDate()}// just example, mb I wrong }// code constdate=_date;// _date is not defined, but should be replaced by "new Date()"
"identifierNamesCache": {
"globalIdentifiers": {
_date: new Date()
}
}
You can do this, but this is not the expected use case for this option (because I limited globalIdentifiers usage to undeclared variables.
If sometime in the future I will add the way to control identifier names, it will the way through identifierNamesGenerator option.
@sanex3339 for use this like replace in code, we should add second obfuscate (or obfuscate only replaced values) or we get unobfuscated values, functions and etc.
yep, I now. I mean, if we add feature for replace code as expected, we also should add obfuscation for replaced values
or we have second choice - obfuscate values before inserting for replace.
Thank you for testing. Probably from tomorrow and all this and partially next week I won't be able to finish this PR, because of my vacation. I'll finish in a week.
Activity
sanex3339 commentedon Jun 23, 2020
The solution is to implement
name cachelikeuglifyJsandterserare doing.challengeable commentedon Nov 18, 2020
Was this ever completed ?
sanex3339 commentedon Nov 18, 2020
In the future. Right now I have other priorities.
challengeable commentedon Nov 18, 2020
Okay, is there a known workaround ?
sanex3339 commentedon Nov 18, 2020
only with
reservedNameschallengeable commentedon Nov 18, 2020
Returning a Map with the old function/vars => new obf functions/vars would allow us to come up with potential alternatives
sanex3339 commentedon Nov 18, 2020
I will implement names cache (that writes into the file) in the future (like uglify.js does) but i haven't any date. Sometime in next year.
sanex3339 commentedon Mar 7, 2021
I think, i have to implement this as the next big feature.
31 remaining items
BlackYuzia commentedon May 31, 2021
hmm, that means what we can do something like REPLACE function inside obfuscator?
Like:
sanex3339 commentedon May 31, 2021
With
You can do this, but this is not the expected use case for this option (because I limited
globalIdentifiersusage to undeclared variables.If sometime in the future I will add the way to control identifier names, it will the way through
identifierNamesGeneratoroption.BlackYuzia commentedon May 31, 2021
Tested, that work now

sanex3339 commentedon May 31, 2021
The empty option object now should work correctly
BlackYuzia commentedon May 31, 2021
did that bug? 👀
I was try do like you say - #629 (comment)
sanex3339 commentedon May 31, 2021
No. Dictionary values should be strings.
BlackYuzia commentedon May 31, 2021
yep, work now.
That all or we should test anything more?
BlackYuzia commentedon May 31, 2021
@sanex3339 for use this like
replace in code, we should add second obfuscate (or obfuscate only replaced values) or we get unobfuscated values, functions and etc.sanex3339 commentedon May 31, 2021
All replaced values won't be obfuscated. So as I said before this use case is not an expected use case.
BlackYuzia commentedon May 31, 2021
yep, I now. I mean, if we add feature for replace code as expected, we also should add obfuscation for replaced values
or we have second choice - obfuscate values before inserting for replace.
sanex3339 commentedon May 31, 2021
I don't know how i will do this right now. Right now this is the cache only for reuse some names between files
sanex3339 commentedon May 31, 2021
Thank you for testing. Probably from tomorrow and all this and partially next week I won't be able to finish this PR, because of my vacation. I'll finish in a week.
sanex3339 commentedon May 31, 2021
Why not? Released as
2.14.0. Enjoy! For any bugs, please create a new issue