Adds warning if phone is outdated in getprop module

This commit is contained in:
tek 2022-02-07 17:28:01 +01:00
parent 71c4ba799f
commit ed54761747
1 changed files with 10 additions and 0 deletions

View File

@ -5,6 +5,7 @@
import logging
import re
from datetime import datetime, timedelta
from mvt.android.parsers import parse_getprop
@ -47,4 +48,13 @@ class Getprop(BugReportModule):
self.results = parse_getprop("\n".join(lines))
# Alert if phone is outdated
for entry in self.results:
if entry == "ro.build.version.security_patch":
last_patch = datetime.strptime(self.results[entry], "%Y-%m-%d")
if (datetime.now() - last_patch) > timedelta(days=6*31):
self.log.warning("This phone has not received security updates for more than six months (last update: %s)", self.results[entry])
self.log.info("Extracted %d Android system properties", len(self.results))