pyarmor icon indicating copy to clipboard operation
pyarmor copied to clipboard

[BUG] Obfuscate with SPP mode: TypeError: string indices must be integers

Open hongphu8790 opened this issue 2 years ago • 2 comments

Pyarmor version: 7.6.2

Simple classes:

foo.py

class Foo:
    def hello(self, name):
        print("hello {}".format(name))

bar.py

from foo import Foo

class Bar:
    def __init__(self):
        self.foo = Foo()


if __name__ == '__main__':
    bar = Bar()
    bar.foo.hello("Pyarmor in SPP")

Obfuscate with: --advanced 2

pyarmor -d obfuscate  --advanced 2  bar.py && python3 ./dist/bar.py

Working fine with result:

hello Pyarmor in SPP

Obfuscate with: --advanced 5

pyarmor -d obfuscate  --advanced 5  bar.py && python3 ./dist/bar.py

Throws exception

  File "</workspace/test/./dist/bar.py>", line 2, in <module>
  File "<frozen bar>", line 57, in <module>
  File "<frozen bar>", line 49, in protect_pytransform
  File "<frozen bar>", line 35, in spp_caller
TypeError: string indices must be integers

hongphu8790 avatar Sep 12 '22 03:09 hongphu8790

I reproduce it in Windows by Python3.8, I'll check it.

jondy avatar Sep 15 '22 01:09 jondy

Fix it in pre-release pip install https://pyarmor.dashingsoft.com/downloads/temp/pyarmor-7.7.0.zip

jondy avatar Sep 15 '22 06:09 jondy

Fixed in v7.7.0

jondy avatar Sep 28 '22 23:09 jondy