I almost got this working, but not quite.
I created a branch that sets the proper cargo environment variables to point at the android compiler/linker via the flake: cross-android. With these set, it should be possible to either cargo build --target aarch64-linux-android --release in ngrok-java-native or mvn --global-toolchains toolchains.xml --batch-mode --projects ngrok-java-native --also-make package --activate-profiles ci-native --define 'ngrok.native.classifier=linux-android-aarch_64' --define 'ngrok.native.target=aarch64-linux-android' --define 'skipTests' from the root, but both of them give me the same dump of link errors: Whoops, I was using the uppercased target triple for the CC_ and AR_ variables. Now it works!
One can either do:
mvn --global-toolchains toolchains.xml package --activate-profiles ci-native --define 'ngrok.native.classifier=linux-android-aarch_64' --define 'ngrok.native.target=aarch64-linux-android' --define 'skipTests' from the top-level
mvn --global-toolchains toolchains.xml compile from the top-level, followed by cargo build --target aarch64-linux-android --release from ngrok-java-native
Neither of which are terribly ergonomic. The latter is probably the easiest and most direct way to get just the .so to build, since loading it from the jar seems broken anyway (#50).