Skip to content

Commit 191732b

Browse files
Merge pull request #2 from godot-x/new-version
android r8, docs, new versions, fix scripts
2 parents 194c0b0 + a12908d commit 191732b

10 files changed

Lines changed: 151 additions & 38 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2025 Paulo Coutinho
3+
Copyright (c) 2026 Paulo Coutinho
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ APPLE_SDK_ARCHS = iphoneos/arm64 iphonesimulator/arm64 iphonesimulator/x86_64
4242
# ============================================================================
4343
GODOT_VERSION = 4.5-stable
4444
GODOT_REPO = https://github.com/godotengine/godot.git
45-
REVENUECAT_VERSION = 5.48.0
45+
REVENUECAT_VERSION = 5.54.0
4646

4747
# ============================================================================
4848
# Help
@@ -302,7 +302,7 @@ package:
302302
@echo "→ Copying addons..."
303303
@cp -a addons godotx_revenue_cat/
304304
@echo "→ Copying iOS plugin..."
305-
@cp -a ios/plugins/revenue_cat godotx_revenue_cat/ios/
305+
@cp -a ios godotx_revenue_cat/
306306
@echo "→ Copying Android plugin..."
307307
@mkdir -p godotx_revenue_cat/android
308308
@cp -a android/revenue_cat godotx_revenue_cat/android/

README.md

Lines changed: 72 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -41,28 +41,50 @@ This project provides a native RevenueCat plugin for Godot, built as a fully int
4141
| Component | Version |
4242
|-----------|---------|
4343
| Godot | 4.5‑stable |
44-
| RevenueCat iOS SDK | 5.48.0 |
45-
| RevenueCat Android SDK | 9.14.0 |
46-
| Kotlin | 2.1.0 |
44+
| RevenueCat iOS SDK | 5.54.0 |
45+
| RevenueCat Android SDK | 9.19.0 |
46+
| Kotlin | 2.3.0 |
4747
| Min iOS | 15.0 |
4848
| Min Android SDK | 24 (Android 7.0) |
4949

5050
## Quick Start
5151

5252
### 1. Installation
5353

54-
Copy the plugin folder into your Godot project:
55-
56-
```
57-
your_project/
58-
└── addons/
59-
└── godotx_revenue_cat/
60-
```
61-
62-
Enable it in the editor:
63-
64-
- Go to **Project → Project Settings → Plugins**
65-
- Enable **Godotx RevenueCat**
54+
#### Option A: Godot Asset Library (Recommended)
55+
56+
1. Open **AssetLib** in Godot Editor
57+
2. Search for "Godotx RevenueCat"
58+
3. Click **Download** and **Install**
59+
4. Or download directly from: https://godotengine.org/asset-library/asset/4493
60+
61+
#### Option B: Manual Installation
62+
63+
1. **Download the ZIP** from [Releases](https://github.com/godot-x/revenuecat/releases)
64+
65+
2. **Extract the ZIP** - it contains 3 folders:
66+
```
67+
godotx_revenuecat/
68+
├── addons/
69+
├── ios/
70+
└── android/
71+
```
72+
73+
3. **Copy all 3 folders** to your Godot project root:
74+
```
75+
your_project/
76+
├── addons/
77+
│ └── godotx_revenue_cat/
78+
├── ios/
79+
│ └── plugins/
80+
│ └── revenuecat/
81+
└── android/
82+
└── revenuecat/
83+
```
84+
85+
4. **Enable the plugin** in Godot:
86+
- Open **Project → Project Settings → Plugins**
87+
- Enable "Godotx RevenueCat"
6688

6789
### 2. Configure Export Preset
6890

@@ -147,6 +169,41 @@ revenuecat.login("user_123")
147169
revenuecat.logout()
148170
```
149171

172+
## Advanced Configuration
173+
174+
### Android R8/ProGuard Minification
175+
176+
By default, R8 minification is **disabled** in release builds. If you want to enable it for smaller APK/AAB sizes, follow these steps:
177+
178+
1. **Edit `android/build/build.gradle`** and enable minification in the release build type:
179+
180+
```gradle
181+
android {
182+
buildTypes {
183+
release {
184+
minifyEnabled true
185+
shrinkResources true
186+
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
187+
}
188+
}
189+
}
190+
```
191+
192+
2. **Create `android/build/proguard-rules.pro`** with the following content:
193+
194+
```proguard
195+
####################################
196+
# Godot JNI
197+
####################################
198+
-keep class org.godotengine.godot.** { *; }
199+
-dontwarn org.godotengine.godot.**
200+
```
201+
202+
**Important Notes:**
203+
- RevenueCat ProGuard rules are already included in the module (via `consumerProguardFiles`)
204+
- Only add custom rules if you encounter issues with other libraries
205+
- Test thoroughly after enabling minification to ensure everything works correctly
206+
150207
## Building (For Developers)
151208

152209
```bash

addons/godotx_revenue_cat/export_plugin.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class AndroidExportPlugin extends EditorExportPlugin:
5151
"name": "revenue_cat/revenue_cat_version",
5252
"type": TYPE_STRING
5353
},
54-
"default_value": "9.14.0"
54+
"default_value": "9.19.0"
5555
})
5656

5757
# RevenueCat UI version
@@ -60,7 +60,7 @@ class AndroidExportPlugin extends EditorExportPlugin:
6060
"name": "revenue_cat/revenue_cat_ui_version",
6161
"type": TYPE_STRING
6262
},
63-
"default_value": "9.14.0"
63+
"default_value": "9.19.0"
6464
})
6565

