Panagiotis Triantafyllou

new gradle, fixes for new gradle

......@@ -15,7 +15,7 @@
</deviceKey>
</Target>
</runningDeviceTargetSelectedWithDropDown>
<timeTargetWasSelectedWithDropDown value="2024-07-26T13:26:33.140020Z" />
<timeTargetWasSelectedWithDropDown value="2024-07-26T14:53:01.900442Z" />
</State>
</entry>
</value>
......
......@@ -3,6 +3,7 @@ apply plugin: 'com.android.application'
//apply plugin: 'com.huawei.agconnect'
android {
namespace "warp.ly.android_sdk"
compileSdkVersion 34
buildToolsVersion "34.0.0"
......
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="warp.ly.android_sdk">
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
......
......@@ -8,7 +8,7 @@ buildscript {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:7.1.3'
classpath 'com.android.tools.build:gradle:8.1.4'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.huawei.agconnect:agcp:1.7.2.300'
classpath 'io.github.gradle-nexus:publish-plugin:1.1.0'
......
#Fri Jul 26 17:08:44 EEST 2024
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
......
......@@ -32,7 +32,7 @@ afterEvaluate {
// Two artifacts, the `aar` (or `jar`) and the sources
if (project.plugins.findPlugin("com.android.library")) {
from components.release
from components.findByName('release')
} else {
from components.java
}
......
......@@ -9,7 +9,7 @@ ext {
apply from: "${rootProject.projectDir}/scripts/publish-module.gradle"
android {
namespace 'ly.warp.sdk'
compileSdkVersion 34
buildToolsVersion "34.0.0"
......@@ -107,9 +107,6 @@ dependencies {
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
//------------------------------ Expandable Layout -----------------------------//
api 'net.cachapa.expandablelayout:expandablelayout:2.9.2'
//------------------------------ Lifecycle -----------------------------//
implementation "androidx.lifecycle:lifecycle-extensions:2.2.0"
......
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="ly.warp.sdk">
xmlns:tools="http://schemas.android.com/tools">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
......@@ -177,57 +176,6 @@
</intent-filter>
</activity>
<!-- Service used for updating user's location. -->
<service
android:name=".services.UpdateUserLocationService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.VouchersFetchedService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventCouponsService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventRewardsCouponsService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventUnifiedCouponsService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventCampaignCouponService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventCampaignService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventRefreshDeviceTokenService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<service
android:name=".services.EventQuestionnaireService"
android:exported="false"
android:permission="android.permission.BIND_JOB_SERVICE" />
<!-- android:stopWithTask="false"-->
<!-- android:process=":warplyHealthService"-->
<!-- <service-->
......
......@@ -52,7 +52,6 @@ import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.Warply;
import ly.warp.sdk.dexter.listener.DexterError;
import ly.warp.sdk.dexter.listener.PermissionDeniedResponse;
......@@ -102,10 +101,8 @@ public class UpdateUserLocationService extends Worker {
PermissionsUtil.PERMISSION_LOCATION_FINE
).requestPermissions();
} catch (SecurityException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(TAG);
}
e.printStackTrace();
WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(TAG);
}
} else {
WorkManager.getInstance(Warply.getWarplyContext()).cancelAllWorkByTag(TAG);
......@@ -187,8 +184,7 @@ public class UpdateUserLocationService extends Worker {
getGeofences().add(new WarpGeoFence(geoArray.getJSONObject(i)));
}
} catch (JSONException e) {
if (BuildConfig.DEBUG)
e.printStackTrace();
e.printStackTrace();
geofences = null;
WarpUtils.log("failed during parsing geofencing data.");
}
......@@ -407,17 +403,17 @@ public class UpdateUserLocationService extends Worker {
FusedLocationProviderClient locationClient = LocationServices.getFusedLocationProviderClient(Warply.getWarplyContext());
locationClient.getCurrentLocation(LocationRequest.PRIORITY_HIGH_ACCURACY, new CancellationToken() {
@NonNull
@Override
public CancellationToken onCanceledRequested(@NonNull OnTokenCanceledListener onTokenCanceledListener) {
return null;
}
@NonNull
@Override
public CancellationToken onCanceledRequested(@NonNull OnTokenCanceledListener onTokenCanceledListener) {
return null;
}
@Override
public boolean isCancellationRequested() {
return false;
}
})
@Override
public boolean isCancellationRequested() {
return false;
}
})
.addOnSuccessListener(location1 -> {
if (location1 != null) {
sendLocation(location1);
......@@ -427,9 +423,7 @@ public class UpdateUserLocationService extends Worker {
WarpUtils.log("Could not get location data.");
});
} catch (SecurityException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
};
......
/*
* Copyright 2010-2013 Warply Ltd. All rights reserved.
*
*
* Redistribution and use in source and binary forms, without modification, are
* permitted provided that the following conditions are met:
*
*
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
*
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
*
* THIS SOFTWARE IS PROVIDED BY THE WARPLY LTD ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
......@@ -38,7 +38,6 @@ import androidx.work.WorkManager;
import java.util.List;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.Warply;
import ly.warp.sdk.dexter.listener.DexterError;
import ly.warp.sdk.dexter.listener.PermissionDeniedResponse;
......@@ -122,9 +121,7 @@ public class WarplyLocationManager {
defaultMinTime, defaultMinDistance,
locationListenerPendingIntent);
} catch (SecurityException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
};
......@@ -137,8 +134,7 @@ public class WarplyLocationManager {
PermissionsUtil.PERMISSION_LOCATION_FINE
).requestPermissions();
} catch (Exception e) {
if (BuildConfig.DEBUG)
e.printStackTrace();
e.printStackTrace();
}
}
......@@ -262,9 +258,7 @@ public class WarplyLocationManager {
lm.requestLocationUpdates(bestProvider, minTime, minDistance, locationListenerPendingIntent);
}
} catch (SecurityException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
};
......@@ -276,9 +270,7 @@ public class WarplyLocationManager {
PermissionsUtil.PERMISSION_LOCATION_FINE
).requestPermissions();
} catch (SecurityException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
}
......
......@@ -16,7 +16,6 @@ import android.widget.ImageView;
import android.widget.RelativeLayout;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyDeviceInfoCollector;
......@@ -117,9 +116,7 @@ public class CampaignItemWebHolder extends CampaignItemViewHolder {
try {
context.startActivity(new Intent(Intent.ACTION_VIEW, Uri.parse(url)));
} catch (ActivityNotFoundException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
});
......
package ly.warp.sdk.views;
import android.content.Context;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentActivity;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentTransaction;
import android.text.TextUtils;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.Warply;
import ly.warp.sdk.fragments.WarpViewFragment;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
......@@ -87,9 +88,7 @@ public class CampaignViewLoader implements CallbackReceiver<CampaignList> {
try {
transaction.commit();
} catch (IllegalStateException e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
}
}
......
......@@ -35,7 +35,6 @@ import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.IntentSender;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageManager;
import android.location.LocationManager;
import android.net.Uri;
......@@ -103,12 +102,9 @@ import ly.warp.sdk.io.models.RefreshVouchersEventModel;
import ly.warp.sdk.io.models.UnifiedCoupon;
import ly.warp.sdk.io.models.WarplyCCMSEnabledModel;
import ly.warp.sdk.io.models.WarplyCouponsChangedEventModel;
import ly.warp.sdk.io.models.WarplyHealthEventModel;
import ly.warp.sdk.io.models.WarplyPacingCardEventModel;
import ly.warp.sdk.io.models.WarplyPacingEventModel;
import ly.warp.sdk.io.models.WarplyUnifiedActivatedEventModel;
import ly.warp.sdk.services.EventCampaignService;
import ly.warp.sdk.services.WarplyHealthService;
import ly.warp.sdk.utils.WarpUtils;
import ly.warp.sdk.utils.WarplyManagerHelper;
import ly.warp.sdk.utils.WarplyProperty;
......
......@@ -10,7 +10,6 @@ import java.util.Collections;
import java.util.Comparator;
import java.util.concurrent.atomic.AtomicBoolean;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.Warply;
import ly.warp.sdk.io.callbacks.CallbackReceiver;
import ly.warp.sdk.io.callbacks.SimpleCallbackReceiver;
......@@ -142,9 +141,7 @@ public class CampaignsArrayAdapter<VH extends CampaignItemViewHolder> extends Ba
itemView = viewHolder.itemView;
itemView.setTag(viewHolder);
} catch (Exception e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
} else {
viewHolder = (VH) itemView.getTag();
......@@ -273,7 +270,7 @@ public class CampaignsArrayAdapter<VH extends CampaignItemViewHolder> extends Ba
* with certain campaigns.
*
* @param result the {@link CampaignList} used to update the
* offers inside the {@link android.widget.ListView}
* offers inside the {@link android.widget.ListView}
*/
public void updateCampaigns(CampaignList result) {
this.mCampaigns = result;
......
package ly.warp.sdk.views.adapters.mix;
import android.database.DataSetObserver;
import androidx.annotation.NonNull;
import androidx.recyclerview.widget.RecyclerView;
import android.view.View;
import android.view.ViewGroup;
import android.widget.AbsListView;
import android.widget.BaseAdapter;
import android.widget.ListView;
import ly.warp.sdk.BuildConfig;
import ly.warp.sdk.io.callbacks.SimpleCallbackReceiver;
import ly.warp.sdk.io.models.Campaign;
import ly.warp.sdk.io.models.CampaignList;
......@@ -185,9 +186,7 @@ public class CampaignsMixListAdapter<VH extends CampaignItemViewHolder> extends
itemView = viewHolder.itemView;
itemView.setTag(viewHolder);
} catch (Exception e) {
if (BuildConfig.DEBUG) {
e.printStackTrace();
}
e.printStackTrace();
}
} else {
viewHolder = (VH) itemView.getTag();
......
......@@ -5,6 +5,7 @@
<attr name="dashLength" format="dimension" />
<attr name="dashGap" format="dimension" />
<attr name="dashThickness" format="dimension" />
<attr name="colorPrimary" format="color" />
<attr name="orientation" format="enum">
<enum name="horizontal" value="0" />
<enum name="vertical" value="1" />
......