Skip to content

Commit 8cd36ca

Browse files
committed
chore(): initial commit
0 parents  commit 8cd36ca

File tree

72 files changed

+2758
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

72 files changed

+2758
-0
lines changed

.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Specifies intentionally untracked files to ignore when using Git
2+
# http://git-scm.com/docs/gitignore
3+
4+
*~
5+
*.sw[mnpcod]
6+
*.log
7+
*.tmp
8+
*.tmp.*
9+
log.txt
10+
*.sublime-project
11+
*.sublime-workspace
12+
.vscode/
13+
npm-debug.log*
14+
15+
.idea/
16+
.sourcemaps/
17+
.sass-cache/
18+
.tmp/
19+
.versions/
20+
coverage/
21+
dist/
22+
node_modules/
23+
tmp/
24+
temp/
25+
hooks/
26+
platforms/
27+
plugins/
28+
plugins/android.json
29+
plugins/ios.json
30+
$RECYCLE.BIN/
31+
32+
.DS_Store
33+
Thumbs.db
34+
UserInterfaceState.xcuserstate

.npmignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
androidlibs/src
2+
tests

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# AirGap Secure Storage - Cordova Plugin
2+
3+
## Installation
4+
Install the plugin simply using npm:
5+
6+
```
7+
npm install git+ssh://git@github.com:airgap-it/cordova-plugin-airgap-secure-storage.git#master --save
8+
```
9+
10+
Make sure the plugin is added in your cordova `config.xml` as follows:
11+
12+
```
13+
<plugin name="cordova-plugin-airgap-secure-storage" spec="git+ssh://git@github.com:airgap-it/cordova-plugin-airgap-secure-storage.git#master" />
14+
```
15+
16+
Instead of `#master` you can also pass a specific commit-hash to fix the version you would like to install.
17+
18+
## Pre-Requisites Android / iOS
19+
To work, SecureStorage requires a secure lock-screen setup, either secured by a PIN / Pattern or Fingerprint. Otherwise, the keystore cannot be used to safely store data.
20+
21+
## Usage
22+
The plugin provides a global variable as any cordova plugin does, to create a new instance call it as follows:
23+
24+
```
25+
let secureStorage = new window.SecureStorage("secure-storage-alias", false)
26+
```
27+
28+
You need to init() the SecureStorage instance in order to set it up properly if necessary.
29+
30+
```
31+
secureStorage.init(() => {
32+
// successful setup
33+
}), (error) => {
34+
// setup failed
35+
})
36+
```
37+
38+
Then, the plugin provides the following functionalities:
39+
40+
```
41+
secureStorage.isDeviceSecure(key, value, () => {}, (error) => {})
42+
secureStorage.secureDevice(key, value, () => {}, (error) => {})
43+
44+
secureStorage.setItem(key, value, () => {}, (error) => {})
45+
secureStorage.getItem(key, (value) => {}, (error) => {})
46+
secureStorage.removeItem(key, () => {}, (error) => {})
47+
secureStorage.removeAll(key, () => {}, (error) => {})
48+
```
49+
50+
Everything else is handled by the device.
120 KB
Binary file not shown.

androidlibs/src/.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.gradle
2+
.idea
3+
build
4+
gradle/
5+
gradle_bat
6+
gradlew
7+
gradle.properties
8+
proxystore
9+
*.iml
10+
local.properties

androidlibs/src/.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.iml
2+
.gradle
3+
local.properties
4+
.idea/
5+
.idea/workspace.xml
6+
.idea/libraries
7+
.DS_Store
8+
build/
9+
captures/
10+
.externalNativeBuild

androidlibs/src/.gitlab-ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
stages:
2+
- build
3+
4+
variables:
5+
IMAGE_TAG: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_NAME
6+
7+
build:
8+
stage: build
9+
only:
10+
- master
11+
script:
12+
- docker build -t $IMAGE_TAG .
13+
- docker run --name $CI_PIPELINE_ID $IMAGE_TAG echo "container ran."
14+
- docker cp $CI_PIPELINE_ID:/code/app/build/outputs/aar/app-debug.aar app-debug.aar
15+
tags:
16+
- docker
17+
artifacts:
18+
paths:
19+
- app-debug.aar
20+

androidlibs/src/Dockerfile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
FROM openjdk:8
2+
3+
# configure SDK version
4+
ENV SDK_URL="https://dl.google.com/android/repository/sdk-tools-linux-3859397.zip" \
5+
ANDROID_HOME="/usr/local/android-sdk" \
6+
ANDROID_VERSION=26 \
7+
ANDROID_BUILD_TOOLS_VERSION=26.0.2
8+
9+
# accept all licences
10+
RUN mkdir "$ANDROID_HOME" .android \
11+
&& cd "$ANDROID_HOME" \
12+
&& curl -o sdk.zip $SDK_URL \
13+
&& unzip sdk.zip \
14+
&& rm sdk.zip \
15+
&& yes | $ANDROID_HOME/tools/bin/sdkmanager --licenses > /dev/null 2>&1
16+
17+
# install android build tool and libraries
18+
RUN $ANDROID_HOME/tools/bin/sdkmanager --update > /dev/null 2>&1
19+
RUN $ANDROID_HOME/tools/bin/sdkmanager "build-tools;${ANDROID_BUILD_TOOLS_VERSION}" \
20+
"platforms;android-${ANDROID_VERSION}" \
21+
"platform-tools" > /dev/null 2>&1
22+
23+
# install gradle
24+
RUN wget -q https://services.gradle.org/distributions/gradle-4.1-bin.zip \
25+
&& unzip gradle-4.1-bin.zip -d /opt \
26+
&& rm gradle-4.1-bin.zip
27+
28+
ENV GRADLE_HOME /opt/gradle-4.1
29+
ENV PATH $PATH:/opt/gradle-4.1/bin
30+
31+
# import src copy
32+
RUN mkdir /code
33+
WORKDIR /code
34+
COPY . /code
35+
36+
# gradle build
37+
RUN gradle build

androidlibs/src/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Secure Storage Android

androidlibs/src/app/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)