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
compress qr code data #27
Comments
I hit this. My real https lock (with certs) is fine so luckily this is not impacting me :-) For a test shell script with cert (that doesn't really control a lock https://github.com/mwarning/trigger/pull/30/files) I get an error that its too big (larger than 5000 bytes). |
I tried to apply compression, but the result was not significant enough to be useful. |
I was able to fit some certificates (e.g. for google.com) in the QR-Code. No idea how to improve the situation in general. |
I was not able to scan the qrcode with a generic app to look at the payload (scanning from within Trigger works great). I spent a little time looking at the json export files. I saw a few places in the json payload where there is room for saving some bytes, I do not know if this would apply to qrcode:
Again, I looking at json payload. I'm not sure what the qrcode payload is where space is constrained. |
hm, empty strings and null values should be removed from the QR-Code: https://github.com/mwarning/trigger/blob/v1.9.1/app/src/main/java/com/example/trigger/QRShowActivity.java#L78 |
This encoding for the ssh key could be improved. For now I wanted to be sure to get a string that does not contain binary data or the " character. |
The ssh key is also big because it stores the private and public key. Only the private key should be ok, but I do not know yet how to restore the public key from the private one with the library at hand. |
The QR-Code is ~3400 Bytes now. But that is still too big. |
The private key is about 512 Bytes (4096 bits), so it should be possible to fit it into the QR code - in theory. |
The used library stores the public key along the private key. There is not much i can do right now. Compression won't help here in a significant way. Closing this for now. |
Key or certificates as part of the setup often do not fit into the QR-Code. Compress might help here.
Some data as pictures (in future versions) would need to be removed.
The text was updated successfully, but these errors were encountered: