use http://osmand.net/go URL as HTTP url for sharing

For the record, I do not think it is a good idea to share location using
HTTP, it should always be HTTPS.  There are too many privacy concerns.
@vshcherb says he plans on adding HTTPS to osmand.net, so that will be good
once it happens.
This commit is contained in:
Hans-Christoph Steiner 2015-01-19 20:55:11 +01:00
parent 01bb7d091f
commit 56eee3216f
2 changed files with 11 additions and 6 deletions

View file

@ -79,7 +79,11 @@
</intent-filter>
<intent-filter>
<data android:scheme="http" android:host="download.osmand.net" android:path="go" />
<data android:scheme="http" />
<data android:scheme="https" />
<data android:host="osmand.net" />
<data android:host="download.osmand.net" />
<data android:path="go" />
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

View file

@ -43,11 +43,12 @@ public class ShareLocation extends OsmAndAction {
final double longitude = args.getDouble(MapActivityActions.KEY_LONGITUDE);
final int zoom = args.getInt(MapActivityActions.KEY_ZOOM);
try {
final String shortOsmUrl = MapUtils.buildShortOsmUrl(latitude, longitude, zoom);
final String geoUrl = MapUtils.buildGeoUrl(latitude, longitude, zoom);
String sms = mapActivity.getString(R.string.send_location_sms_pattern, geoUrl, shortOsmUrl);
// TODO change this to HTTPS once it is setup!
final String httpUrl = "http://osmand.net/go?lat=" + ((float) latitude) + "&lon=" + ((float) longitude) + "&z=" + zoom;
String sms = mapActivity.getString(R.string.send_location_sms_pattern, geoUrl, httpUrl);
if (which == 0) {
sendEmail(shortOsmUrl, geoUrl);
sendEmail(httpUrl, geoUrl);
} else if (which == 1) {
sendSms(sms);
} else if (which == 2) {
@ -69,8 +70,8 @@ public class ShareLocation extends OsmAndAction {
private void sendEmail(final String shortOsmUrl, final String geoUrl) {
String email = mapActivity.getString(R.string.send_location_email_pattern, shortOsmUrl, geoUrl);
private void sendEmail(final String httpUrl, final String geoUrl) {
String email = mapActivity.getString(R.string.send_location_email_pattern, httpUrl, geoUrl);
ShareDialog.sendEmail(mapActivity, email, getString(R.string.send_location));
}