mirror of
https://github.com/mvt-project/mvt.git
synced 2024-06-30 16:18:54 +00:00
* Remove duplicated detection logic from GetProp modules * Deduplicate settings and processes * Refactor detection in artifacts * Improves Artifact class --------- Co-authored-by: tek <tek@randhome.io>
20 lines
682 B
Python
20 lines
682 B
Python
# Mobile Verification Toolkit (MVT)
|
|
# Copyright (c) 2021-2023 Claudio Guarnieri.
|
|
# Use of this software is governed by the MVT License 1.1 that can be found at
|
|
# https://license.mvt.re/1.1/
|
|
from datetime import datetime, timedelta
|
|
|
|
|
|
def warn_android_patch_level(patch_level: str, log) -> bool:
|
|
"""Alert if Android patch level out-of-date"""
|
|
patch_date = datetime.strptime(patch_level, "%Y-%m-%d")
|
|
if (datetime.now() - patch_date) > timedelta(days=6 * 31):
|
|
log.warning(
|
|
"This phone has not received security updates "
|
|
"for more than six months (last update: %s)",
|
|
patch_level,
|
|
)
|
|
return True
|
|
|
|
return False
|