I’m noticing that Cordova is a pretty common pain point for F-Droid, so I wanted to bring up a discussion here. I have been trying to learn about it and have only made progress by digging through many random threads. Hopefully this thread can serve to begin compiling information and discussing how we can make it easier to include Cordova apps in F-Droid.
Here are a few useful links chadcurtis found while digging. This is coming from the perspective of trying to reverse-engineer what other people have done to make this work.
Thank you for your engagement. If you want to create a wiki article, I suggest you to open a merge request on the new website, because we will likely drop the old wiki in favor of this.
Thanks! I’d like to get started on that. However, I’m learning as I’m going along.
One thing I’m curious about: is Cordova installed on the F-Droid server? I’ve noticed a few app repos include the entire Cordova source code within them so it will properly build on the server. I’m sure this has been considered, but is there a better way to do this?
At one stage I was interested in trying to get a Cordova app built using the F-Droid server. My first port of call was to jump into F-Droid / Data · GitLab and search for other apps which are indeed built and released on F-Droid that use Cordova.
I’m not sure if they all use different recipies or not, but you could have a read through some of them to get some ideas.
It could be great to add cordova apps into f-droid repository.
I also submitted an inclusion request for my app Pi-hole Droid (#48) · Issues · F-Droid / Requests For Packaging · GitLab made with Apache Cordova. On the app’s repository there are all the files generated from cordova exept these:
Usually, when I make an update for the app, I launch a simple “cordova build --release android” that it will generate the apk to /platforms/android/build/outputs/apk/android-release-unsigned.apk
I know nothing about cordova. Is there a standard build config file that is in the project? For example, gradle builds always have build.gradle and settings.gradle. If so, then we should be able to auto-detect cordova builds, then just call cordova build --release android and auto-fetch the unsigned APK from the standard location.
Does this work with the nodejs Debian package? Imagine you just
installed a new Debian/jessie machine: what exact steps would you take
to install cordova, then run the build. These steps should be in a script.
These are the steps I followed for my Ubuntu (tested on 16.04/16.10 and now on my 17.04):
nodejs/npm install
sudo apt-get install nodejs
sudo apt-get install npm
cordova install
sudo npm install -g cordova
Assuming that you will clone my app from Github you will do:
cd into the root of the app
cordova build --release android
The unsigned apk will be inside platforms/android/build/outputs/apk/android-release-unsigned.apk
One thing to consider is that, first of all, you obviously need Java + Android SDK which, in my case, I got them from webupd8.org (java) and Google Android Studio (sdk). In particoular:
How much do Cordoba builds rely on the most recent release of nodejs and
npm? The buildserver runs Debian/stable (currently Jessie), so it is
guaranteed to be an older version. So if the Debian/jessie versions are
not useful, then the nodejs/npm installs should happen using the new
sudo= build field.
A Cordova App is a full package.
In fact you build for Microsoft, Iphone, Android…
It’s a generated APK for Android.
The packages are separated in the structure of the project and different with the implementation of Cordova for the targeted phone OS (ex: notifications).
On my Android, I tested the app: “Cordova Showcase”.
Could be a good start
You have a link to the github project.