android: fix QR join flow + cleanup log levels + remove log artifacts

- MainActivity: call NativeLib.joinChannel directly (bypass ViewModel null repo)
- LogManager: add Log.d for Kotlin logs visibility in logcat
- ChatViewModel/NativeLib: add diagnostic logs for join path
- chat_sync: JNI-safe logs via __android_log_print, add error on !g_cs
- etcp_debug: DUMP INFO→DEBUG (remove 99.8% packet spam)
- secure_channel/etcp_connections/topo_node: keepalive PING/PONG spam INFO→DEBUG
- .gitignore: logreceiver output + build artifacts
- Remove tracked log files and build dir from repo
This commit is contained in:
evgeny committed 2026-07-28 18:11:11 +03:00
1 parent 0216b0bf50
commit 03b34e9580
40 files changed
+42 -3954

No files matched your search

+24 -4
View File
@@ -23,6 +23,9 @@
#include <string.h>
#include <sqlite3.h>
#include <openssl/evp.h>
#ifdef __ANDROID__
#include <android/log.h>
#endif
static struct chat_sync* g_cs = NULL;
@@ -579,6 +582,9 @@ static void cm_invite_trampoline(void* arg) {
uint64_t node_id = inv->node_id;
uint64_t channel_id = inv->channel_id;
DEBUG_INFO(DEBUG_CATEGORY_DB_SYNC, "%s: invite start ch=%llu node=0x%016llx addrs=%d",
CS_ID, channel_id, node_id, inv->addr_count);
/* save pubkey to nodes */
sqlite3_stmt* st = NULL;
sqlite3_prepare_v2(db, "INSERT INTO nodes(node_id,x25519_pubkey,created_at) VALUES(?,?,?)"
@@ -637,8 +643,13 @@ static void cm_invite_trampoline(void* arg) {
if (inst->topo_groups && ni->v4_addrs) {
struct TOPO_GROUP* g = topo_groups_find(inst->topo_groups, channel_id);
if (g && g->conn_mgr)
if (g && g->conn_mgr) {
conn_mgr_connect_from_invite(g->conn_mgr, ni, channel_id, 0, NULL, NULL);
DEBUG_INFO(DEBUG_CATEGORY_DB_SYNC, "%s: invite connect posted node=0x%016llx", CS_ID, (unsigned long long)node_id);
}
} else {
DEBUG_ERROR(DEBUG_CATEGORY_DB_SYNC, "%s: invite no addrs topo=%p v4=%p", CS_ID,
(void*)inst->topo_groups, (void*)ni->v4_addrs);
}
if (g_cs && g_cs->pending_invite_ch_id != 0 && !g_cs->info_req_timer) {
@@ -660,6 +671,12 @@ void chat_sync_connect_from_invite(uint64_t channel_id, uint64_t node_id,
const uint8_t* addrs_data, int addr_count) {
if (!g_cs || !g_cs->inst || !g_cs->inst->ua) {
int r = -7;
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_ERROR, "utun-chat", "invite ch=%llu node=%016llx REJECTED g_cs=%p inst=%p ua=%p",
(long long)channel_id, (long long)node_id, (void*)g_cs,
g_cs ? (void*)g_cs->inst : NULL,
(g_cs && g_cs->inst) ? (void*)g_cs->inst->ua : NULL);
#endif
uint8_t err[12]; memcpy(err, &node_id, 8); memcpy(err + 8, &r, 4);
chat_event_post(CHAT_EVT_CONNECT_RESULT, err, 12);
return;
@@ -680,11 +697,14 @@ void chat_sync_connect_from_invite(uint64_t channel_id, uint64_t node_id,
g_cs->pending_invite_ch_id = channel_id;
g_cs->pending_invite_node_id = node_id;
DEBUG_TRACE(DEBUG_CATEGORY_DB_SYNC, "%s: invite ch=%llu node=%016llx pubkey=%016llx addrs=%d",
CS_ID, channel_id, node_id, *(const uint64_t*)pubkey_bin, addr_count);
#ifdef __ANDROID__
__android_log_print(ANDROID_LOG_INFO, "utun-chat", "invite ch=%llu node=%016llx addrs=%d",
(long long)channel_id, (long long)node_id, addr_count);
#endif
#ifndef __ANDROID__
DEBUG_INFO(DEBUG_CATEGORY_DB_SYNC, "%s: invite start ch=%llu node=0x%016llx pubkey=%016llx... addrs=%d",
CS_ID, channel_id, node_id, *(const uint64_t*)pubkey_bin, addr_count);
#endif
struct cm_invite_wrap { struct chat_invite inv; }* w = u_malloc(sizeof(struct cm_invite_wrap));
w->inv = *inv; u_free(inv);