@@ -4,13 +4,13 @@ import android.content.Context
44import android.database.sqlite.SQLiteDatabase
55import android.database.sqlite.SQLiteOpenHelper
66
7- class MyDbHelper (context : Context ): SQLiteOpenHelper(context, " data" , null , 7 ) {
7+ class MyDbHelper (context : Context ): SQLiteOpenHelper(context, " data" , null , 8 ) {
88 override fun onCreate (db : SQLiteDatabase ) {
99 db.execSQL(DHIZUKU_CLIENTS_TABLE )
1010 db.execSQL(SECURITY_LOGS_TABLE )
1111 db.execSQL(NETWORK_LOGS_TABLE )
1212 db.execSQL(APP_GROUPS_TABLE )
13- db.execSQL(CP_INTENTS_TABLE )
13+ db.execSQL(CPIF_TABLE )
1414 }
1515 override fun onUpgrade (db : SQLiteDatabase , oldVersion : Int , newVersion : Int ) {
1616 if (oldVersion < 2 ) {
@@ -22,14 +22,8 @@ class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 7) {
2222 if (oldVersion < 4 ) {
2323 db.execSQL(APP_GROUPS_TABLE )
2424 }
25- if (oldVersion < 5 ) {
26- db.execSQL(CP_INTENTS_TABLE )
27- }
28- if (oldVersion < 6 ) {
29- db.execSQL(UPGRADE_CP_INTENTS_TABLE )
30- }
31- if (oldVersion < 7 ) {
32- db.execSQL(RENAME_CP_COLUMN )
25+ if (oldVersion < 8 ) {
26+ db.execSQL(CPIF_TABLE )
3327 }
3428 }
3529 companion object {
@@ -43,11 +37,7 @@ class MyDbHelper(context: Context): SQLiteOpenHelper(context, "data", null, 7) {
4337 const val APP_GROUPS_TABLE = " CREATE TABLE app_groups(" +
4438 " id INTEGER PRIMARY KEY AUTOINCREMENT," +
4539 " name TEXT, apps TEXT)"
46- const val CP_INTENTS_TABLE = " CREATE TABLE cross_profile_intent_filters (" +
40+ const val CPIF_TABLE = " CREATE TABLE cpif (" +
4741 " action_str TEXT, category TEXT, mime_type TEXT, direction INTEGER, time INTEGER)"
48- const val UPGRADE_CP_INTENTS_TABLE = " ALTER TABLE cross_profile_intent_filters " +
49- " ADD COLUMN created_at INTEGER NOT NULL DEFAULT 0"
50- const val RENAME_CP_COLUMN = " ALTER TABLE cross_profile_intent_filters " +
51- " RENAME COLUMN created_at TO time"
5242 }
5343}
0 commit comments