mirror of
https://github.com/apache/cordova-android.git
synced 2026-04-23 00:00:09 +08:00
Change to use Commands and CommandManager.
This commit is contained in:
@@ -1,33 +1,36 @@
|
||||
var Crypto = function()
|
||||
{
|
||||
}
|
||||
com.phonegap.CryptoHandlerProxy = function() {
|
||||
this.className = "com.phonegap.CryptoHandler";
|
||||
};
|
||||
com.phonegap.CryptoHandlerProxy.prototype.encrypt = function(pass, text) {
|
||||
return PhoneGap.exec(this.className, "encrypt", [pass, text]);
|
||||
};
|
||||
com.phonegap.CryptoHandlerProxy.prototype.decrypt = function(pass, text) {
|
||||
return PhoneGap.exec(this.className, "decrypt", [pass, text]);
|
||||
};
|
||||
com.phonegap.CryptoHandler = new com.phonegap.CryptoHandlerProxy();
|
||||
|
||||
Crypto.prototype.encrypt = function(seed, string, callback)
|
||||
{
|
||||
GapCrypto.encrypt(seed, string);
|
||||
this.encryptWin = callback;
|
||||
}
|
||||
var Crypto = function() {
|
||||
};
|
||||
|
||||
Crypto.prototype.decrypt = function(seed, string, callback)
|
||||
{
|
||||
GapCrypto.decrypt(seed, string);
|
||||
this.decryptWin = callback;
|
||||
}
|
||||
Crypto.prototype.encrypt = function(seed, string, callback) {
|
||||
com.phonegap.CryptoHandler.encrypt(seed, string);
|
||||
this.encryptWin = callback;
|
||||
};
|
||||
|
||||
Crypto.prototype.gotCryptedString = function(string)
|
||||
{
|
||||
this.encryptWin(string);
|
||||
}
|
||||
Crypto.prototype.decrypt = function(seed, string, callback) {
|
||||
com.phonegap.CryptoHandler.decrypt(seed, string);
|
||||
this.decryptWin = callback;
|
||||
};
|
||||
|
||||
Crypto.prototype.getPlainString = function(string)
|
||||
{
|
||||
this.decryptWin(string);
|
||||
}
|
||||
Crypto.prototype.gotCryptedString = function(string) {
|
||||
this.encryptWin(string);
|
||||
};
|
||||
|
||||
Crypto.prototype.getPlainString = function(string) {
|
||||
this.decryptWin(string);
|
||||
};
|
||||
|
||||
PhoneGap.addConstructor(function() {
|
||||
if (typeof navigator.Crypto == "undefined")
|
||||
{
|
||||
navigator.Crypto = new Crypto();
|
||||
}
|
||||
if (typeof navigator.Crypto == "undefined") navigator.Crypto = new Crypto();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user