pyarmor icon indicating copy to clipboard operation
pyarmor copied to clipboard

[Question] Skipping code obfuscation inline in super and advance mode.

Open parseltongued opened this issue 3 years ago • 1 comments

Hi,

I'm writing in pyspark and have issues in running the obfuscated code because of User Defined Functions (UDF). The error thrown is by cloudpickle. Is there a way to skip certain parts of code in a function to be obfuscated (ie. function calls)?

I've seen there's a way using inline comments for pyarmor to skip code in spp-mode, however did not find the equivalent for super mode and advance mode. '''pyarmor options: no-spp-mode'''

Thank you.

Environment pyarmor usage: project mode

OS: Ubuntu 20.04.5 LTS (Focal Fossa) x86-64
Java: openjdk 1.8.0_352
Javac: 1.8.0_352

Apache Spark: 3.1.3-bin-hadoop3.2 2.4.0-bin-hadoop2.7 [GCC 7.5.0] : Anaconda, Inc. on linux

INFO PyArmor Version 7.7.3 (Enterprise) INFO Python 3.9.12

parseltongued avatar Dec 09 '22 06:12 parseltongued

Update: Issue resolved by extracting the offending UDF into a new file and excluding it in the build manifest. However if having an inline comment option for tool to auto detect and not obfuscate the particular function call would be great.

parseltongued avatar Dec 09 '22 12:12 parseltongued