Showing
6 changed files
with
24 additions
and
8 deletions
... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { | ... | @@ -36,7 +36,7 @@ public class SplashActivity extends BaseActivity { |
36 | public void onWarplyReady() { | 36 | public void onWarplyReady() { |
37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { | 37 | if (!WarplyDBHelper.getInstance(SplashActivity.this).isTableNotEmpty("auth")) { |
38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() | 38 | WarplyManager.getCosmoteUser(new WarplyCosmoteUserRequest() |
39 | - .setGuid("6012049139"), //6012049321, 6012049322, 6012049323 | 39 | + .setGuid("6012049321"), //6012049321, 6012049322, 6012049323 |
40 | mLoginReceiver); | 40 | mLoginReceiver); |
41 | } else { | 41 | } else { |
42 | startNextActivity(); | 42 | startNextActivity(); | ... | ... |
... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' | ... | @@ -2,7 +2,7 @@ apply plugin: 'com.android.library' |
2 | 2 | ||
3 | ext { | 3 | ext { |
4 | PUBLISH_GROUP_ID = 'ly.warp' | 4 | PUBLISH_GROUP_ID = 'ly.warp' |
5 | - PUBLISH_VERSION = '4.5.4-cosbeta55' | 5 | + PUBLISH_VERSION = '4.5.4-cosbeta56' |
6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' | 6 | PUBLISH_ARTIFACT_ID = 'warply-android-sdk' |
7 | } | 7 | } |
8 | 8 | ||
... | @@ -13,6 +13,8 @@ android { | ... | @@ -13,6 +13,8 @@ android { |
13 | compileSdkVersion 31 | 13 | compileSdkVersion 31 |
14 | buildToolsVersion "31.0.0" | 14 | buildToolsVersion "31.0.0" |
15 | 15 | ||
16 | + useLibrary 'org.apache.http.legacy' | ||
17 | + | ||
16 | defaultConfig { | 18 | defaultConfig { |
17 | minSdkVersion 23 | 19 | minSdkVersion 23 |
18 | targetSdkVersion 31 | 20 | targetSdkVersion 31 |
... | @@ -32,7 +34,7 @@ android { | ... | @@ -32,7 +34,7 @@ android { |
32 | 34 | ||
33 | buildTypes { | 35 | buildTypes { |
34 | release { | 36 | release { |
35 | - minifyEnabled true | 37 | + minifyEnabled false |
36 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' | 38 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
37 | } | 39 | } |
38 | } | 40 | } | ... | ... |
... | @@ -27,6 +27,5 @@ | ... | @@ -27,6 +27,5 @@ |
27 | -keep class com.huawei.hianalytics.**{*;} | 27 | -keep class com.huawei.hianalytics.**{*;} |
28 | -keep class com.huawei.updatesdk.**{*;} | 28 | -keep class com.huawei.updatesdk.**{*;} |
29 | -keep class com.huawei.hms.**{*;} | 29 | -keep class com.huawei.hms.**{*;} |
30 | --keep class ly.warp.sdk.**{*;} | ||
31 | -keep,includedescriptorclasses class net.sqlcipher.** { *; } | 30 | -keep,includedescriptorclasses class net.sqlcipher.** { *; } |
32 | -keep,includedescriptorclasses interface net.sqlcipher.** { *; } | 31 | -keep,includedescriptorclasses interface net.sqlcipher.** { *; } |
... | \ No newline at end of file | ... | \ No newline at end of file | ... | ... |
... | @@ -40,9 +40,12 @@ import java.util.Map.Entry; | ... | @@ -40,9 +40,12 @@ import java.util.Map.Entry; |
40 | import javax.net.ssl.HttpsURLConnection; | 40 | import javax.net.ssl.HttpsURLConnection; |
41 | import javax.net.ssl.SSLSocketFactory; | 41 | import javax.net.ssl.SSLSocketFactory; |
42 | 42 | ||
43 | +import ly.warp.sdk.Warply; | ||
44 | +import ly.warp.sdk.db.WarplyDBHelper; | ||
43 | import ly.warp.sdk.io.volley.AuthFailureError; | 45 | import ly.warp.sdk.io.volley.AuthFailureError; |
44 | import ly.warp.sdk.io.volley.Request; | 46 | import ly.warp.sdk.io.volley.Request; |
45 | import ly.warp.sdk.io.volley.Request.Method; | 47 | import ly.warp.sdk.io.volley.Request.Method; |
48 | +import ly.warp.sdk.utils.constants.WarpConstants; | ||
46 | 49 | ||
47 | /** | 50 | /** |
48 | * An {@link HttpStack} based on {@link HttpURLConnection}. | 51 | * An {@link HttpStack} based on {@link HttpURLConnection}. |
... | @@ -94,6 +97,13 @@ public class HurlStack implements HttpStack { | ... | @@ -94,6 +97,13 @@ public class HurlStack implements HttpStack { |
94 | HashMap<String, String> map = new HashMap<String, String>(); | 97 | HashMap<String, String> map = new HashMap<String, String>(); |
95 | map.putAll(request.getHeaders()); | 98 | map.putAll(request.getHeaders()); |
96 | map.putAll(additionalHeaders); | 99 | map.putAll(additionalHeaders); |
100 | + if (request.getTag() != null && request.getTag().equals("true")) { | ||
101 | + map.put(WarpConstants.HEADER_AUTHORIZATION, | ||
102 | + "Bearer " + WarplyDBHelper.getInstance(Warply.getWarplyContext()).getAuthValue("access_token")); | ||
103 | + } else if (request.getTag() != null && request.getTag().equals("cosuser")) { | ||
104 | + map.put(WarpConstants.HEADER_AUTHORIZATION, | ||
105 | + "Basic MWlTM0EyNjcxT2Q0a1B5QkIydEs1ZU5uRENhR0NWQjQ6MjI4MjA4ZTliMTQzNGQ2MmIxNGI3ZDAzYjM2ZjUwMzg="); | ||
106 | + } | ||
97 | if (mUrlRewriter != null) { | 107 | if (mUrlRewriter != null) { |
98 | String rewritten = mUrlRewriter.rewriteUrl(url); | 108 | String rewritten = mUrlRewriter.rewriteUrl(url); |
99 | if (rewritten == null) { | 109 | if (rewritten == null) { | ... | ... |
... | @@ -46,10 +46,10 @@ public class Volley { | ... | @@ -46,10 +46,10 @@ public class Volley { |
46 | // HTTP connection reuse which was buggy pre-froyo | 46 | // HTTP connection reuse which was buggy pre-froyo |
47 | /*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) { | 47 | /*if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) { |
48 | System.setProperty("http.keepAlive", "false"); | 48 | System.setProperty("http.keepAlive", "false"); |
49 | - } | 49 | + }*/ |
50 | - stack = new HurlStack();*/ | 50 | + stack = new HurlStack(); |
51 | 51 | ||
52 | - stack = new HttpClientStack(); | 52 | +// stack = new HttpClientStack(); |
53 | } | 53 | } |
54 | 54 | ||
55 | Network network = new BasicNetwork(stack); | 55 | Network network = new BasicNetwork(stack); | ... | ... |
... | @@ -44,6 +44,7 @@ import java.util.HashMap; | ... | @@ -44,6 +44,7 @@ import java.util.HashMap; |
44 | 44 | ||
45 | import ly.warp.sdk.R; | 45 | import ly.warp.sdk.R; |
46 | import ly.warp.sdk.Warply; | 46 | import ly.warp.sdk.Warply; |
47 | +import ly.warp.sdk.activities.ContextualActivity; | ||
47 | import ly.warp.sdk.activities.CouponsetInfoActivity; | 48 | import ly.warp.sdk.activities.CouponsetInfoActivity; |
48 | import ly.warp.sdk.activities.GiftsForYouActivity; | 49 | import ly.warp.sdk.activities.GiftsForYouActivity; |
49 | import ly.warp.sdk.activities.TelcoActivity; | 50 | import ly.warp.sdk.activities.TelcoActivity; |
... | @@ -526,7 +527,11 @@ public class WarplyManagerHelper { | ... | @@ -526,7 +527,11 @@ public class WarplyManagerHelper { |
526 | 527 | ||
527 | public static void handleContextualCampaigns(Context context, LoyaltyContextualOfferModel item) { | 528 | public static void handleContextualCampaigns(Context context, LoyaltyContextualOfferModel item) { |
528 | if (item != null) { | 529 | if (item != null) { |
529 | - if (mCampaignListAll != null && mCampaignListAll.size() > 0) { | 530 | + if (TextUtils.isEmpty(item.getLoyaltyCampaignId()) || item.getLoyaltyCampaignId().equals("NA")) { |
531 | + Intent intent = new Intent(context, ContextualActivity.class); | ||
532 | + intent.putExtra("ccms", item); | ||
533 | + context.startActivity(intent); | ||
534 | + } else if (mCampaignListAll != null && mCampaignListAll.size() > 0) { | ||
530 | for (Campaign camp : mCampaignListAll) { | 535 | for (Campaign camp : mCampaignListAll) { |
531 | try { | 536 | try { |
532 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | 537 | JSONObject extraFields = WarpJSONParser.getJSONFromString(camp.getExtraFields()); | ... | ... |
-
Please register or login to post a comment