Open tady159 opened 8 years ago
If you want only this to be fixed, you can take commit (https://github.com/sejans/pyminifier/commit/62622e9171407b056c2633f3fd7a37a08f1764e3) that solves this problem - https://github.com/liftoff/pyminifier/issues/54: --obfuscate-variables - obfuscates class static attributes as well
The result will be something like this:
class utM:
integer=0
letter='A'
decimal=1.9
def __init__(utw,integer,letter,decimal):
utw._integer=integer
utw._letter=letter
utw._decimal=decimal
def getInteger(utw):
return utw._integer
t=utM(1,"B",2.62)
print(t.getInteger())
print(t.integer)
I was trying a simple test with a class, and I have noticed that although pyminifier does obfuscate class members within the class itself, it doesn't change calls from outside the class, here's an example to illustrate this:
file test.py
And here's the result using
It can be noticed that although "integer" and "getInteger" do get obfuscated inside the class, on the call outside the class, they're not, and of course, this code can't run, because
'o' object has no attribute 'getInteger'
, etc.