check for <application android:testOnly="true">

This adds a check for "testOnly" to the existing "debuggable" check, since
they are very similar.  We should really be refactoring all the checks into
a more reasonable setup.  Since "debuggable" and "testOnly" are both set in
the same place (`<application>` in _AndroidManifest.xml_) and are both set
by the same process (running debug builds), I thought it would be OK to
include both in the same place.  Plus it was a one-line change.
This commit is contained in:
Hans-Christoph Steiner 2024-04-01 12:40:14 +02:00 committed by Michael Pöhn
parent 0cf1749ec3
commit 9c65bed4a5
6 changed files with 26 additions and 16 deletions

View file

@ -720,8 +720,10 @@ def build_local(app, build, vcs, build_dir, output_dir, log_dir, srclib_dir, ext
f"{app.id}:{build.versionName}", p.output)
# Make sure it's not debuggable...
if common.is_apk_and_debuggable(src):
raise BuildException("APK is debuggable")
if common.is_debuggable_or_testOnly(src):
raise BuildException(
"%s: debuggable or testOnly set in AndroidManifest.xml" % src
)
# By way of a sanity check, make sure the version and version
# code in our new APK match what we expect...