What is F-Droid?

FDroid is an Open Source package of server and client applications to deploy an app eco-system similar to Google Play. The server scripts are written in Python language and the client is written in JAVA using Android SDK.

The FDroid Repository is an easily-installable catalogue of FOSS applications for the Android platform. The server contains the details of multiple versions of each application, and the Android client makes it easy to browse, install them onto your device, and keep track of updates.

Detailed installation instructions can be found in the official manual.
In this tutorial we are going to serve unsigned APK files without source / signing.

Prerequisites

  • Python run time
  • Android SDK
  • FDroid server tools and fdroid android client from gitorious
  • Its given in the manual that GNU/Linux is required at the very least, but we got working it in Mac.

Setup server tools

Extract fdroidserver files and add the path of the extracted folder to the environmental PATH variable, so that the script ‘fdroid’ can be run from anywhere.

Creating Binary Repo

Create a folder ‘fdroid’ in localhost (I use MAMP/localhost). Copy the file config.sample.py to fdroid and rename it as config.py. Edit just the two following props in config.py with appropriate values:

sdk_path = "/tools/android-sdks"
repo_url = "http://localhost/fdroid"
repo_icon = "icon.png"

Get a png file for icon and place it in fdroid with the name icon.png and create 3 folders and name them metadata, repo and stats. Copy all your APK files into repo directory. Now your file structure should look like this:

  • fdroid
    • config.py
    • icon.png
    • metadata
    • repo (contains all APKs)
    • stats

We now got the file structure ready. Navigate to fdroid dir in terminal and run the command fdroid update -c, which will create skeleton metadata for all our APKs. There will be a txt file for each APK in fdroid/metadata/. I have 3 APKs in fdroid/repo (2 APKs are different versions of the same app) and I get the following getting printed:

Processing KeysEngine-2.apk
Processing KeysEngine.apk
Processing tag.apk
Generated skeleton metadata for com.y.keysengine
Generated skeleton metadata for com.y.keysengine
Generated skeleton metadata for com.y.example
Finished.
0 apps in repo
0 disabled
0 with no packages
0 warnings

Update the files in fdroid/metadata with the meta-information of the the app. Then run the command fdroid update, which will update the index.xml with the updated meta data and outputs the following to the terminal:

Processing KeysEngine-2.apk
Processing KeysEngine.apk
Processing tag.apk
Finished.
2 apps in repo
0 disabled
0 with no packages
0 warnings

If all went well, you should be able to view the file structure with the following URL: http://localhost:8888/fdroid/repo/

Android Client

Import the downloaded Android Client project into Eclipse. Open the file at res/values/default_repo.xml and update it as follows:

<string name="default_repo_address" formatted="false">YOUR REPO URL HERE</string>

The string tag with name “default_repo_pubkey” shoule be removed/commented out since our APK’s will be served unsigned and we dont have any code signing process involved.

If everything went fine, running the Android project should connect to our server, get the index.xml and list out all our APK’s and their versions ready to be installed !!!