### Build and install directly to device Source: https://f-droid.org/pl/docs/Building_Applications Builds and installs the latest signed version of an application directly to a connected device or emulator. Use `--all` to install all available versions, but be aware that no validation checks are performed in this mode. ```bash fdroid install --all ``` -------------------------------- ### Install fdroidserver on Debian/Ubuntu Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Installs the basic fdroidserver package from the operating system's standard package repository. This is sufficient for a basic F-Droid setup. ```bash sudo apt-get install fdroidserver ``` -------------------------------- ### Install Build Server Packages and Create User Source: https://f-droid.org/pl/docs/Build_Server_Setup Installs essential packages for the build server and creates a dedicated 'fdroid' user. Ensure no additional packages are needed for specific app builds. ```bash root:~# apt-get install vagrant git python3-certifi \ python3-libvirt python3-requestbuilder python3-yaml \ python3-progress python3-vagrant python3-paramiko python3-pyasn1 \ python3-pyasn1-modules python3-requests python3-git vagrant-mutate vagrant-libvirt ebtables dnsmasq-base \ libvirt-clients libvirt-daemon-system qemu-kvm qemu-utils root:~# adduser --disabled-password fdroid root:~# su fdroid ``` -------------------------------- ### Install Nginx Web Server Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo Installs the nginx web server, which is used to serve the F-Droid repository. ```bash sudo apt-get install nginx ``` -------------------------------- ### Install fdroidserver on Guix Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Installs fdroidserver using the Guix package manager. Ensure you have Guix installed and configured. ```bash guix install fdroidserver ``` -------------------------------- ### Install Dependencies and Download JAR Source: https://f-droid.org/pl/docs/Release_Channels_and_Signing_Keys Installs required packages and downloads the admin@f-droid.org.jar file. ```bash sudo apt-get install wget vim-common unzip openjdk-8-jdk-headless wget https://f-droid.org/assets/admin@f-droid.org.jar ``` -------------------------------- ### Initialize and Build the F-Droid Build Server Source: https://f-droid.org/pl/docs/Build_Server_Setup Run the script to create the base build server image. This process can take a significant amount of time and resources due to SDK downloads and installations. ```bash fdroid:~$ cd fdroidserver fdroid:~/fdroidserver$ ./makebuildserver --verbose ``` -------------------------------- ### Travis CI Configuration for F-Droid Server Source: https://f-droid.org/pl/docs/Publishing_Nightly_Builds Example Travis CI configuration to install fdroidserver and deploy APKs after successful tests. Requires a debug keystore to be set as the DEBUG_KEYSTORE environment variable. ```yaml sudo: required language: android addons: apt: sources: - sourceline: 'ppa:fdroid/fdroidserver' packages: - fdroidserver - openssh-client android: components: - tools - platform-tools - build-tools-26.0.2 - android-25 licenses: - 'android-sdk-license-.+' script: - ./gradlew test after_success: - fdroid nightly -v ``` -------------------------------- ### Clone fdroiddata and Configure Build Server Source: https://f-droid.org/pl/docs/Build_Server_Setup Clones the fdroiddata repository, copies the example configuration file, and enables the build server by modifying the configuration. ```bash fdroid:~/fdroidserver$ cd ~ fdroid:~$ git clone https://gitlab.com/fdroid/fdroiddata.git fdroid:~$ cp fdroidserver/examples/config.yml fdroiddata/ fdroid:~$ sed -i "s@^[# ]*build_server_always.*@build_server_always: true@" fdroiddata/config.yml ``` -------------------------------- ### Install fdroidserver on Fedora/Archlinux with venv Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Use this method to install fdroidserver on Fedora or Archlinux, especially when newer packages are available. It ensures dependency resolution by installing in a virtual environment. ```bash python3 -m venv env source env/bin/activate pip install -e . ``` -------------------------------- ### Install fdroidserver from Debian Backports Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Installs fdroidserver from Debian's backports repository. Ensure backports are set up first, and replace 'bookworm' with your specific Debian release name. ```bash apt-get install -t bookworm-backports fdroidserver ``` -------------------------------- ### Install pidcat on Debian Source: https://f-droid.org/pl/docs/Getting_logcat_messages_after_crash Use apt-get to install pidcat on Debian systems for colored syntax and tab completion. ```bash apt-get install pidcat ``` -------------------------------- ### Install fdroidserver on WSL Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Installs fdroidserver on the Windows Subsystem for Linux (WSL) by adding the F-Droid PPA and updating package lists. ```bash sudo add-apt-repository ppa:fdroid/fdroidserver sudo apt-get update sudo apt-get install fdroidserver ``` -------------------------------- ### Install fdroidserver on Homebrew Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Installs fdroidserver using the Homebrew package manager on macOS or Linux. Refer to the Homebrew formula for more details. ```bash brew install fdroidserver ``` -------------------------------- ### Create SDK Platform Cache Archive Source: https://f-droid.org/pl/docs/Build_Server_Setup Manually create a tarball of an Android SDK platform for caching. This speeds up subsequent installations by avoiding re-downloads. ```bash cd /path/to/android-sdk/platforms tar czf android-19.tar.gz android-19 mv android-19.tar.gz /path/to/fdroidserver/buildserver/cache/platforms/ ``` -------------------------------- ### Add F-Droid PPA and Install fdroidserver on Ubuntu/Mint Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Adds the F-Droid PPA to your system and updates package lists to install a newer version of fdroidserver. This is recommended for Ubuntu and Mint users. ```bash sudo add-apt-repository ppa:fdroid/fdroidserver sudo apt-get update sudo apt-get install fdroidserver ``` -------------------------------- ### Get Help for fdroid update command Source: https://f-droid.org/pl/docs/Building_Applications Use the --help flag with any `fdroid` command to view available options and usage instructions. This is useful for understanding command-specific configurations and parameters. ```bash fdroid update --help ``` -------------------------------- ### Configure Vagrant VM Provider Source: https://f-droid.org/pl/docs/Build_Server_Setup Specify the virtual machine provider for Vagrant. Ensure libvirt is installed and configured on your host system. ```yaml vm_provider: libvirt ``` -------------------------------- ### Download and Verify F-Droid APK on Linux Source: https://f-droid.org/pl/docs/Verifying_Downloaded_APK Use these commands to download the APK and its signature, import the public key, and verify the signature. Ensure you have wget and GPG installed. ```bash # download files wget -q https://f-droid.org/F-Droid.apk.asc wget -q https://f-droid.org/F-Droid.apk # import public key gpg --keyserver keyserver.ubuntu.com --recv-key 37D2C98789D8311948394E3E41E7044E1DBA2E89 # check file gpg --verify F-Droid.apk.asc F-Droid.apk ``` -------------------------------- ### F-Droid App Metadata URL Example Source: https://f-droid.org/pl/docs/All_our_APIs Direct URL to an application's build metadata file in YAML format, accessible via GitLab's raw file access. ```URL https://gitlab.com/fdroid/fdroiddata/-/raw/master/metadata/org.fdroid.fdroid.yml ``` -------------------------------- ### F-Droid Repository Configuration Example Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo A basic configuration block for an F-Droid repository, defining the repository URL, name, icon, and description. Update 'repo_icon' and 'archive_icon' if you change the icon file name. ```yaml repo_url = "http://guardianproject.info/fdroid/repo" repo_name = "My Local Repo" repo_icon = "GP_Logo_hires.png" repo_description = "" Lokalne repozytorium testów Hans-Christoph Steiner . Jest to repozytorium aplikacji Guardian Project. " ``` -------------------------------- ### Configure Cygwin and Initialize Repository Source: https://f-droid.org/pl/docs/Installing_the_Server_and_Repo_Tools Sets up the Android SDK path and initializes the fdroidserver repository in a Cygwin environment. Note that keystore generation may fail initially. ```bash export ANDROID_HOME=/cygdrive/c/path/to/android-sdk fdroid init # wygenerowanie keystore nie powiedzie się ``` -------------------------------- ### Clone F-Droid Data Repository Source: https://f-droid.org/pl/docs/Building_Applications Clone the F-Droid data repository to start managing your application builds. This repository contains the necessary data structures and examples for configuring your build environment. ```bash git clone https://gitlab.com/fdroid/fdroiddata.git ``` -------------------------------- ### Import Application with License Source: https://f-droid.org/pl/docs/Importing_Applications Specify the project's license using the '--license' flag to pre-fill the metadata. ```bash fdroid import -l ``` -------------------------------- ### Prepare and Publish APKs Source: https://f-droid.org/pl/docs/Signing_Process Commands to prepare an unsigned APK, move it to the correct directory, and then publish and update the F-Droid repository. Ensure 'unsigned/' directory is created alongside 'metadata/' and 'repo/'. ```bash $ cd /path/to/repobasedir $ touch metadata/com.example.app.yml $ mkdir unsigned $ cp /path/to/app-release-unsigned.apk unsigned/com.example.app_1234.apk $ fdroid publish --verbose $ fdroid update --verbose $ fdroid deploy --verbose ``` -------------------------------- ### Initialize F-Droid Repository Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo Run this command in a new directory to generate a signing key and initialize your F-Droid repository. This key uniquely identifies your repository. ```bash fdroid init ``` -------------------------------- ### Build all available app versions Source: https://f-droid.org/pl/docs/Building_Applications When using a metadata file within the application's source code, this command builds every version of the app. ```bash fdroid build --all ``` -------------------------------- ### Import Application from Project URL Source: https://f-droid.org/pl/docs/Importing_Applications Import an application by providing its project URL. The command will fetch project information and clone the Git repository if found. Ensure the URL points to a supported format (GitLab, GitHub, Bitbucket, NotABug, or Git). ```bash fdroid import --url=http://address.of.project ``` -------------------------------- ### Initialize F-Droid Nightly Build Source: https://f-droid.org/pl/docs/Publishing_Nightly_Builds Initializes the F-Droid nightly build process using the specified keystore. ```bash fdroid nightly --keystore im.zom.messenger-debug.keystore ``` -------------------------------- ### F-Droid Package API Response Example Source: https://f-droid.org/pl/docs/All_our_APIs Example JSON response for the F-Droid package API, showing application version names and codes. ```JSON { "packageName": "org.fdroid.fdroid", "suggestedVersionCode": 1009000, "packages": [ { "versionName": "1.10-alpha0", "versionCode": 1010000 }, { "versionName": "1.9", "versionCode": 1009000 } ] } ``` -------------------------------- ### Import Application from Cloned Git Repository Source: https://f-droid.org/pl/docs/Importing_Applications Use this command after cloning a Git repository to initialize the fdroid project structure. Navigate into the cloned directory and run 'fdroid import'. ```bash git clone https://gitlab.com/fdroid/fdroidclient cd fdroidclient fdroid import ``` -------------------------------- ### Download SDK Platform Archive from Build Server Source: https://f-droid.org/pl/docs/Build_Server_Setup Retrieve a pre-created SDK platform archive from the build server VM. This is useful if you have already built the cache on the server. ```bash vagrant ssh -- -C 'tar -C ~/android-sdk/platforms czf android-19.tar.gz android-19' vagrant ssh -- -C 'cat ~/android-sdk/platforms/android-19.tar.gz' > /path/to/fdroidserver/buildserver/cache/platforms/android19.tar.gz ``` -------------------------------- ### Get App Information Source: https://f-droid.org/pl/docs/All_our_APIs Retrieves information about published and suggested versions of an application from the main repository. Archived apps are not included. ```APIDOC ## GET /api/v1/packages/{appId} ### Description Retrieves information about published and suggested versions of an application from the main repository. Archived apps are not included. ### Method GET ### Endpoint https://f-droid.org/api/v1/packages/{appId} ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application (e.g., org.fdroid.fdroid). ### Response #### Success Response (200) - **packageName** (string) - The package name of the application. - **suggestedVersionCode** (integer) - The suggested version code for the application. - **packages** (array) - A list of available versions. - **versionName** (string) - The name of the version. - **versionCode** (integer) - The version code. ``` -------------------------------- ### Configure Custom App Repositories in XML Source: https://f-droid.org/pl/docs/Whitelabel_Builds Define a custom set of application repositories by providing a `default_repos.xml` file. This file is an array of strings, with each repository defined by an 8-element set. ```xml Guardian Project https://guardianproject.info/fdroid/repo Oficjalne repozytorium aplikacji The Guardian Project. Aplikacje w tym repozytorium to oficjalne pliki binarne opracowane przez oryginalnych twórców aplikacji i podpisane tym samym kluczem, co pliki APK wydane w sklepie Google Play. 13 1 10 always 308205d8308203c0020900a397b4da7ecda034300d06092a864886f70d01010505003081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f301e170d3134303632363139333931385a170d3431313131303139333931385a3081ad310b30090603550406130255533111300f06035504080c084e657720596f726b3111300f06035504070c084e657720596f726b31143012060355040b0c0b4644726f6964205265706f31193017060355040a0c10477561726469616e2050726f6a656374311d301b06035504030c14677561726469616e70726f6a6563742e696e666f3128302606092a864886f70d0109011619726f6f7440677561726469616e70726f6a6563742e696e666f30820222300d06092a864886f70d01010105000382020f003082020a0282020100b3cd79121b9b883843be3c4482e320809106b0a23755f1dd3c7f46f7d315d7bb2e943486d61fc7c811b9294dcc6b5baac4340f8db2b0d5e14749e7f35e1fc211fdbc1071b38b4753db201c314811bef885bd8921ad86facd6cc3b8f74d30a0b6e2e6e576f906e9581ef23d9c03e926e06d1f033f28bd1e21cfa6a0e3ff5c9d8246cf108d82b488b9fdd55d7de7ebb6a7f64b19e0d6b2ab1380a6f9d42361770d1956701a7f80e2de568acd0bb4527324b1e0973e89595d91c8cc102d9248525ae092e2c9b69f7414f724195b81427f28b1d3d09a51acfe354387915fd9521e8c890c125fc41a12bf34d2a1b304067ab7251e0e9ef41833ce109e76963b0b256395b16b886bca21b831f1408f836146019e7908829e716e72b81006610a2af08301de5d067c9e114a1e5759db8a6be6a3cc2806bcfe6fafd41b5bc9ddddb3dc33d6f605b1ca7d8a9e0ecdd6390d38906649e68a90a717bea80fa220170eea0c86fc78a7e10dac7b74b8e62045a3ecca54e035281fdc9fe5920a855fde3c0be522e3aef0c087524f13d973dff3768158b01a5800a060c06b451ec98d627dd052eda804d0556f60dbc490d94e6e9dea62ffcafb5beffbd9fc38fb2f0d7050004fe56b4dda0a27bc47554e1e0a7d764e17622e71f83a475db286bc7862deee1327e2028955d978272ea76bf0b88e70a18621aba59ff0c5993ef5f0e5d6b6b98e68b70203010001300d06092a864886f70d0101050500038202010079c79c8ef408a20d243d8bd8249fb9a48350dc19663b5e0fce67a8dbcb7de296c5ae7bbf72e98a2020fb78f2db29b54b0e24b181aa1c1d333cc0303685d6120b03216a913f96b96eb838f9bff125306ae3120af838c9fc07ebb5100125436bd24ec6d994d0bff5d065221871f8410daf536766757239bf594e61c5432c9817281b985263bada8381292e543a49814061ae11c92a316e7dc100327b59e3da90302c5ada68c6a50201bda1fcce800b53f381059665dbabeeb0b50eb22b2d7d2d9b0aa7488ca70e67ac6c518adb8e78454a466501e89d81a45bf1ebc350896f2c3ae4b6679ecfbf9d32960d4f5b493125c7876ef36158562371193f600bc511000a67bdb7c664d018f99d9e589868d103d7e0994f166b2ba18ff7e67d8c4da749e44dfae1d930ae5397083a51675c409049dfb626a96246c0015ca696e94ebb767a20147834bf78b07fece3f0872b057c1c519ff882501995237d8206b0b3832f78753ebd8dcbd1d3d9f5ba733538113af6b407d960ec4353c50eb38ab29888238da843cd404ed8f4952f59e4bbc0035fc77a54846a9d419179c46af1b4a3b7fc98e4d312aaa29b9b7d79e739703dc0fa41c7280d5587709277ffa11c3620f5fba985b82c238ba19b17ebd027af9424be0941719919f620dd3bb3c3f11638363708aa11f858e153cf3a69bce69978b90e4a273836100aa1e617ba455cd00426847f ``` -------------------------------- ### Initialize F-Droid Repository Directory Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo Creates the directory structure for the F-Droid repository and sets ownership to the current user. Initializes the repository using 'fdroid init'. ```bash sudo mkdir /usr/share/nginx/www/fdroid sudo chown -R $USER /usr/share/nginx/www/fdroid cd /usr/share/nginx/www/fdroid fdroid init ``` -------------------------------- ### Build a single version of an app Source: https://f-droid.org/pl/docs/Building_Applications Use this command to build a specific version of a single application. The output files will be placed in the `unsigned` directory. ```bash fdroid build org.fdroid.fdroid:16 ``` -------------------------------- ### Get App Package Information Source: https://f-droid.org/pl/docs/All_our_APIs Retrieve details about published and suggested versions of an application from the main repository. Archived apps are not available via this API. ```HTTP GET https://f-droid.org/api/v1/packages/org.fdroid.fdroid HTTP/1.1 ``` -------------------------------- ### Import Application with Categories Source: https://f-droid.org/pl/docs/Importing_Applications Pre-fill the application's categories during import by providing a comma-separated list using the '--categories' flag. ```bash fdroid import -c ``` -------------------------------- ### Run F-Droid Build Command Source: https://f-droid.org/pl/docs/Build_Server_Setup Use this command to build the latest version of F-Droid from its git checkout. Ensure you have installed and configured the fdroidserver tools first. ```bash fdroid:~/fdroidserver$ cd ~/fdroiddata fdroid:~/fdroiddata$ ~/fdroidserver/fdroid build org.fdroid.fdroid -l --server ``` -------------------------------- ### Configure VM CPU for Nested KVM Source: https://f-droid.org/pl/docs/Build_Server_Setup Modify the libvirt VM configuration file to pass the required CPU features for nested virtualization. This example requires the 'vmx' feature. ```xml SandyBridge Intel ``` -------------------------------- ### Verify JAR with Index Key Source: https://f-droid.org/pl/docs/Release_Channels_and_Signing_Keys Downloads the index.jar, extracts its certificate, imports it into a keystore, and verifies the JAR signature. ```bash wget https://f-droid.org/repo/index.jar unzip -p index.jar META-INF/CIARANG.RSA | openssl pkcs7 -print_certs -inform DER -out index.cer keytool -import -noprompt -trustcacerts -alias index -storepass android -file index.cer -keystore index.jks jarsigner -keystore index.jks -storepass android -strict -verify admin@f-droid.org.jar ``` -------------------------------- ### Publish built application artifacts Source: https://f-droid.org/pl/docs/Building_Applications After a successful build, use this command to move the source archive and signed APK to the `repo` directory for publishing. Files in the `unsigned` directory are removed. ```bash fdroid publish ``` -------------------------------- ### Deploy F-Droid Repository Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo This command deploys the generated repository content to a web server. Ensure the `serverwebroot` is configured in your `config.yml` file. ```bash fdroid deploy ``` -------------------------------- ### Markdown Link with F-Droid Badge Source: https://f-droid.org/pl/docs/Badges This Markdown snippet allows you to create a link to your F-Droid application page, featuring the 'Get it on F-Droid' badge. Replace 'ID.TWOJEJ.APLIKACJI' with your app's ID. ```markdown [Pobierz z F-Droid](https://f-droid.org/packages/ID.TWOJEJ.APLIKACJI) ``` -------------------------------- ### HTML Link with F-Droid Badge Source: https://f-droid.org/pl/docs/Badges Use this HTML snippet to link to your application on F-Droid, displaying the 'Get it on F-Droid' badge. Adjust the 'YOUR.APP.ID' placeholder with your application's unique identifier. ```html Pobierz z F-Droid ``` -------------------------------- ### F-Droid Repository Entry Point URLs Source: https://f-droid.org/pl/docs/All_our_APIs URLs for the signed entry point files (JAR, JSON, and GPG signature) for the repository, which list available indexes and diff files. ```URL https://f-droid.org/repo/entry.jar ``` ```URL https://f-droid.org/repo/entry.json ``` ```URL https://f-droid.org/repo/entry.json.asc ``` -------------------------------- ### Configure QEMU/KVM Libvirt Ownership Source: https://f-droid.org/pl/docs/Build_Server_Setup Configure the QEMU libvirt user to always set ownership to 'libvirt.libvirt' for libvirt image files. This is the recommended setting for F-Droid.org. ```bash root:~# cat << EOF >> /etc/libvirt/qemu.conf user = "libvirt" group = "libvirt" dynamic_ownership = 1 EOF root:~# service libvirtd restart ``` -------------------------------- ### Upload Signed Source Package Source: https://f-droid.org/pl/docs/Release_Channels_and_Signing_Keys Use this command to upload a source package for release. Ensure your package is signed. ```shell python3 setup.py sdist upload --sign ``` -------------------------------- ### Add APKs and Update Repository Source: https://f-droid.org/pl/docs/Setup_an_F-Droid_App_Repo Copies APK files to the repository's 'repo' directory and then updates the repository metadata. Ensure your Android SDK is accessible or provide the path when prompted. ```bash cd /usr/share/nginx/www/fdroid cp /path/to/*.apk /usr/share/nginx/www/fdroid/repo/ fdroid update --create-metadata ``` -------------------------------- ### Verify JAR with Page Embedded Key Source: https://f-droid.org/pl/docs/Release_Channels_and_Signing_Keys Downloads the current page's certificate, imports it into a keystore, and verifies the JAR signature. ```bash wget -O - https://f-droid.org/docs/Release_Channels_and_Signing_Keys/ | openssl x509 -inform pem -outform der -out docs.der keytool -import -noprompt -trustcacerts -alias docs -storepass android -file docs.der -keystore docs.jks jarsigner -keystore docs.jks -storepass android -strict -verify admin@f-droid.org.jar ```