DependenciesManager¶
-
class
apkinjector.dependencies.
DependenciesManager
(dependencies_directory: str)¶ This class manages system-level dependencies by tracking them, and their status within a provided directory.
-
add_dependency
(name: str, path: str = None, required: bool = False, fallback: Optional[Callable] = None, fallback_args: tuple = None, use_path: bool = True) → apkinjector.dependencies.Dependency¶ Adds a new dependency to the tracked list.
- Parameters
name (str) – The name of the dependency.
path (str, optional) – Path to existing dependency. If left None, it will detect the system dependency or call fallback function, defaults to None.
required (bool) – Indicates if the dependency is required, defaults to False.
fallback (Callable, optional) – The fallback function if the dependency is not found, defaults to None.
fallback_args (tuple, optional) – Arguments to be passed to the fallback function, defaults to ().
use_path (bool, optional) – Use binary from path if exists. defaults to True
- Returns
The newly added dependency.
- Return type
-
get_dependency
(name: str) → apkinjector.dependencies.Dependency¶ Retrieves a tracked dependency by name.
- Parameters
name (str) – The name of the dependency.
- Returns
The corresponding Dependency object if it is found, None otherwise.
- Return type
-
has_missing_required_dependency
() → bool¶ Checks if there is any required dependency missing.
- Returns
True if a required dependency is missing, False otherwise.
- Return type
bool
-
-
class
apkinjector.dependencies.
Dependency
(name: str, path: str, required: bool)¶