Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require pyca/cryptography >= 3.1, and add tools/fake-v35-device.py #424

Merged
merged 5 commits into from
Nov 16, 2023

Conversation

uzlonewolf
Copy link
Collaborator

An interesting use of fake-v35-device.py is setting bcast_to to the IP of either a SmartLife-running device or a gateway/hub device and changing gwId/real_key to that of one of your devices - doing this will cause said device to send v3.5 commands to this script, which you can then inspect and reverse engineer. This is basically how I got v3.5 support working despite not having any v3.5 devices.

ttcorefunc.py is a "known good" copy of tinytuya/core.py (with most of the device stuff stripped out). By forcing it to use PyCryptodome I was able to use fake-v35-device.py to test the pyca/cryptography functions in the real tinytuya/core.py.

tools/ttcorefunc.py Dismissed Show dismissed Hide dismissed
tools/fake-v35-device.py Dismissed Show dismissed Hide dismissed
@jasonacox
Copy link
Owner

jasonacox commented Nov 16, 2023

✅ Worked for my use case from #423 ...

Was

DEBUG:TinyTuya [1.13.0]

DEBUG:Python 3.6.9 (default, Mar 10 2023, 16:46:00) 
[GCC 8.4.0] on linux
DEBUG:Using pyca/cryptography 2.1.4 for crypto, GCM is supported

This PR

DEBUG:TinyTuya [1.13.0]

DEBUG:Python 3.6.9 (default, Mar 10 2023, 16:46:00) 
[GCC 8.4.0] on linux
DEBUG:Using PyCryptodome 3.18.0 for crypto, GCM is supported

Testing others...

✅ Linux
✅ Win11
✅ MacOS
✅ RPi

@jasonacox jasonacox merged commit d17d031 into jasonacox:master Nov 16, 2023
11 checks passed
@jasonacox
Copy link
Owner

Thanks @uzlonewolf ! I've pushed v1.13.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants