From 60ff098512f83a6b0f8d55900f7d7b46c4783c17 Mon Sep 17 00:00:00 2001
From: pradeep singh <pradeep1991singh@gmail.com>
Date: Sat, 1 Jul 2017 21:52:58 +0530
Subject: [PATCH] fix wrong field in json string

---
 package.json                    | 7 ++-----
 plugin.xml                      | 4 ++--
 src/android/SecureKeyStore.java | 9 ++++++---
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/package.json b/package.json
index 1405451..07d6a7b 100644
--- a/package.json
+++ b/package.json
@@ -1,13 +1,10 @@
 {
   "name": "cordova-plugin-secure-key-store",
-  "version": "1.5.2",
+  "version": "1.5.3",
   "description": "Cordova plugin for securely saving keys, passwords or strings on devices.",
   "cordova": {
     "id": "cordova-plugin-secure-key-store",
-    "platforms": [
-      "android",
-      "ios"
-    ]
+    "platforms": ["android", "ios"]
   },
   "repository": {
     "type": "git",
diff --git a/plugin.xml b/plugin.xml
index 0f7eb4e..9f25f54 100644
--- a/plugin.xml
+++ b/plugin.xml
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='utf-8'?>
 <plugin id="cordova-plugin-secure-key-store"
-    version="1.5.2"
+    version="1.5.3"
     xmlns="http://apache.org/cordova/ns/plugins/1.0"
     xmlns:android="http://schemas.android.com/apk/res/android">
 
@@ -44,4 +44,4 @@
         <framework src="Security.framework" />        
     </platform>
 
-</plugin>
\ No newline at end of file
+</plugin>
diff --git a/src/android/SecureKeyStore.java b/src/android/SecureKeyStore.java
index cac365a..801ab08 100644
--- a/src/android/SecureKeyStore.java
+++ b/src/android/SecureKeyStore.java
@@ -102,7 +102,8 @@ private void encrypt(String alias, String input, CallbackContext callbackContext
 
         } catch (Exception e) {
             Log.e(Constants.TAG, "Exception: " + e.getMessage());
-            callbackContext.error("{\"code\":9,\"api-level\":" + Build.VERSION.SDK_INT + ",\"class\":" + e.getMessage() + "}");
+            callbackContext.error(
+                    "{\"code\":9,\"api-level\":" + Build.VERSION.SDK_INT + ",\"message\":" + e.getMessage() + "}");
         }
 
     }
@@ -135,7 +136,8 @@ private void decrypt(String alias, CallbackContext callbackContext) {
 
         } catch (Exception e) {
             Log.e(Constants.TAG, "Exception: " + e.getMessage());
-            callbackContext.error("{\"code\":1,\"api-level\":" + Build.VERSION.SDK_INT + ",\"class\":" + e.getMessage() + "}");
+            callbackContext.error(
+                    "{\"code\":1,\"api-level\":" + Build.VERSION.SDK_INT + ",\"message\":" + e.getMessage() + "}");
         }
     }
 
@@ -147,7 +149,8 @@ private void removeKeyFile(String alias, CallbackContext callbackContext) {
 
         } catch (Exception e) {
             Log.e(Constants.TAG, "Exception: " + e.getMessage());
-            callbackContext.error("{\"code\":6,\"api-level\":" + Build.VERSION.SDK_INT + ",\"class\":" + e.getMessage() + "}");
+            callbackContext.error(
+                    "{\"code\":6,\"api-level\":" + Build.VERSION.SDK_INT + ",\"message\":" + e.getMessage() + "}");
         }
     }