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

@ -185,7 +185,7 @@ class CommonTest(unittest.TestCase):
fdroidserver.common._add_java_paths_to_config(pathlist, config)
self.assertEqual(config['java_paths']['8'], choice[1:])
def test_is_apk_and_debuggable(self):
def test_is_debuggable_or_testOnly(self):
config = dict()
fdroidserver.common.fill_config_defaults(config)
fdroidserver.common.config = config
@ -197,7 +197,7 @@ class CommonTest(unittest.TestCase):
testfiles.append(os.path.join(self.basedir, 'urzip-badcert.apk'))
for apkfile in testfiles:
self.assertTrue(
fdroidserver.common.is_apk_and_debuggable(apkfile),
fdroidserver.common.is_debuggable_or_testOnly(apkfile),
"debuggable APK state was not properly parsed!",
)
@ -208,7 +208,7 @@ class CommonTest(unittest.TestCase):
testfiles.append(os.path.join(self.basedir, 'v2.only.sig_2.apk'))
for apkfile in testfiles:
self.assertFalse(
fdroidserver.common.is_apk_and_debuggable(apkfile),
fdroidserver.common.is_debuggable_or_testOnly(apkfile),
"debuggable APK state was not properly parsed!",
)