Draft: index: Ignore APKs with duplicate permissions
This change makes it more obvious when indexing fails for whatever reason, so the failing APK is mentioned just before the stacktrace:
2025-08-18 03:27:34,098 ERROR: Error processing sadLogic.HomeCentral_8.apk 2025-08-18 03:27:34,099 CRITICAL: Unknown exception found! Traceback (most recent call last): File "/home/vagrant/fdroidserver/fdroid", line 22, in fdroidserver.main.main() File "/home/vagrant/fdroidserver/fdroidserver/main.py", line 222, in main raise e File "/home/vagrant/fdroidserver/fdroidserver/main.py", line 203, in main mod.main() File "/home/vagrant/fdroidserver/fdroidserver/update.py", line 2844, in main fdroidserver.index.make(repoapps, apks, repodirs[0], False) File "/home/vagrant/fdroidserver/fdroidserver/index.py", line 138, in make make_v0(sortedapps, apks, repodir, repodict, requestsdict, signer_fingerprints) File "/home/vagrant/fdroidserver/fdroidserver/index.py", line 1294, in make_v0 sorted_permissions = sorted(apk['uses-permission']) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: '<' not supported between instances of 'NoneType' and 'int'
Additionally, it ignores APKs that have the same permission twice but once without a maxSdkVersion, e.g.
['android.permission.WRITE_EXTERNAL_STORAGE', 18] ['android.permission.WRITE_EXTERNAL_STORAGE', None]
The program will continue but log the following error:
2025-08-18 03:38:47,162 ERROR: Failed to sort permissions for sadLogic.HomeCentral_8.apk: ['android.permission.WRITE_EXTERNAL_STORAGE', 18], ['android.permission.WRITE_EXTERNAL_STORAGE', None], ...
Fixes: #1282