Fix build

This commit is contained in:
max-klaus 2019-09-11 13:58:03 +03:00
parent e861741fe6
commit 05b87e1ed8
2 changed files with 13 additions and 13 deletions

View file

@ -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,9 +255,11 @@ task downloadWorldMiniBasemap {
task downloadHuaweiDrm {
doLast {
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/')
}
}
}
task collectVoiceAssets(type: Sync) {
@ -325,11 +327,8 @@ task collectExternalResources {
updateNoTranslate,
validateTranslate,
copyWidgetIcons,
downloadWorldMiniBasemap
if (huawei) {
downloadWorldMiniBasemap,
downloadHuaweiDrm
}
}
// Legacy core build

View file

@ -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() {