VirtCode / SmartMouse

use your smartphone as a normal computer mouse
GNU General Public License v3.0
97 stars 6 forks source link

App crashes with invalid mac address #7

Closed Zeeoneoof closed 9 months ago

Zeeoneoof commented 9 months ago

On Android 14, adding the device manually and pressing connect crashes the app. If this project is still being worked on, please let me know if there are any ways to get a log of the app.

Zeeoneoof commented 9 months ago

Nevermind, it seems to be a mismatch of MAC address formats, I apologize for the inconvenience.

VirtCode commented 9 months ago

Hey, I'm glad you could resolve the issue! However, the app should give an error if the user enters a wrongly formatted MAC address and should never crash. Could you quickly elaborate on what you have entered for it to crash?

Zeeoneoof commented 9 months ago

I have entered the format as XX-XX-XX-XX... and so on. I'm not sure why it has crashed, although I'll also look through the code if I can assist.

Zeeoneoof commented 9 months ago

Looking at /java/.../ui/connect/dialog/AddManualSubdialog.java, it looks like it was meant to accept MAC addresses of type (XX-XX...), it might be something to do when trying to connect to that device.

VirtCode commented 9 months ago

Yes, you're right. Android was expecting MAC addresses in the format XX:XX:XX:XX:XX:XX, but as you pointed out, the regex allowed for dashes and lower-case letters. I've just fixed that in commit https://github.com/VirtCode/SmartMouse/commit/e7abb4c1dbbe277babdb2b1ddb95ebef964cfc7a and they are now converted to the expected format. So those addresses work properly now. I'll upload a new build for the current release in a few minutes. Thank you so much for your help!