How to obfusucate whole or most of the project? #1555
Unanswered
Cookeh-dev
asked this question in
Q&A
Replies: 2 comments
-
Please check documentation |
Beta Was this translation helpful? Give feedback.
0 replies
-
@Cookeh-dev |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Using pyarmor 8.0+.
I've been messing around with pyarmor all night and got the hang of running some commands.
I have a rather large project, and I am trying to use pyarmor to obfuscate. I purchased the pro version today.
So, I run this command on my main file with my main method:
pyarmor gen --enable-rft --enable-bcc --mix-str --assert-import -r ../main.py
And it generates the obfuscated main file correctly and I can run that file. However, only the main.py is obfuscated. I couldn't really see anywhere I could just obfuscate my project or somehow it knows to look into the imported files of my project and obfuscate those as well.
Now, if I obfuscate two different files which share imports, it won't work of course as they are referencing imports of the non-obfuscated version.
Would appreciate some help.
Example file structure:
project/
----main.py
----class1.py
----class2.py
main.py imports class 1
class 1 imports class 2
How could:
pyarmor gen --enable-rft --enable-bcc --mix-str --assert-import -r ../main.py
obfuscate main.py, and know that it imports class1.py and obfuscate that as well, while knowing class1.py imports class2.py and obfuscates that too.
Or is there some way to obfuscate all the files or list of files together such that it knows to import the related obfuscated files?
Also, how about variables that can no longer be referenced?
AttributeError: 'pyarmor__16' object has no attribute 'w'
This came up after trying:
pyarmor gen --enable-rft --enable-bcc --mix-str --assert-import -r ../main.py ../class1.py
I would also like to mention that if I use the old version commands:
pyarmor-7 pack --name easy-han -e "--hidden-import comtypes --add-data 'config.json;.'" -x " --exclude vnev --exclude tests --exclude make_qrc.py --exclude node_modules --exclude Deploy --exclude venv2" main.py
It works fine - everything is obfuscated and I can run normally. My issue is I would like to make use of the "pro" features since it seems files fail to link with eachother.
I don't think I can make use of the new commands and features of "pro"... let me know. I tried searching on documentation and didn't find much.
I've been trying this as well:
pyarmor gen --exclude "./venv" --recursive -i src
Which gets me files with incorrect imports:
from ..pyarmor_runtime_005400 import __pyarmor__
Beta Was this translation helpful? Give feedback.
All reactions