object of type 'NoneType' has no len()
Closed this issue · 2 comments
Hello. I've got some error. It just exported only part of my codes, not full export. Please help to fix it. I use Frida-server.apk 16.4.8
Traceback (most recent call last):
File "/home/zippy/.venv/lib/python3.12/site-packages/frida/core.py", line 562, in _on_message
callback(message, data)
File "/home/zippy/authy-offline.py", line 58, in onMessage
parseXML(dataFile)
File "/home/zippy/authy-offline.py", line 126, in parseXML
totp = pyotp.TOTP(secret, digits=digits, interval=30).now()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zippy/.venv/lib/python3.12/site-packages/pyotp/totp.py", line 64, in now
return self.generate_otp(self.timecode(datetime.datetime.now()))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/zippy/.venv/lib/python3.12/site-packages/pyotp/otp.py", line 35, in generate_otp
hasher = hmac.new(self.byte_secret(), self.int_to_bytestring(input), self.digest)
^^^^^^^^^^^^^^^^^^
File "/home/zippy/.venv/lib/python3.12/site-packages/pyotp/otp.py", line 49, in byte_secret
missing_padding = len(secret) % 8
^^^^^^^^^^^
TypeError: object of type 'NoneType' has no len()
Commited 718655d
Reworked some of the implementation and added a few checks. It still might not parse every accountType
but it now shouldn't crash.
It works, thank you!