Skip to content

Native assets (nodejs mobile)

Wiktor Sieprawski edited this page Aug 25, 2022 · 5 revisions

How it works

Quiet uses nodejs-mobile for running @quiet/backend in node process on mobile. nodejs-mobile forks official nodejs, which means all the binaries used by project's dependencies has to be compiled against this fork. nodejs-mobile-react-native has the ability to compile those native assets on buildtime (they're being stored inside build/Release folder within certain package's directory). node-gyp-build's responsibility is to search for those assets either within previously mentioned location or package's prebuild assets.

Android app bundle

.aab ships assets fitted for certain architecture only. It generates .apks file containing all necessary data prepared for shipping in the form of multiple .apk files.

@quiet/backend is present within base-master.apk and it figures as nodejs-project. All the native assets compiled against nodejs-mobile exists within similar, proper cpu-arch suffixed directories, e.g. nodejs-project-android-arm64

Use bundletool to get .apks

bundletool build-apks --bundle=<path-to-aab> --output=<path-to-apks> --ks=<keysotre.jks> --ks-pass=pass:<password> --ks-key-alias=<alias>

Install .apks on a device

bundletool install-apks --adb=<path-to-adb> --apks=<path-to-apks>

Debugging

Always make sure proper binaries are being built and shipped onto your device. Although you cannot debug signed releases, it's possible to generate debuggable app bundle using ./gradlew bundleDebug. Android studio provides UI for searching through device's file system (Device File Explorer). Application's data exists under /data/data/<com.appid>

Clone this wiki locally