capacitor-secure-storage-plugin 0.8.1 → 0.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -30
- package/android/build.gradle +9 -8
- package/android/src/main/AndroidManifest.xml +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -4,12 +4,18 @@ Capacitor plugin for storing string values securly on iOS and Android.
|
|
|
4
4
|
|
|
5
5
|
## How to install
|
|
6
6
|
|
|
7
|
-
For Capacitor
|
|
7
|
+
For Capacitor v5
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install capacitor-secure-storage-plugin
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
For Capacitor v4 - install with fixed version 0.8.1
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install capacitor-secure-storage-plugin@0.8.1
|
|
17
|
+
```
|
|
18
|
+
|
|
13
19
|
For Capacitor v3 - install with fixed version 0.7.1
|
|
14
20
|
|
|
15
21
|
```bash
|
|
@@ -73,38 +79,38 @@ public class MainActivity extends BridgeActivity {
|
|
|
73
79
|
|
|
74
80
|
## Methods
|
|
75
81
|
|
|
76
|
-
|
|
82
|
+
```ts
|
|
77
83
|
|
|
78
|
-
|
|
84
|
+
get(options: { key: string }): Promise<{ value: string }>
|
|
79
85
|
|
|
80
|
-
|
|
86
|
+
```
|
|
81
87
|
|
|
82
|
-
|
|
83
|
-
|
|
88
|
+
> **Note**
|
|
89
|
+
> if item with specified key does not exist, throws an Error
|
|
84
90
|
|
|
85
|
-
|
|
91
|
+
---
|
|
86
92
|
|
|
87
|
-
|
|
93
|
+
```ts
|
|
88
94
|
|
|
89
|
-
|
|
95
|
+
set(options: { key: string; value: string }): Promise<{ value: boolean }>
|
|
90
96
|
|
|
91
|
-
|
|
97
|
+
```
|
|
92
98
|
|
|
93
|
-
|
|
94
|
-
|
|
99
|
+
> **Note**
|
|
100
|
+
> return true in case of success otherwise throws an error
|
|
95
101
|
|
|
96
|
-
|
|
102
|
+
---
|
|
97
103
|
|
|
98
|
-
|
|
104
|
+
```ts
|
|
99
105
|
|
|
100
|
-
|
|
106
|
+
remove(options: { key: string }): Promise<{ value: boolean }>
|
|
101
107
|
|
|
102
|
-
|
|
108
|
+
```
|
|
103
109
|
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
> **Note**
|
|
111
|
+
> return true in case of success otherwise throws an error
|
|
106
112
|
|
|
107
|
-
|
|
113
|
+
---
|
|
108
114
|
|
|
109
115
|
```ts
|
|
110
116
|
keys(): Promise<{ value: string[] }>
|
|
@@ -116,21 +122,21 @@ keys(): Promise<{ value: string[] }>
|
|
|
116
122
|
|
|
117
123
|
clear(): Promise<{ value: boolean }>
|
|
118
124
|
|
|
119
|
-
|
|
125
|
+
```
|
|
120
126
|
|
|
121
|
-
|
|
122
|
-
|
|
127
|
+
> **Note**
|
|
128
|
+
> return true in case of success otherwise throws an error
|
|
123
129
|
|
|
124
|
-
|
|
130
|
+
---
|
|
125
131
|
|
|
126
|
-
|
|
132
|
+
```ts
|
|
127
133
|
|
|
128
|
-
|
|
134
|
+
getPlatform(): Promise<{ value: string }>
|
|
129
135
|
|
|
130
|
-
|
|
136
|
+
```
|
|
131
137
|
|
|
132
|
-
|
|
133
|
-
|
|
138
|
+
> **Note**
|
|
139
|
+
> return returns which implementation is used - one of 'web', 'ios' or 'android'
|
|
134
140
|
|
|
135
141
|
## Example
|
|
136
142
|
|
|
@@ -138,8 +144,7 @@ keys(): Promise<{ value: string[] }>
|
|
|
138
144
|
const key = 'username';
|
|
139
145
|
const value = 'hellokitty2';
|
|
140
146
|
|
|
141
|
-
SecureStoragePlugin.set({ key, value })
|
|
142
|
-
.then(success => console.log(success))
|
|
147
|
+
SecureStoragePlugin.set({ key, value }).then(success => console.log(success));
|
|
143
148
|
```
|
|
144
149
|
|
|
145
150
|
```ts
|
package/android/build.gradle
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
ext {
|
|
2
2
|
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
|
|
3
|
-
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.
|
|
4
|
-
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.
|
|
5
|
-
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.
|
|
3
|
+
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
|
|
4
|
+
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
|
|
5
|
+
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
buildscript {
|
|
@@ -11,17 +11,18 @@ buildscript {
|
|
|
11
11
|
mavenCentral()
|
|
12
12
|
}
|
|
13
13
|
dependencies {
|
|
14
|
-
classpath 'com.android.tools.build:gradle:
|
|
14
|
+
classpath 'com.android.tools.build:gradle:8.0.0'
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
apply plugin: 'com.android.library'
|
|
19
19
|
|
|
20
20
|
android {
|
|
21
|
-
|
|
21
|
+
namespace "com.whitestein.securestorage"
|
|
22
|
+
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
|
|
22
23
|
defaultConfig {
|
|
23
24
|
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
|
|
24
|
-
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion :
|
|
25
|
+
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
|
|
25
26
|
versionCode 1
|
|
26
27
|
versionName "1.0"
|
|
27
28
|
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
|
@@ -36,8 +37,8 @@ android {
|
|
|
36
37
|
abortOnError false
|
|
37
38
|
}
|
|
38
39
|
compileOptions {
|
|
39
|
-
sourceCompatibility JavaVersion.
|
|
40
|
-
targetCompatibility JavaVersion.
|
|
40
|
+
sourceCompatibility JavaVersion.VERSION_17
|
|
41
|
+
targetCompatibility JavaVersion.VERSION_17
|
|
41
42
|
}
|
|
42
43
|
}
|
|
43
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "capacitor-secure-storage-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Securely store secrets such as usernames, passwords, tokens, certificates or other sensitive information (strings) on iOS & Android",
|
|
5
5
|
"main": "dist/plugin.cjs.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,10 +44,11 @@
|
|
|
44
44
|
"prepublishOnly": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@capacitor/android": "^
|
|
48
|
-
"@capacitor/
|
|
47
|
+
"@capacitor/android": "^5.0.0",
|
|
48
|
+
"@capacitor/cli": "^5.0.0",
|
|
49
|
+
"@capacitor/core": "^5.0.0",
|
|
49
50
|
"@capacitor/docgen": "^0.2.0",
|
|
50
|
-
"@capacitor/ios": "^
|
|
51
|
+
"@capacitor/ios": "^5.0.0",
|
|
51
52
|
"@ionic/eslint-config": "^0.3.0",
|
|
52
53
|
"@ionic/prettier-config": "^1.0.1",
|
|
53
54
|
"@ionic/swiftlint-config": "^1.1.2",
|
|
@@ -60,7 +61,7 @@
|
|
|
60
61
|
"typescript": "~4.0.3"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
|
-
"@capacitor/core": "^
|
|
64
|
+
"@capacitor/core": "^5.0.0"
|
|
64
65
|
},
|
|
65
66
|
"prettier": "@ionic/prettier-config",
|
|
66
67
|
"swiftlint": "@ionic/swiftlint-config",
|