capacitor-secure-storage-plugin 0.8.1 → 0.10.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 +41 -30
- package/android/build.gradle +9 -8
- package/android/src/main/AndroidManifest.xml +1 -1
- package/package.json +7 -5
package/README.md
CHANGED
|
@@ -4,12 +4,24 @@ 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 v6
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
npm install capacitor-secure-storage-plugin
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
+
For Capacitor v5 - install with fixed version 0.9.0
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install capacitor-secure-storage-plugin@0.9.0
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
For Capacitor v4 - install with fixed version 0.8.1
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npm install capacitor-secure-storage-plugin@0.8.1
|
|
23
|
+
```
|
|
24
|
+
|
|
13
25
|
For Capacitor v3 - install with fixed version 0.7.1
|
|
14
26
|
|
|
15
27
|
```bash
|
|
@@ -73,38 +85,38 @@ public class MainActivity extends BridgeActivity {
|
|
|
73
85
|
|
|
74
86
|
## Methods
|
|
75
87
|
|
|
76
|
-
|
|
88
|
+
```ts
|
|
77
89
|
|
|
78
|
-
|
|
90
|
+
get(options: { key: string }): Promise<{ value: string }>
|
|
79
91
|
|
|
80
|
-
|
|
92
|
+
```
|
|
81
93
|
|
|
82
|
-
|
|
83
|
-
|
|
94
|
+
> **Note**
|
|
95
|
+
> if item with specified key does not exist, throws an Error
|
|
84
96
|
|
|
85
|
-
|
|
97
|
+
---
|
|
86
98
|
|
|
87
|
-
|
|
99
|
+
```ts
|
|
88
100
|
|
|
89
|
-
|
|
101
|
+
set(options: { key: string; value: string }): Promise<{ value: boolean }>
|
|
90
102
|
|
|
91
|
-
|
|
103
|
+
```
|
|
92
104
|
|
|
93
|
-
|
|
94
|
-
|
|
105
|
+
> **Note**
|
|
106
|
+
> return true in case of success otherwise throws an error
|
|
95
107
|
|
|
96
|
-
|
|
108
|
+
---
|
|
97
109
|
|
|
98
|
-
|
|
110
|
+
```ts
|
|
99
111
|
|
|
100
|
-
|
|
112
|
+
remove(options: { key: string }): Promise<{ value: boolean }>
|
|
101
113
|
|
|
102
|
-
|
|
114
|
+
```
|
|
103
115
|
|
|
104
|
-
|
|
105
|
-
|
|
116
|
+
> **Note**
|
|
117
|
+
> return true in case of success otherwise throws an error
|
|
106
118
|
|
|
107
|
-
|
|
119
|
+
---
|
|
108
120
|
|
|
109
121
|
```ts
|
|
110
122
|
keys(): Promise<{ value: string[] }>
|
|
@@ -116,21 +128,21 @@ keys(): Promise<{ value: string[] }>
|
|
|
116
128
|
|
|
117
129
|
clear(): Promise<{ value: boolean }>
|
|
118
130
|
|
|
119
|
-
|
|
131
|
+
```
|
|
120
132
|
|
|
121
|
-
|
|
122
|
-
|
|
133
|
+
> **Note**
|
|
134
|
+
> return true in case of success otherwise throws an error
|
|
123
135
|
|
|
124
|
-
|
|
136
|
+
---
|
|
125
137
|
|
|
126
|
-
|
|
138
|
+
```ts
|
|
127
139
|
|
|
128
|
-
|
|
140
|
+
getPlatform(): Promise<{ value: string }>
|
|
129
141
|
|
|
130
|
-
|
|
142
|
+
```
|
|
131
143
|
|
|
132
|
-
|
|
133
|
-
|
|
144
|
+
> **Note**
|
|
145
|
+
> return returns which implementation is used - one of 'web', 'ios' or 'android'
|
|
134
146
|
|
|
135
147
|
## Example
|
|
136
148
|
|
|
@@ -138,8 +150,7 @@ keys(): Promise<{ value: string[] }>
|
|
|
138
150
|
const key = 'username';
|
|
139
151
|
const value = 'hellokitty2';
|
|
140
152
|
|
|
141
|
-
SecureStoragePlugin.set({ key, value })
|
|
142
|
-
.then(success => console.log(success))
|
|
153
|
+
SecureStoragePlugin.set({ key, value }).then(success => console.log(success));
|
|
143
154
|
```
|
|
144
155
|
|
|
145
156
|
```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.2.1'
|
|
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
|
+
compileSdk project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 34
|
|
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 : 34
|
|
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.10.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,23 +44,25 @@
|
|
|
44
44
|
"prepublishOnly": "npm run build"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@capacitor/android": "^
|
|
48
|
-
"@capacitor/
|
|
47
|
+
"@capacitor/android": "^6.0.0",
|
|
48
|
+
"@capacitor/cli": "^6.0.0",
|
|
49
|
+
"@capacitor/core": "^6.0.0",
|
|
49
50
|
"@capacitor/docgen": "^0.2.0",
|
|
50
|
-
"@capacitor/ios": "^
|
|
51
|
+
"@capacitor/ios": "^6.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",
|
|
54
55
|
"eslint": "^7.11.0",
|
|
55
56
|
"prettier": "~2.2.0",
|
|
56
57
|
"prettier-plugin-java": "~1.0.0",
|
|
58
|
+
"release-it": "^17.2.1",
|
|
57
59
|
"rimraf": "^3.0.2",
|
|
58
60
|
"rollup": "^2.32.0",
|
|
59
61
|
"swiftlint": "^1.0.1",
|
|
60
62
|
"typescript": "~4.0.3"
|
|
61
63
|
},
|
|
62
64
|
"peerDependencies": {
|
|
63
|
-
"@capacitor/core": "^
|
|
65
|
+
"@capacitor/core": "^6.0.0"
|
|
64
66
|
},
|
|
65
67
|
"prettier": "@ionic/prettier-config",
|
|
66
68
|
"swiftlint": "@ionic/swiftlint-config",
|