From c6f3f7afdaa19c4e32ad3a7d1d7488e4dc690e04 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Tue, 4 Sep 2018 23:10:53 +0200 Subject: [PATCH 1/3] Add parameter to check live --- .../net/osmand/plus/download/DownloadActivityType.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java index 28f4922ed0..9944264550 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java @@ -233,8 +233,14 @@ public class DownloadActivityType { } public String getBaseUrl(OsmandApplication ctx, String fileName) { - return "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN + "/download?event=2&" + String url = "http://" + IndexConstants.INDEX_DOWNLOAD_DOMAIN + "/download?event=2&" + Version.getVersionAsURLParam(ctx) + "&file=" + encode(fileName); + if(this == LIVE_UPDATES_FILE && fileName.length() > 16) { + // DATE_AND_EXT_STR_LEN = "_18_06_02.obf.gz".length() + String region = fileName.substring(0, fileName.length() - 16).toLowerCase(); + url += "®ion" + encode(region); + } + return url; } From fcd1f99ca7f8030533135287a41969355c3105b3 Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 5 Sep 2018 00:56:45 +0200 Subject: [PATCH 2/3] Add parameter to check live --- OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java index 9944264550..88f3431eb3 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivityType.java @@ -238,7 +238,7 @@ public class DownloadActivityType { if(this == LIVE_UPDATES_FILE && fileName.length() > 16) { // DATE_AND_EXT_STR_LEN = "_18_06_02.obf.gz".length() String region = fileName.substring(0, fileName.length() - 16).toLowerCase(); - url += "®ion" + encode(region); + url += "®ion=" + encode(region); } return url; } From 0c285dc9edb1ea3935f6459c51770aa9506e133f Mon Sep 17 00:00:00 2001 From: Victor Shcherb Date: Wed, 5 Sep 2018 01:53:24 +0200 Subject: [PATCH 3/3] Fix missing search --- OsmAnd/res/layout/context_menu_card_image.xml | 2 +- OsmAnd/res/values/strings.xml | 2 +- .../net/osmand/plus/search/SendSearchQueryBottomSheet.java | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/OsmAnd/res/layout/context_menu_card_image.xml b/OsmAnd/res/layout/context_menu_card_image.xml index fe2f2fefd7..f29f59ff39 100644 --- a/OsmAnd/res/layout/context_menu_card_image.xml +++ b/OsmAnd/res/layout/context_menu_card_image.xml @@ -28,7 +28,7 @@ android:textColor="?attr/color_dialog_buttons" android:textSize="@dimen/default_list_text_size" android:visibility="gone" - tools:text="http://osmand.net/images/123456789012.jpg" + tools:text="https://osmand.net/images/123456789012.jpg" tools:visibility="visible"/> diff --git a/OsmAnd/src/net/osmand/plus/search/SendSearchQueryBottomSheet.java b/OsmAnd/src/net/osmand/plus/search/SendSearchQueryBottomSheet.java index bfb171ecce..27e8b4f2b8 100644 --- a/OsmAnd/src/net/osmand/plus/search/SendSearchQueryBottomSheet.java +++ b/OsmAnd/src/net/osmand/plus/search/SendSearchQueryBottomSheet.java @@ -44,7 +44,8 @@ public class SendSearchQueryBottomSheet extends MenuBottomSheetDialogFragment { if (Algorithms.isEmpty(searchQuery)) { return; } - params.put(searchQuery, searchLocation); + params.put("query", searchQuery); + params.put("location", searchLocation); items.add(new TitleItem(getString(R.string.send_search_query))); final int themeRes = nightMode ? R.style.OsmandDarkTheme : R.style.OsmandLightTheme; final TextView textView = (TextView) View.inflate(new ContextThemeWrapper(getContext(), themeRes), @@ -73,7 +74,7 @@ public class SendSearchQueryBottomSheet extends MenuBottomSheetDialogFragment { Toast.makeText(app, R.string.internet_not_available, Toast.LENGTH_LONG).show(); dismiss(); } else { - AndroidNetworkUtils.sendRequestAsync(app, "http://osmand.net/api/missing_search", params, + AndroidNetworkUtils.sendRequestAsync(app, "https://osmand.net/api/missing_search", params, null, true, true, new AndroidNetworkUtils.OnRequestResultListener() { @Override public void onResult(String result) {