Loading fake-store/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl +8 −11 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ interface IInAppBillingService { * and "subs" for subscriptions) * @return RESULT_OK(0) on success and appropriate response code on failures. */ int isBillingSupported(int apiVersion, String packageName, String type); int isBillingSupported(int apiVersion, String packageName, String type) = 0; /** * Provides details of a list of SKUs Loading @@ -78,7 +78,7 @@ interface IInAppBillingService { * "title : "Example Title", * "description" : "This is an example description" }' */ Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle) = 1; /** * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU, Loading Loading @@ -111,7 +111,7 @@ interface IInAppBillingService { * TODO: change this to app-specific keys. */ Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload); String developerPayload) = 2; /** * Returns the current SKUs owned by the user of the type and package name specified along with Loading @@ -137,7 +137,7 @@ interface IInAppBillingService { * next set of in-app purchases. Only set if the * user has more owned skus than the current list. */ Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken) = 3; /** * Consume the last purchase of the given SKU. This will result in this item being removed Loading @@ -148,12 +148,7 @@ interface IInAppBillingService { * to be consumed * @return RESULT_OK(0) if consumption succeeded, appropriate response codes on failures. */ int consumePurchase(int apiVersion, String packageName, String purchaseToken); /** * This API is currently under development. */ int stub(int apiVersion, String packageName, String type); int consumePurchase(int apiVersion, String packageName, String purchaseToken) = 4; /** * Returns a pending intent to launch the purchase flow for upgrading or downgrading a Loading Loading @@ -188,5 +183,7 @@ interface IInAppBillingService { * TODO: change this to app-specific keys. */ Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, in List<String> oldSkus, String newSku, String type, String developerPayload); in List<String> oldSkus, String newSku, String type, String developerPayload) = 6; Bundle queryPurchases(int apiVersion, String packageName, String type, String continuationToken, in Bundle extras) = 10; } fake-store/src/main/java/com/android/vending/billing/InAppBillingService.java +25 −11 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.app.Service; import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; import android.util.Log; Loading @@ -14,17 +15,18 @@ import java.util.List; * Created by andrew.zhao on 9/19/16. */ public class InAppBillingService extends Service { private static final String TAG = "FakeInAppStore"; private final IInAppBillingService.Stub mInAppBillingService = new IInAppBillingService.Stub() { @Override public int isBillingSupported(int apiVersion, String packageName, String type) throws RemoteException { Log.e("fakestore", "issupported"); Log.d(TAG, "isBillingSupported(" + apiVersion + ", " + packageName + ", " + type + ")"); return 0; } @Override public Bundle getSkuDetails(int apiVersion, String packageName, String type, Bundle skusBundle) throws RemoteException { Log.e("fakestore", "getsku"); Log.d(TAG, "getSkuDetails(" + apiVersion + ", " + packageName + ", " + type + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("DETAILS_LIST", new ArrayList<String>()); Loading @@ -33,7 +35,7 @@ public class InAppBillingService extends Service { @Override public Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload) throws RemoteException { Log.e("fakestore", "getbuy"); Log.d(TAG, "getBuyIntent(" + apiVersion + ", " + packageName + ", " + sku + ", " + type + ", " + developerPayload + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); return data; Loading @@ -41,7 +43,7 @@ public class InAppBillingService extends Service { @Override public Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken) throws RemoteException { Log.e("fakestore", "getpurchase"); Log.d(TAG, "getPurchases(" + apiVersion + ", " + packageName + ", " + type + ", " + continuationToken + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("INAPP_PURCHASE_ITEM_LIST", new ArrayList<String>()); Loading @@ -52,23 +54,35 @@ public class InAppBillingService extends Service { @Override public int consumePurchase(int apiVersion, String packageName, String purchaseToken) throws RemoteException { Log.e("fakestore", "consumepurchase"); Log.d(TAG, "consumePurchase(" + apiVersion + ", " + packageName + ", " + purchaseToken + ")"); return 8; } @Override public int stub(int apiVersion, String packageName, String type) throws RemoteException { Log.e("fakestore", "stub"); return 0; public Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, List<String> oldSkus, String newSku, String type, String developerPayload) throws RemoteException { Log.d(TAG, "getBuyIntentToReplaceSkus(" + apiVersion + ", " + packageName + ", " + newSku + ", " + type + ", " + developerPayload + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); return data; } @Override public Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, List<String> oldSkus, String newSku, String type, String developerPayload) throws RemoteException { Log.e("fakestore", "getbuyintenttoreplace"); public Bundle queryPurchases(int apiVersion, String packageName, String type, String continuationToken, Bundle extras) throws RemoteException { Log.d(TAG, "queryPurchases(" + apiVersion + ", " + packageName + ", " + type + ", " + continuationToken + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("INAPP_PURCHASE_ITEM_LIST", new ArrayList<String>()); data.putStringArrayList("INAPP_PURCHASE_DATA_LIST", new ArrayList<String>()); data.putStringArrayList("INAPP_DATA_SIGNATURE_LIST", new ArrayList<String>()); return data; } @Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { if (super.onTransact(code, data, reply, flags)) return true; Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); return false; } }; public IBinder onBind(Intent intent) { Loading Loading
fake-store/src/main/aidl/com/android/vending/billing/IInAppBillingService.aidl +8 −11 Original line number Diff line number Diff line Loading @@ -53,7 +53,7 @@ interface IInAppBillingService { * and "subs" for subscriptions) * @return RESULT_OK(0) on success and appropriate response code on failures. */ int isBillingSupported(int apiVersion, String packageName, String type); int isBillingSupported(int apiVersion, String packageName, String type) = 0; /** * Provides details of a list of SKUs Loading @@ -78,7 +78,7 @@ interface IInAppBillingService { * "title : "Example Title", * "description" : "This is an example description" }' */ Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle); Bundle getSkuDetails(int apiVersion, String packageName, String type, in Bundle skusBundle) = 1; /** * Returns a pending intent to launch the purchase flow for an in-app item by providing a SKU, Loading Loading @@ -111,7 +111,7 @@ interface IInAppBillingService { * TODO: change this to app-specific keys. */ Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload); String developerPayload) = 2; /** * Returns the current SKUs owned by the user of the type and package name specified along with Loading @@ -137,7 +137,7 @@ interface IInAppBillingService { * next set of in-app purchases. Only set if the * user has more owned skus than the current list. */ Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken); Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken) = 3; /** * Consume the last purchase of the given SKU. This will result in this item being removed Loading @@ -148,12 +148,7 @@ interface IInAppBillingService { * to be consumed * @return RESULT_OK(0) if consumption succeeded, appropriate response codes on failures. */ int consumePurchase(int apiVersion, String packageName, String purchaseToken); /** * This API is currently under development. */ int stub(int apiVersion, String packageName, String type); int consumePurchase(int apiVersion, String packageName, String purchaseToken) = 4; /** * Returns a pending intent to launch the purchase flow for upgrading or downgrading a Loading Loading @@ -188,5 +183,7 @@ interface IInAppBillingService { * TODO: change this to app-specific keys. */ Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, in List<String> oldSkus, String newSku, String type, String developerPayload); in List<String> oldSkus, String newSku, String type, String developerPayload) = 6; Bundle queryPurchases(int apiVersion, String packageName, String type, String continuationToken, in Bundle extras) = 10; }
fake-store/src/main/java/com/android/vending/billing/InAppBillingService.java +25 −11 Original line number Diff line number Diff line Loading @@ -4,6 +4,7 @@ import android.app.Service; import android.content.Intent; import android.os.Bundle; import android.os.IBinder; import android.os.Parcel; import android.os.RemoteException; import android.util.Log; Loading @@ -14,17 +15,18 @@ import java.util.List; * Created by andrew.zhao on 9/19/16. */ public class InAppBillingService extends Service { private static final String TAG = "FakeInAppStore"; private final IInAppBillingService.Stub mInAppBillingService = new IInAppBillingService.Stub() { @Override public int isBillingSupported(int apiVersion, String packageName, String type) throws RemoteException { Log.e("fakestore", "issupported"); Log.d(TAG, "isBillingSupported(" + apiVersion + ", " + packageName + ", " + type + ")"); return 0; } @Override public Bundle getSkuDetails(int apiVersion, String packageName, String type, Bundle skusBundle) throws RemoteException { Log.e("fakestore", "getsku"); Log.d(TAG, "getSkuDetails(" + apiVersion + ", " + packageName + ", " + type + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("DETAILS_LIST", new ArrayList<String>()); Loading @@ -33,7 +35,7 @@ public class InAppBillingService extends Service { @Override public Bundle getBuyIntent(int apiVersion, String packageName, String sku, String type, String developerPayload) throws RemoteException { Log.e("fakestore", "getbuy"); Log.d(TAG, "getBuyIntent(" + apiVersion + ", " + packageName + ", " + sku + ", " + type + ", " + developerPayload + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); return data; Loading @@ -41,7 +43,7 @@ public class InAppBillingService extends Service { @Override public Bundle getPurchases(int apiVersion, String packageName, String type, String continuationToken) throws RemoteException { Log.e("fakestore", "getpurchase"); Log.d(TAG, "getPurchases(" + apiVersion + ", " + packageName + ", " + type + ", " + continuationToken + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("INAPP_PURCHASE_ITEM_LIST", new ArrayList<String>()); Loading @@ -52,23 +54,35 @@ public class InAppBillingService extends Service { @Override public int consumePurchase(int apiVersion, String packageName, String purchaseToken) throws RemoteException { Log.e("fakestore", "consumepurchase"); Log.d(TAG, "consumePurchase(" + apiVersion + ", " + packageName + ", " + purchaseToken + ")"); return 8; } @Override public int stub(int apiVersion, String packageName, String type) throws RemoteException { Log.e("fakestore", "stub"); return 0; public Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, List<String> oldSkus, String newSku, String type, String developerPayload) throws RemoteException { Log.d(TAG, "getBuyIntentToReplaceSkus(" + apiVersion + ", " + packageName + ", " + newSku + ", " + type + ", " + developerPayload + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); return data; } @Override public Bundle getBuyIntentToReplaceSkus(int apiVersion, String packageName, List<String> oldSkus, String newSku, String type, String developerPayload) throws RemoteException { Log.e("fakestore", "getbuyintenttoreplace"); public Bundle queryPurchases(int apiVersion, String packageName, String type, String continuationToken, Bundle extras) throws RemoteException { Log.d(TAG, "queryPurchases(" + apiVersion + ", " + packageName + ", " + type + ", " + continuationToken + ")"); Bundle data = new Bundle(); data.putInt("RESPONSE_CODE", 4); data.putInt("RESPONSE_CODE", 0); data.putStringArrayList("INAPP_PURCHASE_ITEM_LIST", new ArrayList<String>()); data.putStringArrayList("INAPP_PURCHASE_DATA_LIST", new ArrayList<String>()); data.putStringArrayList("INAPP_DATA_SIGNATURE_LIST", new ArrayList<String>()); return data; } @Override public boolean onTransact(int code, Parcel data, Parcel reply, int flags) throws RemoteException { if (super.onTransact(code, data, reply, flags)) return true; Log.d(TAG, "onTransact [unknown]: " + code + ", " + data + ", " + flags); return false; } }; public IBinder onBind(Intent intent) { Loading