android - Database migration in sqlcipher -


i used sqlcipher 3.* encrypt database. work well; want migrate new database ( version 2 ).when change database version, open database not work , can not open previous database.

mydatabase = sqlitedatabase.openorcreatedatabase(db_path,db_pass, null); 

exception occur in line in class sqlitedatabase

this.dbopen(this.mpath, this.mflags); 

mflags not value.

the second problem, database version. return 0 . current sqlcipher's version 3.3.1-2 add maven. add icudt46l.zip assets folder. , add commons-codec.jar , quava-r09.jar , sqlcipher-javadoc.jar libs folder.

thanks

it sounds if version of database not being set. can either manually setversion(…) , getversion() sqlitedatabase instance, or required provide value if subclassing sqliteopenhelper. have test verifies onupgrade(…) function called once version number changes sqliteopenhelper subclass.


Comments