1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-19 19:40:17 +02:00
Commit Graph

411 Commits

Author SHA1 Message Date
Michael Pöhn
6930edf889 sort index-v1; publish now creates and stores a list of signature fingerprints 2017-09-26 14:11:09 +02:00
Michael Pöhn
6a4a78429f add signer to index v1 2017-09-26 14:11:09 +02:00
Hans-Christoph Steiner
176f539647 allow spaces in filenames
This fixes all the bugs I could find that prevented fdroid from
handling files with spaces in them.  This is more important now that
fdroid supports random media files, and Repomaker
2017-09-19 20:13:36 +02:00
Hans-Christoph Steiner
6c7b987239 fix string formats that are ambiguous for translators 2017-09-16 13:19:38 +02:00
Hans-Christoph Steiner
53e4ec47a7 English source string corrections
From @monolifed <monolifed@gmail.com>
2017-09-16 13:19:38 +02:00
Hans-Christoph Steiner
278d67d960 implement gettext localization
This allows all the text to be localized via Weblate.  This is a quick
overview of all the strings, but there are certainly some that were left
out.

closes #342
2017-09-15 11:39:00 +02:00
Hans-Christoph Steiner
7bd171480f update: test metadata creation using internal and external templates
There is a hardcoded template in update.py, and there is also the
possibility for the user to create a template.yml.  This tests both of them
and cleans up the related code a bit.

