Merge pull request #11033 from f321x/android_deps
What changed, and why it matters
This commit updates Electrum's Android build setup by switching from a manually downloaded Java 17 to the standard Debian Java 21 package, removing an AndroidX support library dependency, and updating the python-for-android build tool version. These are build/maintenance changes rather than a fix for a known security flaw. The main security angle is that using a current, standard Java version and removing an unnecessary third-party dependency slightly reduces the attack surface and maintenance risk for the Android build environment.
Treat as routine build hygiene. Verify the new Java 21 package and python-for-android commit build correctly and that removing AndroidX does not break biometric or QML features. No urgent security action is indicated by the commit itself.
Security signals we found
Dependency update: Java 17 -> 21
Dependency removal: androidx.core:core:1.16.0
Build tool update: python-for-android commit bump
No explicit security fix or CVE referenced in commit message or diff
Evidence from the diff
The diff modifies contrib/android/Dockerfile and contrib/android/buildozer_qml.spec. It replaces a custom download of openjdk-17-jre-headless and openjdk-17-jdk-headless from snapshot.debian.org with apt installation of openjdk-21-jdk-headless from Debian repositories. It also bumps the P4A_CHECKOUT_COMMIT used by python-for-android. In buildozer_qml.spec it removes the androidx.core:core:1.16.0 gradle dependency and explicitly disables AndroidX. There is no direct patch of application code, no mention of a CVE, and no disclosed vulnerability being fixed.
Changed components
contrib/android/Dockerfilecontrib/android/buildozer_qml.specElectrum Android build environmentInspect captured patch +8 / −34
### contrib/android/Dockerfile
@@ -77,38 +77,11 @@ RUN mkdir --parents "${ANDROID_SDK_HOME}/.android/" \
&& echo '### User Sources for Android SDK Manager' \
> "${ANDROID_SDK_HOME}/.android/repositories.cfg"
-# download Java-17 (debian 13 only packages Java-21 and Java-25)
-# - we download the amd64 binaries from debian 12 repos
-# - we should try to upgrade to Java-21...
-ENV JAVA_JRE_DL_URL="https://snapshot.debian.org/archive/debian/20260130T143028Z/pool/main/o/openjdk-17/openjdk-17-jre-headless_17.0.18+8-1~deb12u1_amd64.deb"
-ENV JAVA_JRE_ARCHIVE="openjdk-17-jre-headless.deb"
-ENV JAVA_JRE_HASH="5bc36cbb4e383dbea4168d57b5fd9b42375ec8837dd62a1d56677632c3c960e0"
-ENV JAVA_JDK_DL_URL="https://snapshot.debian.org/archive/debian/20260130T143028Z/pool/main/o/openjdk-17/openjdk-17-jdk-headless_17.0.18+8-1~deb12u1_amd64.deb"
-ENV JAVA_JDK_ARCHIVE="openjdk-17-jdk-headless.deb"
-ENV JAVA_JDK_HASH="8841044caa66860a71039342fe3c02b7853b61c518e05970e501faa215b1788a"
+# install Java
RUN apt -y update -qq \
- && apt -y install -qq --no-install-recommends \
- ca-certificates-java \
- java-common \
- libcups2 \
- libfontconfig1 \
- liblcms2-2 \
- libjpeg62-turbo \
- libnss3 \
- libasound2 \
- libfreetype6 \
- libharfbuzz0b \
- libpcsclite1 \
- && apt -y autoremove \
- && cd /opt \
- && curl --location --progress-bar "${JAVA_JRE_DL_URL}" --output "${JAVA_JRE_ARCHIVE}" \
- && echo "${JAVA_JRE_HASH} ${JAVA_JRE_ARCHIVE}" | sha256sum -c - \
- && dpkg -i "${JAVA_JRE_ARCHIVE}" \
- && rm "${JAVA_JRE_ARCHIVE}" \
- && curl --location --progress-bar "${JAVA_JDK_DL_URL}" --output "${JAVA_JDK_ARCHIVE}" \
- && echo "${JAVA_JDK_HASH} ${JAVA_JDK_ARCHIVE}" | sha256sum -c - \
- && dpkg -i "${JAVA_JDK_ARCHIVE}" \
- && rm "${JAVA_JDK_ARCHIVE}"
+ && apt -y install -qq --no-install-recommends --allow-downgrades \
+ openjdk-21-jdk-headless \
+ && apt -y autoremove
# accept Android licenses (JDK necessary!)
RUN yes | ${ANDROID_SDK_MANAGER} --licenses > /dev/null
@@ -233,7 +206,7 @@ RUN cd /opt \
&& /opt/venv/bin/python3 -m pip install --no-build-isolation --no-dependencies -e .
# install python-for-android
-ENV P4A_CHECKOUT_COMMIT="40116ae6caf9971f02630d9e1107db76ed10c786"
+ENV P4A_CHECKOUT_COMMIT="eb06faf4e1bb1e14125971137829a23cc7697c19"
# ^ from branch electrum_202609_qtmultimedia (note: careful with force-pushing! see #8162)
RUN cd /opt \
&& git clone https://github.com/spesmilo/python-for-android \
### contrib/android/buildozer_qml.spec
@@ -160,8 +160,9 @@ android.add_jars = .buildozer/android/platform/*/build/libs_collections/Electrum
# directory containing the files)
android.add_src = electrum/gui/qml/java_classes/
-android.gradle_dependencies =
- androidx.core:core:1.16.0
+# (bool) Enable AndroidX support. We don't use any androidx packages, keep it
+# disabled so gradle fails the build if one gets pulled in.
+android.enable_androidx = False
android.add_activities = org.electrum.biometry.BiometricActivity
Why this scored 19/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.