DEV Community

Sh Raj
Sh Raj

Posted on

Publishing App on F-Droid for Free

Publishing your app on F-Droid involves several steps, from ensuring your app meets the required criteria to submitting the necessary metadata. Here's a detailed guide to help you through the process:

1. Preparing Your App

Open Source License

Ensure your app is under an open-source license such as MIT, GPL-3.0-only, or Apache-2.0. F-Droid only accepts apps with open-source licenses.

Repository Setup

Your app's source code should be hosted on a public version control system like GitHub or GitLab. The repository must be public and contain all the necessary files to build your app.

2. Setting Up Your Environment

Install F-Droid Tools

You need to install the F-Droid server tools. This can be done on a Linux machine using the following commands:

sudo apt-get install fdroidserver
Enter fullscreen mode Exit fullscreen mode

3. Creating Metadata

Clone the F-Droid Data Repository

You need to clone the F-Droid data repository, which contains the metadata for all the apps.

git clone https://gitlab.com/fdroid/fdroiddata.git
cd fdroiddata
Enter fullscreen mode Exit fullscreen mode

Create a New Branch

Create a new branch named after your app’s package name:

git checkout -b com.example.myapp
Enter fullscreen mode Exit fullscreen mode

Create Metadata File

Create a new YAML file in the metadata directory with your app’s package name:

nano metadata/com.example.myapp.yml
Enter fullscreen mode Exit fullscreen mode

Populate the file with your app’s details. Here's an example:

Categories:
  - Science & Education
  - Reading
License: MIT
AuthorName: John Doe
AuthorEmail: john@example.com
AuthorWebSite: https://example.com
SourceCode: https://github.com/username/myapp
IssueTracker: https://github.com/username/myapp/issues
Changelog: https://github.com/username/myapp/releases

AutoName: My App Name
RepoType: git
Repo: https://github.com/username/myapp.git
Binaries: https://github.com/username/myapp/releases/download/v%v/MyApp-%v.apk

Builds:
  - versionName: 1.0.1
    versionCode: 1
    commit: v1.0.1
    subdir: app
    sudo:
      - apt-get update
      - apt-get install -y openjdk-17-jdk-headless
      - update-java-alternatives -a
    gradle:
      - yes
Enter fullscreen mode Exit fullscreen mode

4. Verifying and Building

Read Metadata

Ensure your metadata file is error-free:

fdroid readmeta
Enter fullscreen mode Exit fullscreen mode

Rewrite Metadata

Clean up and rewrite the metadata file:

fdroid rewritemeta com.example.myapp
Enter fullscreen mode Exit fullscreen mode

Lint Metadata

Check for any warnings in the metadata:

fdroid lint com.example.myapp
Enter fullscreen mode Exit fullscreen mode

Build the App

Build your app using F-Droid tools:

fdroid build -v -l com.example.myapp
Enter fullscreen mode Exit fullscreen mode

5. Submitting Your App

Push to GitLab

Commit your changes and push them to your fork of the F-Droid data repository on GitLab:

git add .
git commit -m "Added My App"
git remote set-url origin https://gitlab.com/YOUR-USERNAME/fdroiddata.git
git push -u origin com.example.myapp
Enter fullscreen mode Exit fullscreen mode

6. Creating a Merge Request

Go to your GitLab repository and create a merge request to the main F-Droid data repository. The F-Droid maintainers will review your request, and if everything is in order, they will merge your app into the main repository.

7. Additional Details

Graphic Assets

To include icons and screenshots, add them using a Fastlane or Triple-T folder structure in your app’s repository. This helps F-Droid fetch and display these assets in the app store.

CI/CD Pipelines

Monitor the CI/CD pipelines in GitLab to ensure there are no build errors. If the pipelines pass successfully, your app will soon be available on F-Droid.

Final Notes

Publishing on F-Droid can take a day or two after the merge. You can promote your app using F-Droid's official graphics, which can be found on their website.

For more detailed instructions and examples, refer to F-Droid's official documentation, Dev Community guide, and Random Bits blog.

This comprehensive process ensures your app meets F-Droid’s standards and provides users with a trustworthy source for open-source Android applications.

Top comments (0)