Public bug reported:

On 22.04, when running `fdroidserver update` to add android APK's from
the official fdroid site to a local Android APK repo it's serving, it
will fail if any APK are using Android API versions greater than 28.

The most modern API version is 35, quite a bit ahead of 28, so this
error covers most of the APK's available for fdroid.

The verbose error output suggests this due to an inability of both
fdroidserver and its dependency androguard to parse the different
metadata in newer API versions.

When I manually built the latest versions of fdroidserver and androguard
from their respective git repos, both softwares downgraded the errors to
warnings and were able to serve any fdroid APK from the server; just
updating one or the other did not fully resolve the errors.

I would like to request that the 22.04 APT packages for fdroidserver and
its dependency androguard be updated to their latest versions, 2.4.3 and
4.1.3 respectively.

The current APT versions are fdroidserver 2.1-1 and androguard
3.4.0~a1-14~jammy.

The network I intend to use them on does not have internet access and
only permits an APT repo mirror by policy, and passing around source
code or pip wheels for the newest versions is not terribly ergonomic.


A typical verbose error output of this type looks like this:
sudo fdroid update -v
2025-10-14 09:13:58,645 DEBUG: Reading 'config.yml'
2025-10-14 09:13:58,666 DEBUG: Using androguard from 
"/usr/lib/python3/dist-packages/androguard/__init__.py"
2025-10-14 09:13:58,666 WARNING: repo_icon "repo/icons/icon.png" does not 
exist! Check "config.yml".
2025-10-14 09:13:58,714 DEBUG: Reading F-Droid.apk from cache
2025-10-14 09:13:58,766 DEBUG: Reading de.danoeh.antennapod_3090095.apk from 
cache
2025-10-14 09:13:58,769 DEBUG: Reading de.kaffeemitkoffein.imagepipe_52.apk 
from cache
2025-10-14 09:13:58,769 DEBUG: Processing ir.shahriaarrr.tomodoro_2.apk
2025-10-14 09:13:58,942 INFO: Starting analysis on AndroidManifest.xml
2025-10-14 09:13:58,953 INFO: APK file was successfully validated!
2025-10-14 09:13:58,953 DEBUG: Available API levels: 4, 5, 6, 7, 8, 9, 10, 13, 
14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28
2025-10-14 09:13:58,953 WARNING: Requested API level 35 is larger than maximum 
we have, returning API level 28 instead.
2025-10-14 09:13:58,953 DEBUG: Available API levels: 4, 5, 6, 7, 8, 9, 10, 13, 
14, 15, 16, 17, 18, 19, 21, 22, 23, 24, 25, 26, 27, 28
2025-10-14 09:13:58,957 CRITICAL: Unknown exception found!
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/androguard/core/bytecodes/apk.py", line 
1556, in get_android_resources
    return self.arsc["resources.arsc"]
KeyError: 'resources.arsc'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/fdroid", line 33, in <module>
    sys.exit(load_entry_point('fdroidserver==2.1', 'console_scripts', 
'fdroid')())
  File "/usr/lib/python3/dist-packages/fdroidserver/__main__.py", line 230, in 
main
    raise e
  File "/usr/lib/python3/dist-packages/fdroidserver/__main__.py", line 211, in 
main
    mod.main()
  File "/usr/lib/python3/dist-packages/fdroidserver/update.py", line 2169, in 
main
    apks, cachechanged = process_apks(apkcache, repodirs[0], knownapks, 
options.use_date_from_apk)
  File "/usr/lib/python3/dist-packages/fdroidserver/update.py", line 1555, in 
process_apks
    (skip, apk, cachethis) = process_apk(apkcache, apkfilename, repodir, 
knownapks,
  File "/usr/lib/python3/dist-packages/fdroidserver/update.py", line 1422, in 
process_apk
    apk = scan_apk(apkfile)
  File "/usr/lib/python3/dist-packages/fdroidserver/update.py", line 1173, in 
scan_apk
    scan_apk_androguard(apk, apk_file)
  File "/usr/lib/python3/dist-packages/fdroidserver/update.py", line 1260, in 
scan_apk_androguard
    arsc = apkobject.get_android_resources()
  File "/usr/lib/python3/dist-packages/androguard/core/bytecodes/apk.py", line 
1562, in get_android_resources
    self.arsc["resources.arsc"] = ARSCParser(self.zip.read("resources.arsc"))
  File 
"/usr/lib/python3/dist-packages/androguard/core/bytecodes/axml/__init__.py", 
line 1321, in __init__
    self.packages[package_name].append(ARSCResTypeSpec(self.buff, pc))
  File 
"/usr/lib/python3/dist-packages/androguard/core/bytecodes/axml/__init__.py", 
line 2181, in __init__
    raise ResParserError("res1 must be zero!")
androguard.core.bytecodes.axml.ResParserError: res1 must be zero!


Version info:
lsb_release -rd

Description:    Ubuntu 22.04.5 LTS

Release:        22.04


apt-cache policy fdroidserver

fdroidserver:

  Installed: 2.1-1

  Candidate: 2.1-1

  Version table:

 *** 2.1-1 500

        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64
Packages

        500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386
Packages

        100 /var/lib/dpkg/status


apt-cache policy androguard

androguard:

  Installed: 3.4.0~a1-14~jammy

  Candidate: 3.4.0~a1-14~jammy

  Version table:

 *** 3.4.0~a1-14~jammy 100

        100 /var/lib/dpkg/status

     3.4.0~a1-1 500

        500 http://us.archive.ubuntu.com/ubuntu jammy/universe amd64
Packages

        500 http://us.archive.ubuntu.com/ubuntu jammy/universe i386
Packages

** Affects: fdroidserver (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2140589

Title:
  fdroidserver fails to serve APK's with API version > 26

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/fdroidserver/+bug/2140589/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to