'cordova - bundle extra binary file to the app root

when building a project, HOW do i instruct cordova to add a file.bin to the resulted APK, so that after installing the apk the file will be available in this path: /data/data/com.myapp/file.bin

file.bin is a ( Cross-compiled Android binary file ) from the https://github.com/aria2/aria2 project, it is a command line tool downloader that run on android.

i installed plugin: org.apache.cordova.shell-exec so that i can "chmod 755 /data/data/com.myapp/file.bin" and call this binary file from my js code.

i tried adding to config.xml: <resource-file src="file.bin" target="app/src/main/file.bin" /> but this did not work, it was not add to the final .APK, although it was copied to app/src/main/file.bin.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source