## Summary
Not having support for MMS caused some minor problems, like in https://bugs.kde.org/show_bug.cgi?id=398889 . This patch adds basic MMS support for plain-text MMS, including multi-target messages.
Android companion to https://invent.kde.org/kde/kdeconnect-kde/merge_requests/97
Currently there are several rough areas:
- Multi-target messages do not have the full list of recipients (I am planning to work on this in another patch, because this one is already quite large enough)
- Parsing MMS is significantly slower than parsing SMS. This makes sense, since we need to make significantly many more content:// calls for MMS. The only solution I can think of here is to add the ability to request a range of messages, which I need to do anyway, but which should not be part of this patch.
- The desktop app is totally busted with regard to multi-target MMS, but that will also be fixed in another MR
BUG: 398889
## Test Plan
### Before:
Open SMS app on desktop, scroll through conversations, notice:
- Any single-target message which had the most-recent message as an MMS does not appear
- Any multi-target MMS conversations do not appear
### After:
Open SMS app on desktop, notice:
- Conversations which have an MMS as their most-recent message appear
- MMS which consisted of only text are rendered correctly
- Multi-target conversations are shown (though pretty busted, as said before. Do not attempt to reply to one!)
This would happen to people who transferred their KDE Connect config from
one phone to another (mostly with backup apps that only work on rooted
phones). This led to a state where other devices would always reject the
connection because the certificate CN didn't match the device ID.
On the PC side this is not a problem because the certificate is the source
of truth for the device ID.
Summary:
So from android 8 onwards it appears that fetching content from "cleartext" urls is disabled by default
https://stackoverflow.com/questions/45940861/android-8-cleartext-http-traffic-not-permitted
I have a mpris service running on my local computer which is connected to the android, that service is also serving cover art for currently playing song. Obviously I can not have a domain set for my computer on a local machine, so cover art urls look like
`http://<ip>:<port>/<songid>.ext` . Since this restriction was introduced into android 8, kde connect is not able to fetch the art from this url.
This is patch allows connections to raw IPs addresses as well. If there is any security issues regarding this change, I'm prepared to do more work, my suggestion would be to check if IP address in this case matches paired computer's IP address, although this would still be a bit annoying (especially since whatever malicious file can be served from a "cleartext" link as well).
Test Plan:
- start some sort of server which can serve an image on a paired computer
- create mpris Player instance on a paired computer and set the `mpris:artUrl` to the served address where this image is available
- open kde connect android app, select prepared player and see default cover art instead of the served image
- change artUrl to some image from the web
- check in kde connect again and see it correctly show a remote image
Reviewers: #kde_connect, nicolasfella, albertvaka
Reviewed By: #kde_connect, nicolasfella, albertvaka
Subscribers: albertvaka, nicolasfella, andyholmes, kdeconnect
Tags: #kde_connect
Differential Revision: https://phabricator.kde.org/D21247