fix: show real identity fingerprint (SHA-256 full format) on Android home screen
This commit is contained in:
@@ -159,6 +159,18 @@ class WzpEngine(private val callback: WzpCallback) {
|
||||
private external fun nativeWriteAudioDirect(handle: Long, buffer: java.nio.ByteBuffer, sampleCount: Int): Int
|
||||
private external fun nativeReadAudioDirect(handle: Long, buffer: java.nio.ByteBuffer, maxSamples: Int): Int
|
||||
private external fun nativeDestroy(handle: Long)
|
||||
|
||||
companion object {
|
||||
init { System.loadLibrary("wzp_android") }
|
||||
|
||||
/** Get the identity fingerprint for a seed hex. No engine needed. */
|
||||
@JvmStatic
|
||||
private external fun nativeGetFingerprint(seedHex: String): String?
|
||||
|
||||
/** Compute the full identity fingerprint (xxxx:xxxx:...) from a seed hex string. */
|
||||
@JvmStatic
|
||||
fun getFingerprint(seedHex: String): String = nativeGetFingerprint(seedHex) ?: ""
|
||||
}
|
||||
private external fun nativePingRelay(handle: Long, relay: String): String?
|
||||
private external fun nativeStartSignaling(handle: Long, relay: String, seed: String, token: String, alias: String): Int
|
||||
private external fun nativePlaceCall(handle: Long, targetFp: String): Int
|
||||
@@ -208,11 +220,6 @@ class WzpEngine(private val callback: WzpCallback) {
|
||||
return nativeAnswerCall(nativeHandle, callId, mode)
|
||||
}
|
||||
|
||||
companion object {
|
||||
init {
|
||||
System.loadLibrary("wzp_android")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** Integer constants matching the Rust [CallState] enum ordinals. */
|
||||
|
||||
@@ -431,14 +431,16 @@ fun InCallScreen(
|
||||
|
||||
Spacer(modifier = Modifier.height(20.dp))
|
||||
|
||||
// Identity
|
||||
val fp = if (seedHex.length >= 16) seedHex.take(16) else ""
|
||||
// Identity — compute real fingerprint from seed
|
||||
val fullFp = remember(seedHex) {
|
||||
if (seedHex.length >= 64) com.wzp.engine.WzpEngine.getFingerprint(seedHex) else ""
|
||||
}
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
if (fp.isNotEmpty()) {
|
||||
Identicon(fingerprint = seedHex, size = 28.dp)
|
||||
if (fullFp.isNotEmpty()) {
|
||||
Identicon(fingerprint = fullFp, size = 28.dp)
|
||||
Spacer(modifier = Modifier.width(8.dp))
|
||||
CopyableFingerprint(
|
||||
fingerprint = fp.chunked(4).joinToString(":"),
|
||||
fingerprint = fullFp,
|
||||
style = MaterialTheme.typography.bodySmall.copy(fontFamily = FontFamily.Monospace),
|
||||
color = TextDim
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user