From 1fd47a6f148c3f021190ea3667ccb46b129113c9 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Thu, 21 Jan 2021 13:17:41 +0300 Subject: [PATCH] Fix srtm/depth features --- .../OsmandInAppPurchaseActivity.java | 2 +- .../chooseplan/ChoosePlanDialogFragment.java | 2 +- .../ChoosePlanFreeBannerDialogFragment.java | 3 +- ...ChoosePlanHillshadeSrtmDialogFragment.java | 60 ++---------------- .../ChoosePlanSeaDepthMapsDialogFragment.java | 63 +++---------------- .../ChoosePlanWikipediaDialogFragment.java | 1 - .../osmand/plus/dialogs/ConfigureMapMenu.java | 2 +- .../plus/download/DownloadActivity.java | 7 ++- .../plus/download/DownloadResources.java | 4 +- .../plus/download/ui/ItemViewHolder.java | 3 +- .../plus/inapp/InAppPurchaseHelper.java | 8 ++- .../controllers/MapDataMenuController.java | 2 +- .../plus/resources/ResourceManager.java | 2 +- .../plus/srtmplugin/ContourLinesMenu.java | 2 +- .../osmand/plus/srtmplugin/SRTMPlugin.java | 10 +-- .../views/corenative/NativeCoreContext.java | 2 +- build.gradle | 2 +- 17 files changed, 39 insertions(+), 136 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/activities/OsmandInAppPurchaseActivity.java b/OsmAnd/src/net/osmand/plus/activities/OsmandInAppPurchaseActivity.java index 6cc1b222bb..ee7b882c54 100644 --- a/OsmAnd/src/net/osmand/plus/activities/OsmandInAppPurchaseActivity.java +++ b/OsmAnd/src/net/osmand/plus/activities/OsmandInAppPurchaseActivity.java @@ -204,7 +204,7 @@ public class OsmandInAppPurchaseActivity extends AppCompatActivity implements In } onInAppPurchaseItemPurchased(sku); fireInAppPurchaseItemPurchasedOnFragments(fragmentManager, sku, active); - if (purchaseHelper != null && purchaseHelper.getContourLines().getSku().equals(sku)) { + if (purchaseHelper != null && purchaseHelper.getFullVersion().getSku().equals(sku)) { if (!(this instanceof MapActivity)) { finish(); } diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java index 6547ae01db..256a845dc7 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanDialogFragment.java @@ -118,7 +118,7 @@ public abstract class ChoosePlanDialogFragment extends BaseOsmAndDialogFragment case SEA_DEPTH_MAPS: return InAppPurchaseHelper.isDepthContoursPurchased(ctx); case CONTOUR_LINES_HILLSHADE_MAPS: - return OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null; + return OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isContourLinesPurchased(ctx); } return false; } diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanFreeBannerDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanFreeBannerDialogFragment.java index bfdeb1b632..aa5a41a1a8 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanFreeBannerDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanFreeBannerDialogFragment.java @@ -30,7 +30,8 @@ public class ChoosePlanFreeBannerDialogFragment extends ChoosePlanDialogFragment private final OsmAndFeature[] planTypeFeatures = { OsmAndFeature.WIKIPEDIA_OFFLINE, - OsmAndFeature.WIKIVOYAGE_OFFLINE, + OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, + OsmAndFeature.SEA_DEPTH_MAPS, OsmAndFeature.UNLIMITED_DOWNLOADS, OsmAndFeature.MONTHLY_MAP_UPDATES, }; diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanHillshadeSrtmDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanHillshadeSrtmDialogFragment.java index d3a48a5a15..b204557717 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanHillshadeSrtmDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanHillshadeSrtmDialogFragment.java @@ -1,16 +1,6 @@ package net.osmand.plus.chooseplan; -import android.app.Activity; -import android.view.View; - -import androidx.annotation.Nullable; - -import net.osmand.plus.R; -import net.osmand.plus.activities.OsmandInAppPurchaseActivity; -import net.osmand.plus.inapp.InAppPurchaseHelper; -import net.osmand.plus.inapp.InAppPurchases.InAppPurchase; - -public class ChoosePlanHillshadeSrtmDialogFragment extends ChoosePlanDialogFragment { +public class ChoosePlanHillshadeSrtmDialogFragment extends ChoosePlanFreeBannerDialogFragment { public static final String TAG = ChoosePlanHillshadeSrtmDialogFragment.class.getSimpleName(); private final OsmAndFeature[] osmLiveFeatures = { @@ -29,6 +19,10 @@ public class ChoosePlanHillshadeSrtmDialogFragment extends ChoosePlanDialogFragm private final OsmAndFeature[] planTypeFeatures = { OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, + OsmAndFeature.SEA_DEPTH_MAPS, + OsmAndFeature.WIKIPEDIA_OFFLINE, + OsmAndFeature.UNLIMITED_DOWNLOADS, + OsmAndFeature.MONTHLY_MAP_UPDATES, }; private final OsmAndFeature[] selectedPlanTypeFeatures = {}; @@ -51,48 +45,4 @@ public class ChoosePlanHillshadeSrtmDialogFragment extends ChoosePlanDialogFragm public OsmAndFeature[] getSelectedPlanTypeFeatures() { return selectedPlanTypeFeatures; } - - @Override - public int getPlanTypeHeaderImageId() { - return R.drawable.img_logo_38dp_contour_lines; - } - - @Override - public String getPlanTypeHeaderTitle() { - return getString(R.string.srtm_plugin_name); - } - - @Override - public String getPlanTypeHeaderDescription() { - return getString(R.string.paid_plugin); - } - - @Override - public String getPlanTypeButtonDescription() { - return getString(R.string.in_app_purchase_desc); - } - - @Override - public void setPlanTypeButtonClickListener(View button) { - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Activity activity = getActivity(); - if (activity != null) { - OsmandInAppPurchaseActivity.purchaseContourLines(activity); - dismiss(); - } - } - }); - } - - @Nullable - @Override - public InAppPurchase getPlanTypePurchase() { - InAppPurchaseHelper purchaseHelper = getOsmandApplication().getInAppPurchaseHelper(); - if (purchaseHelper != null) { - return purchaseHelper.getContourLines(); - } - return null; - } } diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanSeaDepthMapsDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanSeaDepthMapsDialogFragment.java index 211c788c38..8a07c25bef 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanSeaDepthMapsDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanSeaDepthMapsDialogFragment.java @@ -1,21 +1,11 @@ package net.osmand.plus.chooseplan; -import android.app.Activity; -import android.view.View; - -import androidx.annotation.Nullable; - -import net.osmand.plus.R; -import net.osmand.plus.activities.OsmandInAppPurchaseActivity; -import net.osmand.plus.inapp.InAppPurchaseHelper; -import net.osmand.plus.inapp.InAppPurchases.InAppPurchase; - -public class ChoosePlanSeaDepthMapsDialogFragment extends ChoosePlanDialogFragment { +public class ChoosePlanSeaDepthMapsDialogFragment extends ChoosePlanFreeBannerDialogFragment { public static final String TAG = ChoosePlanSeaDepthMapsDialogFragment.class.getSimpleName(); private final OsmAndFeature[] osmLiveFeatures = { - OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, OsmAndFeature.SEA_DEPTH_MAPS, + OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, OsmAndFeature.WIKIPEDIA_OFFLINE, OsmAndFeature.WIKIVOYAGE_OFFLINE, OsmAndFeature.DAILY_MAP_UPDATES, @@ -23,12 +13,16 @@ public class ChoosePlanSeaDepthMapsDialogFragment extends ChoosePlanDialogFragme OsmAndFeature.UNLOCK_ALL_FEATURES, }; private final OsmAndFeature[] selectedOsmLiveFeatures = { - OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, OsmAndFeature.SEA_DEPTH_MAPS, + OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, }; private final OsmAndFeature[] planTypeFeatures = { OsmAndFeature.SEA_DEPTH_MAPS, + OsmAndFeature.CONTOUR_LINES_HILLSHADE_MAPS, + OsmAndFeature.WIKIPEDIA_OFFLINE, + OsmAndFeature.UNLIMITED_DOWNLOADS, + OsmAndFeature.MONTHLY_MAP_UPDATES, }; private final OsmAndFeature[] selectedPlanTypeFeatures = {}; @@ -51,47 +45,4 @@ public class ChoosePlanSeaDepthMapsDialogFragment extends ChoosePlanDialogFragme public OsmAndFeature[] getSelectedPlanTypeFeatures() { return selectedPlanTypeFeatures; } - - @Override - public int getPlanTypeHeaderImageId() { - return R.drawable.img_logo_38dp_sea_depth; - } - - @Override - public String getPlanTypeHeaderTitle() { - return getString(R.string.index_item_depth_contours_osmand_ext); - } - - @Override - public String getPlanTypeHeaderDescription() { - return getString(R.string.in_app_purchase); - } - - @Override - public String getPlanTypeButtonDescription() { - return getString(R.string.in_app_purchase_desc); - } - - @Override - public void setPlanTypeButtonClickListener(View button) { - button.setOnClickListener(new View.OnClickListener() { - @Override - public void onClick(View v) { - Activity activity = getActivity(); - if (activity != null) { - OsmandInAppPurchaseActivity.purchaseDepthContours(activity); - } - } - }); - } - - @Nullable - @Override - public InAppPurchase getPlanTypePurchase() { - InAppPurchaseHelper purchaseHelper = getOsmandApplication().getInAppPurchaseHelper(); - if (purchaseHelper != null) { - return purchaseHelper.getDepthContours(); - } - return null; - } } diff --git a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanWikipediaDialogFragment.java b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanWikipediaDialogFragment.java index 8729bdbbeb..a6b222734e 100644 --- a/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanWikipediaDialogFragment.java +++ b/OsmAnd/src/net/osmand/plus/chooseplan/ChoosePlanWikipediaDialogFragment.java @@ -19,7 +19,6 @@ public class ChoosePlanWikipediaDialogFragment extends ChoosePlanFreeBannerDialo private final OsmAndFeature[] planTypeFeatures = { OsmAndFeature.WIKIPEDIA_OFFLINE, - OsmAndFeature.WIKIVOYAGE_OFFLINE, OsmAndFeature.UNLIMITED_DOWNLOADS, OsmAndFeature.MONTHLY_MAP_UPDATES, }; diff --git a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java index ca7382dd6e..7a0bcb0e79 100644 --- a/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java +++ b/OsmAnd/src/net/osmand/plus/dialogs/ConfigureMapMenu.java @@ -251,7 +251,7 @@ public class ConfigureMapMenu { OsmandPlugin.registerLayerContextMenu(activity.getMapView(), adapter, activity); boolean srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null - && !InAppPurchaseHelper.isSubscribedToLiveUpdates(app); + && !InAppPurchaseHelper.isContourLinesPurchased(app); if (srtmDisabled) { SRTMPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class); if (srtmPlugin != null) { diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index 52bb44bf5f..d076f329f0 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -684,11 +684,12 @@ public class DownloadActivity extends AbstractDownloadActivity implements Downlo } public void initAppStatusVariables() { + OsmandApplication app = getMyApplication(); srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null - && !InAppPurchaseHelper.isSubscribedToLiveUpdates(getMyApplication()); + && !InAppPurchaseHelper.isContourLinesPurchased(app); nauticalPluginDisabled = OsmandPlugin.getEnabledPlugin(NauticalMapsPlugin.class) == null; - freeVersion = Version.isFreeVersion(getMyApplication()); - OsmandPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class); + freeVersion = Version.isFreeVersion(app); + SRTMPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class); srtmNeedsInstallation = srtmPlugin == null || srtmPlugin.needsInstallation(); } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java index f28310645e..4f820bac2a 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadResources.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadResources.java @@ -352,9 +352,7 @@ public class DownloadResources extends DownloadResourceGroup { continue; } if (ii.getType() == DownloadActivityType.DEPTH_CONTOUR_FILE) { - if (InAppPurchaseHelper.isDepthContoursPurchased(app) - || InAppPurchaseHelper.isSubscribedToLiveUpdates(app) - || nauticalMaps.size() == 0) { + if (InAppPurchaseHelper.isDepthContoursPurchased(app) || nauticalMaps.size() == 0) { nauticalMaps.addItem(ii); } continue; diff --git a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java index 9ad1a0f89e..70041a525e 100644 --- a/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java +++ b/OsmAnd/src/net/osmand/plus/download/ui/ItemViewHolder.java @@ -134,8 +134,7 @@ public class ItemViewHolder { srtmDisabled = context.isSrtmDisabled(); nauticalPluginDisabled = context.isNauticalPluginDisabled(); srtmNeedsInstallation = context.isSrtmNeedsInstallation(); - depthContoursPurchased = InAppPurchaseHelper.isDepthContoursPurchased(context.getMyApplication()) - || InAppPurchaseHelper.isSubscribedToLiveUpdates(context.getMyApplication()); + depthContoursPurchased = InAppPurchaseHelper.isDepthContoursPurchased(context.getMyApplication()); } public void bindIndexItem(final IndexItem indexItem) { diff --git a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java index ec13eba2bd..48fd643099 100644 --- a/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java +++ b/OsmAnd/src/net/osmand/plus/inapp/InAppPurchaseHelper.java @@ -153,11 +153,15 @@ public abstract class InAppPurchaseHelper { } public static boolean isDepthContoursPurchased(@NonNull OsmandApplication ctx) { - return Version.isDeveloperBuild(ctx) || ctx.getSettings().DEPTH_CONTOURS_PURCHASED.get(); + return Version.isDeveloperBuild(ctx) + || Version.isPaidVersion(ctx) + || ctx.getSettings().DEPTH_CONTOURS_PURCHASED.get(); } public static boolean isContourLinesPurchased(@NonNull OsmandApplication ctx) { - return Version.isDeveloperBuild(ctx) || ctx.getSettings().CONTOUR_LINES_PURCHASED.get(); + return Version.isDeveloperBuild(ctx) + || Version.isPaidVersion(ctx) + || ctx.getSettings().CONTOUR_LINES_PURCHASED.get(); } public InAppPurchases getInAppPurchases() { diff --git a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java index ac6b8287b4..22d6d97830 100644 --- a/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java +++ b/OsmAnd/src/net/osmand/plus/mapcontextmenu/controllers/MapDataMenuController.java @@ -85,7 +85,7 @@ public class MapDataMenuController extends MenuController { } srtmDisabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) == null - && !InAppPurchaseHelper.isSubscribedToLiveUpdates(app); + && !InAppPurchaseHelper.isContourLinesPurchased(app); OsmandPlugin srtmPlugin = OsmandPlugin.getPlugin(SRTMPlugin.class); srtmNeedsInstallation = srtmPlugin == null || srtmPlugin.needsInstallation(); diff --git a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java index db1c3c96d6..47b4b037df 100644 --- a/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java +++ b/OsmAnd/src/net/osmand/plus/resources/ResourceManager.java @@ -639,7 +639,7 @@ public class ResourceManager { collectFiles(context.getAppPath(IndexConstants.WIKI_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); collectFiles(context.getAppPath(IndexConstants.WIKIVOYAGE_INDEX_DIR), IndexConstants.BINARY_TRAVEL_GUIDE_MAP_INDEX_EXT, files); } - if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(context)) { + if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isContourLinesPurchased(context)) { collectFiles(context.getAppPath(IndexConstants.SRTM_INDEX_DIR), IndexConstants.BINARY_MAP_INDEX_EXT, files); } diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java index 0f12c0a85d..03c6fde1f2 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/ContourLinesMenu.java @@ -52,7 +52,7 @@ public class ContourLinesMenu { final OsmandApplication app = mapActivity.getMyApplication(); final OsmandSettings settings = app.getSettings(); final SRTMPlugin plugin = OsmandPlugin.getPlugin(SRTMPlugin.class); - final boolean srtmEnabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(app); + final boolean srtmEnabled = OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isContourLinesPurchased(app); final RenderingRuleProperty contourLinesProp = app.getRendererRegistry().getCustomRenderingRuleProperty(CONTOUR_LINES_ATTR); final RenderingRuleProperty colorSchemeProp = app.getRendererRegistry().getCustomRenderingRuleProperty(CONTOUR_LINES_SCHEME_ATTR); diff --git a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java index b6f22610e0..dcf9101695 100644 --- a/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java +++ b/OsmAnd/src/net/osmand/plus/srtmplugin/SRTMPlugin.java @@ -14,14 +14,11 @@ import androidx.core.content.ContextCompat; import net.osmand.AndroidUtils; import net.osmand.data.LatLon; -import net.osmand.plus.settings.backend.ApplicationMode; import net.osmand.plus.ContextMenuAdapter; import net.osmand.plus.ContextMenuItem; import net.osmand.plus.DialogListItemAdapter; import net.osmand.plus.OsmandApplication; import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.settings.backend.OsmandSettings; -import net.osmand.plus.settings.backend.CommonPreference; import net.osmand.plus.R; import net.osmand.plus.activities.MapActivity; import net.osmand.plus.dashboard.DashboardOnMap; @@ -31,6 +28,9 @@ import net.osmand.plus.download.DownloadResources; import net.osmand.plus.download.IndexItem; import net.osmand.plus.inapp.InAppPurchaseHelper; import net.osmand.plus.quickaction.QuickActionType; +import net.osmand.plus.settings.backend.ApplicationMode; +import net.osmand.plus.settings.backend.CommonPreference; +import net.osmand.plus.settings.backend.OsmandSettings; import net.osmand.plus.views.OsmandMapTileView; import net.osmand.render.RenderingRuleProperty; import net.osmand.util.Algorithms; @@ -88,13 +88,13 @@ public class SRTMPlugin extends OsmandPlugin { @Override public boolean needsInstallation() { - return super.needsInstallation() && !InAppPurchaseHelper.isSubscribedToLiveUpdates(app); + return super.needsInstallation() + && !InAppPurchaseHelper.isContourLinesPurchased(app); } @Override protected boolean pluginAvailable(OsmandApplication app) { return super.pluginAvailable(app) - || InAppPurchaseHelper.isSubscribedToLiveUpdates(app) || InAppPurchaseHelper.isContourLinesPurchased(app); } diff --git a/OsmAnd/src/net/osmand/plus/views/corenative/NativeCoreContext.java b/OsmAnd/src/net/osmand/plus/views/corenative/NativeCoreContext.java index d3685fc048..02a8e07a2a 100644 --- a/OsmAnd/src/net/osmand/plus/views/corenative/NativeCoreContext.java +++ b/OsmAnd/src/net/osmand/plus/views/corenative/NativeCoreContext.java @@ -61,7 +61,7 @@ public class NativeCoreContext { ObfsCollection obfsCollection = new ObfsCollection(); obfsCollection.addDirectory(directory.getAbsolutePath(), false); - if(OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isSubscribedToLiveUpdates(app)) { + if (OsmandPlugin.getEnabledPlugin(SRTMPlugin.class) != null || InAppPurchaseHelper.isContourLinesPurchased(app)) { obfsCollection.addDirectory(app.getAppPath(IndexConstants.SRTM_INDEX_DIR).getAbsolutePath(), false); } diff --git a/build.gradle b/build.gradle index 2f7736470a..e59a694b17 100644 --- a/build.gradle +++ b/build.gradle @@ -10,7 +10,7 @@ buildscript { } dependencies { //classpath 'com.android.tools.build:gradle:2.+' - classpath 'com.android.tools.build:gradle:4.1.1' + classpath 'com.android.tools.build:gradle:4.1.2' classpath 'com.google.gms:google-services:3.0.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"