Panagiotis Triantafyllou

crash fixes

...@@ -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.6rc33' 5 + PUBLISH_VERSION = '4.5.4.6rc34'
6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk' 6 PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
7 } 7 }
8 8
......
...@@ -254,8 +254,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -254,8 +254,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
254 protected void onActivityResult(int requestCode, int resultCode, Intent data) { 254 protected void onActivityResult(int requestCode, int resultCode, Intent data) {
255 if (requestCode == 1000) { 255 if (requestCode == 1000) {
256 if (resultCode == RESULT_OK) { 256 if (resultCode == RESULT_OK) {
257 - if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag())) { 257 + if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(LoyaltyWallet.this))) {
258 - mTvUserBadge.setText(WarplyManagerHelper.getUserTag()); 258 + mTvUserBadge.setText(WarplyManagerHelper.getUserTag(LoyaltyWallet.this));
259 mLlQuestionnaire.setVisibility(View.GONE); 259 mLlQuestionnaire.setVisibility(View.GONE);
260 mLlUserBadge.setVisibility(View.VISIBLE); 260 mLlUserBadge.setVisibility(View.VISIBLE);
261 } else { 261 } else {
...@@ -489,8 +489,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie ...@@ -489,8 +489,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
489 .into(mIvProfilePhoto); 489 .into(mIvProfilePhoto);
490 } 490 }
491 491
492 - if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag())) { 492 + if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(this))) {
493 - mTvUserBadge.setText(WarplyManagerHelper.getUserTag()); 493 + mTvUserBadge.setText(WarplyManagerHelper.getUserTag(this));
494 mLlQuestionnaire.setVisibility(View.GONE); 494 mLlQuestionnaire.setVisibility(View.GONE);
495 mLlUserBadge.setVisibility(View.VISIBLE); 495 mLlUserBadge.setVisibility(View.VISIBLE);
496 } else { 496 } else {
......
...@@ -113,9 +113,9 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener { ...@@ -113,9 +113,9 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener {
113 return; 113 return;
114 WarpUtils.log("**************** WARPLY Response *****************"); 114 WarpUtils.log("**************** WARPLY Response *****************");
115 WarpUtils.verbose("[WARP Trace] HTTP Web Id: " 115 WarpUtils.verbose("[WARP Trace] HTTP Web Id: "
116 - + WarpUtils.getWebId(Warply.INSTANCE.mContext.get())); 116 + + WarpUtils.getWebId(Warply.INSTANCE.mContext));
117 WarpUtils.verbose("[WARP Trace] HTTP API Key: " 117 WarpUtils.verbose("[WARP Trace] HTTP API Key: "
118 - + WarplyProperty.getAppUuid(Warply.INSTANCE.mContext.get())); 118 + + WarplyProperty.getAppUuid(Warply.INSTANCE.mContext));
119 if (response != null) { 119 if (response != null) {
120 try { 120 try {
121 // WarpUtils.log("[WARP Trace] Request: " + response.toString(2)); 121 // WarpUtils.log("[WARP Trace] Request: " + response.toString(2));
......
...@@ -61,7 +61,7 @@ public class PrefsUtils { ...@@ -61,7 +61,7 @@ public class PrefsUtils {
61 ); 61 );
62 62
63 return encryptedSharedPreferences; 63 return encryptedSharedPreferences;
64 - } catch (GeneralSecurityException | IOException e) { 64 + } catch (Exception e) {
65 WarpUtils.log("PrefUtils Get Encrypted Shared Preferences Error", e); 65 WarpUtils.log("PrefUtils Get Encrypted Shared Preferences Error", e);
66 return PreferenceManager.getDefaultSharedPreferences(context); 66 return PreferenceManager.getDefaultSharedPreferences(context);
67 } 67 }
......
...@@ -256,7 +256,7 @@ public class WarpUtils { ...@@ -256,7 +256,7 @@ public class WarpUtils {
256 ); 256 );
257 257
258 _prefs = encryptedSharedPreferences; 258 _prefs = encryptedSharedPreferences;
259 - } catch (GeneralSecurityException | IOException e) { 259 + } catch (Exception e) {
260 WarpUtils.log("WarpUtils Get Encrypted Shared Preferences Error", e); 260 WarpUtils.log("WarpUtils Get Encrypted Shared Preferences Error", e);
261 _prefs = context.getSharedPreferences(PREFERENCES_NAME, 261 _prefs = context.getSharedPreferences(PREFERENCES_NAME,
262 Context.MODE_PRIVATE); 262 Context.MODE_PRIVATE);
......
...@@ -1065,8 +1065,8 @@ public class WarplyManagerHelper { ...@@ -1065,8 +1065,8 @@ public class WarplyManagerHelper {
1065 /** 1065 /**
1066 * Get user badge tag 1066 * Get user badge tag
1067 */ 1067 */
1068 - public static String getUserTag() { 1068 + public static String getUserTag(Context context) {
1069 - return WarpUtils.getUserTag(Warply.getWarplyContext()); 1069 + return WarpUtils.getUserTag(context);
1070 } 1070 }
1071 1071
1072 /** 1072 /**
......
...@@ -39,7 +39,7 @@ public class WarplyPreferences { ...@@ -39,7 +39,7 @@ public class WarplyPreferences {
39 ); 39 );
40 40
41 this.warplySharedPrefs = encryptedSharedPreferences; 41 this.warplySharedPrefs = encryptedSharedPreferences;
42 - } catch (GeneralSecurityException | IOException e) { 42 + } catch (Exception e) {
43 WarpUtils.log("WarplyPreferences Encrypted Shared Preferences Error", e); 43 WarpUtils.log("WarplyPreferences Encrypted Shared Preferences Error", e);
44 this.warplySharedPrefs = context. 44 this.warplySharedPrefs = context.
45 getSharedPreferences(WARPLY_SHARED_PREFS, Activity.MODE_PRIVATE); 45 getSharedPreferences(WARPLY_SHARED_PREFS, Activity.MODE_PRIVATE);
......
...@@ -27,12 +27,12 @@ public class WarplyProvider extends ContentProvider { ...@@ -27,12 +27,12 @@ public class WarplyProvider extends ContentProvider {
27 new CalligraphyConfig.Builder() 27 new CalligraphyConfig.Builder()
28 .setDefaultFontPath("fonts/pf_square_sans_pro_regular.ttf") 28 .setDefaultFontPath("fonts/pf_square_sans_pro_regular.ttf")
29 .setFontAttrId(R.attr.fontPath) 29 .setFontAttrId(R.attr.fontPath)
30 - .setFontMapper(new FontMapper() { 30 +// .setFontMapper(new FontMapper() {
31 - @Override 31 +// @Override
32 - public String map(String font) { 32 +// public String map(String font) {
33 - return font; 33 +// return font;
34 - } 34 +// }
35 - }) 35 +// })
36 .build())) 36 .build()))
37 .build()); 37 .build());
38 38
......
...@@ -187,7 +187,7 @@ public class WarplyAnalyticsManager { ...@@ -187,7 +187,7 @@ public class WarplyAnalyticsManager {
187 if (metadata != null) { 187 if (metadata != null) {
188 jObj.putOpt("action_metadata", metadata); 188 jObj.putOpt("action_metadata", metadata);
189 } 189 }
190 - Warply.postMicroappData(WarpConstants.MICROAPP_INAPP_ANALYTICS, jObj, force); 190 + Warply.postMicroappData(context, WarpConstants.MICROAPP_INAPP_ANALYTICS, jObj, force);
191 } catch (JSONException e) { 191 } catch (JSONException e) {
192 if (WarpConstants.DEBUG) { 192 if (WarpConstants.DEBUG) {
193 e.printStackTrace(); 193 e.printStackTrace();
......