diff --git a/mvt/android/cli.py b/mvt/android/cli.py index 77fded2..ec4125e 100644 --- a/mvt/android/cli.py +++ b/mvt/android/cli.py @@ -11,6 +11,7 @@ from rich.logging import RichHandler from mvt.common.help import * from mvt.common.indicators import Indicators, IndicatorsFileBadFormat +from mvt.common.logo import logo from mvt.common.module import run_module, save_timeline from .download_apks import DownloadAPKs @@ -30,7 +31,7 @@ log = logging.getLogger(__name__) #============================================================================== @click.group(invoke_without_command=False) def cli(): - return + logo() #============================================================================== diff --git a/mvt/common/logo.py b/mvt/common/logo.py new file mode 100644 index 0000000..89ee582 --- /dev/null +++ b/mvt/common/logo.py @@ -0,0 +1,24 @@ +# Mobile Verification Toolkit (MVT) +# Copyright (c) 2021 The MVT Project Authors. +# Use of this software is governed by the MVT License 1.1 that can be found at +# https://license.mvt.re/1.1/ + +from rich import print + +from .version import MVT_VERSION, check_for_updates + +def logo(): + print("\n") + print("\t[bold]MVT[/bold] - Mobile Verification Toolkit") + print("\t\thttps://mvt.re") + print(f"\t\tVersion: {MVT_VERSION}") + + try: + latest_version = check_for_updates() + except: + pass + else: + if latest_version: + print(f"\t\t[bold]Version {latest_version} is available! Upgrade mvt![/bold]") + + print("\n") diff --git a/mvt/common/version.py b/mvt/common/version.py new file mode 100644 index 0000000..5af273b --- /dev/null +++ b/mvt/common/version.py @@ -0,0 +1,20 @@ +# Mobile Verification Toolkit (MVT) +# Copyright (c) 2021 The MVT Project Authors. +# Use of this software is governed by the MVT License 1.1 that can be found at +# https://license.mvt.re/1.1/ + +from packaging import version + +import requests + +MVT_VERSION = "1.2.4" + +def check_for_updates(): + res = requests.get("https://pypi.org/pypi/mvt/json") + data = res.json() + latest_version = data.get("info", {}).get("version", "") + + if version.parse(latest_version) > version.parse(MVT_VERSION): + return latest_version + + return None diff --git a/setup.py b/setup.py index bed8ba7..4a8dd52 100755 --- a/setup.py +++ b/setup.py @@ -7,9 +7,7 @@ import os from setuptools import find_packages, setup -__package_name__ = "mvt" -__version__ = "1.2.3" -__description__ = "Mobile Verification Toolkit" +from mvt.common.version import MVT_VERSION this_directory = os.path.abspath(os.path.dirname(__file__)) readme_path = os.path.join(this_directory, "README.md") @@ -43,9 +41,9 @@ def get_package_data(package): return {package: filepaths} setup( - name=__package_name__, - version=__version__, - description=__description__, + name="mvt", + version=MVT_VERSION, + description="Mobile Verification Toolkit", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/mvt-project/mvt",