mirror of https://github.com/mvt-project/mvt.git
Adds warning if phone is outdated in getprop module
This commit is contained in:
parent
71c4ba799f
commit
ed54761747
|
@ -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))
|
||||
|
|
Loading…
Reference in New Issue