Skip to content

Commit 1e50f43

Browse files
committed
fix: android ci
1 parent 89fba6e commit 1e50f43

File tree

7 files changed

+56
-4
lines changed

7 files changed

+56
-4
lines changed

.github/workflows/build-example-android.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
node-version: '22'
1717

1818
- name: Set up JDK 17
19-
uses: actions/setup-java@v2
19+
uses: actions/setup-java@v4
2020
with:
2121
java-version: '17'
2222
distribution: 'zulu'
@@ -26,7 +26,7 @@ jobs:
2626
yarn setup
2727
2828
- name: Cache Gradle packages
29-
uses: actions/cache@v2
29+
uses: actions/cache@v4
3030
with:
3131
path: |
3232
~/.gradle/caches

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
"workspaces": {
1111
"packages": [
1212
"packages/*",
13+
"packages/connect-examples/shared-constants",
1314
"packages/connect-examples/expo-example",
1415
"packages/connect-examples/electron-example",
1516
"packages/connect-examples/expo-playground"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
// eslint-disable-next-line import/no-relative-packages
2-
import { getConnectSrc } from '../../../constants';
2+
import { getConnectSrc } from '@onekey-internal/shared-constants';
33

44
export const CONNECT_SRC = getConnectSrc();

packages/connect-examples/expo-playground/app/constants/connect.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { getConnectSrc } from '../../../constants';
1+
import { getConnectSrc } from '@onekey-internal/shared-constants';
22

33
/**
44
* OneKey Hardware SDK Connect Source Configuration
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"name": "@onekey-internal/shared-constants",
3+
"version": "1.1.10-alpha.2",
4+
"private": true,
5+
"author": "OneKey",
6+
"homepage": "https://github.com/OneKeyHQ/hardware-js-sdk#readme",
7+
"license": "ISC",
8+
"type": "module",
9+
"main": "constants.js"
10+
}
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
diff --git a/node_modules/react-native-crypto/index.js b/node_modules/react-native-crypto/index.js
2+
index f644543..bf38ebb 100644
3+
--- a/node_modules/react-native-crypto/index.js
4+
+++ b/node_modules/react-native-crypto/index.js
5+
@@ -1,28 +1,16 @@
6+
'use strict'
7+
+import { getRandomValues } from 'react-native-get-random-values';
8+
9+
-import { randomBytes } from 'react-native-randombytes'
10+
-exports.randomBytes = exports.rng = exports.pseudoRandomBytes = exports.prng = randomBytes
11+
-
12+
-// implement window.getRandomValues(), for packages that rely on it
13+
-if (typeof window === 'object') {
14+
- if (!window.crypto) window.crypto = {}
15+
- if (!window.crypto.getRandomValues) {
16+
- window.crypto.getRandomValues = function getRandomValues (arr) {
17+
- let orig = arr
18+
- if (arr.byteLength != arr.length) {
19+
- // Get access to the underlying raw bytes
20+
- arr = new Uint8Array(arr.buffer)
21+
- }
22+
- const bytes = randomBytes(arr.length)
23+
- for (var i = 0; i < bytes.length; i++) {
24+
- arr[i] = bytes[i]
25+
- }
26+
-
27+
- return orig
28+
- }
29+
+if (typeof globalThis === 'object') {
30+
+ if (!globalThis.crypto) {
31+
+ globalThis.crypto = {};
32+
+ }
33+
+ if (!globalThis.crypto.getRandomValues) {
34+
+ globalThis.crypto.getRandomValues = getRandomValues;
35+
}
36+
}
37+
38+
+
39+
exports.createHash = exports.Hash = require('create-hash')
40+
exports.createHmac = exports.Hmac = require('create-hmac')
41+

0 commit comments

Comments
 (0)