It is not safe. I would dissuade you from such a check. You better go for the standard approach and use the getPurchases () method. You can call this method at any time (even offline), and if the user has purchases, they will be returned back from this method. Here is a sample code:
IInAppBillingService service; // initialize it first Bundle response = service.getPurchases(3, "you app package", "inapp", null); int responseCode = response.getInt(KEY_RESPONSE_CODE); if (responseCode == RESPONSE_OK) { ArrayList<String> purchases = response.getStringArrayList(KEY_INAPP_PURCHASE_ITEM_LIST); ... }
From the curse, you need to check that the purchases are signed with the correct certificate, and the purchase status is not canceled. But it is much safer than storing data in shared properties. Another advantage of this approach is that after the user reinstalls the application, all purchases will be automatically available there too.
source share