fix(kmp): repair code/cash app compile broken by the KMP conversions - #1205
Merged
Conversation
- Sha256Hash.bytes: internal → public val (restores cross-module Kotlin access and the auto-generated Java getBytes() accessor; removes now- redundant explicit getBytes() method that would clash with the getter) - Sha256Hash companion functions: add @JvmStatic so Java callers can resolve hash(), hashTwice(), wrap(), wrapReversed(), of(), twiceOf() as static methods - PBKDF2SHA512.derive: add @JvmStatic so Java callers can call PBKDF2SHA512.derive(...) from a static context - MnemonicCode.java: replace Sha256Hash.newDigest() (an androidMain extension, not Java-callable) with an inline MessageDigest.getInstance call; Sha256Hash.hash() now resolves via @JvmStatic above
Adds a compile-check job that runs :apps:flipcash:app:compileDebugSources before the flipcash-tests job. This task compiles all Kotlin/Java sources but stops before processDebugGoogleServices, so it requires no secrets. The missing gate is what allowed the KMP conversions in #1201 and #1202 to land on code/cash without surfacing the Java interop breaks (missing @JvmStatic, internal visibility) — those were only caught by compiling the full consumer graph, which CI never did without creds.
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.
Summary
Repairs
code/cash, which stopped compiling the app after the base58 (#1201) and sha256/sha512/hmac (#1202) KMP conversions. Those PRs were gated only on KotlincommonTest, whileassembleDebugwas masked by the missing GoogleServices creds file — so Java/Kotlin consumer breaks slipped through (Kotlin objects/companions aren't Java-static without@JvmStatic; some fields becameinternal).Three commits:
Sha256Hash.bytesmadepublic(wasinternal, which broke Kotlin consumers such aspersistence:sourcesreading.bytes); the now-redundant explicitgetBytes()removed;@JvmStaticadded to theSha256Hashcompanion functions and toPBKDF2SHA512.derivefor Java callers.:apps:flipcash:app:compileDebugSources(which precedes the creds-requiringprocessDebugGoogleServicesstep) so a future KMP change that breaks a downstream consumer fails CI instead of landing silently. This is the gate that would have caught feat(kmp): graduate shared-core to real KMP module — Base58 + randomBytes #1201/feat(kmp): sha256 / sha512 / hmac as KMP modules via kotlincrypto #1202.@JvmStatic toSeed,@JvmField INSTANCE), eliminating the Java-interop call sites in the mnemonic module.Verification
:apps:flipcash:app:compileDebugSources— compiles clean (onlyprocessDebugGoogleServicesfails, needs creds).:libs:encryption:{sha256,sha512,hmac,base58}:testAndroidHostTest— cross-platform vector gates pass.:libs:encryption:mnemonic:testDebugUnitTest— passes.Note
The full BIP39 + SLIP-10 correctness gate (
slip10.json) is an instrumented test (needs a device/emulator), so it did not run in this environment. Recommend running it on the CI emulator to fully validate the mnemonic Kotlin port'stoEntropy/toMnemonicbit-manipulation before merge.