mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-09-15 15:32:30 +03:00
Issue warnings for debuggable apks
This commit is contained in:
parent
ce19ba1c29
commit
94a33f0a04
2 changed files with 20 additions and 0 deletions
|
@ -2180,3 +2180,19 @@ class KnownApks:
|
|||
lst.reverse()
|
||||
return lst
|
||||
|
||||
def isApkDebuggable(apkfile):
|
||||
"""Returns True if the given apk file is debuggable"""
|
||||
|
||||
p = subprocess.Popen([os.path.join(sdk_path, 'platform-tools', 'aapt'),
|
||||
'dump', 'xmltree', apkfile, 'AndroidManifest.xml'],
|
||||
stdout=subprocess.PIPE)
|
||||
output = p.communicate()[0]
|
||||
if p.returncode != 0:
|
||||
print "ERROR: Failed to get apk manifest information"
|
||||
sys.exit(1)
|
||||
for line in output.splitlines():
|
||||
if line.find('android:debuggable') != -1 and not line.endswith('0x0'):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue