Commit graph

71 commits

Author SHA1 Message Date
Hans-Christoph Steiner
8fc340aaca install: fix download dir when fetching from GitHub Releases 2024-11-26 15:31:47 +01:00
Hans-Christoph Steiner
d2cc020336 install: fix broken URL building logic for Maven Central
The append logic was wrong, so it was trying to download URLs like:
https://repo.maven.apache.org/maven2/org/fdroid/fdroid/F-Droid/maven-metadata.xml/org/fdroid/fdroid/F-Droid/1.20.0/F-Droid-1.20.0.apk

Which should be:
https://repo.maven.apache.org/maven2/org/fdroid/fdroid/F-Droid/1.20.0/F-Droid-1.20.0.apk

Can be manually tested using:
`test_download_fdroid_apk=1 python -m unittest -k test_download_fdroid_apk_from_maven`
2024-11-26 15:14:18 +01:00
Hans-Christoph Steiner
a2d27ba15e
install: remove forgotten print() 2024-11-26 11:17:46 +01:00
Hans-Christoph Steiner
290587f449 add ColorFormatter class for optional colorized log output 2024-11-19 13:04:23 +00:00
Hans-Christoph Steiner
05e091804d install: verify sig for all downloaded APKs if apksigner is installed 2024-11-08 17:12:42 +02:00
Hans-Christoph Steiner
addb7b9acc install: echo characters that the user inputs at the prompt 2024-11-08 17:12:42 +02:00
Hans-Christoph Steiner
b9b4ca9778 install: download any app from f-droid.org 2024-11-08 17:12:42 +02:00
Hans-Christoph Steiner
27e3b5066a install: add --no-privacy-mode as an argument 2024-11-01 00:34:03 +01:00
Hans-Christoph Steiner
4d22a7f67f install: Y/n prompt, --yes, --no controls downloading F-Droid.apk 2024-11-01 00:34:03 +01:00
Hans-Christoph Steiner
560472e4e5 install: download from GitHub Releases 2024-11-01 00:16:13 +01:00
Hans-Christoph Steiner
1eb6516f16 install: add IPNS download method 2024-11-01 00:09:58 +01:00
Hans-Christoph Steiner
3da48e64bc install: use Maven Central as additional source 2024-11-01 00:09:58 +01:00
Hans-Christoph Steiner
b77eba824b install: convert to common.get_config() 2024-11-01 00:09:54 +01:00
Hans-Christoph Steiner
3a3417f6f8 install: add --privacy-mode flag 2024-10-31 23:49:34 +01:00
Hans-Christoph Steiner
c7bc8d0fea install: function to fetch, verify and install the F-Droid.apk 2024-10-31 23:49:30 +01:00
Hans-Christoph Steiner
681d705da0 install: reliable algorithm for picking devices from adb output
Versions of this algorithm are used elsewhere:
* https://github.com/openatx/adbutils/blob/master/adbutils/_adb.py
2024-10-31 21:55:20 +01:00
Hans-Christoph Steiner
49dcc53076 install: download_fdroid_apk() to fetch the recommended initial APK 2024-10-31 21:54:47 +01:00
Hans-Christoph Steiner
56bed02a29 install: download_apk() fetchs APKs by appid based on the index 2024-10-31 21:54:45 +01:00
Hans-Christoph Steiner
18f3acc32e split out options from read_config()
There is no longer any reason for these to be intertwined.

This deliberately avoids touching some files as much as possible because
they are super tangled and due to be replaced.  Those files are:

* fdroidserver/build.py
* fdroidserver/update.py

# Conflicts:
#	tests/testcommon.py

