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

install: add --no-privacy-mode as an argument

This commit is contained in:
Hans-Christoph Steiner 2024-10-22 19:21:11 +02:00
parent 4d22a7f67f
commit 27e3b5066a

View File

@ -27,7 +27,7 @@ import tty
import defusedxml.ElementTree as XMLElementTree
from argparse import ArgumentParser
from argparse import ArgumentParser, BooleanOptionalAction
from pathlib import Path
from urllib.parse import urlencode, urlparse, urlunparse
@ -166,8 +166,13 @@ def install_fdroid_apk(privacy_mode=False):
None for success or the error message.
"""
if locale.getlocale()[0].split('_')[-1] in ('CN', 'HK', 'IR', 'TM'):
logging.warning(_('Privacy mode was enabled based on your locale.'))
country_code = locale.getlocale()[0].split('_')[-1]
if privacy_mode is None and country_code in ('CN', 'HK', 'IR', 'TM'):
logging.warning(
_('Privacy mode was enabled based on your locale ({country_code}).').format(
country_code=country_code
)
)
privacy_mode = True
if privacy_mode or not (common.config and common.config.get('jarsigner')):
@ -303,8 +308,8 @@ def main():
parser.add_argument(
"-p",
"--privacy-mode",
action="store_true",
default=False,
action=BooleanOptionalAction,
default=None,
help=_("Download F-Droid.apk using mirrors that leak less to the network"),
)
parser.add_argument(