Make msys database available in Flipper Database plugin
Summary: DefaultSqliteDatabaseProvider only list databases in the "files" folder & "databases" folder: /data/user/0/com.facebook.wakizashi/files/ /data/user/0/com.facebook.wakizashi/databases/ On Messenger in Blue, msys database is located in the folder /data/data/com.facebook.wakizashi/app_mib_msys and therefore is not found automatically. This patch makes the Database Flipper dolphin see the msys database by also listing the databases referred via extraDatabaseFiles. Differential Revision: D35041276 fbshipit-source-id: e91b95fdc3bb31d414087cdea4a6825a98f3210a
This commit is contained in:
committed by
Facebook GitHub Bot
parent
f8e4c0c02c
commit
59db6c63b6
@@ -18,6 +18,7 @@ public class DefaultSqliteDatabaseProvider implements SqliteDatabaseProvider {
|
|||||||
|
|
||||||
private final int fileDirectoryRecursiveDepth;
|
private final int fileDirectoryRecursiveDepth;
|
||||||
private final Context context;
|
private final Context context;
|
||||||
|
private static final List<File> extraDatabaseFiles = new ArrayList<>();
|
||||||
|
|
||||||
public DefaultSqliteDatabaseProvider(Context context) {
|
public DefaultSqliteDatabaseProvider(Context context) {
|
||||||
this(context, MAX_RECURSIVE_TRAVERSAL_DEPTH);
|
this(context, MAX_RECURSIVE_TRAVERSAL_DEPTH);
|
||||||
@@ -40,6 +41,9 @@ public class DefaultSqliteDatabaseProvider implements SqliteDatabaseProvider {
|
|||||||
DB_EXTENSION,
|
DB_EXTENSION,
|
||||||
fileDirectoryRecursiveDepth,
|
fileDirectoryRecursiveDepth,
|
||||||
databaseFiles);
|
databaseFiles);
|
||||||
|
synchronized (extraDatabaseFiles) {
|
||||||
|
databaseFiles.addAll(extraDatabaseFiles);
|
||||||
|
}
|
||||||
return databaseFiles;
|
return databaseFiles;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -59,4 +63,10 @@ public class DefaultSqliteDatabaseProvider implements SqliteDatabaseProvider {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void registerExtraDatabaseFile(File file) {
|
||||||
|
synchronized (extraDatabaseFiles) {
|
||||||
|
extraDatabaseFiles.add(file);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user