diff --git a/README.md b/README.md index ee2c290..dc4b037 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ You can include the library from either Maven Central or Jitpack. You can include the library in the common source set like this: ```kotlin dependencies { - implementation("io.github.kotlingeekdev:rhodium:1.0-beta-14") + implementation("io.github.kotlingeekdev:rhodium:1.0-beta-15") } ``` @@ -74,7 +74,7 @@ then, in your module's `build.gradle(.kts)`, you need to add: // build.gradle.kts dependencies { //... - implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-14") + implementation("com.github.KotlinGeekDev.Rhodium:rhodium:1.0-beta-15") } @@ -85,7 +85,7 @@ If you're including it in an Android app, you can just add: // app/build.gradle.kts dependencies { //... - implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-14") + implementation("com.github.KotlinGeekDev.Rhodium:rhodium-android:1.0-beta-15") } ``` diff --git a/build.gradle.kts b/build.gradle.kts index c7e0273..585aba7 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,7 +31,7 @@ allprojects { val isJitpack = System.getenv("JITPACK") == "true" group = "io.github.kotlingeekdev" - version = "1.0-beta-14" + version = "1.0-beta-15" // val javadocJar = tasks.register("javadocJar") { diff --git a/rhodium-core/build.gradle.kts b/rhodium-core/build.gradle.kts index 7716307..8d9cdb9 100644 --- a/rhodium-core/build.gradle.kts +++ b/rhodium-core/build.gradle.kts @@ -149,7 +149,6 @@ kotlin { val androidMain by getting { - dependsOn(commonJvmMain) dependencies { implementation("androidx.appcompat:appcompat:1.7.0") @@ -158,11 +157,11 @@ kotlin { } androidInstrumentedTest.configure { - dependsOn(commonJvmTest) +// dependsOn(commonJvmTest) } val androidUnitTest by getting { - dependsOn(commonJvmTest) +// dependsOn(commonJvmTest) } linuxMain.configure { @@ -201,6 +200,7 @@ android { compileSdk = 34 testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" + consumerProguardFiles("consumer-rules.pro") } buildTypes { @@ -208,8 +208,18 @@ android { aarMetadata { } + proguardFiles( + getDefaultProguardFile("proguard-android-optimize.txt"), + "proguard-rules.pro" + ) isMinifyEnabled = true } + debug { + aarMetadata { + + } + isMinifyEnabled = false + } } compileOptions { isCoreLibraryDesugaringEnabled = false diff --git a/rhodium-core/consumer-rules.pro b/rhodium-core/consumer-rules.pro new file mode 100644 index 0000000..3d56318 --- /dev/null +++ b/rhodium-core/consumer-rules.pro @@ -0,0 +1,2 @@ +# preserve access to native classses +-keep class fr.acinq.secp256k1.** { *; } \ No newline at end of file diff --git a/rhodium-core/proguard-rules.pro b/rhodium-core/proguard-rules.pro new file mode 100644 index 0000000..1a928c7 --- /dev/null +++ b/rhodium-core/proguard-rules.pro @@ -0,0 +1,26 @@ +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# preserve the line number information for debugging stack traces. +-dontobfuscate +-keepattributes LocalVariableTable +-keepattributes LocalVariableTypeTable +-keepattributes *Annotation* +-keepattributes SourceFile +-keepattributes LineNumberTable +-keepattributes Signature +-keepattributes Exceptions +-keepattributes InnerClasses +-keepattributes EnclosingMethod +-keepattributes MethodParameters +-keepparameternames + + +# Keep all names +-keepnames class ** { *; } + +# Keep All enums +-keep enum ** { *; } + +# preserve access to native classses +-keep class fr.acinq.secp256k1.** { *; } diff --git a/rhodium-core/src/commonMain/kotlin/rhodium/nostr/client/ClientMessage.kt b/rhodium-core/src/commonMain/kotlin/rhodium/nostr/client/ClientMessage.kt index 98e2e80..27a4913 100644 --- a/rhodium-core/src/commonMain/kotlin/rhodium/nostr/client/ClientMessage.kt +++ b/rhodium-core/src/commonMain/kotlin/rhodium/nostr/client/ClientMessage.kt @@ -12,6 +12,7 @@ import kotlinx.serialization.descriptors.SerialDescriptor import kotlinx.serialization.encoding.Decoder import kotlinx.serialization.encoding.Encoder import kotlinx.serialization.json.* +import rhodium.crypto.toHexString import rhodium.nostr.Event import rhodium.nostr.NostrFilter @@ -114,7 +115,7 @@ open class RequestMessage( companion object { fun singleFilterRequest( - subscriptionId: String = uuid4().bytes.decodeToString().substring(0, 5), + subscriptionId: String = uuid4().bytes.toHexString().substring(0, 5), filter: NostrFilter ): RequestMessage { return RequestMessage(messageType = "REQ", subscriptionId, listOf(filter))