Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.

Commit 252758b

Browse files
authored
chore: bump nitro to 0.7.0, patch rnscreens, java22 & gradle 8.8 (margelo#441)
1 parent de94007 commit 252758b

File tree

11 files changed

+63
-21
lines changed

11 files changed

+63
-21
lines changed

.github/workflows/build-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ jobs:
4141
- name: Setup JDK
4242
uses: actions/setup-java@v4
4343
with:
44-
distribution: zulu
45-
java-version: 17
44+
distribution: corretto
45+
java-version: 22
4646
cache: gradle
4747

4848
- name: Setup Android SDK

.github/workflows/validate-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- name: Setup JDK
2929
uses: actions/setup-java@v4
3030
with:
31-
distribution: zulu
32-
java-version: 17
31+
distribution: corretto
32+
java-version: 22
3333
cache: gradle
3434

3535
- name: Setup Android SDK

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,5 +181,8 @@ lib/
181181
# TypeScript
182182
tsconfig.tsbuildinfo
183183

184+
# jenv
185+
.java-version
186+
184187
# development stuffs
185188
example0/

bun.lockb

612 Bytes
Binary file not shown.

example/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#Fri Aug 09 17:48:30 EDT 2024
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-all.zip
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
55
networkTimeout=10000
66
validateDistributionUrl=true
77
zipStoreBase=GRADLE_USER_HOME

example/ios/Podfile.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PODS:
77
- hermes-engine (0.74.5):
88
- hermes-engine/Pre-built (= 0.74.5)
99
- hermes-engine/Pre-built (0.74.5)
10-
- NitroModules (0.4.0):
10+
- NitroModules (0.7.0):
1111
- DoubleConversion
1212
- glog
1313
- hermes-engine
@@ -29,7 +29,7 @@ PODS:
2929
- ReactCommon/turbomodule/core
3030
- Yoga
3131
- OpenSSL-Universal (3.2.2000)
32-
- QuickCrypto (1.0.0-beta.2):
32+
- QuickCrypto (1.0.0-beta.3):
3333
- DoubleConversion
3434
- glog
3535
- hermes-engine
@@ -1564,9 +1564,9 @@ SPEC CHECKSUMS:
15641564
fmt: 4c2741a687cc09f0634a2e2c72a838b99f1ff120
15651565
glog: fdfdfe5479092de0c4bdbebedd9056951f092c4f
15661566
hermes-engine: 8c1577f3fdb849cbe7729c2e7b5abc4b845e88f8
1567-
NitroModules: da051fe7d5765063eb128f5fa920e0e3aa5b09b6
1567+
NitroModules: 7c4be57284deac5fbdfd23457cd1aaedfc810c98
15681568
OpenSSL-Universal: f8a9c4fdab7e21cb70bda471c269e86e9212439c
1569-
QuickCrypto: f7ee33fc626d3b924ef8314bead200e028370146
1569+
QuickCrypto: 744978daf1eb30c6dec0f68658de0c5726d9793b
15701570
RCT-Folly: 02617c592a293bd6d418e0a88ff4ee1f88329b47
15711571
RCTDeprecation: 3afceddffa65aee666dafd6f0116f1d975db1584
15721572
RCTRequired: ec1239bc9d8bf63e10fb92bd8b26171a9258e0c1

example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"react": "^18.3.1",
3030
"react-native": "^0.74.5",
3131
"react-native-bouncy-checkbox": "4.0.1",
32-
"react-native-nitro-modules": "0.4.0",
32+
"react-native-nitro-modules": "0.7.0",
3333
"react-native-quick-base64": "2.1.2",
3434
"react-native-quick-crypto": "*",
3535
"react-native-safe-area-context": "4.10.8",

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,8 @@
6565
}
6666
}
6767
}
68+
},
69+
"patchedDependencies": {
70+
6871
}
6972
}

packages/react-native-quick-crypto/cpp/random/HybridRandom.cpp

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,37 @@ namespace margelo::crypto {
88
using namespace margelo::nitro;
99
using namespace margelo::nitro::crypto;
1010

11-
std::future<std::shared_ptr<ArrayBuffer>> HybridRandom::randomFill(const std::shared_ptr<ArrayBuffer>& buffer, double dOffset,
12-
double dSize) {
11+
std::future<std::shared_ptr<ArrayBuffer>>
12+
HybridRandom::randomFill(const std::shared_ptr<ArrayBuffer>& buffer,
13+
double dOffset,
14+
double dSize) {
1315
size_t size = checkSize(dSize);
14-
// copy the JSArrayBuffer that we do not own into a NativeArrayBuffer that we do own, before passing to sync function
16+
// copy the JSArrayBuffer that we do not own into a NativeArrayBuffer that we
17+
// do own, before passing to sync function
1518
uint8_t* data = new uint8_t[size];
1619
memcpy(data, buffer.get()->data(), size);
17-
std::shared_ptr<ArrayBuffer> nativeBuffer = std::make_shared<NativeArrayBuffer>(data, size, false);
20+
std::shared_ptr<ArrayBuffer> nativeBuffer =
21+
std::make_shared<NativeArrayBuffer>(data, size, [=]() { delete[] data; });
1822

1923
return std::async(std::launch::async,
20-
[this, nativeBuffer, dOffset, dSize]() { return this->randomFillSync(nativeBuffer, dOffset, dSize); });
24+
[this, nativeBuffer, dOffset, dSize]() {
25+
return this->randomFillSync(nativeBuffer, dOffset, dSize);
26+
});
2127
};
2228

23-
std::shared_ptr<ArrayBuffer> HybridRandom::randomFillSync(const std::shared_ptr<ArrayBuffer>& buffer, double dOffset, double dSize) {
29+
std::shared_ptr<ArrayBuffer>
30+
HybridRandom::randomFillSync(const std::shared_ptr<ArrayBuffer>& buffer,
31+
double dOffset,
32+
double dSize) {
2433
size_t size = checkSize(dSize);
2534
size_t offset = checkOffset(dSize, dOffset);
2635
uint8_t* data = buffer.get()->data();
2736

2837
if (RAND_bytes(data + offset, (int)size) != 1) {
29-
throw std::runtime_error("error calling RAND_bytes" + std::to_string(ERR_get_error()));
38+
throw std::runtime_error("error calling RAND_bytes" +
39+
std::to_string(ERR_get_error()));
3040
}
31-
return std::make_shared<NativeArrayBuffer>(data, size, false);
41+
return std::make_shared<NativeArrayBuffer>(data, size, nullptr);
3242
};
3343

3444
} // namespace margelo::crypto

packages/react-native-quick-crypto/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"dependencies": {
6767
"@craftzdog/react-native-buffer": "6.0.5",
6868
"events": "3.3.0",
69-
"react-native-nitro-modules": "0.4.0",
69+
"react-native-nitro-modules": "0.7.0",
7070
"react-native-quick-base64": "2.1.2",
7171
"readable-stream": "4.5.2",
7272
"string_decoder": "1.3.0",
@@ -84,11 +84,11 @@
8484
"eslint": "9.9.0",
8585
"eslint-plugin-react-native": "^4.1.0",
8686
"jest": "29.7.0",
87-
"nitro-codegen": "0.4.0",
87+
"nitro-codegen": "0.7.0",
8888
"prettier": "3.2.5",
8989
"react": "18.3.1",
9090
"react-native": "0.74.5",
91-
"react-native-builder-bob": "0.29.1",
91+
"react-native-builder-bob": "0.30.0",
9292
"release-it": "17.6.0",
9393
"typescript": "5.1.6",
9494
"typescript-eslint": "^8.1.0"

0 commit comments

Comments
 (0)