Comments (9)
I tested on small test code, but the obfuscated _ _ pragma _ _ () line compiled without an error. It seems that it produces an error only in a certain situations.
from opy.
When I erased the line including _ _ pragma _ _, Transcrypt threw another error in the new _ _ pragma _ _. Following is the python source:
api = __pragma__ ('js',
'{}',
'BABYLON'
)
Following is the obfuscated code producing an error
l1lll1ll1ll1_opy_ = __pragma__ (l1l111l1_opy_ (u"ࠧࡵࠪੲ"),
l1l111l1_opy_ (u"ࠨࡽࢀࠫੳ"),
l1l111l1_opy_ (u"ࠩࡅࡅࡇࡌࡐࡐࠪੴ")
)
I checked the argument('l1l111l1_opy_ '). It is a function existing in the file, and it looks ok. The error message doesn't say anything helping except the line number.
I think that Transcrypt fails recognizing _ _ pragma _ _ (). after obfuscated
from opy.
Hi!
So you're using Opy and Transcrypt in combination...
I hadn't anticipated that, thought minifiation would do the trick well enough...
But...
It probably can be solved, from my head:
-Switch off string obfuscation altogether, it doesn't offer much protection anyhow.
-Add \_\_pragma\_\_
to the list of names that shouldn't be obfuscated.
I've never tried Opy and Transcrypt together, though.
I only use Opy (intensively) for the CPython code I write for my profession.
Curious about your results.
BTW l1l111l1_opy_
is the string deobfuscator function.
Keep me informed. Maybe some small alterations to Opy are required to spare the __pragma__'s.
But as said you may get by with just switching of string obfuscation.
Kind regards
Jacques
from opy.
Transcrypt throws an syntax error on \_\_pragma\_\_
. As you can see above pragma() is used in outside comment too.
As to minification, do you mean Pyminfier? Does it support multi module? Please give me a recommendation about a good minifier. I thought that Pyminifier and most other free obfuscators worked only in a single file.
Due to the issue of source protection of Javascript, I thought that it was ok even if Transcrypt produces unreadable code. I don't really want to read translated Javascript code, and actually I don't have to apply obfuscation if unreadable. But, Transcrypt is producing clean readable Javascript, so I need obfuscation.
from opy.
I don't mean using Pyminifier. It wasn't usable for me.
I mean that the minified JavaScript that Transcrypt produces in the .min.js files, is hard to read anyhow and may not need any further obfuscation.
Currently I think Opy is the best Python minifier around, I wrote it because I could not find anything else.
Have you tried Opy while setting string obfuscation to False in the config file?
Does that work for you?
from opy.
I didn't know generated *.min.js files are obfuscated already. I looked at the files, it was good enough. Problem solved. Thank you again!
from opy.
They are not really deliberately obfuscated, but the result isn't too easy to read...
Take care not to include sourcemaps however, so don't use the -m switch.
from opy.
Does *.min.js file include source information if compiled with -m switch? I thought that source map created with -m switch was stored in *.map files. Is it still not safe to distribute only *.min.js file if compiled with -m switch?
from opy.
No, the .min.js file doesn't contain source information, it only contains a link to where the sourcemap should be on the server. And the sourcemap (a different file) contains info about the sourcefiles. But if you only distribute the *.min.js file, this link is worthless (or rather: harmless).
About the .min.js file: It is generated by the Google Closure compiler, and its purpose is minification, not obfuscation. So its obscurity is a side effect. In very critical cases it may not be obscure enough. E.g. not all names are mangled and there are tools around that format it neatly as indendented "pretty" source (with the mangled names, that is).
from opy.
Related Issues (20)
- Bug: syntax error in obfuscated code when using multi-line string literals HOT 3
- Help option HOT 1
- error when install using pip install Opy with python3.5 HOT 3
- opy obfuscated only itself but didn't obfuscate the .py HOT 6
- imported local lib, prevent obfuscation
- Prevent parameter keyword obfuscation HOT 4
- tensorflow obfuscation error
- Obfuscate numbers HOT 2
- No module named opy.__main__; 'opy' is a package and cannot be directly executed HOT 3
- Licence for the opy_config.txt
- Opy Error
- Toggle off obfuscation for dictionary key names HOT 3
- Namedtuples? HOT 5
- error import l1llllll_opy HOT 1
- opy.py hanging and then fails
- commented quotation mark is causing execution failure HOT 1
- 1
- fail to copy or obfuscate files
- New OPY .. OPY2 by me .. EMAD MAHDI HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opy.