Closed antverdovsky closed 9 months ago
Please search __assert_armored__
in the documentation, and use this builtin function manually.
I am experiencing the same problem. I get unauthorized use of script (1:1380) when I pack with --private.
It does not occur with pyarmor.cli.core 5.4.2, but with pyarmor.cli.core 5.4.3. Do you have any information on this?
I also get a similar error when using --restrict
, and I also tried restrict_module=2
(which seems to imply this is a duplicate of https://github.com/dashingsoft/pyarmor/issues/1274). My pyinstaller
version is 5.13.2
if thats relevant.
Traceback (most recent call last):
File "<frozen __main__>", line 3, in <module>
File "<frozen protected_main>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
File "<frozen main>", line 3, in <module>
File "<frozen main>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
File "PyInstaller/loader/pyimod02_importers.py", line 385, in exec_module
File "<frozen mymodule>", line 3, in <module>
RuntimeError: unauthorized use of script (1:1380)
It says here that --restrict and --pack cannot be combined, so that pattern may not have been possible originally. But --private has no such statement, and there doesn't seem to be a workaround.
https://pyarmor.readthedocs.io/en/latest/how-to/obfuscation.html#protecting-system-packages
Can you work around the problem by downgrading to 5.4.2?
I don't want to downgrade below 8 as there are some pyarmor deobfuscators out there for <8, but AFAIK version 8 has not been broken.
I also opened a new issue #1676 as I am getting the same issue with --private
.
I meant the version of pyarmor.cli.core, which is a dependent library of pyarmor. pyarmor itself is 8.4.5.
@irreg please refer to #1676
pyarmor.cli.core v5.4.2 has a bug for --private
, so even pack with --private
it still works. core v5.4.3 fixes it.
One solution is described in issue #1676
I have a project with two files: a.py:
main.py:
Following the documentation, I pack the project into an executable using pyinstaller:
If I use pyarmor with
--assert-import
:when I try to run the new
dist/main
, I get the following error:Using pyarmor with
--assert-call
, and runningdist/main
gives me the same error.Is there some other step to enable
assert-import
and--assert-call
when packing withpyinstaller
?