Publish an Open Source app on Fdroid
Fdroid is a famous software repository hosted with numerous free and open source Android apps. They have a main repository where they allow developers hosting free and ad free software after a thorough check up on the app. This blog will tell you how to get your project hosted in their repository using steps I followed to publish the PSLab Android app.
Before you get started, make sure you have the consent from your developer community to publish their app on Fdroid. Fdroid requires your app to use all kind of open resources to implement features. If there is any closed source libraries in your app and you still want to publish it on Fdroid, you may have to reimplement that feature by any other mean without using closed source resources. They will also not allow to have Google’s proprietary “play-services” in your app along with proprietary ad services. You can find the complete inclusion policy document from their official page.
When your app is fully ready, you can get started with the inclusion procedure. Unlike how we are publishing apps on Google Play, publishing an app on Fdroid is as simple as sending a pull request to their main repository. That’s exactly what we have to do. In simple terms all we have to do is:
- Fork the Fdroid main data repository
- Make changes to their files to include our app
- Do a pull request
First of all you need a GitLab account as the Fdroid repository is hosted in GitLab. Once you are ready with a GitLab account, fork and clone the f-droid-data repository. The next step is to install the fdroid-server. This can be simply done using apt:
$ sudo apt install fdroidserver
Once that is done, go into the directory where you cloned the repository and run the following command to read current meta data where it saves all the information related to existing apps on Fdroid;
$ fdroid readmeta
This will list out various details about the current meta files. Next step is to add our app details into this meta file. This can be done easily using following command or you can manually create folders and files. But the following is safer;
$ fdroid import --url https://github.com/fossasia/pslab-android --subdir app
Replace the link to repository from the –url tag in the above command. For instance the following will be the link for fossasia-phimpme android;
$ fdroid import --url https://github.com/fossasia/phimpme-android --subdir app
This will create a file named as “org.fossasia.pslab” in the metadata directory. Open up this text file and we have to fill in our details.
- Categories
- License
- Web Site
- Summary
- Description
Description needs to be terminated with a newline and a dot to avoid build failures.
Once the file is filled up, run the following command to make sure that the metadata file is complete.
$ fdroid readmeta
Then run the following command to clean up the file
$ fdroid rewritemeta org.fossasia.pslab
We can automatically add version details using the following command:
$ fdroid checkupdates org.fossasia.pslab
Now run the lint test to see if the app is building correctly.
$ fdroid lint org.fossasia.pslab
If there are any errors thrown, fix them to get to the next step where we actually build the app:
$ fdroid build -v -l org.fossasia.pslab
Now you are ready to make the pull request which will then get reviewed by developers in Fdroid community to get it merged into their main branch. Make a commit and then push to your fork. From there it is pretty straightforward to make a pull request to the main repository. Once that is done, they will test the app for any insecurities. If all of them are passed, the app will be available in Fdroid!
Reference:
- Quick Start: https://gitlab.com/fdroid/fdroiddata/blob/master/README.md#quickstart
- Making merge requests: https://gitlab.com/fdroid/fdroiddata/blob/master/CONTRIBUTING.md#merge-requests