mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-06 15:30:28 +03:00
Better scan
This commit is contained in:
parent
c050279383
commit
4f61623501
1 changed files with 19 additions and 15 deletions
|
|
@ -1961,26 +1961,30 @@ def scan_source(build_dir, root_dir, thisbuild):
|
||||||
for r,d,f in os.walk(build_dir):
|
for r,d,f in os.walk(build_dir):
|
||||||
for curfile in f:
|
for curfile in f:
|
||||||
|
|
||||||
if r.find('/.hg/') == -1:
|
if r.find('/.hg') != -1 or r.find('/.git') != -1:
|
||||||
|
continue
|
||||||
|
|
||||||
# Path (relative) to the file...
|
# Path (relative) to the file...
|
||||||
fp = os.path.join(r, curfile)
|
fp = os.path.join(r, curfile)
|
||||||
|
|
||||||
for suspect in usual_suspects:
|
for suspect in usual_suspects:
|
||||||
if curfile.lower().find(suspect) != -1:
|
if curfile.lower().find(suspect) != -1:
|
||||||
msg = 'Found probable non-free blob ' + fp
|
msg = 'Found probable non-free blob ' + fp
|
||||||
problems.append(msg)
|
|
||||||
|
|
||||||
if curfile.endswith('.apk'):
|
|
||||||
msg = 'Found apk file, which should not be in the source - ' + fp
|
|
||||||
problems.append(msg)
|
problems.append(msg)
|
||||||
|
|
||||||
if curfile.endswith('.java'):
|
if curfile.endswith('.apk'):
|
||||||
for line in file(fp):
|
msg = 'Found apk file, which should not be in the source - ' + fp
|
||||||
|
problems.append(msg)
|
||||||
|
|
||||||
if line.find('DexClassLoader') != -1:
|
elif curfile.endswith('.so') or curfile.endswith('.elf'):
|
||||||
msg = 'Found DexClassLoader in ' + fp
|
msg = 'Found ELF at ' + fp
|
||||||
problems.append(msg)
|
problems.append(msg)
|
||||||
|
|
||||||
|
elif curfile.endswith('.java'):
|
||||||
|
for line in file(fp):
|
||||||
|
if line.find('DexClassLoader') != -1:
|
||||||
|
msg = 'Found DexClassLoader in ' + fp
|
||||||
|
problems.append(msg)
|
||||||
|
|
||||||
# Presence of a jni directory without buildjni=yes might
|
# Presence of a jni directory without buildjni=yes might
|
||||||
# indicate a problem... (if it's not a problem, explicitly use
|
# indicate a problem... (if it's not a problem, explicitly use
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue