Add E2EE diagnostic logging for debugging call encryption
All checks were successful
Android Kernel Build / build (push) Successful in 19m17s
All checks were successful
Android Kernel Build / build (push) Successful in 19m17s
- Enable diag file for all builds (was DEBUG-only) - Add native frame count + bad streak query methods (JNI) - Add periodic E2EE-HEALTH log with enc/dec frame counts - Reduce scan receivers spam (only log on state change) - Log E2EE state on call connected - Log when attachSender/attachReceiver skips due to missing key
This commit is contained in:
@@ -531,6 +531,7 @@ public:
|
||||
}
|
||||
|
||||
uint32_t KeyFingerprint() const { return key_fingerprint_; }
|
||||
int FrameCount() const { return diag_count_.load(std::memory_order_relaxed); }
|
||||
|
||||
/* ── RefCountInterface ─────────────────────────────────────── */
|
||||
void AddRef() const override {
|
||||
@@ -724,6 +725,8 @@ public:
|
||||
}
|
||||
|
||||
uint32_t KeyFingerprint() const { return key_fingerprint_; }
|
||||
int FrameCount() const { return diag_count_.load(std::memory_order_relaxed); }
|
||||
uint32_t BadStreak() const { return bad_audio_streak_.load(std::memory_order_relaxed); }
|
||||
|
||||
/* ── RefCountInterface ─────────────────────────────────────── */
|
||||
void AddRef() const override {
|
||||
@@ -1121,4 +1124,33 @@ Java_com_rosetta_messenger_network_XChaCha20E2EE_nativeCloseDiagFile(
|
||||
}
|
||||
}
|
||||
|
||||
/* ── Query frame counts for health checks ────────────────────── */
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_rosetta_messenger_network_XChaCha20E2EE_nativeGetEncryptorFrameCount(
|
||||
JNIEnv *, jclass, jlong ptr)
|
||||
{
|
||||
if (ptr == 0) return -1;
|
||||
auto *enc = reinterpret_cast<XChaCha20Encryptor *>(ptr);
|
||||
return enc->FrameCount();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_rosetta_messenger_network_XChaCha20E2EE_nativeGetDecryptorFrameCount(
|
||||
JNIEnv *, jclass, jlong ptr)
|
||||
{
|
||||
if (ptr == 0) return -1;
|
||||
auto *dec = reinterpret_cast<XChaCha20Decryptor *>(ptr);
|
||||
return dec->FrameCount();
|
||||
}
|
||||
|
||||
JNIEXPORT jint JNICALL
|
||||
Java_com_rosetta_messenger_network_XChaCha20E2EE_nativeGetDecryptorBadStreak(
|
||||
JNIEnv *, jclass, jlong ptr)
|
||||
{
|
||||
if (ptr == 0) return -1;
|
||||
auto *dec = reinterpret_cast<XChaCha20Decryptor *>(ptr);
|
||||
return dec->BadStreak();
|
||||
}
|
||||
|
||||
} /* extern "C" */
|
||||
|
||||
Reference in New Issue
Block a user