mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-10-06 17:31:07 +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
|
@ -1067,9 +1067,12 @@ def scan_apk(apk_file):
|
|||
else:
|
||||
scan_apk_aapt(apk, apk_file)
|
||||
|
||||
if not common.is_valid_java_package_name(apk['packageName']):
|
||||
if not common.is_valid_package_name(apk['packageName']):
|
||||
raise BuildException(_("{appid} from {path} is not a valid Java Package Name!")
|
||||
.format(appid=apk['packageName'], path=apk_file))
|
||||
elif not common.is_strict_application_id(apk['packageName']):
|
||||
logging.warning(_("{appid} from {path} is not a valid Java Package Name!")
|
||||
.format(appid=apk['packageName'], path=apk_file))
|
||||
|
||||
# Get the signature, or rather the signing key fingerprints
|
||||
logging.debug('Getting signature of {0}'.format(os.path.basename(apk_file)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue