src = os.path.normpath(apks[0])
# Make sure it's not debuggable...
- if common.isApkAndDebuggable(src, config):
+ if common.isApkAndDebuggable(src):
raise BuildException("APK is debuggable")
# By way of a sanity check, make sure the version and version
return (None, msg)
-def check_repotrunk(app, branch=None):
+def check_repotrunk(app):
try:
if app.RepoType == 'srclib':
return commitmsg
-def checkupdates_app(app, first=True):
+def checkupdates_app(app):
# If a change is made, commitmsg should be set to a description of it.
# Only if this is set will changes be written back to the metadata.
# Derived classes need to implement this. It's called once basic checking
# has been performend.
- def gotorevisionx(self, rev):
+ def gotorevisionx(self, rev): # pylint: disable=unused-argument
raise VCSException("This VCS type doesn't define gotorevisionx")
# Initialise and update submodules
return False
-def isApkAndDebuggable(apkfile, config):
+def isApkAndDebuggable(apkfile):
"""Returns True if the given file is an APK and is debuggable
:param apkfile: full path to the apk to check"""
return [re.compile(r'\s*' + c, re.IGNORECASE) for c in compileCommands]
-# Scan the source code in the given directory (and all subdirectories)
-# and return the number of fatal problems encountered
-def scan_source(build_dir, root_dir, build):
+def scan_source(build_dir, build):
+ """Scan the source code in the given directory (and all subdirectories)
+ and return the number of fatal problems encountered
+ """
count = 0
return True
return False
- def ignoreproblem(what, fd, fp):
+ def ignoreproblem(what, fd):
logging.info('Ignoring %s at %s' % (what, fd))
return 0
def handleproblem(what, fd, fp):
if toignore(fd):
- return ignoreproblem(what, fd, fp)
+ return ignoreproblem(what, fd)
if todelete(fd):
return removeproblem(what, fd, fp)
logging.error('Found %s at %s' % (what, fd))
logging.info("...scanning version " + build.versionName)
# Prepare the source code...
- root_dir, _ = common.prepare_source(vcs, app, build,
- build_dir, srclib_dir,
- extlib_dir, False)
+ common.prepare_source(vcs, app, build,
+ build_dir, srclib_dir,
+ extlib_dir, False)
# Do the scan...
- count = scan_source(build_dir, root_dir, build)
+ count = scan_source(build_dir, build)
if count > 0:
logging.warn('Scanner found %d problems in %s (%s)' % (
count, appid, build.versionCode))
apk['minSdkVersion'] = 1
# Check for debuggable apks...
- if common.isApkAndDebuggable(apkfile, config):
+ if common.isApkAndDebuggable(apkfile):
logging.warning('{0} is set to android:debuggable="true"'.format(apkfile))
# Get the signature (or md5 of, to be precise)...
testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-badsig.apk'))
testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-badcert.apk'))
for apkfile in testfiles:
- debuggable = fdroidserver.common.isApkAndDebuggable(apkfile, config)
+ debuggable = fdroidserver.common.isApkAndDebuggable(apkfile)
self.assertTrue(debuggable,
"debuggable APK state was not properly parsed!")
# these are set NOT debuggable
testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-release.apk'))
testfiles.append(os.path.join(os.path.dirname(__file__), 'urzip-release-unsigned.apk'))
for apkfile in testfiles:
- debuggable = fdroidserver.common.isApkAndDebuggable(apkfile, config)
+ debuggable = fdroidserver.common.isApkAndDebuggable(apkfile)
self.assertFalse(debuggable,
"debuggable APK state was not properly parsed!")