Skip to content

Commit 61e0f56

Browse files
authored
Merge pull request #24 from numandev1/refactor/hash
refactor: hash
2 parents a4440ec + 199fe6c commit 61e0f56

31 files changed

+145
-751
lines changed

β€ŽREADME.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,17 @@ yarn add react-native-keys
4848

4949
Create a new file `keys.development.json` in the root of your React Native app and add Envs in `secure` object for `undecryptable` envs variables and add Envs in public for public usage this:
5050

51-
```
51+
```json
5252
{
5353
"secure": {
54-
"secure1": "secure1 value",
55-
"secure2": "secure2 value",
56-
"secure3": "secure3 value"
54+
"GOOGLE_API": "ABCD",
55+
"BRANCH_API": "ABCDEF"
5756
},
5857
"public": {
59-
"APP_NAME": "RNKEYS",
60-
"public1": "numan",
61-
"public2": "usman",
62-
"APP_ID": "com.example.rnkeys"
58+
"APP_NAME": "Keys Example",
59+
"BUNDLE_ID": "com.example.rnkeys.dev",
60+
"ANDROID_CODE": "50",
61+
"PACKGE_ID": "com.example.rnkeys.dev"
6362
}
6463
}
6564
```
@@ -84,8 +83,8 @@ Keys.URI_SCHEME; // fb://
8483
```js
8584
import Keys from 'react-native-keys';
8685

87-
Keys.secureFor('API_TOKEN '); // 'ABCSE#$DDSD
88-
Keys.secureFor('GOOGLE_API_KEY '); // 'ABCSE#$DDSD
86+
Keys.secureFor('API_TOKEN'); // 'ABCSE#$DDSD
87+
Keys.secureFor('GOOGLE_API_KEY'); // 'ABCSE#$DDSD
8988
Keys.secureFor('SECRET_KEY'); // 'ABCSE#$DDSD
9089
```
9190

β€Žandroid/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
1616
"${NODE_MODULES_DIR}/react-native/React"
1717
"${NODE_MODULES_DIR}/react-native/React/Base"
1818
"${NODE_MODULES_DIR}/react-native/ReactCommon/jsi"
19-
"./cpp"
19+
"./androidcpp"
20+
"../cpp"
2021
${FOLLY_INCLUDE_DIR}
2122
"."
2223
"${NODE_MODULES_DIR}/react-native/ReactAndroid/src/main/jni/react/turbomodule"
@@ -28,10 +29,10 @@ if(${REACT_NATIVE_MINOR_VERSION} GREATER_EQUAL 71)
2829
add_library(
2930
${PACKAGE_NAME}
3031
SHARED
31-
./cpp/mediator.cpp
32-
./cpp/crypto.cpp
33-
./cpp/decryptor.cpp
32+
./androidcpp/mediator.cpp
3433
./cpp-adapter.cpp
34+
../cpp/crypto.cpp
35+
../cpp/decryptor.cpp
3536
)
3637

3738
find_library(
@@ -71,17 +72,18 @@ else()
7172
${PACKAGE_NAME}
7273
SHARED
7374
../../react-native/ReactCommon/jsi/jsi/jsi.cpp
74-
./cpp/mediator.cpp
75-
./cpp/crypto.cpp
76-
./cpp/decryptor.cpp
75+
./androidcpp/mediator.cpp
7776
./cpp-adapter.cpp
77+
../cpp/crypto.cpp
78+
../cpp/decryptor.cpp
7879
)
7980

8081
include_directories(
8182
../../react-native/React
8283
../../react-native/React/Base
8384
../../react-native/ReactCommon/jsi
8485
./cpp
86+
../cpp
8587
)
8688

8789
set_target_properties(
File renamed without changes.
File renamed without changes.

β€Žandroid/cpp-adapter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
#include <sstream>
1010
#include <iomanip>
1111

12-
#include "json.hpp"
12+
#include "androidcpp/json.hpp"
1313
using json = nlohmann::json;
1414

1515
using namespace facebook::jsi;

β€Žandroid/src/main/java/com/reactnativekeysjsi/PrivateKey.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
package com.reactnativekeysjsi;
44

55
public class PrivateKey {
6-
public static String privatekey="WRjbaXf6cpgGNQq1eZ2Yq2yZAo/IQUWu0yCkDIri0hAesHSWaYALnma8qqbDeRfJlyoVXO73M37HdRsr85vo4=";
6+
public static String privatekey="++r99tSrk2+LWomyHaBfUvfegAH2BOY6IcpWkfk4M+oc/0xFbf5dl8zHWLJgjIDhjI/3svF1Vm+O71+l1UTNg=";
77
}

β€Žandroid/cpp/crypto.cpp renamed to β€Žcpp/crypto.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
#include "crypto.h"
33
#include <string>
4+
// #include "decryptor.cpp"
45
#include "decryptor.h"
56

67
using namespace std;
@@ -10,8 +11,11 @@
1011
}
1112

1213
string Crypto::getJniJsonStringyfyData(string key) {
13-
std::string base64Secret = "U2FsdGVkX1+uvOTVCval0JYJjna6el2v8OeJ5vxwRgB7YF3NnYJkIRK5NvygXy1y7LDt08z9Ub5oX/TmMr36VsWRjbaXf6cpgGNQq1eZ2Yq2yZAo/IQUWu0yCkDIri0hAesHSWaYALnma8qqbDeRfJlyoVXO73M37HdRsr85vo4=";
14-
std::string password = "asdf@1234";
14+
std::string base64Secret1 = "U2FsdGVkX19YWrzXkbERDFR2kWtYzJPkq3LnVFpcSnbv1CEwjwWMGCIKWa";
15+
std::string base64Secret2 = "BGS3nmYHhHF9IdAb50fTAawjCPpsYDXdS+SRZx3BHLN79sQz0qUY394HTL";
16+
std::string base64Secret3 = "3gc/bMtxhJtl5EcEXRxrczqhHjCidBEH7vmT6inTKoxr92glFl9yU+0=";
17+
std::string base64Secret = base64Secret1 + base64Secret2 + base64Secret3;
18+
std::string password = "LFsqCW2QRPlu";
1519
bool binary = false;
1620
std::string plaintext = decryptor::dec(base64Secret, password,binary);
1721

File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
Β (0)