Repository navigation
Conversation
All 14 KMP library modules repeated the same android compileSdk/minSdk block and the same five Apple targets, and only text-format applied the convention plugin. The plugin now declares those targets, and every module applies it and keeps only its namespace and test opt-ins. shared-core attaches its SharedCore framework to each native target via targets.withType<KotlinNativeTarget>() instead of a local target list. discrete-curve hard-coded compileSdk = 37; it now picks up the catalog's 37 with minor API level 2 like the other modules.
First step of the desktop client: the KMP libraries need a JVM target before Compose Desktop modules can depend on them. flipcash.kmp.library now declares jvm() with jvmTarget from the android-java catalog version. Two expect declarations needed JVM actuals: - sha512 derivePlatform: the JDK ships PBKDF2WithHmacSHA512, so the actual is the Android JCA one with the same ASCII-only guard. - Ed25519Kmp: pure Java on net.i2p.crypto:eddsa, which already backs the test-utils shadow. The 64-byte private key is eddsa's clamped hash `h`, the same orlp layout the JNI and cinterop actuals return, so keys move between platforms unchanged. The RFC 8032 vectors in ed25519.json pass on jvmTest, so no native library is loaded on desktop. sign.c includes sha3.h, but that header declares the sha512_* functions and sha3.c is libtom's SHA-512 (it carries the 0x428a2f98d728ae22 round constant). It's a misnamed file, not SHA-3, which is why standard SHA-512 on the JVM reproduces the native signatures.
Hilt's Gradle plugin rejects the AGP KMP android target, so KMP modules run the Hilt KSP processors through kspAndroid without the plugin. Only the app and notifications use @androidentrypoint, which is what the plugin's bytecode rewrite exists for. libs:coroutines moves onto the plugin, and its test fixtures become a :libs:coroutines:test-fixtures module, since the KMP android target has no testFixtures. shared:funding moves its sources to androidMain as the first Hilt-bearing module on the KMP plugin.
Collaborator
Author
|
Landed in #1894 as one squash against code/cash. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Compose Desktop
jvm()target can only depend on the shared KMP libraries once they build for the JVM, and none of the 14 did.What changed
flipcash.kmp.librarynow declares every target: android (compileSdk and minSdk from the catalog), the five Apple natives, andjvm(). All 14 modules apply it instead of the raw plugins, and their build files keep only the namespace, test opt-ins, and module-specific wiring.shared-corehangs itsSharedCoreframework offtargets.withType<KotlinNativeTarget>(), so KMMBridge publishing is otherwise unchanged.sha512: thederivePlatformJVM actual reuses the Android JCA path, since the JDK shipsPBKDF2WithHmacSHA512.ed25519: the JVM actual is pure Java onnet.i2p.crypto:eddsa, the library behind thetest-utilsshadow. The private key it returns is eddsa's clamped hashh, which is the orlp 64-byte layout the JNI and cinterop actuals use. The RFC 8032 vectors ined25519.jsonpass onjvmTest, so desktop doesn't load the C library.Modules that needed more than the target
ed25519andsha512: the two new actuals above.discrete-curvehard-codedcompileSdk = 37. It now uses the catalog value, which adds minor API level 2.kikcodecompiles for jvm as is.KikCodePainterstays androidMain-only.chat-cipherneeded nothing: the libsodium bindings load on the JVM host, and its vectors pass onjvmTest.The sha3 question in sign.c
sign.cincludessha3.h, but that header declaressha512_*, andsha3.cis libtom's SHA-512 with the0x428a2f98d728ae22round constant.sha512.cholds only the license comment, andsha512.his empty. So it's a misnamed file, not SHA-3, which is why standard SHA-512 on the JVM reproduces the native signatures.