From 1505b77fea44d111c90b7d68700affb8cfb7b453 Mon Sep 17 00:00:00 2001 From: max-klaus Date: Wed, 11 Sep 2019 13:58:03 +0300 Subject: [PATCH] Fix build --- OsmAnd/build.gradle | 15 +++++++-------- OsmAnd/src/net/osmand/plus/HuaweiDrmHelper.java | 11 ++++++----- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/OsmAnd/build.gradle b/OsmAnd/build.gradle index de3d39bf04..66405dedf1 100644 --- a/OsmAnd/build.gradle +++ b/OsmAnd/build.gradle @@ -18,7 +18,7 @@ apply plugin: 'com.android.application' // Less important -def huawei = (!System.getenv("APP_FEATURES") || System.getenv("APP_FEATURES").contains("+huawei")) +def huawei = (System.getenv("APP_FEATURES") && System.getenv("APP_FEATURES").contains("+huawei")) task printc { configurations.each { if(it.isCanBeResolved()) println it.name } @@ -255,8 +255,10 @@ task downloadWorldMiniBasemap { task downloadHuaweiDrm { doLast { - ant.get(src: 'https://obs.cn-north-2.myhwclouds.com/hms-ds-wf/sdk/HwDRM_SDK_2.5.2.300_ADT.zip', dest: 'HwDRM_SDK_2.5.2.300_ADT.zip', skipexisting: 'true') - ant.unzip(src: 'HwDRM_SDK_2.5.2.300_ADT.zip', dest: 'libs/') + if (huawei) { + ant.get(src: 'https://obs.cn-north-2.myhwclouds.com/hms-ds-wf/sdk/HwDRM_SDK_2.5.2.300_ADT.zip', dest: 'HwDRM_SDK_2.5.2.300_ADT.zip', skipexisting: 'true') + ant.unzip(src: 'HwDRM_SDK_2.5.2.300_ADT.zip', dest: 'libs/') + } } } @@ -325,11 +327,8 @@ task collectExternalResources { updateNoTranslate, validateTranslate, copyWidgetIcons, - downloadWorldMiniBasemap - - if (huawei) { - downloadHuaweiDrm - } + downloadWorldMiniBasemap, + downloadHuaweiDrm } // Legacy core build diff --git a/OsmAnd/src/net/osmand/plus/HuaweiDrmHelper.java b/OsmAnd/src/net/osmand/plus/HuaweiDrmHelper.java index e5a27e37db..3de6dbc0e6 100644 --- a/OsmAnd/src/net/osmand/plus/HuaweiDrmHelper.java +++ b/OsmAnd/src/net/osmand/plus/HuaweiDrmHelper.java @@ -1,14 +1,13 @@ package net.osmand.plus; import android.app.Activity; -import android.widget.Toast; -import com.huawei.android.sdk.drm.Drm; -import com.huawei.android.sdk.drm.DrmCheckCallback; +//import com.huawei.android.sdk.drm.Drm; +//import com.huawei.android.sdk.drm.DrmCheckCallback; public class HuaweiDrmHelper { private Activity activity; - private DrmCheckCallback callback; + //private DrmCheckCallback callback; //Copyright protection id private static final String DRM_ID = "101048021"; @@ -17,6 +16,7 @@ public class HuaweiDrmHelper { public HuaweiDrmHelper(final Activity activity) { this.activity = activity; + /* callback = new DrmCheckCallback() { @Override public void onCheckSuccess() { } @@ -26,10 +26,11 @@ public class HuaweiDrmHelper { activity.finish(); } }; + */ } public void check() { - Drm.check(getActivity(), getActivity().getPackageName(), DRM_ID, DRM_PUBLIC_KEY, callback); + //Drm.check(getActivity(), getActivity().getPackageName(), DRM_ID, DRM_PUBLIC_KEY, callback); } public Activity getActivity() {