Skip to content
This repository has been archived by the owner on Nov 7, 2023. It is now read-only.

Commit

Permalink
Merge pull request #15 from emeraldsanto/dev
Browse files Browse the repository at this point in the history
Version 2.3.0
  • Loading branch information
emeraldsanto authored May 30, 2020
2 parents 137cb5f + 735a349 commit f3a3582
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
14 changes: 7 additions & 7 deletions android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ import groovy.json.JsonSlurper
// original location:
// - https://github.com/facebook/react-native/blob/0.58-stable/local-cli/templates/HelloWorld/android/app/build.gradle

def DEFAULT_COMPILE_SDK_VERSION = 28
def DEFAULT_COMPILE_SDK_VERSION = 29
def DEFAULT_BUILD_TOOLS_VERSION = '28.0.3'
def DEFAULT_MIN_SDK_VERSION = 23
def DEFAULT_TARGET_SDK_VERSION = 28
def DEFAULT_MIN_SDK_VERSION = 1
def DEFAULT_TARGET_SDK_VERSION = 29

def safeExtGet(prop, fallback) {
rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
Expand All @@ -35,7 +35,7 @@ buildscript {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.3'
classpath 'com.android.tools.build:gradle:3.6.3'
}
}
repositories {
Expand All @@ -53,8 +53,8 @@ android {
defaultConfig {
minSdkVersion safeExtGet('minSdkVersion', DEFAULT_MIN_SDK_VERSION)
targetSdkVersion safeExtGet('targetSdkVersion', DEFAULT_TARGET_SDK_VERSION)
versionCode 1
versionName "1.0"
versionCode 23
versionName "2.3.0"
}
lintOptions {
abortOnError false
Expand All @@ -79,7 +79,7 @@ repositories {
dependencies {
//noinspection GradleDynamicVersion
implementation 'com.facebook.react:react-native:+'
implementation "androidx.security:security-crypto:1.0.0-alpha02"
implementation "androidx.security:security-crypto:1.0.0-rc02"
}

def configureReactNativePom(def pom) {
Expand Down
13 changes: 13 additions & 0 deletions android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Project-wide Gradle settings.

# IDE (e.g. Android Studio) users:
# Gradle settings configured through the IDE *will override*
# any settings specified in this file.

# For more details on how to configure your build environment visit
# http://www.gradle.org/docs/current/userguide/build_environment.html

# AndroidX package structure to make it clearer which packages are bundled with the
# 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
4 changes: 2 additions & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Mon Feb 10 19:24:35 EST 2020
#Fri May 29 23:06:02 EDT 2020
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.emeraldsanto.encryptedstorage;

import android.content.Context;
import android.content.SharedPreferences;
import android.content.res.Resources;
import android.os.Build;
import android.util.Log;

import androidx.security.crypto.EncryptedSharedPreferences;
Expand All @@ -23,6 +25,11 @@ public class RNEncryptedStorageModule extends ReactContextBaseJavaModule {
public RNEncryptedStorageModule(ReactApplicationContext context) {
super(context);

if (Build.VERSION.SDK_INT < Build.VERSION_CODES.M) {
this.sharedPreferences = context.getSharedPreferences(RNEncryptedStorageModule.SHARED_PREFERENCES_FILENAME, Context.MODE_PRIVATE);
return;
}

try {
this.sharedPreferences = EncryptedSharedPreferences.create(
RNEncryptedStorageModule.SHARED_PREFERENCES_FILENAME,
Expand All @@ -34,7 +41,7 @@ public RNEncryptedStorageModule(ReactApplicationContext context) {
}

catch (Exception ex) {
Log.w(RNEncryptedStorageModule.NATIVE_MODULE_NAME, String.format("Could not initialize SharedPreferences - %s", ex.getLocalizedMessage()));
this.sharedPreferences = context.getSharedPreferences(RNEncryptedStorageModule.SHARED_PREFERENCES_FILENAME, Context.MODE_PRIVATE);
}
}

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "react-native-encrypted-storage",
"title": "React Native Encrypted Storage",
"version": "2.2.0",
"version": "2.3.0",
"description": "A React Native wrapper over SharedPreferences and Keychain to provide a secure alternative to Async Storage",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"homepage": "https://www.github.com/emeraldsanto/react-native-encrypted-storage#readme",
"scripts": {
"test": "jest",
"prepublish": "tsc"
"prepare": "npm run test && tsc"
},
"repository": {
"type": "git",
Expand Down

0 comments on commit f3a3582

Please sign in to comment.