22var SQLiteCipher = require ( 'cordova-sqlcipher-adapter.SQLitePlugin' ) ;
33var SecureStorage = require ( 'cordova-plugin-secure-storage.SecureStorage' ) ;
44
5- var Logger = ! ! OutSystemsNative ? OutSystemsNative . Logger : undefined ;
6- if ( typeof ( Logger ) === "undefined" ) {
7- throw new Error ( "Dependencies were not loaded correctly: OutSystemsNative.Logger is not defined." ) ;
8- }
95// Validate SQLite plugin API is properly set
106if ( typeof ( window . sqlitePlugin ) === "undefined" ) {
117 throw new Error ( "Dependencies were not loaded correctly: window.sqlitePlugin is not defined." ) ;
@@ -51,7 +47,7 @@ function acquireLsk(successCallback, errorCallback) {
5147 successCallback ( lskCache ) ;
5248 } ,
5349 function ( error ) {
54- Logger . logError ( " Error getting local storage key from keychain: " + error , "SecureSQLiteBundle" ) ;
50+ console . log ( "SecureSQLiteBundle: Error getting local storage key from keychain: " + error ) ;
5551 errorCallback ( error ) ;
5652 } ,
5753 LOCAL_STORAGE_KEY ) ;
@@ -62,20 +58,20 @@ function acquireLsk(successCallback, errorCallback) {
6258 lskCache = undefined ;
6359 ss . set (
6460 function ( key ) {
65- Logger . logWarning ( " Setting new local storage key." , "SecureSQLiteBundle ") ;
61+ console . log ( "SecureSQLiteBundle: Setting new local storage key.") ;
6662 lskCache = newKey ;
6763 successCallback ( lskCache ) ;
6864 } ,
6965 function ( error ) {
70- Logger . logError ( " Error generating new local storage key: " + error , "SecureSQLiteBundle" ) ;
66+ console . log ( "SecureSQLiteBundle: Error generating new local storage key: " + error ) ;
7167 errorCallback ( error ) ;
7268 } ,
7369 LOCAL_STORAGE_KEY ,
7470 newKey ) ;
7571 }
7672 } ,
7773 function ( error ) {
78- Logger . logError ( " Error while getting local storage key: " + error , "SecureSQLiteBundle" ) ;
74+ console . log ( "SecureSQLiteBundle: Error while getting local storage key: " + error ) ;
7975 if ( error . message === "Authentication screen skipped" ) {
8076 window . alert ( "Authentication required to use this app. Relaunch the app to try again." ) ;
8177 navigator . app . exitApp ( ) ;
@@ -91,7 +87,7 @@ function acquireLsk(successCallback, errorCallback) {
9187 if ( error . message === "Authentication screen skipped" || error . code == "OS-PLUG-KSTR-0010" ) {
9288 navigator . app . exitApp ( ) ;
9389 } else if ( error . message === "Device is not secure" ) {
94- Logger . logError ( " Device is not secure." , "SecureSQLiteBundle ") ;
90+ console . log ( "SecureSQLiteBundle: Device is not secure.") ;
9591 if ( window . confirm ( "In order to use this app, your device must have a secure lock screen. Press OK to setup your device." ) ) {
9692 ss . secureDevice (
9793 initFn ,
@@ -104,7 +100,7 @@ function acquireLsk(successCallback, errorCallback) {
104100 }
105101 // When secure storage key migration fails
106102 } else if ( error . message . indexOf ( "MIGRATION FAILED" ) === 0 ) {
107- Logger . logError ( " Migration Failed." , "SecureSQLiteBundle ") ;
103+ console . log ( "SecureSQLiteBundle: Migration failed. ") ;
108104 window . alert ( "A feature on this app failed to be upgraded. Relaunch the app to try again." ) ;
109105 navigator . app . exitApp ( ) ;
110106 // Otherwise
0 commit comments