Closed ptrivedi2610 closed 4 years ago
First obfuscate all the .py
files in the DirA
pyarmor obfuscate -O dist DirA
Then obfuscate all then entry scripts in the DirB, by the option --exact
, all the scripts list command will be taken as entry scripts
pyarmor obfuscate --no-runtime --exact -O dist --src DirB file3.py file4.py
About the usage of obfuscate and some examples, refer to https://pyarmor.readthedocs.io/en/latest/man.html#obfuscate
@jondy Thanks for the help.
Actually what I am trying to do here is as below
To obfuscate DirA, I used below command, pyarmor obfuscate --recursive --output obf/DirA DirA/init.py
I don't need to obfuscate DirB for now. When I execute files from DirB, it gives following error from one of the DirA files
File "./DirA/sub1/init.py", line 1, in
There are multiple init.py files inside DirA. Is that causing the issue
In this case first create one bootstrap package pytransform_bootstrap
by command runtime
:
cd DirB
pyarmor runtime -O . -i
Then edit any script in DirB, insert one line:
import pytransform_bootstrap
After that, it could import any obfuscate module
Refer to https://pyarmor.readthedocs.io/en/latest/advanced.html#run-bootstrap-code-in-plain-scripts
@jondy Thanks, that fixed the issue
@jondy
I have following directory hierarchy |-DirA |------file1.py |------file2.py |-DirB |------file3.py |------file4.py |-DirC |------file5.py |------file6.py
My requirement is to obfuscate 2 directories DirA & DirB together in such a way that I can run both scripts file3.py & file4.py individually.
Currently, it breaks due to some bootstrap command. What is the command to obfucate them together ?