@functionland/react-native-fula 1.12.0 → 1.13.1

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.
@@ -1,4 +1,3 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
1
  <project version="4">
3
2
  <component name="ExternalStorageConfigurationManager" enabled="true" />
4
3
  <component name="ProjectRootManager" version="2" languageLevel="JDK_17" project-jdk-name="jbr-17" project-jdk-type="JavaSDK">
@@ -1,70 +1,70 @@
1
- buildscript {
2
- if (project == rootProject) {
3
- repositories {
4
- google()
5
- mavenCentral()
6
- jcenter()
7
- }
8
-
9
- dependencies {
10
- classpath 'com.android.tools.build:gradle:4.2.2'
11
- }
12
- }
13
- }
14
-
15
- apply plugin: 'com.android.library'
16
-
17
- def safeExtGet(prop, fallback) {
18
- rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19
- }
20
-
21
- android {
22
- compileSdk 33
23
- defaultConfig {
24
- minSdkVersion safeExtGet('Fula_minSdkVersion', 26)
25
- targetSdkVersion safeExtGet('Fula_targetSdkVersion', 31)
26
- versionCode 1
27
- versionName "1.0"
28
-
29
- }
30
-
31
- buildTypes {
32
- release {
33
- minifyEnabled false
34
- }
35
- }
36
- lintOptions {
37
- disable 'GradleCompatible'
38
- }
39
- compileOptions {
40
- sourceCompatibility JavaVersion.VERSION_1_8
41
- targetCompatibility JavaVersion.VERSION_1_8
42
- }
43
- ndkVersion '25.1.8937393'
44
- }
45
-
46
- repositories {
47
- mavenLocal()
48
- google()
49
- jcenter()
50
- mavenCentral()
51
- maven {
52
- // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
53
- url("$rootDir/../node_modules/react-native/android")
54
- }
55
-
56
-
57
-
58
- // Add this repo to get go-fula package
59
- maven { url 'https://jitpack.io' }
60
- }
61
-
62
- dependencies {
63
- //noinspection GradleDynamicVersion
64
- implementation "com.facebook.react:react-native:+" // From node_modules
65
- implementation 'com.github.functionland:fula-build-aar:1.12.0' // From jitpack.io
66
- implementation 'com.github.functionland:wnfs-build-aar:v1.4.1' // From jitpack.io
67
- implementation 'commons-io:commons-io:20030203.000550'
68
- implementation 'commons-codec:commons-codec:1.15'
69
- // implementation files('mobile.aar')
70
- }
1
+ buildscript {
2
+ if (project == rootProject) {
3
+ repositories {
4
+ google()
5
+ mavenCentral()
6
+ jcenter()
7
+ }
8
+
9
+ dependencies {
10
+ classpath 'com.android.tools.build:gradle:4.2.2'
11
+ }
12
+ }
13
+ }
14
+
15
+ apply plugin: 'com.android.library'
16
+
17
+ def safeExtGet(prop, fallback) {
18
+ rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback
19
+ }
20
+
21
+ android {
22
+ compileSdk 33
23
+ defaultConfig {
24
+ minSdkVersion safeExtGet('Fula_minSdkVersion', 26)
25
+ targetSdkVersion safeExtGet('Fula_targetSdkVersion', 31)
26
+ versionCode 1
27
+ versionName "1.0"
28
+
29
+ }
30
+
31
+ buildTypes {
32
+ release {
33
+ minifyEnabled false
34
+ }
35
+ }
36
+ lintOptions {
37
+ disable 'GradleCompatible'
38
+ }
39
+ compileOptions {
40
+ sourceCompatibility JavaVersion.VERSION_1_8
41
+ targetCompatibility JavaVersion.VERSION_1_8
42
+ }
43
+ ndkVersion '25.1.8937393'
44
+ }
45
+
46
+ repositories {
47
+ mavenLocal()
48
+ google()
49
+ jcenter()
50
+ mavenCentral()
51
+ maven {
52
+ // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
53
+ url("$rootDir/../node_modules/react-native/android")
54
+ }
55
+
56
+
57
+
58
+ // Add this repo to get go-fula package
59
+ maven { url 'https://jitpack.io' }
60
+ }
61
+
62
+ dependencies {
63
+ //noinspection GradleDynamicVersion
64
+ implementation "com.facebook.react:react-native:+" // From node_modules
65
+ implementation 'com.github.functionland:fula-build-aar:1.13.1' // From jitpack.io
66
+ implementation 'com.github.functionland:wnfs-android:v1.7.3' // From jitpack.io
67
+ implementation 'commons-io:commons-io:20030203.000550'
68
+ implementation 'commons-codec:commons-codec:1.15'
69
+ // implementation files('mobile.aar')
70
+ }
@@ -23,11 +23,13 @@ import javax.crypto.spec.SecretKeySpec;
23
23
  import javax.crypto.spec.GCMParameterSpec;
24
24
 
25
25
  public class Cryptography {
26
- public static String encryptMsg(String message, SecretKey secret)
26
+ public static String encryptMsg(String message, SecretKey secret, byte[] iv)
27
27
  throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, IllegalBlockSizeException, BadPaddingException, InvalidAlgorithmParameterException {
28
28
  Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding");
29
- byte[] iv = new byte[12]; // Ensure this is randomly generated for each encryption.
30
- new SecureRandom().nextBytes(iv);
29
+ if (iv == null || iv.length == 0) {
30
+ iv = new byte[12]; // Ensure this is randomly generated for each encryption.
31
+ new SecureRandom().nextBytes(iv);
32
+ }
31
33
  GCMParameterSpec spec = new GCMParameterSpec(128, iv);
32
34
  cipher.init(Cipher.ENCRYPT_MODE, secret, spec);
33
35
  byte[] cipherText = cipher.doFinal(message.getBytes(StandardCharsets.UTF_8));