<commit_before>var sjcl_ss = cordova.require('cordova-plugin-secure-storage.sjcl_ss');
var ESP6Promise = cordova.require('cordova-plugin-secure-storage.es6-promise').Promise;
var _AES_PARAM = {
    ks: 256,
    ts: 128,
    mode: 'ccm',
    cipher: 'aes'
 };

var _checkCallbacks = function (success, error) {

    if (typeof success !== "function")  {
        console.log("SecureStorage failure: success callback parameter must be a function");
        return false;
    }

    if (typeof error !== "function") {
        console.log("SecureStorage failure: error callback parameter must be a function");
        return false;
    }

    return true;
};

var SecureStorageiOS = function (success, error, service) {
    var _success = function(){};
    var _service = service;

    if('function' === typeof success) {
        _success = success;
    }
    else if('string' === typeof success) {
        _service = success;
    }

    this.service = _service;
    setTimeout(_success, 0);
    return this;
};

SecureStorageiOS.prototype = {

    get: function (success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "get", [self.service, _key]);
        });
        
        if(_hasCallbacks) {
            promise.then(success, error);
        }    
        return promise;
    },

    set: function (success, error, key, value) {
        var self = this;
        var _key = key;
        var _value = value;
        var _hasCallbacks = true;

        if('string' === typeof success && 'function' !== typeof error && 'undefined' !== typeof error && !!error) {
            _key = success;
            _value = error;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "set", [self.service, _key, _value]);
        });
    
        if(_hasCallbacks) {
            promise.then(success, error);
        }  
        return promise;
    },

    remove: function(success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "remove", [self.service, _key]);
        });
    
        if(_hasCallbacks) {
            promise.then(success, error);
        }
        return promise;
    }
};

var SecureStorageAndroid = function (success, error, service, encryptionKey) {
    var _success = function(){};
    var _error = function(error){};
    var _service = service;
	var _encryptionKey = encryptionKey;

    if('function' === typeof success) {
        _success = success;
    }
    else if('string' === typeof success) {
        _service = success;
    }

    if('function' === typeof error) {
        _error = error;
    }

    this.service = _service;
	this.encryptionKey = _encryptionKey;
    cordova.exec(_success, _error, "SecureStorage", "init", [this.service, this.encryptionKey]);
    return this;
};

SecureStorageAndroid.prototype = {
    get: function (success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "get", [_key]);
        });
        
        if(_hasCallbacks) {
            promise.then(_success, _error);
        }    
        return promise;
    },

    set: function (success, error, key, value) {
        var self = this;
        var _key = key;
        var _value = value;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success && 'function' !== typeof error && 'undefined' !== typeof error && !!error) {
            _key = success;
            _value = error;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "set", [_key, _value]);
        });
    
        if(_hasCallbacks) {
            promise.then(_success, _error);
        }  
        return promise;
    },

    remove: function(success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "remove", [_key]);
        });
    
        if(_hasCallbacks) {<commit_msg>new parameter service added to android calls to native plugin<commit_after>var sjcl_ss = cordova.require('cordova-plugin-secure-storage.sjcl_ss');
var ESP6Promise = cordova.require('cordova-plugin-secure-storage.es6-promise').Promise;
var _AES_PARAM = {
    ks: 256,
    ts: 128,
    mode: 'ccm',
    cipher: 'aes'
 };

var _checkCallbacks = function (success, error) {

    if (typeof success !== "function")  {
        console.log("SecureStorage failure: success callback parameter must be a function");
        return false;
    }

    if (typeof error !== "function") {
        console.log("SecureStorage failure: error callback parameter must be a function");
        return false;
    }

    return true;
};

var SecureStorageiOS = function (success, error, service) {
    var _success = function(){};
    var _service = service;

    if('function' === typeof success) {
        _success = success;
    }
    else if('string' === typeof success) {
        _service = success;
    }

    this.service = _service;
    setTimeout(_success, 0);
    return this;
};

SecureStorageiOS.prototype = {

    get: function (success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "get", [self.service, _key]);
        });
        
        if(_hasCallbacks) {
            promise.then(success, error);
        }    
        return promise;
    },

    set: function (success, error, key, value) {
        var self = this;
        var _key = key;
        var _value = value;
        var _hasCallbacks = true;

        if('string' === typeof success && 'function' !== typeof error && 'undefined' !== typeof error && !!error) {
            _key = success;
            _value = error;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "set", [self.service, _key, _value]);
        });
    
        if(_hasCallbacks) {
            promise.then(success, error);
        }  
        return promise;
    },

    remove: function(success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(resolve, reject) {
            cordova.exec(resolve, reject, "SecureStorage", "remove", [self.service, _key]);
        });
    
        if(_hasCallbacks) {
            promise.then(success, error);
        }
        return promise;
    }
};

var SecureStorageAndroid = function (success, error, service, encryptionKey) {
    var _success = function(){};
    var _error = function(error){};
    var _service = service;
	var _encryptionKey = encryptionKey;

    if('function' === typeof success) {
        _success = success;
    }
    else if('string' === typeof success) {
        _service = success;
    }

    if('function' === typeof error) {
        _error = error;
    }

    this.service = _service;
	this.encryptionKey = _encryptionKey;
    cordova.exec(_success, _error, "SecureStorage", "init", [this.service, this.encryptionKey]);
    return this;
};

SecureStorageAndroid.prototype = {
    get: function (success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "get", [self.service, _key]);
        });
        
        if(_hasCallbacks) {
            promise.then(_success, _error);
        }    
        return promise;
    },

    set: function (success, error, key, value) {
        var self = this;
        var _key = key;
        var _value = value;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success && 'function' !== typeof error && 'undefined' !== typeof error && !!error) {
            _key = success;
            _value = error;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "set", [self.service, _key, _value]);
        });
    
        if(_hasCallbacks) {
            promise.then(_success, _error);
        }  
        return promise;
    },

    remove: function(success, error, key) {
        var self = this;
        var _key = key;
        var _hasCallbacks = true;
        var _success = success;
        var _error = error;

        if('string' === typeof success) {
            _key = success;
            _hasCallbacks = false;
        }

        var promise = new ESP6Promise(function(_success, _error) {
            cordova.exec(_success, _error, "SecureStorage", "remove", [self.service, _key]);
        });
    
        if(_hasCallbacks) {
{'fraction_non_alphanumeric': 0.12072548649159268, 'fraction_numerical': 0.0028339316077838654, 'mean_word_length': 2.0370051635111874, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1418360', 'n_tokens_mistral': 3072, 'n_tokens_neox': 3000, 'n_words': 792}