From fcaff43f7f4fb02ab32719125cc68ebc79063356 Mon Sep 17 00:00:00 2001 From: FinepointCGI Date: Fri, 19 May 2023 11:32:46 -0400 Subject: [PATCH 1/3] Updated to 5.2 * Updated gradle version * updated the billing verison --- godot-google-play-billing/build.gradle | 6 +++--- .../plugin/googleplaybilling/GodotGooglePlayBilling.java | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/godot-google-play-billing/build.gradle b/godot-google-play-billing/build.gradle index 8e987ea..656634b 100644 --- a/godot-google-play-billing/build.gradle +++ b/godot-google-play-billing/build.gradle @@ -6,12 +6,12 @@ ext.pluginVersionCode = 4 ext.pluginVersionName = "1.1.2" android { - compileSdkVersion 30 + compileSdkVersion 31 buildToolsVersion "30.0.3" defaultConfig { minSdkVersion 18 - targetSdkVersion 30 + targetSdkVersion 31 versionCode pluginVersionCode versionName pluginVersionName } @@ -25,6 +25,6 @@ android { dependencies { implementation "androidx.legacy:legacy-support-v4:1.0.0" - implementation 'com.android.billingclient:billing:4.0.0' + implementation 'com.android.billingclient:billing:5.2.0' compileOnly fileTree(dir: 'libs', include: ['godot-lib*.aar']) } diff --git a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java index a519223..1229953 100644 --- a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java +++ b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java @@ -159,6 +159,7 @@ public void onAcknowledgePurchaseResponse(BillingResult billingResult) { }); } + public void consumePurchase(String purchaseToken) { ConsumeParams consumeParams = ConsumeParams.newBuilder() .setPurchaseToken(purchaseToken) From 06e228864642f1d6a6227517ecf45809b01b772e Mon Sep 17 00:00:00 2001 From: FinepointCGI Date: Fri, 19 May 2023 13:08:07 -0400 Subject: [PATCH 2/3] Added in UsedByGodot Tags --- .../GodotGooglePlayBilling.java | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java index 1229953..1baa7dd 100644 --- a/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java +++ b/godot-google-play-billing/src/main/java/org/godotengine/godot/plugin/googleplaybilling/GodotGooglePlayBilling.java @@ -35,6 +35,7 @@ import org.godotengine.godot.plugin.GodotPlugin; import org.godotengine.godot.plugin.SignalInfo; import org.godotengine.godot.plugin.googleplaybilling.utils.GooglePlayBillingUtils; +import org.godotengine.godot.plugin.UsedByGodot; import androidx.annotation.NonNull; import androidx.annotation.Nullable; @@ -91,15 +92,16 @@ public void startConnection() { public void endConnection() { billingClient.endConnection(); } - + @UsedByGodot public boolean isReady() { return this.billingClient.isReady(); } - + @UsedByGodot public int getConnectionState() { return billingClient.getConnectionState(); } + @UsedByGodot public void queryPurchases(String type) { billingClient.queryPurchasesAsync(type, new PurchasesResponseListener() { @Override @@ -118,7 +120,7 @@ public void onQueryPurchasesResponse(BillingResult billingResult, } }); } - + @UsedByGodot public void querySkuDetails(final String[] list, String type) { List skuList = Arrays.asList(list); @@ -141,7 +143,7 @@ public void onSkuDetailsResponse(BillingResult billingResult, } }); } - + @UsedByGodot public void acknowledgePurchase(final String purchaseToken) { AcknowledgePurchaseParams acknowledgePurchaseParams = AcknowledgePurchaseParams.newBuilder() @@ -159,7 +161,7 @@ public void onAcknowledgePurchaseResponse(BillingResult billingResult) { }); } - + @UsedByGodot public void consumePurchase(String purchaseToken) { ConsumeParams consumeParams = ConsumeParams.newBuilder() .setPurchaseToken(purchaseToken) @@ -190,7 +192,7 @@ public void onBillingSetupFinished(BillingResult billingResult) { public void onBillingServiceDisconnected() { emitSignal("disconnected"); } - + @UsedByGodot public Dictionary confirmPriceChange(String sku) { if (!skuDetailsCache.containsKey(sku)) { Dictionary returnValue = new Dictionary(); @@ -211,12 +213,12 @@ public Dictionary confirmPriceChange(String sku) { returnValue.put("status", 0); // OK = 0 return returnValue; } - + @UsedByGodot public Dictionary purchase(String sku) { return purchaseInternal("", sku, BillingFlowParams.ProrationMode.UNKNOWN_SUBSCRIPTION_UPGRADE_DOWNGRADE_POLICY); } - + @UsedByGodot public Dictionary updateSubscription(String oldToken, String sku, int prorationMode) { return purchaseInternal(oldToken, sku, prorationMode); } @@ -259,11 +261,12 @@ private Dictionary purchaseInternal(String oldToken, String sku, int prorationMo } return returnValue; - } + } + @UsedByGodot public void setObfuscatedAccountId(String accountId) { obfuscatedAccountId = accountId; } - + @UsedByGodot public void setObfuscatedProfileId(String profileId) { obfuscatedProfileId = profileId; } From d5a6e1c9d498ea8b5707880812a05345e3c25288 Mon Sep 17 00:00:00 2001 From: FinepointCGI Date: Fri, 19 May 2023 18:02:07 -0400 Subject: [PATCH 3/3] Updated gdap file --- GodotGooglePlayBilling.gdap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GodotGooglePlayBilling.gdap b/GodotGooglePlayBilling.gdap index b6fddfd..b50d3e8 100644 --- a/GodotGooglePlayBilling.gdap +++ b/GodotGooglePlayBilling.gdap @@ -5,4 +5,4 @@ binary_type="local" binary="GodotGooglePlayBilling.1.1.2.release.aar" [dependencies] -remote=["com.android.billingclient:billing:4.0.0"] +remote=["com.android.billingclient:billing:5.4.0"]