For 2. you could use a Migration, this has the Room database passed to it as a SupportSQLiteDatabase
So you could then either
- open the original (encrypted) database and then access it as you would (have done), perhaps unloading the data into Cursors for loading into the Room version, or
ATTACH the original database to the Room database (via the SupportSQLiteDatabase's execSQL method), and then copy the data using SQL and finally DETACH the original database.
When a database is attached, then it's components, such as tables, are available (you should use the given schema_name to distinguish components with the same name). See ATTACH
- Note the ATTACH SQL would be along the lines of
ATTACH 'the_path_to_the_database' AS 'the_schema_name_to_use' KEY 'the_key'
the_path_to_the_database being the path to the database to be attached
the_schema_name_to_use can be an arbitrary value with some limitations (not main or temp).
the_key being the secret key
The answer here includes an example that uses the first method (as per the MainDatabase class, albeit in Java (which should take little effort to convert to Kotlin))