# Conflicts:
#	fdroidserver/btlog.py
#	fdroidserver/import_subcommand.py
2024-05-08 16:26:46 +02:00
Hans-Christoph Steiner
617a9e75c7 convert install.py to black code format 2024-03-06 13:31:46 +00:00
Hans-Christoph Steiner
76d9eddb3a method to globally set logging to output nicely to the console
This will make all of the direct calls to logging level functions output
in a format that looks appropriate for the console. Previously, the default
output looked like it should be written to a log file.
2024-03-06 12:53:20 +00:00
Hans-Christoph Steiner
b92e280eab fix code format for new black rule 2023-03-20 14:47:48 +01:00
Felix C. Stegerman
3e557a1a8a
check for invalid appids passed to commands 2021-04-08 10:31:33 +02:00
Hans-Christoph Steiner
63be6f6347 standardize naming in strings and comments on all caps APK 2021-01-29 15:40:59 +01:00
Hans-Christoph Steiner
5e1377c77a standardize on "Application ID" in UI text 2020-10-01 23:01:55 +02:00
Hans-Christoph Steiner
6030445be0 logging.warn() was deprecated in Python 3.3, use logging.warning()
sed -i 's,logging\.warn(,logging.warning(,g' fdroid */*.*

https://docs.python.org/3.3/library/logging.html#logging.Logger.warning
2020-05-27 08:35:14 +02:00
Hans-Christoph Steiner
df563d339a
fix pep8 E741 ambiguous variable name 'l' 2020-05-14 12:11: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
fa0d618d2f rename 'app-id' to standard Android 'applicationId'
* https://developer.android.com/studio/build/application-id.html
* https://sites.google.com/a/android.com/tools/tech-docs/new-build-system/applicationid-vs-packagename

This only changes the term in the human texts, not var names or CLI flags.
2017-09-15 11:41:51 +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
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
6c2cf2ccdd convert internal dict keys to match fdroidclient's Apk class
This syncs up the field names between the fdroiddata .yml files, the keys
used in the implementation in fdroidserver, the index data format, and the
final data structures in fdroidclient.  This makes it easier for devs to
follow, and makes the Jackson parsing library automatically handle
converting the data from the index file to Java instances.

This bumps the metadata version since the apkcache will have to be
discarded.

Here are the name changes:
* apkname --> apkName
* id --> packageName
* sha256 --> hash
* version --> versionName
* versioncode --> versionCode

tests/repo/index.xml was changed only to bump the metadata version
from 17 to 18.
2017-03-17 13:55:40 +01:00
Hans-Christoph Steiner
bc27dee950 fdroid publish now includes OTA ZIPs and related source
This adds support for publishing ZIP files which were built with
`fdroid build`.  This is for "Over-The-Air" (OTA) update ZIP files for
flashing to ROMs.  The first example of this is the Privileged Extension,
which must be installed by flashing an OTA ZIP on Android > 5.0.

!181
https://gitlab.com/fdroid/privileged-extension/issues/9
https://gitlab.com/fdroid/privileged-extension/issues/10
https://gitlab.com/fdroid/fdroiddata/merge_requests/1804

Also, "if app.Binaries:" is the same as "if app.Binaries is not None:", but
is the standard Python style.
2017-01-09 11:32:52 +01:00
Daniel Martí
82b1d7ad14 all: make newer pycodestyle happy
Apparently the "two empty lines" rule is now stricter.
2016-11-15 20:55:06 +00:00
Daniel Martí
920ae4692f Port all imports to python3 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í
0d758daa22 install: filter out log messages better 2015-11-11 13:09:29 +01:00
Daniel Martí
576da1d048 all: deduplicate -v/-q setup 2015-09-11 23:42:50 -07:00
nero-tux
d23ecf1b35 replace deprecated optparse with argparse
following guidelines from:
https://docs.python.org/2/library/argparse.html#upgrading-optparse-code
except, still using option = parse.parse_args() instead of args = ...

- using the following script in folder fdroidserver:
	for i in *.py; do
		sed -i -e 's/optparse/argparse/' \
			-e 's/OptionParser/ArgumentParser/' \
			-e 's/OptionError/ArgumentError/' \
			-e 's/add_option/add_argument/' \
			-e 's/(options, args) = parser/options = parser/' \
			-e 's/options, args = parser/options = parser/' \
			-e 's/Usage: %prog/%(prog)s/' $i;
	done
- use ArgumentParser argument to replace (option, args) = parser.parse()
  call
- use parser.error(msg) instead of raise ArgumentException as suggested
  in https://docs.python.org/2/library/argparse.html#exiting-methods
- in fdroid catch ArgumentError instead of OptionError
2015-09-06 10:34:50 +02:00
Hans-Christoph Steiner
fa1cc48d57 run all SDK tools commands using SdkToolsPopen 2014-12-14 13:25:20 +01:00
Daniel Martí
2116dee6d2 install: don't error if there are bin apks in repo/ 2014-08-10 01:09:44 +02:00
Daniel Martí
ff06694adc Don't use generic Exception raises
That hides bugs, since all exceptions (including bugs that cause raises that
weren't our doing) fall under the "Exception" except
2014-07-07 15:41:50 +02:00
Daniel Martí
a8d4c8705f Also use adb via a full path 2014-07-03 18:21:33 +02:00
Daniel Martí
8888962ace Rename PopenResult.stdout to output since it also contains stderr 2014-07-01 18:04:41 +02:00
Daniel Martí
0c8512ca26 Install and lint were missing -q 2014-06-12 21:48:45 +02:00
Hans-Christoph Steiner
aa5f317c26 fix PEP8 "W391 blank line at end of file" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
3f4f7a544b fix PEP8 "E302 expected 2 blank lines, found 1" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
7e17fafc14 fix PEP8 "E225 missing whitespace around operator" 2014-05-06 11:45:03 -04:00
Hans-Christoph Steiner
62204d1fe5 fix PEP8 "E202 whitespace before ']' or '}'" 2014-05-06 11:45:02 -04:00