Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7ee947c6 authored by Andre Eisenbach's avatar Andre Eisenbach
Browse files

Fix btsnooz.py multi-line base64 decoding

Change-Id: Ie915c52d8a7eada10f68999c40a2b50b35f640e2
parent 423cf90e
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -146,10 +146,19 @@ def main():
    exit(1)

  iterator = fileinput.input()
  found = False
  base64_string = ""
  for line in iterator:
    if line.find('--- BEGIN:BTSNOOP_LOG_SUMMARY') != -1:
      decode_snooz(base64.standard_b64decode(iterator.next()))
    if found:
      if line.find('--- END:BTSNOOP_LOG_SUMMARY') != -1:
        decode_snooz(base64.standard_b64decode(base64_string))
        sys.exit(0)
      base64_string += line.strip()

    if line.find('--- BEGIN:BTSNOOP_LOG_SUMMARY') != -1:
      found = True

  if not found:
    sys.stderr.write('No btsnooz section found in bugreport.\n')
    sys.exit(1)