Handle invalid response codes

This commit is contained in:
M66B 2024-04-07 11:27:32 +02:00
parent 0577fed9ab
commit 8558f2f123
2 changed files with 7 additions and 3 deletions

View File

@ -6460,8 +6460,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
try {
if (ActivityBilling.activatePro(context, uri))
ToastEx.makeText(context, R.string.title_pro_valid, Toast.LENGTH_LONG).show();
else
ToastEx.makeText(context, R.string.title_pro_invalid, Toast.LENGTH_LONG).show();
else {
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) {
Log.e(ex);
ToastEx.makeText(context, Log.formatThrowable(ex), Toast.LENGTH_LONG).show();

View File

@ -210,7 +210,7 @@ public class ActivityBilling extends ActivityBase implements
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);
if (android_id == null) {
Log.e("Android ID empty");