This repository was archived by the owner on Oct 17, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 10 files changed +468
-244
lines changed
main/java/dev/hyo/openiap
test/java/dev/hyo/openiap Expand file tree Collapse file tree 10 files changed +468
-244
lines changed Original file line number Diff line number Diff line change 11plugins {
22 id(" com.android.application" )
33 id(" org.jetbrains.kotlin.android" )
4+ id(" org.jetbrains.kotlin.plugin.compose" )
45}
56
67android {
@@ -33,23 +34,18 @@ android {
3334 }
3435
3536 compileOptions {
36- sourceCompatibility = JavaVersion .VERSION_11
37- targetCompatibility = JavaVersion .VERSION_11
37+ sourceCompatibility = JavaVersion .VERSION_17
38+ targetCompatibility = JavaVersion .VERSION_17
3839 }
3940
4041 kotlinOptions {
41- jvmTarget = " 11 "
42+ jvmTarget = " 17 "
4243 }
4344
4445 buildFeatures {
4546 compose = true
4647 }
4748
48- composeOptions {
49- kotlinCompilerExtensionVersion =
50- (project.findProperty(" COMPOSE_COMPILER_VERSION" ) as String? ) ? : " 1.5.14"
51- }
52-
5349 packaging {
5450 resources {
5551 excludes + = " /META-INF/{AL2.0,LGPL2.1}"
@@ -81,4 +77,3 @@ dependencies {
8177 androidTestImplementation(" androidx.test.espresso:espresso-core:3.5.1" )
8278 androidTestImplementation(" androidx.compose.ui:ui-test-junit4:$composeUiVersion " )
8379}
84-
Original file line number Diff line number Diff line change 11plugins {
22 id(" com.android.library" ) version " 8.5.0" apply false
33 id(" com.android.application" ) version " 8.5.0" apply false
4- id(" org.jetbrains.kotlin.android" ) version " 1.9.24" apply false
4+ id(" org.jetbrains.kotlin.android" ) version " 2.0.21" apply false
5+ id(" org.jetbrains.kotlin.plugin.compose" ) version " 2.0.21" apply false
56 id(" com.vanniktech.maven.publish" ) version " 0.29.0" apply false
67}
78
Original file line number Diff line number Diff line change 11plugins {
22 id(" com.android.library" )
33 id(" org.jetbrains.kotlin.android" )
4+ id(" org.jetbrains.kotlin.plugin.compose" )
45 id(" com.vanniktech.maven.publish" )
56}
67
@@ -16,7 +17,6 @@ android {
1617
1718 defaultConfig {
1819 minSdk = 21
19- targetSdk = 34
2020
2121 testInstrumentationRunner = " androidx.test.runner.AndroidJUnitRunner"
2222 consumerProguardFiles(" consumer-rules.pro" )
@@ -33,31 +33,26 @@ android {
3333 }
3434
3535 compileOptions {
36- sourceCompatibility = JavaVersion .VERSION_11
37- targetCompatibility = JavaVersion .VERSION_11
36+ sourceCompatibility = JavaVersion .VERSION_17
37+ targetCompatibility = JavaVersion .VERSION_17
3838 }
3939
4040 kotlinOptions {
41- jvmTarget = " 11 "
41+ jvmTarget = " 17 "
4242 }
4343
4444 // Enable Compose for composables in this library (IapContext)
4545 buildFeatures {
4646 compose = true
4747 }
48-
49- composeOptions {
50- kotlinCompilerExtensionVersion =
51- (project.findProperty(" COMPOSE_COMPILER_VERSION" ) as String? ) ? : " 1.5.14"
52- }
5348}
5449
5550dependencies {
5651 implementation(" androidx.core:core-ktx:1.12.0" )
5752 implementation(" androidx.lifecycle:lifecycle-runtime-ktx:2.7.0" )
5853
59- // Google Play Billing Library
60- api(" com.android.billingclient:billing-ktx:6 .0.1 " )
54+ // Google Play Billing Library (align with app/lib v8)
55+ api(" com.android.billingclient:billing-ktx:8 .0.0 " )
6156
6257 // Kotlin Coroutines
6358 implementation(" org.jetbrains.kotlinx:kotlinx-coroutines-core:1.7.3" )
Original file line number Diff line number Diff line change @@ -9,6 +9,12 @@ sealed class OpenIapError : Exception() {
99 abstract val code: String
1010 abstract override val message: String
1111
12+ fun toJSON (): Map <String , Any ?> = mapOf (
13+ " code" to toCode(this ),
14+ " message" to (this .message ? : " " ),
15+ " platform" to " android" ,
16+ )
17+
1218 data class ProductNotFound (val productId : String ) : OpenIapError() {
1319 override val code = " PRODUCT_NOT_FOUND"
1420 override val message = " Product not found: $productId "
You can’t perform that action at this time.
0 commit comments