Panagiotis Triantafyllou

fixes

......@@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity {
public void onWarplyReady() {
if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) {
WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest()
.setGuid("6012049139"), //6012049321, 6012049322, 6012049323
.setGuid("6012049321"), //6012049321, 6012049322, 6012049323
mLoginReceiver);
} else {
startNextActivity();
......
......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4-cosbeta55'
PUBLISH_VERSION = '4.5.4-cosbeta56'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......@@ -13,6 +13,8 @@ android {
compileSdkVersion 31
buildToolsVersion "31.0.0"
useLibrary 'org.apache.http.legacy'
defaultConfig {
minSdkVersion 23
targetSdkVersion 31
......@@ -32,7 +34,7 @@ android {
buildTypes {
release {
minifyEnabled true
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
......
......@@ -27,6 +27,5 @@
-keep class com.huawei.hianalytics.**{*;}
-keep class com.huawei.updatesdk.**{*;}
-keep class com.huawei.hms.**{*;}
-keep class ly.warp.sdk.**{*;}
-keep,includedescriptorclasses class net.sqlcipher.** { *; }
-keep,includedescriptorclasses interface net.sqlcipher.** { *; }
\ No newline at end of file
......
......@@ -40,9 +40,12 @@ import java.util.Map.Entry;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLSocketFactory;
import ly.warp.sdk.Warply;
import ly.warp.sdk.db.WarplyDBHelper;
import ly.warp.sdk.io.volley.AuthFailureError;
import ly.warp.sdk.io.volley.Request;
import ly.warp.sdk.io.volley.Request.Method;
import ly.warp.sdk.utils.constants.WarpConstants;
/**
* An {@link HttpStack} based on {@link HttpURLConnection}.
......@@ -94,6 +97,13 @@ public class HurlStack implements HttpStack {
HashMap<String, String> map = new HashMap<String, String>();
map.putAll(request.getHeaders());
map.putAll(additionalHeaders);
if (request.getTag() != null && request.getTag().equals("true")) {
map.put(WarpConstants.HEADER_AUTHORIZATION,
"Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token"));
} else if (request.getTag() != null && request.getTag().equals("cosuser")) {
map.put(WarpConstants.HEADER_AUTHORIZATION,
"Basic MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg=");
}
if (mUrlRewriter != null) {
String rewritten = mUrlRewriter.rewriteUrl(url);
if (rewritten == null) {
......
......@@ -46,10 +46,10 @@ public class Volley {
// HTTP connection reuse which was buggy pre-froyo
/*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {
System.setProperty("http.keepAlive", "false");
}
stack = new HurlStack();*/
}*/
stack = new HurlStack();
stack = new HttpClientStack();
// stack = new HttpClientStack();
}
Network network = new BasicNetwork(stack);
......
......@@ -44,6 +44,7 @@ import java.util.HashMap;
import ly.warp.sdk.R;
import ly.warp.sdk.Warply;
import ly.warp.sdk.activities.ContextualActivity;
import ly.warp.sdk.activities.CouponsetInfoActivity;
import ly.warp.sdk.activities.GiftsForYouActivity;
import ly.warp.sdk.activities.TelcoActivity;
......@@ -526,7 +527,11 @@ public class WarplyManagerHelper {
public static void handleContextualCampaigns(Context context, LoyaltyContextualOfferModel item) {
if (item != null) {
if (mCampaignListAll != null && mCampaignListAll.size() > 0) {
if (TextUtils.isEmpty(item.getLoyaltyCampaignId()) || item.getLoyaltyCampaignId().equals("NA")) {
Intent intent = new Intent(context, ContextualActivity.class);
intent.putExtra("ccms", item);
context.startActivity(intent);
} else if (mCampaignListAll != null && mCampaignListAll.size() > 0) {
for (Campaign camp : mCampaignListAll) {
try {
JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields());
......