I published few months ago a free Android app with In App Billing where you can buy a durable product. When coding billing part, I didn't pay attention to order validation in fact I used with code when purchase was finished:
IabHelper.OnIabPurchaseFinishedListener mPurchaseFinishedListener = new IabHelper.OnIabPurchaseFinishedListener() {
public void onIabPurchaseFinished(IabResult result, Purchase purchase) {
if (mHelper == null) return;
if (result.isFailure() && result.getResponse() == 7) {
// Already bought
} else if (result.isFailure()) {
return;
}
if(purchase != null)
{
// add premium features
}
}
};
I know it's not a safe check.
First question. Now I'm able to see through Analytics that I get transaction with two orderID types:
GPA.XXXX-XXXX-XXXX-XXXXX
[19 digits].[16 digits]
As I could understand, the second one was deprecated about 2 years ago (link), so why I'm still receiving that orderID? Also all the orders of the first type are visible in Google Merchant Console, while the second one are not. Is it safe to add a check on app start that retrieves the purchase and deactivate premium features if the related orderID is the second one?
Second question. Assumed that it's probably an hack and also assumed I don't think it worth to perform server-side checks, would make it safer is I implement a verifyDeveloperPayload
when purchasing?
As far as I could understand, most of the hacks in circulation (like Freeedom) don't spoof the developerPayload, which is computed at runtime based on Google account ID, so it should be enough.