mirror of https://github.com/M66B/FairEmail.git
Handle invalid response codes
This commit is contained in:
parent
0577fed9ab
commit
8558f2f123
|
@ -6460,8 +6460,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
try {
|
try {
|
||||||
if (ActivityBilling.activatePro(context, uri))
|
if (ActivityBilling.activatePro(context, uri))
|
||||||
ToastEx.makeText(context, R.string.title_pro_valid, Toast.LENGTH_LONG).show();
|
ToastEx.makeText(context, R.string.title_pro_valid, Toast.LENGTH_LONG).show();
|
||||||
else
|
else {
|
||||||
ToastEx.makeText(context, R.string.title_pro_invalid, Toast.LENGTH_LONG).show();
|
Uri invalid = Uri.parse(BuildConfig.PRO_FEATURES_URI + "invalid.html" +
|
||||||
|
"?challenge=" + ActivityBilling.getChallenge(context) +
|
||||||
|
"&version=" + BuildConfig.VERSION_CODE);
|
||||||
|
Helper.view(context, invalid, true);
|
||||||
|
}
|
||||||
} catch (NoSuchAlgorithmException ex) {
|
} catch (NoSuchAlgorithmException ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
ToastEx.makeText(context, Log.formatThrowable(ex), Toast.LENGTH_LONG).show();
|
ToastEx.makeText(context, Log.formatThrowable(ex), Toast.LENGTH_LONG).show();
|
||||||
|
|
|
@ -210,7 +210,7 @@ public class ActivityBilling extends ActivityBase implements
|
||||||
prefs.getBoolean("test_iab", false));
|
prefs.getBoolean("test_iab", false));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static String getChallenge(Context context) throws NoSuchAlgorithmException {
|
static String getChallenge(Context context) throws NoSuchAlgorithmException {
|
||||||
String android_id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
String android_id = Settings.Secure.getString(context.getContentResolver(), Settings.Secure.ANDROID_ID);
|
||||||
if (android_id == null) {
|
if (android_id == null) {
|
||||||
Log.e("Android ID empty");
|
Log.e("Android ID empty");
|
||||||
|
|
Loading…
Reference in New Issue