#352 !310
2017-07-26 15:34:13 -07:00
Izzy
cbd420e490 preserve order and formatting on creating Metadata from Yaml template (closes #352) 2017-07-26 09:22:01 +02:00
Izzy
54a646bd93 have fallback for XML icons also consider res/mipmap*
several apps (e.g.
[FastHub](http://apt.qumran.org/fdroid/index/apk/com.fastaccess.github)
and [Monety](http://apt.qumran.org/fdroid/index/apk/open.currency)) have
their ic_launcher.png files not in res/drawable*dpi/, but in
res/mipmap*/ -- so the regex has been adjusted by this patch.

Additionally: if the only icon for a given resolution was an XML without
existing fallback-PNG, it should be considered "non existent" (ie.
"empty_density").
2017-07-17 00:54:33 +02:00
Izzy
dd69490821 --create-metadata: only set default empty values if not using template.py 2017-07-08 14:41:19 +02:00
Izzy
4d375a585d enable user to have presets for metadata by using a template.yml (see #345) 2017-07-08 14:21:49 +02:00
Izzy
732de91aa7 make --create-metadata use yaml.dump instead of ruamel (solves #345) 2017-07-08 14:07:11 +02:00
Izzy
8ea06ce83e --create-metadata: make sure apk[name] is not empty 2017-07-07 00:18:08 +02:00
Hans-Christoph Steiner
3e6b7062b6 update: remove ruamel requirement, and improve '--create-metadata'
If ruamel.yaml is not available, this will fallback to using PyYAML. This
also adds some blank fields to the newly created template to make it easy
for human editors to fill in.

closes #343
2017-07-06 13:31:42 +02:00
Hans-Christoph Steiner
4a15208b84 update: update openssl KnownVuln scan to handle all recent versions
Thanks to @bubu for reporting!
2017-07-06 13:31:42 +02:00
Hans-Christoph Steiner
10a607ede3 update: find PNG when recommended icon is an XML file
APKs can now use XML files for vector graphics like the app icon. `aapt`
returns the XML file by default, and perhaps also androguard.  This
checks if the icon is an XML file, and if so, it tries to find a PNG in
the APK with the same name and density to use instead

closes #322

This should also ultimately make the XML file available as an icon source
as well fdroidclient#1091
2017-07-06 12:25:48 +02:00
Hans-Christoph Steiner
c14cbeb0a5 update: normalize var name to apkzip 2017-07-06 12:25:48 +02:00
Hans-Christoph Steiner
df99c85ca6 support manually adding per-build antiFeatures in metadata
For cases like the OpenVPN vuln that was recently announced, it is useful
for fdroiddata maintainers to be able to mark builds that have known
vulnerabilities.
2017-07-06 12:25:48 +02:00
Izzy
2c8bacde42 create_metadata: do not skip APK files having no name 2017-07-05 20:31:21 +00:00
Hans-Christoph Steiner
3cb936ae92 fdroid update --create-metadata now outputs YAML format
As part of the push towards using YAML as the main metadata format, this
makes the blank template be a .yml file.
2017-07-04 11:51:08 +02:00
Torsten Grote
0bbe0c5db0
Break up the scan_apk() method and rename it to process_apk() 2017-07-03 18:37:01 -03:00
Hans-Christoph Steiner
56ee5de2bd update: invalidate cache if allow_disabled_algorithms changes
Since the cache contains implicitly the result of the jarsigner verify,
if the allow_disabled_algorithms config changes, then the apkcache is
invalid.
2017-07-03 10:02:51 +02:00
Hans-Christoph Steiner
e75cabfe77 update: write cache file if anything has changed it
This fixes a bug introduced in 04db6870 where cachechanged for scan_apks()
was set only by the last call to scan_apk().
2017-07-03 10:02:51 +02:00
Hans-Christoph Steiner
39fd664778 update: create 'archive/' if needed when moving APKs
Normally, just 'repo/' is created by default, e.g. `fdroid init`. If APKs
are dumped into 'repo/', then have invalid signatures, then they'll be
automatically moved to 'archive/', which therefore needs to exist.
2017-07-03 10:02:51 +02:00
Hans-Christoph Steiner
746d4bd4cf update: allow_disabled_algorithms option to keep MD5 sigs in repo
The new policy is to move APKs with invalid signatures to the archive,
and only add those APKs to the archive's index if they have valid MD5
signatures.

closes #323
closes #292
2017-07-03 10:02:51 +02:00
Hans-Christoph Steiner
b7260ea854 update: allow deprecated signatures only in the archive
In April 2017, Oracle's jarsigner and Google's apksigner both switched to
considering any APK signature that uses MD5 as unsigned.  Any old build
is likely to have a MD5 signature.  This sets up the archive as the only
place where these "disabled algorithms" are allowed in the repo, and
marks any APK signed by a "disabled algorithm" as having a "known
vulnerability"

This also now automatically moves APKs with invalid signatures to the
archive section.

#323
2017-06-28 23:53:42 +02:00
Hans-Christoph Steiner
0047f19d56 update: move duplicated code into move_apk_between_sections() 2017-06-28 23:53:42 +02:00
Hans-Christoph Steiner
e1492148fa fix "Archive Policy:" field, APKs can move in/out of archive
The original logic was checking keepversions against the len() of ALL the
APKs in the repo/archive.  The correct thing is to check against the
number of APKs available for the given packageName/appid.

closes #166
2017-06-28 23:53:42 +02:00
Hans-Christoph Steiner
9886e539d3 scan APKs for signs of "Master Key" exploit
This exploit is old, and was fixed in 4.4.  But it was easy to exploit,
so it is still worth scanning for it.  It is also easy to scan for, since
valid APKs should not have files with duplicate names.  In theory, this
could look for duplicate file names for any file, but this limits the
false positives by only checking names of files related to executing code.

fdroidclient#40
2017-06-28 23:14:57 +02:00
Hans-Christoph Steiner
5fd014a852 update: move btlog import since btlog.py requires python3-git
To keep the dependencies limited to where they are needed.
2017-06-28 23:14:57 +02:00
Hans-Christoph Steiner
d06f05e9c8 update: do not crash on screenshots without texts/graphics
`fdroid update` crashed for apps that only had screenshots but no graphics
or localized texts because destdir was not being set in that case.  This
fixes that and adds a test case.

closes #320
!286
2017-06-12 21:25:54 +02:00
Rui Zhao (renyuneyun)
b5b463a5ec fix !320 due to unintentionally reusing the same variable name 2017-06-12 18:09:00 +01:00
Hans-Christoph Steiner
37c3bf304c support fdroid names in filenames for localized texts
* "full description" is just "description"
* "short description" is "summary"
* "title" is "name"
2017-06-07 22:10:25 +02:00
Hans-Christoph Steiner
43d3a9c7a5 support fastlane simplified metadata dir
Running `fastlane init` gave me a much simpler directory layout, which
turns out to be the same as what is used for fdroiddata.
2017-06-07 22:10:25 +02:00
Hans-Christoph Steiner
8776221988 check signature and OpenSSL after APK has proven valid
If working with a random grabbag of APKs, there can be all sorts of
issues like corrupt entries in the ZIP, bad signatures, signatures that
are invalid since they use MD5, etc.  Moving these two checks later means
that the APKs can be renamed still.

This does change how common.getsig() works.  For years, it returned
None if the signature check failed.  Now that I've started working
with giant APK collections gathered from the wild, I can see that
`fdroid update` needs to be able to first index what's there, then
make decisions based on that information.  So that means separating
the getsig() fingerprint fetching from the APK signature verification.

This is not hugely security sensitive, since the APKs still have to
get past the Android checks, e.g. update signature checks.  Plus the
APK hash is already included in the signed index.
2017-06-01 17:45:29 +02:00
Hans-Christoph Steiner
372c8b418d strip file extension from generated name for non-APKs
With a generic file, the file name is the only guaranteed name metadata
field.  So if the name is not specified in the metadata, then the name
is set to the filename.  This changes that so that the file extension is
stripped from that generated name.
2017-06-01 16:01:05 +02:00
Hans-Christoph Steiner
9471bf2731 regexs for getting packageName and versionCode from filenames
This is useful for parsing APK files, which can include packageName,
versionCode, and optionally 7 char signing key ID (i.e. <sig>).
This also can set the packageName and versionCoe for non APK files, so
that it is easy to assign them to metadata files, and to allow for
upgrades by setting the versionCode in the filename.
2017-06-01 16:01:05 +02:00
Hans-Christoph Steiner
4053f03d77 update: add --rename-apks to force APK filenames to fdroid standard
uses the standard package.name_123.apk.  If that exists, it appends the
shasum.  If that exists, then its a duplicate, so its deleted. This should
help @SergeWinters with his 12,000 APKs.
2017-06-01 16:01:05 +02:00
Hans-Christoph Steiner
9ad457c16f fix pylink 'dict' has no member 'keystore' 2017-05-23 22:34:16 +02:00
Hans-Christoph Steiner
17cd07f1a7 fix pylint unused-argument 2017-05-23 22:34:16 +02:00
Torsten Grote
1fcd8e63a3
Replace sys.exit() in non-main functions by exceptions
Also move all exceptions into one module
2017-05-22 16:51:11 -03:00
Hans-Christoph Steiner
0345d2c79f update: find aapt when it is not in the PATH
This is some very messy logic built up since 2010.  This will all go away
once we have a python3 version of androguard available.

The removed imports and `dir(APK)` is to silence pyflakes

closes #303
2017-05-18 17:21:05 +02:00
Hans-Christoph Steiner
c348186ad6 update: fix fastlane scraping, it uses a subdir called 'images'
https://commons.wikimedia.org/wiki/File:GetChromium_FeatureGraphic_1024x500.png
2017-05-18 16:13:17 +02:00
Hans-Christoph Steiner
a17b95a860 update: improved logging
the aapt warnings were very verbose, and the other now includes the
file name type for screenshots, rather than the filename twice.
2017-05-18 16:13:17 +02:00
Hans-Christoph Steiner
5d705452f5 update: allow repo files to use _ in the file names
_ is a valid character for Java package names, so it should also work in
the repo file naming scheme. This makes it so it only splits the file
name based on the last _.
2017-05-18 16:13:17 +02:00
thez3ro
06598ae406
use androguard if aapt isn't found 2017-05-04 23:35:17 +02:00
Hans-Christoph Steiner
cdef5bcd92 downcase all 'localized' key names to match the rest of index-v1
This is a little omission.  keys that are used in metadata/*.yml all start
with an UpperCase letter, but in fdroidserver, index-v1.json, and
fdroidclient, it is all camelCase with lowercase first letter. The keys
from the 'localized' section are currently never in metadata/*.yml, so
these keys never get downcase.  This change will break fdroidclient
versions that do not also have this change, but since we're in alpha, that
should be fine.

If support for a 'localized' section is added to metadata/*.yml, then the
keys there should probably be UpperCase CamelCase to match the other keys.
2017-04-27 21:12:49 +02:00
Michael Pöhn
5b7209d882 unified method for naming build output 2017-04-22 12:04:32 +02:00
Hans-Christoph Steiner
fd21d68bc1 update: fix glob to actually match all locales
glob != regexp, [A-Z-.@] means one of those chars is required in that
position, so the glob pattern was requiring a least 3 chars.  Locales are
usually just two lower case letters, e.g. vi, de, ar.
2017-04-19 10:05:24 +02:00
Hans-Christoph Steiner
18f949c62b include Author/Contact info from Triple-T Gradle Play Publisher
This is just the bare minimum, it adds it to the index, but AuthorPhone
and AuthorWebsite are not yet supported by fdroidclient.  AuthorName is.

#204
2017-04-19 10:05:24 +02:00