debug_query.py
677 Bytes
import sys, os, sqlite3
plain = '/data/data/com.termux/files/home/EnMicroMsg.db.decrypted.db'
print('plain exists=', os.path.exists(plain))
print('plain size=', os.path.getsize(plain))
conn = sqlite3.connect(plain)
conn.row_factory = sqlite3.Row
# Check table exists
rows = conn.execute("SELECT name FROM sqlite_master WHERE type='table' AND name='message'").fetchall()
print('message table exists=', len(rows) > 0)
# Query messages
rows = conn.execute("SELECT msgId, talker, content, isSend, type FROM message WHERE msgId > 0 AND isSend = 0 ORDER BY msgId DESC LIMIT 5").fetchall()
print('messages count=', len(rows))
for r in rows:
print(' ', dict(r))
conn.close()