mirror of
https://github.com/mvt-project/mvt.git
synced 2026-11-03 11:37:21 +01:00
* Add the mvt.plugin import surface mvt.plugin re-exports the names a plugin needs from MVT under one import path. It holds the module base classes and Command, the alert and result types, the database errors a module raises, the timestamp converters, the plugin settings API, MVT's settings, get_plugin_logger() and MVT_VERSION. The names it exports are kept working on a best-effort basis. Changes to them are announced in the release notes. Anything else in mvt can still be imported, and may change between releases without notice. get_plugin_logger(__name__) returns a logger under mvt.ext for plugin code outside a module class. Its records then reach the console and the command.log file of a run. A file loaded with --load-module or --load-command is named after the file. * Document how to write MVT plugins The custom modules page now leads with plugin packages. Loading module files with --load-module and MVT_CUSTOM_MODULES moves to a section on developing a module locally. A new "Writing a module" section shows a module which subclasses IOSExtraction. It lists each base class, the command pair it serves and the helpers it provides. "Depending on a built-in module" says to import a built-in class from its family package. "Importing from MVT" says what mvt.plugin exports and what importing from it means. The custom commands page shows a Command subclass which lists its own modules. The sysdiagnose and plugin configuration pages import from mvt.plugin.
81 lines
2.3 KiB
Python
81 lines
2.3 KiB
Python
# Mobile Verification Toolkit (MVT)
|
|
# Copyright (c) 2021-2026 The MVT Authors.
|
|
# Use of this software is governed by the MVT License 1.1 that can be found at
|
|
# https://license.mvt.re/1.1/
|
|
|
|
"""Stable functions and modules which plugins can import.
|
|
|
|
Anything else in mvt can be imported too, and may change
|
|
between releases without notice.
|
|
"""
|
|
|
|
from mvt.android.modules.androidqf.base import AndroidQFModule
|
|
from mvt.android.modules.backup.base import BackupModule as AndroidBackupModule
|
|
from mvt.android.modules.bugreport.base import BugReportModule
|
|
from mvt.common.alerts import Alert, AlertLevel
|
|
from mvt.common.command import Command
|
|
from mvt.common.config import settings
|
|
from mvt.common.module import DatabaseCorruptedError, DatabaseNotFoundError, MVTModule
|
|
from mvt.common.module_loader import get_plugin_logger
|
|
from mvt.common.module_types import (
|
|
ModuleAtomicResult,
|
|
ModuleResults,
|
|
ModuleSerializedResult,
|
|
)
|
|
from mvt.common.plugin_config import (
|
|
MVTPluginSettings,
|
|
PluginConfigLoadError,
|
|
plugin_config_path,
|
|
plugin_data_folder,
|
|
plugin_env_prefix,
|
|
)
|
|
from mvt.common.utils import (
|
|
convert_chrometime_to_datetime,
|
|
convert_datetime_to_iso,
|
|
convert_mactime_to_datetime,
|
|
convert_mactime_to_iso,
|
|
convert_unix_to_iso,
|
|
convert_unix_to_utc_datetime,
|
|
)
|
|
from mvt.common.version import MVT_VERSION
|
|
from mvt.ios.modules.base import IOSExtraction
|
|
from mvt.ios.modules.sysdiagnose.base import SysdiagnoseExtraction
|
|
|
|
__all__ = [
|
|
# Classes a plugin subclasses.
|
|
"MVTModule",
|
|
"IOSExtraction",
|
|
"SysdiagnoseExtraction",
|
|
"AndroidQFModule",
|
|
"AndroidBackupModule",
|
|
"BugReportModule",
|
|
"Command",
|
|
# Results and alerts.
|
|
"ModuleAtomicResult",
|
|
"ModuleResults",
|
|
"ModuleSerializedResult",
|
|
"Alert",
|
|
"AlertLevel",
|
|
# Errors a module raises.
|
|
"DatabaseNotFoundError",
|
|
"DatabaseCorruptedError",
|
|
# Settings.
|
|
"settings",
|
|
"MVTPluginSettings",
|
|
"PluginConfigLoadError",
|
|
"plugin_config_path",
|
|
"plugin_data_folder",
|
|
"plugin_env_prefix",
|
|
# Logging.
|
|
"get_plugin_logger",
|
|
# Timestamps.
|
|
"convert_chrometime_to_datetime",
|
|
"convert_datetime_to_iso",
|
|
"convert_mactime_to_datetime",
|
|
"convert_mactime_to_iso",
|
|
"convert_unix_to_iso",
|
|
"convert_unix_to_utc_datetime",
|
|
# MVT's version.
|
|
"MVT_VERSION",
|
|
]
|