Refactor network logging

This commit is contained in:
BinTianqi
2025-10-17 12:54:47 +08:00
parent 5b9ce9f984
commit fde191adc5
17 changed files with 232 additions and 98 deletions

View File

@@ -4,7 +4,7 @@ import android.content.Context
import android.database.sqlite.SQLiteDatabase
import android.database.sqlite.SQLiteOpenHelper
class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 2) {
class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 3) {
override fun onCreate(db: SQLiteDatabase) {
db.execSQL("CREATE TABLE dhizuku_clients (uid INTEGER PRIMARY KEY," +
"signature TEXT, permissions TEXT)")
@@ -14,5 +14,12 @@ class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 2) {
db.execSQL("CREATE TABLE security_logs (id INTEGER, tag INTEGER, level INTEGER," +
"time INTEGER, data TEXT)")
}
if (oldVersion < 3) {
db.execSQL(
"CREATE TABLE network_logs (id INTEGER, package INTEGER, time INTEGER," +
"type TEXT, host TEXT, count INTEGER, addresses TEXT, address TEXT," +
"port INTEGER)"
)
}
}
}