Skip to content

Commit

Permalink
Migrate to Capacitor v5
Browse files Browse the repository at this point in the history
Bump version

update docs
  • Loading branch information
Martin Kaša authored and martinkasa committed May 18, 2023
1 parent ed871ae commit b454ad2
Show file tree
Hide file tree
Showing 68 changed files with 4,563 additions and 3,404 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
## v0.9.0

- migrate to capacitor 5.0

## v0.8.1

- iOS - calling clear if storage if empty is not throwing an error

## v0.8.0

- migrate to capacitor 4.0
- for Capacitor 3.X.X install version v0.7.1

Expand Down
65 changes: 35 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ Capacitor plugin for storing string values securly on iOS and Android.

## How to install

For Capacitor v4
For Capacitor v5

```bash
npm install capacitor-secure-storage-plugin
```

For Capacitor v4 - install with fixed version 0.8.1

```bash
npm install [email protected]
```

For Capacitor v3 - install with fixed version 0.7.1

```bash
Expand Down Expand Up @@ -73,38 +79,38 @@ public class MainActivity extends BridgeActivity {
## Methods
```ts
```ts

get(options: { key: string }): Promise<{ value: string }>
get(options: { key: string }): Promise<{ value: string }>

```
```
> **Note**
> if item with specified key does not exist, throws an Error
> **Note**
> if item with specified key does not exist, throws an Error
---
---
```ts
```ts

set(options: { key: string; value: string }): Promise<{ value: boolean }>
set(options: { key: string; value: string }): Promise<{ value: boolean }>

```
```
> **Note**
> return true in case of success otherwise throws an error
> **Note**
> return true in case of success otherwise throws an error
---
---
```ts
```ts

remove(options: { key: string }): Promise<{ value: boolean }>
remove(options: { key: string }): Promise<{ value: boolean }>

```
```
> **Note**
> return true in case of success otherwise throws an error
> **Note**
> return true in case of success otherwise throws an error
---
---
```ts
keys(): Promise<{ value: string[] }>
Expand All @@ -116,30 +122,29 @@ keys(): Promise<{ value: string[] }>

clear(): Promise<{ value: boolean }>

```
```
> **Note**
> return true in case of success otherwise throws an error
> **Note**
> return true in case of success otherwise throws an error
---
---
```ts
```ts

getPlatform(): Promise<{ value: string }>
getPlatform(): Promise<{ value: string }>

```
```
> **Note**
> return returns which implementation is used - one of 'web', 'ios' or 'android'
> **Note**
> return returns which implementation is used - one of 'web', 'ios' or 'android'
## Example
```ts
const key = 'username';
const value = 'hellokitty2';

SecureStoragePlugin.set({ key, value })
.then(success => console.log(success))
SecureStoragePlugin.set({ key, value }).then(success => console.log(success));
```
```ts
Expand Down
Binary file added android/.gradle/8.0.2/checksums/checksums.lock
Binary file not shown.
Binary file added android/.gradle/8.0.2/checksums/md5-checksums.bin
Binary file not shown.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file not shown.
Binary file not shown.
Binary file added android/.gradle/8.0.2/fileChanges/last-build.bin
Binary file not shown.
Binary file added android/.gradle/8.0.2/fileHashes/fileHashes.bin
Binary file not shown.
Binary file added android/.gradle/8.0.2/fileHashes/fileHashes.lock
Binary file not shown.
Binary file not shown.
Empty file.
Binary file modified android/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
4 changes: 2 additions & 2 deletions android/.gradle/buildOutputCleanup/cache.properties
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#Thu Jul 28 18:18:21 CEST 2022
gradle.version=7.4.2
#Thu May 18 07:28:54 CEST 2023
gradle.version=8.0.2
Binary file modified android/.gradle/buildOutputCleanup/outputFiles.bin
Binary file not shown.
Binary file added android/.gradle/file-system.probe
Binary file not shown.
17 changes: 9 additions & 8 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
ext {
junitVersion = project.hasProperty('junitVersion') ? rootProject.ext.junitVersion : '4.13.2'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.4.2'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.3'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.4.0'
androidxAppCompatVersion = project.hasProperty('androidxAppCompatVersion') ? rootProject.ext.androidxAppCompatVersion : '1.6.1'
androidxJunitVersion = project.hasProperty('androidxJunitVersion') ? rootProject.ext.androidxJunitVersion : '1.1.5'
androidxEspressoCoreVersion = project.hasProperty('androidxEspressoCoreVersion') ? rootProject.ext.androidxEspressoCoreVersion : '3.5.1'
}

buildscript {
Expand All @@ -11,17 +11,18 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.2.1'
classpath 'com.android.tools.build:gradle:8.0.0'
}
}

apply plugin: 'com.android.library'

android {
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 32
namespace "com.whitestein.securestorage"
compileSdkVersion project.hasProperty('compileSdkVersion') ? rootProject.ext.compileSdkVersion : 33
defaultConfig {
minSdkVersion project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : 22
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 32
targetSdkVersion project.hasProperty('targetSdkVersion') ? rootProject.ext.targetSdkVersion : 33
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
Expand All @@ -36,8 +37,8 @@ android {
abortOnError false
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}
}

Expand Down
3 changes: 1 addition & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ org.gradle.jvmargs=-Xmx1536m
# Android operating system, and which are packaged with your app's APK
# https://developer.android.com/topic/libraries/support-library/androidx-rn
android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.4.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit b454ad2

Please sign in to comment.