mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-15 11:40:30 +03:00
standardize naming in strings and comments on all caps APK
This commit is contained in:
parent
97d5933a05
commit
63be6f6347
47 changed files with 408 additions and 408 deletions
|
|
@ -659,7 +659,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
|
|||
|
||||
# expected to fail.
|
||||
# Signing will fail if not set by environnment vars (cf. p4a docs).
|
||||
# But the unsigned apk will be ok.
|
||||
# But the unsigned APK will be ok.
|
||||
p.returncode = 0
|
||||
|
||||
elif bmethod == 'gradle':
|
||||
|
|
@ -748,7 +748,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
|
|||
# really old path
|
||||
os.path.join(root_dir, 'build', 'apk'),
|
||||
]
|
||||
# If we build with gradle flavours with gradle plugin >= 3.0 the apk will be in
|
||||
# If we build with gradle flavours with gradle plugin >= 3.0 the APK will be in
|
||||
# a subdirectory corresponding to the flavour command used, but with different
|
||||
# capitalization.
|
||||
if flavours_cmd:
|
||||
|
|
@ -790,10 +790,10 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
|
|||
raise BuildException("APK is debuggable")
|
||||
|
||||
# By way of a sanity check, make sure the version and version
|
||||
# code in our new apk match what we expect...
|
||||
# code in our new APK match what we expect...
|
||||
logging.debug("Checking " + src)
|
||||
if not os.path.exists(src):
|
||||
raise BuildException("Unsigned apk is not at expected location of " + src)
|
||||
raise BuildException("Unsigned APK is not at expected location of " + src)
|
||||
|
||||
if common.get_file_extension(src) == 'apk':
|
||||
vercode, version = get_metadata_from_apk(app, build, src)
|
||||
|
|
@ -807,7 +807,7 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
|
|||
if scanner.scan_binary(src):
|
||||
raise BuildException("Found blacklisted packages in final apk!")
|
||||
|
||||
# Copy the unsigned apk to our destination directory for further
|
||||
# Copy the unsigned APK to our destination directory for further
|
||||
# processing (by publish.py)...
|
||||
dest = os.path.join(output_dir, common.get_release_filename(app, build))
|
||||
shutil.copyfile(src, dest)
|
||||
|
|
@ -1111,7 +1111,7 @@ def main():
|
|||
|
||||
if app.Binaries is not None:
|
||||
# This is an app where we build from source, and
|
||||
# verify the apk contents against a developer's
|
||||
# verify the APK contents against a developer's
|
||||
# binary. We get that binary now, and save it
|
||||
# alongside our built one in the 'unsigend'
|
||||
# directory.
|
||||
|
|
|
|||
|
|
@ -2312,7 +2312,7 @@ class KnownApks:
|
|||
|
||||
def recordapk(self, apkName, app, default_date=None):
|
||||
'''
|
||||
Record an apk (if it's new, otherwise does nothing)
|
||||
Record an APK (if it's new, otherwise does nothing)
|
||||
Returns the date it was added as a datetime instance
|
||||
'''
|
||||
if apkName not in self.apks:
|
||||
|
|
@ -2410,7 +2410,7 @@ def is_apk_and_debuggable(apkfile):
|
|||
|
||||
Parse only <application android:debuggable=""> from the APK.
|
||||
|
||||
:param apkfile: full path to the apk to check"""
|
||||
:param apkfile: full path to the APK to check"""
|
||||
|
||||
if get_file_extension(apkfile) != 'apk':
|
||||
return False
|
||||
|
|
@ -2968,7 +2968,7 @@ def metadata_find_developer_signing_files(appid, vercode):
|
|||
def apk_strip_v1_signatures(signed_apk, strip_manifest=False):
|
||||
"""Removes signatures from APK.
|
||||
|
||||
:param signed_apk: path to apk file.
|
||||
:param signed_apk: path to APK file.
|
||||
:param strip_manifest: when set to True also the manifest file will
|
||||
be removed from the APK.
|
||||
"""
|
||||
|
|
@ -3049,7 +3049,7 @@ def get_min_sdk_version(apk):
|
|||
"""
|
||||
This wraps the androguard function to always return and int and fall back to 1
|
||||
if we can't get a valid minsdk version
|
||||
:param apk: androguard apk object
|
||||
:param apk: androguard APK object
|
||||
:return: minsdk as int
|
||||
"""
|
||||
try:
|
||||
|
|
@ -3144,12 +3144,12 @@ def verify_apks(signed_apk, unsigned_apk, tmp_dir):
|
|||
|
||||
One of the inputs is signed, the other is unsigned. The signature metadata
|
||||
is transferred from the signed to the unsigned apk, and then jarsigner is
|
||||
used to verify that the signature from the signed apk is also valid for
|
||||
used to verify that the signature from the signed APK is also valid for
|
||||
the unsigned one. If the APK given as unsigned actually does have a
|
||||
signature, it will be stripped out and ignored.
|
||||
|
||||
:param signed_apk: Path to a signed apk file
|
||||
:param unsigned_apk: Path to an unsigned apk file expected to match it
|
||||
:param signed_apk: Path to a signed APK file
|
||||
:param unsigned_apk: Path to an unsigned APK file expected to match it
|
||||
:param tmp_dir: Path to directory for temporary files
|
||||
:returns: None if the verification is successful, otherwise a string
|
||||
describing what went wrong.
|
||||
|
|
@ -3312,7 +3312,7 @@ apk_badchars = re.compile('''[/ :;'"]''')
|
|||
def compare_apks(apk1, apk2, tmp_dir, log_dir=None):
|
||||
"""Compare two apks
|
||||
|
||||
Returns None if the apk content is the same (apart from the signing key),
|
||||
Returns None if the APK content is the same (apart from the signing key),
|
||||
otherwise a string describing what's different, or what went wrong when
|
||||
trying to do the comparison.
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -444,7 +444,7 @@ def make_v0(apps, apks, repodir, repodict, requestsdict, fdroid_signing_key_fing
|
|||
if app.RequiresRoot:
|
||||
addElement('requirements', 'root', doc, apel)
|
||||
|
||||
# Sort the apk list into version order, just so the web site
|
||||
# Sort the APK list into version order, just so the web site
|
||||
# doesn't have to do any work by default...
|
||||
apklist = sorted(apklist, key=lambda apk: apk['versionCode'], reverse=True)
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ def main():
|
|||
vercodes = common.read_pkg_args(options.appid, True)
|
||||
apks = {appid: None for appid in vercodes}
|
||||
|
||||
# Get the signed apk with the highest vercode
|
||||
# Get the signed APK with the highest vercode
|
||||
for apkfile in sorted(glob.glob(os.path.join(output_dir, '*.apk'))):
|
||||
|
||||
try:
|
||||
|
|
@ -85,7 +85,7 @@ def main():
|
|||
|
||||
for appid, apk in apks.items():
|
||||
if not apk:
|
||||
raise FDroidException(_("No signed apk available for %s") % appid)
|
||||
raise FDroidException(_("No signed APK available for %s") % appid)
|
||||
|
||||
else:
|
||||
|
||||
|
|
|
|||
|
|
@ -1442,14 +1442,14 @@ def scan_apk_androguard(apk, apkfile):
|
|||
else:
|
||||
if options.delete_unknown:
|
||||
if os.path.exists(apkfile):
|
||||
logging.error(_("Failed to get apk information, deleting {path}")
|
||||
logging.error(_("Failed to get APK information, deleting {path}")
|
||||
.format(path=apkfile))
|
||||
os.remove(apkfile)
|
||||
else:
|
||||
logging.error(_("Could not find {path} to remove it")
|
||||
.format(path=apkfile))
|
||||
else:
|
||||
logging.error(_("Failed to get apk information, skipping {path}")
|
||||
logging.error(_("Failed to get APK information, skipping {path}")
|
||||
.format(path=apkfile))
|
||||
raise BuildException(_("Invalid APK"))
|
||||
except (FileNotFoundError, zipfile.BadZipFile) as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue