1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-19 05:10:10 +01:00
Commit Graph

734 Commits

Author SHA1 Message Date
Daniel Martí
ab614ab442 Rework app into a class
This simplifies usage, goes from

	app['Foo']
to
	app.Foo

Also makes static analyzers able to detect invalid attributes as the set
is now limited in the class definition.

As a bonus, setting of the default field values is now done in the
constructor, not separately and manually.
2015-11-28 17:11:05 +01:00
Daniel Martí
5e1b07dce3 import: don't crash due to missing id
Fixes #129
2015-11-18 15:33:30 -08:00
Daniel Martí
3a616e2d9f Don't crash if AM.xml has no application element 2015-11-16 07:21:19 -08:00
Daniel Martí
c97b0e7ed9 common: error if any glob paths are unused
Like rm=foo and foo doesn't exist.
2015-11-14 13:05:16 +01:00
Daniel Martí
66e82cb077 Bump build-tools to 23.0.2 2015-11-05 11:56:13 +01:00
Daniel Martí
a4d1fa22f7 Install Java 1.8 alongside 1.7 for retrolambda
Fixes #103.
2015-11-03 11:08:34 +01:00
Daniel Martí
c8627764e3 checkupdates: check packages in AM.xml files too 2015-11-01 12:35:36 +01:00
Daniel Martí
3ace102bd5 checkupdates: work around multiple package ids
If there are multiple package ids in a build.gradle file and the first
one we don't want, checkupdates would get stuck. Make it ignore any
package id that we don't want so that it can get past that.
2015-10-30 19:03:53 +01:00
Daniel Martí
37b13c37d5 Also fix local.prop files before subdir
If subdir=foo/bar and there is a foo/local.properties file, it would not
get treated.
2015-10-26 16:49:11 +01:00
Daniel Martí
9017328698 Add an extra strip() to work around tostring issue
In cases like this xml code:

	<string name="app_name">"OpenKeychain"</string>
	<!-- title -->
	<string name="title_encrypt_text">"Encrypt"</string>

tostring() returns trailing whitespaces (including newlines). Which
aren't removed until the very end, after we try to remove enclosing
quotes. So strip right after tostring() too, since we never really care
about whitespaces anyway.
2015-10-26 00:28:29 +01:00
Daniel Martí
6ea51abfaa common: Compile more regexes only once 2015-10-25 19:10:49 +01:00
Daniel Martí
2872027835 Also replace git@gitlab.com submodule urls 2015-10-24 19:42:40 +02:00
Daniel Martí
78a661fc7d Typo fix for 91daacb889 2015-10-24 18:37:57 +02:00
Daniel Martí
91daacb889 common: don't crash if an sdk binary is not found 2015-10-24 17:02:53 +02:00
Daniel Martí
48645072ee extension simplifications 2015-10-04 18:01:32 +02:00
Daniel Martí
1aa891c4fd Add basic yaml metadata writing 2015-10-04 07:55:42 -07:00
Daniel Martí
59f5d19dfe Rework path glob expansion
Slightly simplifies the whole thing and lets us map what each resulting path
comes from. This will be useful to fix #110 later on.
2015-10-03 16:52:23 -07:00
Daniel Martí
4ea5ce8889 checkupdates: Ignore xml tags in string content
This allows us to fetch strings like the following:

<string name="app_name">foo <xliff:g>bar</xliff:g></string>

Up until now, using .text would only return "foo ", but if we use .tostring()
with the text method, it converts everything into plain text for us resulting
in "foo bar".
2015-09-30 16:35:41 -07:00
Daniel Martí
79475d055f Fetch string contents in a safer way 2015-09-30 16:35:41 -07:00
Daniel Martí
cc017d70d2 Fix for bb2cbd527b 2015-09-29 20:39:36 -07:00
Daniel Martí
bb2cbd527b Increase wiki error detail length limit
8k is too small, e.g. when make -jN errors or when there are a lot of scanner
errors and warnings. 16k should be better. Also, use "[...]" to make it
obvious that the output is truncated.
2015-09-29 12:51:11 -07:00
Daniel Martí
27a5dc8429 checkupdates: ignore gradle comments 2015-09-23 18:52:59 -07:00
Daniel Martí
83daf71338 gradle: don't strip out comments
This was never intended. Comments can help sed usage, and can still be useful
in source tarballs.
2015-09-22 11:52:16 -07:00
NeroBurner
694a4ce7da Add asynchronous filereader, fix python3 lockups 2015-09-20 20:57:53 +02:00
Daniel Martí
055759cf76 Rewrite scanner logic
Initially, the scanner used libmagic which used magic numbers in the file's
content to detect what kind of file it appears to be. Since that library isn't
available on all systems, we added support for two other libraries, mimetypes
amongst them.

The issue with mimetypes is that it only uses the file's extension, not its
actual content. So this ends in variable behaviour depending on what system
you're using fdroidserver on. For example, an executable binary without
extension would be ignored if mimetypes was being used.

We now drop all libraries - mimetypes too as it depends on the system's
mime.types file - and instead check extensions ourselves. On top of that, do
a simple binary content check to find binary executables that don't have an
extension.

The new in-house code without any dependencies doesn't add any new checks, so
no builds should break. The current checks still work:

 % fdroid scanner app.openconnect:1029
