Panagiotis Triantafyllou

crash fixes

......@@ -2,7 +2,7 @@ apply plugin: 'com.android.library'
ext {
PUBLISH_GROUP_ID = 'ly.warp'
PUBLISH_VERSION = '4.5.4.6rc33'
PUBLISH_VERSION = '4.5.4.6rc34'
PUBLISH_ARTIFACT_ID = 'warply-android-sdk'
}
......
......@@ -254,8 +254,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
if (requestCode == 1000) {
if (resultCode == RESULT_OK) {
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag())) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag());
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(LoyaltyWallet.this))) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag(LoyaltyWallet.this));
mLlQuestionnaire.setVisibility(View.GONE);
mLlUserBadge.setVisibility(View.VISIBLE);
} else {
......@@ -489,8 +489,8 @@ public class LoyaltyWallet extends Activity implements View.OnClickListener, Vie
.into(mIvProfilePhoto);
}
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag())) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag());
if (!TextUtils.isEmpty(WarplyManagerHelper.getUserTag(this))) {
mTvUserBadge.setText(WarplyManagerHelper.getUserTag(this));
mLlQuestionnaire.setVisibility(View.GONE);
mLlUserBadge.setVisibility(View.VISIBLE);
} else {
......
......@@ -113,9 +113,9 @@ public class VolleyTransformer implements Listener<JSONObject>, ErrorListener {
return;
WarpUtils.log("**************** WARPLY Response *****************");
WarpUtils.verbose("[WARP Trace] HTTP Web Id: "
+ WarpUtils.getWebId(Warply.INSTANCE.mContext.get()));
+ WarpUtils.getWebId(Warply.INSTANCE.mContext));
WarpUtils.verbose("[WARP Trace] HTTP API Key: "
+ WarplyProperty.getAppUuid(Warply.INSTANCE.mContext.get()));
+ WarplyProperty.getAppUuid(Warply.INSTANCE.mContext));
if (response != null) {
try {
// WarpUtils.log("[WARP Trace] Request: " + response.toString(2));
......
......@@ -61,7 +61,7 @@ public class PrefsUtils {
);
return encryptedSharedPreferences;
} catch (GeneralSecurityException | IOException e) {
} catch (Exception e) {
WarpUtils.log("PrefUtils Get Encrypted Shared Preferences Error", e);
return PreferenceManager.getDefaultSharedPreferences(context);
}
......
......@@ -256,7 +256,7 @@ public class WarpUtils {
);
_prefs = encryptedSharedPreferences;
} catch (GeneralSecurityException | IOException e) {
} catch (Exception e) {
WarpUtils.log("WarpUtils Get Encrypted Shared Preferences Error", e);
_prefs = context.getSharedPreferences(PREFERENCES_NAME,
Context.MODE_PRIVATE);
......
......@@ -1065,8 +1065,8 @@ public class WarplyManagerHelper {
/**
* Get user badge tag
*/
public static String getUserTag() {
return WarpUtils.getUserTag(Warply.getWarplyContext());
public static String getUserTag(Context context) {
return WarpUtils.getUserTag(context);
}
/**
......
......@@ -39,7 +39,7 @@ public class WarplyPreferences {
);
this.warplySharedPrefs = encryptedSharedPreferences;
} catch (GeneralSecurityException | IOException e) {
} catch (Exception e) {
WarpUtils.log("WarplyPreferences Encrypted Shared Preferences Error", e);
this.warplySharedPrefs = context.
getSharedPreferences(WARPLY_SHARED_PREFS, Activity.MODE_PRIVATE);
......
......@@ -27,12 +27,12 @@ public class WarplyProvider extends ContentProvider {
new CalligraphyConfig.Builder()
.setDefaultFontPath("fonts/pf_square_sans_pro_regular.ttf")
.setFontAttrId(R.attr.fontPath)
.setFontMapper(new FontMapper() {
@Override
public String map(String font) {
return font;
}
})
// .setFontMapper(new FontMapper() {
// @Override
// public String map(String font) {
// return font;
// }
// })
.build()))
.build());
......
......@@ -187,7 +187,7 @@ public class WarplyAnalyticsManager {
if (metadata != null) {
jObj.putOpt("action_metadata", metadata);
}
Warply.postMicroappData(WarpConstants.MICROAPP_INAPP_ANALYTICS, jObj, force);
Warply.postMicroappData(context, WarpConstants.MICROAPP_INAPP_ANALYTICS, jObj, force);
} catch (JSONException e) {
if (WarpConstants.DEBUG) {
e.printStackTrace();
......