1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-14 02:50:12 +01:00
Commit Graph

299 Commits

Author SHA1 Message Date
Hans-Christoph Steiner
6126b55136 rename server request from "delete" to "uninstall"
This matches the Android API's current Intent action for this, rather than
the deprecated one:

https://gitlab.com/fdroid/fdroidclient/blob/v0.101-alpha5/app/src/main/java/org/fdroid/fdroid/installer/DefaultInstallerActivity.java#L147
https://developer.android.com/reference/android/content/Intent.html#ACTION_UNINSTALL_PACKAGE
https://developer.android.com/reference/android/content/Intent.html#ACTION_DELETE
2016-08-24 23:05:34 +02:00
Hans-Christoph Steiner
a6a8d34528 sanitize mirror URLs to prevent path segments from being removed
urllib.parse.urljoin() will strip off the last path segment before joining
if that last path segment does not end with /.  That's a "feature" to make
it easy to replace file names.  Here it was stripping off the essential
'fdroid' segment, making URLs like:

https://foo.com/repo

when they should be

https://foo.com/fdroid/repo
2016-08-24 23:05:34 +02:00
Hans-Christoph Steiner
85632ba00e set up install/delete lists for "push" commands from server
It is now possible for the server operator to specify lists of apps that
must be installed or deleted on the client (aka "push installs).  If
the user has opted in, or the device is already setup to respond to
these requests, then fdroidclient will automatically install/delete
the packageNames listed.  This is protected by the same signing key
as the app index metadata.

It generates single XML elements with the data set in the attributes. This
keeps the XML compact and easily extensible, e.g. for adding versionCode,
signingKey, etc as attributes:

    <install packageName="com.fsck.k9"/>
    <install packageName="at.bitfire.davdroid"/>
    <delete packageName="com.facebook.orca"/>

Copyright: 2016 Blue Jay Wireless
Signed-off-by: Hans-Christoph Steiner <hans@eds.org>

closes #177
2016-08-16 21:02:15 +02:00
Hans-Christoph Steiner
911297272c Merge branch 'permission-parsing' into 'master'
Parse maxSdkVersion and -23 permission tags

Parse maxSdkVersion and uses-permission-sdk-23 tags and insert them into the index.

AndroidManifest:
```xml
    <uses-permission android:name="android.permission.READ_CALENDAR" />

    <uses-permission
        android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        android:maxSdkVersion="18" />

    <uses-permission-sdk-23 android:name="android.permission.ACCESS_FINE_LOCATION" />
```

new index format:
```xml
<package>
            <version>1.0</version>
            <versioncode>1</versioncode>
            <apkname>maxmin.apk</apkname>
            <hash type="sha256">526eb6d643050c3fae42fb6c001c704006046db52e98998b21f7646ecae3dae5
            </hash>
            <sig>893fc1f22301c902d05c938b29d21648</sig>
            <size>8681</size>
            <sdkver>14</sdkver>
            <targetSdkVersion>24</targetSdkVersion>
            <added>2016-08-01</added>
            <permissions>READ_EXTERNAL_STORAGE,READ_CALENDAR,WRITE_EXTERNAL_STORAGE</permissions>
                <uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
                    maxSdkVersion="18" />
                <uses-permission name="android.permission.READ_CALENDAR" />
                <uses-permission name="android.permission.READ_EXTERNAL_STORAGE" />
                <uses-permission-sdk-23 name="android.permission.ACCESS_FINE_LOCATION" />
</package>
```

old format:
```xml
<permissions>READ_CALENDAR,ACCESS_FINE_LOCATION,WRITE_EXTERNAL_STORAGE</permissions>
```

This generates both formats for backward compatibility with old clients.

Also increase version of index format.

This is a proposal for the issues discussed in https://gitlab.com/fdroid/fdroidclient/issues/704

@eighthave @mvdan 

See merge request !150
2016-08-09 15:33:19 +00:00
Dominik Schürmann
cb965dcb07 Parse maxSdkVersion and -23 permission tags
Parse maxSdkVersion and uses-permission-sdk-23
tags and insert them into the index, e.g.,
<package>
 <permissions>READ_EXTERNAL_STORAGE,READ_CALENDAR,WRITE_EXTERNAL_STORAGE</permissions>
  <uses-permission name="android.permission.WRITE_EXTERNAL_STORAGE"
   maxSdkVersion="18" />
  <uses-permission name="android.permission.READ_CALENDAR" />
  <uses-permission name="android.permission.READ_EXTERNAL_STORAGE" />
  <uses-permission-sdk-23 name="android.permission.ACCESS_FINE_LOCATION" />
</package>

Also increase version of index format
2016-08-09 10:14:57 +02:00
Ciaran Gultnieks
e99454868a Catch another case of invalid wiki page names 2016-08-01 12:25:22 +01:00
Ciaran Gultnieks
21404e8622 Merge branch 'use_date_from_apk_in_known_apks' into 'master'
Pass a date from APK to KnownApks.recordapk()

... if --use-date-from-apks option is used.

Essentially, it just expands influence of `--use-date-from-apks` option to `stats/known_apks.txt`.

See merge request !141
2016-07-13 11:43:33 +00:00
Hans-Christoph Steiner
2201df150f add SHA-256 hashes of each OBB file 2016-07-07 22:34:41 +02:00
Hans-Christoph Steiner
5074be224a support .obb files for Opaque Binary Blog APK Expansions
OBB files provide a mechanism to deliver large data blobs that do not need
to be part of the APK.  For example, a game's assets do not need to change
often, so they can be shipped as an OBB, then APK updates do not need to
include all those assets for each update.

https://developer.android.com/google/play/expansion-files.html
2016-07-07 22:34:41 +02:00
Hans-Christoph Steiner
d522bb7e17 handle APKs with filenames encoded with CP437
The ZIP format has no official encoding :-| so we have to do hacks.  The
zipfile devs couldn't even sort this out:
https://bugs.python.org/issue10614

closes #167
2016-06-27 20:30:32 +02:00
Hans-Christoph Steiner
d6c9a8466b properly close opened images
This stops these errors:

fdroid/fdroidserver/fdroidserver/update.py:744: ResourceWarning: unclosed
 file <_io.BufferedReader
 name='repo/icons-320/info.guardianproject.urzip.100.png'>

fdroid/fdroidserver/fdroidserver/update.py:721: DeprecationWarning: The
 'warn' function is deprecated, use 'warning' instead
2016-06-27 14:00:49 +02:00
Dominik Schürmann
51a6d1602f Make permission parsing more specific
Get name only and ignore maxSdkVersion

Fixes #188
2016-06-26 18:03:37 +02:00
Dmitriy Bogdanov
b7f28fa576 Pass default date to KnownApks.recordapk()
... if --use-date-from-apks option is used
2016-06-26 19:18:50 +04:00
Hans-Christoph Steiner
8e57f2737d invalidate apkcache if the metadata version is different
When the metadata changes, different things will be stored about each APK.
So invalidate the cached info parsed from APKs if the cache's metadata
version does not match the metadata version of the currently running tools.
2016-06-15 16:35:00 +02:00
Hans-Christoph Steiner
1b7a8f85fc parse targetSdkVersion from APKs
The default targetSdkVersion is minSdkVersion, according to the docs:
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#target

https://gitlab.com/fdroid/fdroidclient/issues/682
2016-06-14 11:43:07 +02:00
Hans-Christoph Steiner
032dbc3e8d official Android default minSdkVersion is 1 not 0
https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#min
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
1feccf9eb8 rename 'sdkversion' var to 'minSdkVersion' to avoid confusion
'sdkversion' is confusing when there is also 'targetSdkVersion' and
'maxSdkVersion'.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
0ae257db15 rename maxSdkVersion variables to match Android
Since this variable is already different than the XML name ('maxsdkver'),
this eliminates one more name for the same thing.
2016-06-14 10:06:02 +02:00
Hans-Christoph Steiner
afd528731a read/write F-Droid files always as UTF-8
This makes UTF-8 the sole supported encoding for F-Droid's files. This is
mostly codifying the already existing practice for config.py and index.xml.
The other files where always just ASCII before.

* config.py
* metadata/*.txt
* known_apks.txt
* categories.txt
* latestapps.txt
* latestapps.dat
* index.xml

Note: this does not change the read/write encoding of stats files.  That is
still ASCII.
2016-06-07 14:10:04 +02:00
Ciaran Gultnieks
401649e036 Add extra debug logging for move to/from archive 2016-05-29 15:36:58 +01:00
Dmitriy Bogdanov
3f75c95e5f Add an encoding parameter to open apkcache created with Py2 2016-04-12 12:42:41 +04:00
Daniel Martí
a1703f1204 update: fix encoding issues with the xml index 2016-03-11 13:27:00 +00:00
Daniel Martí
24266d48e1 update: get output bytes, not str, from keytool 2016-03-11 13:27:00 +00:00
Daniel Martí
63f8718cf5 Replace iterkeys() with keys() 2016-03-10 16:43:37 +00:00
Daniel Martí
8b3c27cb47 update: replace encode('hex') with hexlify 2016-03-10 16:43:37 +00:00
Daniel Martí
da258dad57 Replace md5 with hashlib.md5 2016-03-10 16:43:37 +00:00
Daniel Martí
d39bf37ce8 Port urllib and HTMLParser imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
b73cc8e0b3 Replace itervalues() with values() 2016-03-10 16:43:37 +00:00
Daniel Martí
920ae4692f Port all imports to python3 2016-03-10 16:43:37 +00:00
Daniel Martí
11b8b1ca4f update: replace ord() with bytearray 2016-03-10 16:43:37 +00:00
Daniel Martí
ee9a296b64 Make pre-commit hook pass after python3 switch 2016-03-10 16:43:37 +00:00
Daniel Martí
75419c1f04 Replace iteritems() with items() 2016-03-10 16:43:37 +00:00
Daniel Martí
99edd64372 Switch all headers to python3 2016-03-10 16:43:36 +00:00
Daniel Martí
bf32477433 Merge branch 'p1' into 'master'
Fix pubkey extraction on update

Replacement of !86.

Fix pubkey extraction in case of non-empty _JAVA_OPTIONS. Fixes #133.

I didn't actually run the test suite (it looks like there are some preparations to be done for that), but I checked the commands from `test_fdroid_popen_stderr_redirect` in ipython.

See merge request !103
2016-02-28 13:37:17 +00:00
Dmitriy Bogdanov
0fdeade4d4 Add an option to use dates from APK 2016-02-18 16:41:43 +04:00
Dmitriy Bogdanov
a8b1472a43 Fix update crash in case of unset dates in APK 2016-02-18 16:40:51 +04:00
Dmitriy Bogdanov
7fc55a3847 Fix pubkey extraction on update
Fix pubkey extraction in case of non-empty _JAVA_OPTIONS
2016-02-17 22:22:57 +04:00
Ciaran Gultnieks
8135760554 Change can't update category name - closes #80 2016-02-17 14:38:44 +00:00
Hans-Christoph Steiner
e0312897c7 make "Current Version Code" default to most recent APK
closes #36 https://gitlab.com/fdroid/fdroidserver/issues/36
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
3967a0068b added 'mirrors' option to config for giving official mirror URLs
serverwebroot has long supported uploading to multiple servers, this bit of
metadata communicates those official mirrors to the client so that it can
automatically do something useful with that information.

closes #14 https://gitlab.com/fdroid/fdroidserver/issues/14
2016-02-17 10:40:07 +01:00
Hans-Christoph Steiner
69c81c3817 use jarsigner and keytool from same JDK as is being set in JAVA7_HOME
Using the same JDK throughout should prevent weird bugs where a setup might
use Java8's jarsigner and Java7's keytool.  This also allows the user to
set java_paths and have jarsigner and keytool used from that specified JDK.

This incorporates almost all of the patch that is in the Debian package
that forces fdroidserver to use the default JDK on that Debian release.

closes #93 https://gitlab.com/fdroid/fdroidserver/issues/93
2016-02-11 21:17:23 +01:00
Dominik George
7f3434ea50
Add Author Name and Author Email fields. (Closes: #90) 2016-01-03 23:00:03 +01:00
NeroBurner
5ca182a20d except named exception handling 2015-12-29 20:09:27 +01:00
Daniel Martí
bf8518ee8f Rework build into a class
This simplifies usage, goes from

    build['flag']
to
    build.flag

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.

While at it, unify "build", "thisbuild", "info", "thisinfo", etc into
just "build".
2015-12-02 20:03:11 +01:00
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í
301302d76e update: remove icons when removing disabled builds
They were just left there forever.
2015-11-27 00:23:59 +01:00
Daniel Martí
47812ccc24 update: move apk icons to and from archive too
They all were stuck in repo/ for this reason. This resulted in apps that
were only in the archive to seem like they didn't have icons, when in
fact they did but were in the wrong dir.
2015-11-27 00:23:57 +01:00
Daniel Martí
95ad265836 update: lower apps without apks logs to debug
If you run 'fdroid update', 6k+ warning messages are output. This is
definitely wrong. They can still be shown if one enables -v.
2015-11-26 23:47:22 +01:00
Daniel Martí
ab667992c7 update: fix for 0fa6aac288
For some reason, my up to date pyflakes didn't catch this.
2015-10-24 20:13:49 +02:00
Daniel Martí
0fa6aac288 Remove densities getter 2015-10-24 16:34:55 +02:00