如何使用应用程序中嵌入的密码保护来保护SQFlite数据库?

时间:2020-05-13 18:06:41

标签: flutter sqflite

使用密码保护保护SQFlite数据库,使其只能由应用访问。

initDb() async {
    var databasePath = await getDatabasesPath();
    String path = join(databasePath, "Beta2.db");
    var theDb = await openDatabase(path, version: 1, onCreate: _onCreate)
    return theDb;
  }

  void _onCreate(Database db, int version) async {
    await db.execute(
        "CREATE TABLE Master(id INTEGER PRIMARY KEY, masterusername TEXT, masterpassword TEXT)");
    print("Created master username and password table")
    );
  }

0 个答案:

没有答案