Skip to content

Commit

Permalink
add signatureBase64 NULL-check in order to allow normal purchase flow…
Browse files Browse the repository at this point in the history
… if the signature should be skipped
  • Loading branch information
renedecandido committed Mar 2, 2015
1 parent 7db7552 commit a7fb7da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion library/src/com/anjlab/android/iab/v3/BillingProcessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,15 @@ public boolean handleActivityResult(int requestCode, int resultCode, Intent data

private boolean verifyPurchaseSignature(String productId, String purchaseData, String dataSignature) {
try {
return Security.verifyPurchase(productId, signatureBase64, purchaseData, dataSignature);
/*
* Skip the signature check if the provided License Key is NULL and return true in order to
* continue the purchase flow
*/
if (TextUtils.isEmpty(signatureBase64)) {
return true;
} else {
return Security.verifyPurchase(productId, signatureBase64, purchaseData, dataSignature);
}
} catch (Exception e) {
return false;
}
Expand Down

0 comments on commit a7fb7da

Please sign in to comment.