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'):
+ if 'android:debuggable' in line and not line.endswith('0x0'):
return True
return False
if not line or line.startswith("#"):
continue
- index = line.find(':')
- if index == -1:
+ try:
+ field, value = line.split(':',1)
+ except ValueError:
raise MetaDataException("Invalid metadata in " + metafile.name + " at: " + line)
- field = line[:index]
- value = line[index+1:]
if field == "Subdir":
thisinfo[field] = value.split(',')
if line.startswith("#"):
curcomments.append(line)
continue
- index = line.find(':')
- if index == -1:
+ try:
+ field, value = line.split(':',1)
+ except ValueError:
raise MetaDataException("Invalid metadata in " + metafile.name + " at: " + line)
- field = line[:index]
- value = line[index+1:]
# Translate obsolete fields...
if field == 'Market Version':
cwd=tmp_dir, stdout=subprocess.PIPE)
out = p.communicate()[0]
lines = out.splitlines()
- if len(lines) != 1 or lines[0].find('META-INF') == -1:
+ if len(lines) != 1 or 'META-INF' not in lines[0]:
raise Exception("Unexpected diff output - " + out)
print "...successfully verified"