mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
install: add --no-privacy-mode as an argument
This commit is contained in:
parent
4d22a7f67f
commit
27e3b5066a
1 changed files with 10 additions and 5 deletions
|
|
@ -27,7 +27,7 @@ import tty
|
||||||
|
|
||||||
import defusedxml.ElementTree as XMLElementTree
|
import defusedxml.ElementTree as XMLElementTree
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser, BooleanOptionalAction
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from urllib.parse import urlencode, urlparse, urlunparse
|
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.
|
None for success or the error message.
|
||||||
|
|
||||||
"""
|
"""
|
||||||
if locale.getlocale()[0].split('_')[-1] in ('CN', 'HK', 'IR', 'TM'):
|
country_code = locale.getlocale()[0].split('_')[-1]
|
||||||
logging.warning(_('Privacy mode was enabled based on your locale.'))
|
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
|
privacy_mode = True
|
||||||
|
|
||||||
if privacy_mode or not (common.config and common.config.get('jarsigner')):
|
if privacy_mode or not (common.config and common.config.get('jarsigner')):
|
||||||
|
|
@ -303,8 +308,8 @@ def main():
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
"-p",
|
"-p",
|
||||||
"--privacy-mode",
|
"--privacy-mode",
|
||||||
action="store_true",
|
action=BooleanOptionalAction,
|
||||||
default=False,
|
default=None,
|
||||||
help=_("Download F-Droid.apk using mirrors that leak less to the network"),
|
help=_("Download F-Droid.apk using mirrors that leak less to the network"),
|
||||||
)
|
)
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue