mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-16 16:02:33 +03:00
add strict, tested validation of Android/F-Droid package names
Android has stricter rules than Java for Package Names, but anything the Python regex thinks is valid must be valid according to Java's rules too. https://developer.android.com/studio/build/application-id
This commit is contained in:
parent
3ab66efcfe
commit
9d12b1dc61
7 changed files with 329 additions and 14 deletions
|
@ -488,7 +488,13 @@ def check_for_unsupported_metadata_files(basedir=""):
|
|||
if not exists:
|
||||
print(_('"%s/" has no matching metadata file!') % f)
|
||||
return_value = True
|
||||
elif not os.path.splitext(f)[1][1:] in formats:
|
||||
elif os.path.splitext(f)[1][1:] in formats:
|
||||
packageName = os.path.splitext(os.path.basename(f))[0]
|
||||
if not common.is_valid_package_name(packageName):
|
||||
print('"' + packageName + '" is an invalid package name!\n'
|
||||
+ 'https://developer.android.com/studio/build/application-id')
|
||||
return_value = True
|
||||
else:
|
||||
print('"' + f.replace(basedir, '')
|
||||
+ '" is not a supported file format: (' + ','.join(formats) + ')')
|
||||
return_value = True
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue