99import android .database .sqlite .SQLiteException ;
1010import android .util .Log ;
1111
12- import com .outsystems .plugins .oslogger .OSLogger ;
13- import com .outsystems .plugins .oslogger .interfaces .Logger ;
14-
1512import java .io .File ;
1613
1714import java .lang .IllegalArgumentException ;
@@ -56,7 +53,6 @@ public class SQLitePlugin extends CordovaPlugin {
5653 */
5754 static Map <String , DBRunner > dbrmap = new ConcurrentHashMap <String , DBRunner >();
5855
59- private Logger logger ;
6056 private boolean selfHealingEnabled = false ;
6157 private boolean didTryCipherMigration = false ;
6258
@@ -74,7 +70,6 @@ public class SQLitePlugin extends CordovaPlugin {
7470 @ Override
7571 public void initialize (CordovaInterface cordova , CordovaWebView webView ) {
7672 super .initialize (cordova , webView );
77- logger = OSLogger .getInstance ();
7873 selfHealingEnabled = preferences .getBoolean ("EnableSQLCipherSelfHealing" , false );
7974 SQLiteAndroidDatabase .initialize ();
8075 }
@@ -252,10 +247,10 @@ private SQLiteAndroidDatabase openDatabase(String dbname, String key, CallbackCo
252247 return mydb ;
253248 } catch (Exception e ) {
254249
255- logger . logWarning ( " Got " + e .getMessage () + " exception." , "SQLite " );
250+ Log . w ( "SQLite" , " Got " + e .getMessage () + " exception." );
256251
257252 if (mydb != null && !didTryCipherMigration ) {
258- logger . logVerbose ( " Will try Cipher Migration." , "SQLite " );
253+ Log . v ( "SQLite" , " Will try Cipher Migration." );
259254 /*
260255 * An error was found and will try to migrate.
261256 * The migration process is described here: https://www.zetetic.net/sqlcipher/sqlcipher-api/#cipher_migrate
@@ -270,7 +265,7 @@ private SQLiteAndroidDatabase openDatabase(String dbname, String key, CallbackCo
270265 if (selfHealingEnabled && (e .getMessage ().contains ("file is encrypted or is not a database:" ) ||
271266 ((e instanceof SQLiteException ) && e .getMessage ().contains ("file is not a database:" ) )))
272267 {
273- logger . logWarning ( " Android ciphered database will be deleted to self heal: " + e .getMessage (), "SQLite" );
268+ Log . w ( "SQLite" , " Android ciphered database will be deleted to self heal: " + e .getMessage ());
274269 deleteDatabaseNow (dbname );
275270 return openDatabase (dbname , key , cbc , false );
276271 } else {
0 commit comments