April 27, 2011 at 2:26 pm #587
I did finally learn to use git to add applications to the repository. Here is how I did it.
1) Create an account at gitlab.com and set up git. I found a friendly how to about this on github.
Create an SSH key and upload it.
2) Got to https://gitlab.com/fdroid/fdroiddata and press “clone”. This creates a child repository where you can apply your changes.
3) Download your repository (~10mb). Open the Terminal to do so.
git clone email@example.com:YOUR_USERNAME/fdroiddata.git
4) Git should now download a folder which is named like your repository to your working directory. That’s the local copy you can work with. Change into that directory and go on with:
git remote add upstream https://gitlab.com/fdroid/fdroiddata.git
this creates a link to the official repository to sync with.
5) Create a file in metadata/ called package.id.txt; there’s a file called template in there for reference. Check that the app builds and that the update check works by running
fdroid build -v -t -l --no-tarball package.idand
fdroid checkupdates package.idrespectively. You can find more information about this in the manual.
6) When you created and changed all the files you wanted to, open the Terminal again and go to your fdroiddata directory. Then do the following
git add .
this tells git that all files in the directory should be watched for changes.
git commit -a
this adds your changes to your local repository
this sends the changes to your gitlab clone
7) Go back go your repository at gitlab.com and check the changes made. If they are okay, press “request merge” (button at the right) and write a meaningful summary of your changes.
You can check the status of your merge requests here
8) Next time you want to change some files, type
git pull --rebase upstream masterbefore you start working to download the latest version of the files.
Updated gitorious urls to the new gitlab urls –@krt
July 3, 2011 at 12:06 pm #720
- This topic was modified 6 years, 1 month ago by mjw.
- This topic was modified 4 years, 11 months ago by mjw.
- This topic was modified 4 years, 11 months ago by mjw.
- This topic was modified 3 years, 3 months ago by mvdan.
- This topic was modified 3 years, 3 months ago by krt.
- This topic was modified 2 years, 7 months ago by krt. Reason: update urls
thnx for this guide!
I think I understand everything about the metadata files except the Version Code one:
The above specifies to build version 0.12, which has a version code of 3.”
Can someone explain what version code is and how to get it?
eg: am trying to make a metadata file for this application: http://code.google.com/p/anstop/July 3, 2011 at 8:48 pm #724
The Version Code can be read from the AndroidManifest.xml file which should be found in the repository of the project. The file specifies details like the permissions a program needs and is needed for releasing the program in the Android Market.
The Version Code is just an integer that makes clear which version is the most recent one.July 4, 2011 at 11:42 am #726
thnx mjw for the quick response.
So I will attempt to contribute my first file soon..
I am trying now to see if I can manage to help on packaging applications for f-droid too.
If there is any other information about that, other than the README file, do tell.
thnx again!July 4, 2011 at 4:31 pm #727
I don’t think we need any special packaging. F-droid uses .apk files which are the standard way for distributing Android-applications.
If you manage to add all the necessary build-information, the scripts should be able to create .apk packages from the source code.
It’s always a great thing to have another helping hand for filling the repository and keeping it updated. Just ask as soon as new problems appear.
m.June 20, 2012 at 10:18 am #2326
I just updated the post to fix some errors and point to the new data repository. Let me know if something is still unclear.June 21, 2012 at 12:16 pm #2349
That’s great, thanks for updating. I made this post sticky.September 10, 2012 at 7:53 pm #3897
I am trying to sync my clone of the repo with ‘master’, but teh following fails:
liv@liv-laptop:~/Build/f-droid/fdroiddata$ git pull upstream master
fatal: ‘upstream’ does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Am I doing something wrong?September 10, 2012 at 9:20 pm #3903
Use the working with git thread on the development forum. We’ll keep this one short.
Make sure you have the right url in fdroiddata/.git/config . Not the git@git… ssh url.December 3, 2012 at 8:58 pm #5406
Is there a VM I can use to test and debug builds?September 4, 2014 at 8:11 pm #12384
Is there any Windows Guide?September 5, 2014 at 2:16 pm #12387
I don’t think so, but tipps recommended. Lot’s of software is packaged for windows, like Python, Git, Android-SDK, build automation tools etc., so it should be only a question of putting it all together. Or you could try cygwin…
Please note that this guide is quite old and references our old repo, we are now on gitlab, so please check https://gitlab.com/fdroid/fdroiddata/blob/master/CONTRIBUTING.md and post any issues you encounter.October 8, 2014 at 11:21 am #12732
@krt or any other mod,
Could you please update the OP with the new GitLab links?
At I replaced the link pointing here to one pointing to the CONTRIBUTING.md.
As I came here through that old wiki link I blindly followed this guide. Later, when I tried to create a merge request, I realized things had moved to GitLab and I had to repeat the process.October 11, 2014 at 4:35 pm #12754
I updated the links.November 15, 2014 at 10:10 pm #13386
Here are a few issues that I ran into. Hopefully listing these points will help other n00bs like myself to save some time:
0) Install jdk 8. I had jdk 6 installed, and the signing of the api by fdroid requires java 8 (Maybe java 7 is good enough — I didn’t verify).
4.1) You also need to clone the fdroidserver repo:
git clone https://gitlab.com/fdroid/fdroidserver.git
4.2) Copy the fdroidserver/examples/config.py to fdroiddata/config.py
4.3) In order to create a signed apk, you need to modify the following in fdroiddata/config.py:
4.4) If you’re on MacOS, it looks like this change is needed due to a different version of ’sed’ (not sure if there’s a more proper solution):
diff --git a/fdroidserver/common.py b/fdroidserver/common.py index 033cba8..1177a8f 100644 --- a/fdroidserver/common.py +++ b/fdroidserver/common.py @@ -917,7 +917,7 @@ def remove_debuggable_flags(root_dir): for root, dirs, files in os.walk(root_dir): if 'AndroidManifest.xml' in files: path = os.path.join(root, 'AndroidManifest.xml') - p = SilentPopen(['sed', '-i', 's/android:debuggable="[^"]*"//g', path]) + p = SilentPopen(['sed', '-i', '', 's/android:debuggable="[^"]*"//g', path]) if p.returncode != 0: raise BuildException("Failed to remove debuggable flags of %s" % path)
4.5) Add the path to fdroidserver to your PATH environment variable
5) The fdroid build command should be run from the fdroiddata directory. This command will create an unsigned apk.
5.5) To sign the apk:
fdroid publish -v package.id
- This reply was modified 2 years, 6 months ago by caarmen. Reason: Formatting changes
The forum ‘General’ is closed to new topics and replies.