[...]
Found executable binary at assets/raw/armeabi/curl
Found executable binary at assets/raw/mips/curl
Found executable binary at assets/raw/x86/curl
Found JAR file at lib/XposedBridgeApi-54.jar
Found JAR file at libs/acra-4.5.0.jar
Found JAR file at libs/openconnect-wrapper.jar
Found JAR file at libs/stoken-wrapper.jar
Found shared library at libs/armeabi/libopenconnect.so
Found shared library at libs/armeabi/libstoken.so
Found shared library at libs/mips/libopenconnect.so
Found shared library at libs/mips/libstoken.so
Found shared library at libs/x86/libopenconnect.so
Found shared library at libs/x86/libstoken.so
2015-09-13 22:17:37 -07:00
Daniel Martí
576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07:00
Daniel Martí
7a79b000bf Allow slashes in tags
The wikipedia app uses them, for example.
2015-09-11 23:17:36 -07:00
Daniel Martí
03deda914f checkupdates improvements for gradle projects
* Let the package name override the one found in AndroidManifest.xml
* Support the newer applicationId
2015-09-08 13:12:28 -07:00
Daniel Martí
41443edd55 Bump build-tools 2015-09-05 23:02:03 -04:00
Daniel Martí
91f36acaa6 Even examples/config.py with default_config 2015-09-01 15:30:41 -07:00
Hans-Christoph Steiner
325db90918 set "accepted formats" for metadata in config.py
For a bit repo like f-droid.org, it makes sense to standardize on a single
format for metadata files.  This adds support for enforcing a single data
format, or a reduced set of data formats.  So f-droid.org would run like
this if it changed to YAML:

  accepted_formats = ['txt', 'yaml']

Then once everything was converted to YAML, it could look like this:

  accepted_formats = ['yaml']
2015-09-01 11:53:37 +02:00
Daniel Martí
04e6f2ebfd Move requests code out of common.py, closes #114 2015-08-31 17:05:08 -07:00
Daniel Martí
120be4334d Move scan_source into scanner.py
Not really a common.py thing.
2015-08-28 19:20:39 -07:00
Daniel Martí
6fe8d96e85 Simplify some file logic with "with" 2015-08-28 18:37:23 -07:00
Daniel Martí
05316e3292 stats: write known apks in natural order
By using natural instead of alphabetical sorting, we support sorting by
vercodes properly and thus app versions show in the correct order.
2015-08-28 18:28:39 -07:00
Daniel Martí
f4cbb6b3f8 Simlify known_apks writing 2015-08-28 18:26:23 -07:00
Hans-Christoph Steiner
b5cbb4382f new config option: per-app repos to support nightly build repos
For devs that want to build and distribute nightly builds of their apps
using the fdroid tools.  The core idea here is to make the fdroidserver
tool suite the single set of tools for all types of builds and releases.
That will hopefully drive more free software developers to make f-droid.org
an core channel for official releases.
2015-08-25 16:55:52 +02:00
Daniel Martí
f44a1c89f1 config: bump default build_tools after update in BS 2015-08-20 09:48:12 -07:00
Daniel Martí
46b1f09de3 Only do the magic import/except dance once
No need to do it for every file, once per app is enough
2015-08-18 23:46:35 -07:00
Daniel Martí
c813ad0594 Fix type issue 2015-08-17 22:04:20 -07:00
Daniel Martí
6cc91e2ded Line numbers start at 1, not 0 2015-08-14 10:30:27 -07:00
Ciaran Gultnieks
47032cb4e9 Fix multiple errors in get_mime_type
Closes #111
2015-08-13 19:16:28 +02:00
Daniel Martí
bad611ce5a Properly default to NDK r10e 2015-08-05 10:33:42 -07:00
Hans-Christoph Steiner
f38619ef5f chmod keystore after checking whether it was created
On OSX, when Java is not installed, it'll fail to create the keystore, but
then give an error from chmod failing.  This changes things so that the
missing Java is reported instead.
2015-08-01 00:38:41 +02:00
Hans-Christoph Steiner
752b258ba7 get MIME types without strictly requiring python-magic
There are two forms of python-magic, one included in libmagic that is
default on Debian, and another Python wrapper for libmagic that is
called 'python-magic' on pypi.  Those both rely on the compiled binary
library libmagic.  For platforms without good package management, fallback
to using the built-in 'mimetypes' library if 'magic' is not available.

This supports OSX, Windows, and BSD.
2015-08-01 00:38:41 +02:00
Hans-Christoph Steiner
85febd40d1 use common.regsub_file() instead of Popen(sed)
Python libraries work better in Python than running external commands, and
it also makes the code much more portable.  For example, the GNU and BSD
sed commands have different, and sometimes conflicting, flags.

This also reworks the regexp patterns to be more tightly focused, and not
change the same variable name in comments or elsewhere.
2015-08-01 00:38:41 +02:00
Daniel Martí
b4d768b225 Merge branch 'some-compatibility-fixes' of https://gitlab.com/eighthave/fdroidserver 2015-07-27 10:41:23 -07:00
Hans-Christoph Steiner
f625005ec3 remove dependency on wget for 'build' and 'verify'
To make the core tools portable to platforms like Mac OS X and Windows,
remove the dependency on wget and instead use Python Requests, which
probably has better performance anyway.
2015-07-24 11:53:14 -07:00
Hans-Christoph Steiner
bd3ae88608 extend text char limits to match other app stores
We should be compatible with other apps stores unless there is a specific
reason not to be.

* Google Play, Amazon, and iTunes all have 4000 char descriptions

For the summary, we can just bump it up to the same as what Play has
* Google Play allows an 80 char "Short Description"
  https://support.google.com/googleplay/android-developer/answer/113469?hl=en
* Amazon allows a 1200 char "Short Description"
  https://developer.amazon.com/public/support/submitting-your-app/tech-docs/submitting-your-app#Add Metadata and Image Assets
2015-07-23 10:39:30 -07:00
أحمد المحمودي (Ahmed El-Mahmoudy)
44335b64be Add an option to disable repository refresh
This is useful for testing builds with no internet connection, and the
repositories were already fetched previously
2015-07-14 17:43:07 +02:00