6666
return options

addons/godotx_revenue_cat/plugin.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
name="Godotx RevenueCat"
44
description="RevenueCat integration for Godot"
55
author="Paulo Coutinho"
6-
version="1.1.0"
6+
version="1.2.0"
77
script="export_plugin.gd"

export_presets.cfg

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,8 +483,8 @@ permissions/write_social_stream=false
483483
permissions/write_sync_settings=false
484484
permissions/write_user_dictionary=false
485485
revenuecat/enable_revenuecat=true
486-
revenuecat/revenuecat_version="9.14.0"
487-
revenuecat/revenuecat_ui_version="9.14.0"
486+
revenuecat/revenuecat_version="9.19.0"
487+
revenuecat/revenuecat_ui_version="9.19.0"
488488
revenue_cat/enable_revenue_cat=true
489-
revenue_cat/revenue_cat_version="9.14.0"
490-
revenue_cat/revenue_cat_ui_version="9.14.0"
489+
revenue_cat/revenue_cat_version="9.19.0"
490+
revenue_cat/revenue_cat_ui_version="9.19.0"
Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
plugins {
2-
id("com.android.library") version "8.2.2"
3-
id("org.jetbrains.kotlin.android") version "2.1.0"
2+
id("com.android.library") version "8.13.2"
3+
id("org.jetbrains.kotlin.android") version "2.3.0"
44
}
55

66
android {
77
namespace = "com.godotx.revenuecat"
8-
compileSdk = 34
8+
compileSdk = 35
99

1010
defaultConfig {
11-
minSdk = 21
11+
minSdk = 24
12+
consumerProguardFiles("consumer-rules.pro")
1213
}
1314

1415
buildTypes {
@@ -22,17 +23,19 @@ android {
2223
targetCompatibility = JavaVersion.VERSION_11
2324
}
2425

25-
kotlinOptions {
26-
jvmTarget = "11"
26+
kotlin {
27+
compilerOptions {
28+
jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_11
29+
}
2730
}
2831
}
2932

3033
dependencies {
31-
compileOnly("org.godotengine:godot:4.2.2.stable")
32-
34+
compileOnly("org.godotengine:godot:4.5.0.stable")
35+
3336
// RevenueCat
34-
implementation("com.revenuecat.purchases:purchases:9.14.0")
35-
implementation("com.revenuecat.purchases:purchases-ui:9.14.0")
37+
implementation("com.revenuecat.purchases:purchases:9.19.0")
38+
implementation("com.revenuecat.purchases:purchases-ui:9.19.0")
3639
implementation("androidx.appcompat:appcompat:1.7.1")
3740
}
3841

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
####################################
2+
# RevenueCat Core SDK
3+
####################################
4+
-keep class com.revenuecat.purchases.** { *; }
5+
-dontwarn com.revenuecat.purchases.**
6+
7+
####################################
8+
# RevenueCat UI SDK
9+
####################################
10+
-keep class com.revenuecat.purchases.ui.** { *; }
11+
-dontwarn com.revenuecat.purchases.ui.**
12+
13+
####################################
14+
# RevenueCat uses reflection + serialization
15+
####################################
16+
-keepattributes Signature
17+
-keepattributes InnerClasses
18+
-keepattributes EnclosingMethod
19+
-keepattributes *Annotation*
20+
21+
####################################
22+
# Kotlin / Coroutines (required)
23+
####################################
24+
-keep class kotlin.Metadata { *; }
25+
-keep class kotlin.** { *; }
26+
-dontwarn kotlin.**
27+
28+
-keep class kotlinx.coroutines.** { *; }
29+
-dontwarn kotlinx.coroutines.**
30+
31+
####################################
32+
# Google Billing (required by RevenueCat)
33+
####################################
34+
-keep class com.android.billingclient.** { *; }
35+
-dontwarn com.android.billingclient.**
36+
37+
####################################
38+
# AndroidX / AppCompat (UI SDK)
39+
####################################
40+
-keep class androidx.appcompat.** { *; }
41+
-dontwarn androidx.appcompat.**
42+
43+
####################################
44+
# Lifecycle / ViewModel (used by purchases-ui)
45+
####################################
46+
-keep class androidx.lifecycle.** { *; }
47+
-dontwarn androidx.lifecycle.**
48+
49+
####################################
50+
# Gson / JSON (used internally)
51+
####################################
52+
-keep class com.google.gson.** { *; }
53+
-dontwarn com.google.gson.**

source/android/revenue_cat/src/main/java/com/godotx/revenuecat/RCProxyActivity.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class RCProxyActivity : ComponentActivity(), PaywallResultHandler {
6161
is PaywallResult.Purchased -> emitBroadcast("purchased")
6262
is PaywallResult.Restored -> emitBroadcast("restored")
6363
is PaywallResult.Cancelled -> emitBroadcast("cancelled")
64-
is PaywallResult.Error -> emitBroadcast("error", result.error.message ?: "")
64+
is PaywallResult.Error -> emitBroadcast("error", result.error.message)
6565
}
6666
finish()
6767
}

source/ios/revenue_cat/Podfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ platform :ios, '15.0'
22
use_frameworks!
33

44
target 'GodotxRevenueCat' do
5-
pod 'RevenueCat', '5.48.0'
6-
pod 'RevenueCatUI', '5.48.0'
5+
pod 'RevenueCat', '5.54.0'
6+
pod 'RevenueCatUI', '5.54.0'
77
end
88

99
post_install do |installer|

0 commit comments

Comments
 (0)