Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ function requireNative() {
}
} else if (process.platform === 'android') {
if (process.arch === 'arm64') {
// Try Android-specific binaries first
try {
return require('./hypersync-client.android-arm64.node')
} catch (e) {
Expand All @@ -84,6 +85,22 @@ function requireNative() {
} catch (e) {
loadErrors.push(e)
}
// Fall back to Linux arm64 GNU binary (Android is Linux under the hood)
try {
return require('./hypersync-client.linux-arm64-gnu.node')
} catch (e) {
loadErrors.push(e)
}
try {
const binding = require('@envio-dev/hypersync-client-linux-arm64-gnu')
const bindingPackageVersion = require('@envio-dev/hypersync-client-linux-arm64-gnu/package.json').version
if (bindingPackageVersion !== '1.1.0' && process.env.NAPI_RS_ENFORCE_VERSION_CHECK && process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== '0') {
throw new Error(`Native binding package version mismatch, expected 1.1.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`)
}
return binding
} catch (e) {
loadErrors.push(e)
}
} else if (process.arch === 'arm') {
try {
return require('./hypersync-client.android-arm-eabi.node')
Expand Down
3 changes: 2 additions & 1 deletion npm/linux-arm64-gnu/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"node": ">= 10"
},
"os": [
"linux"
"linux",
"android"
],
"libc": [
"glibc"
Expand Down