From e11560825e5c4f079cf5a583d02b0e62dd9a1754 Mon Sep 17 00:00:00 2001 From: Denis Sazonov Date: Sat, 30 Apr 2022 16:11:03 +0100 Subject: [PATCH] support for py10 --- .github/workflows/python-package-test.yml | 2 +- .gitignore | 169 ++++++++++++++++++++-- CHANGELOG.md | 5 + LICENSE | 2 +- README.md | 2 +- andriller/__init__.py | 46 ++++-- andriller/messages.py | 43 +++--- requirements-dev.txt | 1 - requirements.txt | 2 +- setup.cfg | 2 +- setup.py | 27 ++-- tox.ini | 5 +- 12 files changed, 245 insertions(+), 61 deletions(-) diff --git a/.github/workflows/python-package-test.yml b/.github/workflows/python-package-test.yml index f6d994c..23c2a7a 100644 --- a/.github/workflows/python-package-test.yml +++ b/.github/workflows/python-package-test.yml @@ -19,7 +19,7 @@ jobs: strategy: matrix: - python-version: ["3.6", "3.7", "3.8", "3.9"] + python-version: ["3.6", "3.7", "3.8", "3.9", "3.10"] steps: - uses: actions/checkout@v2 diff --git a/.gitignore b/.gitignore index db9f4c3..b3a8045 100644 --- a/.gitignore +++ b/.gitignore @@ -1,17 +1,164 @@ +### Python ### + +# Byte-compiled / optimized / DLL files __pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python build/ +develop-eggs/ dist/ -env*/ -*.egg-info -*.py[coxd] -*.log -.DS_Store +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ .tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. +# This is especially recommended for binary packages to ensure reproducibility, and is more +# commonly ignored for libraries. +# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control +#poetry.lock + +# pdm +# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. +#pdm.lock +# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it +# in version control. +# https://pdm.fming.dev/#use-with-ide +.pdm.toml + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer .pytype/ -.coverage* -htmlcov/ -.pytest_cache -.vscode -.idea -*.code-workspace + +# Cython debug symbols +cython_debug/ + +# PyCharm +# JetBrains specific template is maintained in a separate JetBrains.gitignore that can +# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore +# and can be added to the global gitignore or merged into this file. For a more nuclear +# option (not recommended) you can uncomment the following to ignore the entire idea folder. +#.idea/ + tests_live/ diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f3d2b4..128e684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ CHANGELOG === +### 3.6.3 (2022-04-30) + +- Support for Python 3.10 + + ### 3.6.2 (2022-04-29) - Dependency pins for Jinja2 and MarkupSafe diff --git a/LICENSE b/LICENSE index 3e10e85..58465dc 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2012-2020 Denis Sazonov +Copyright (c) 2012-2022 Denis Sazonov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 933e27c..939f274 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ Andriller - is software utility with a collection of forensic tools for smartpho ## Python Requirements -- 3.6-3.9 (64-bit version recommended) +- 3.6-3.10 (64-bit version recommended) > It is highly advised to setup a virtual environment to install Andriller and its dependencies in it. However, it is not essential, and the global environment can also be used. Depending on how Python was setup, it may be needed to substitute `python` and `pip` to `python3` and `pip3` retrospectively for the instructions below. diff --git a/andriller/__init__.py b/andriller/__init__.py index 7fe4839..6b2a850 100644 --- a/andriller/__init__.py +++ b/andriller/__init__.py @@ -1,9 +1,9 @@ -__version__ = '3.6.2' -__app_name__ = 'Andriller CE' -__package_name__ = 'andriller' +__version__ = "3.6.3" +__app_name__ = "Andriller CE" +__package_name__ = "andriller" __website__ = "https://github.com/den4uk/andriller" -__license__ = 'MIT' -__all__ = ['gui'] +__license__ = "MIT" +__all__ = ["gui"] import os import logging @@ -13,11 +13,29 @@ def run(): import argparse - parser = argparse.ArgumentParser(description='Andriller execution with CLI options.') - parser.add_argument("-d", "--debug", dest='debug', action='store_true', help="Run with log level set to debug.") - parser.add_argument("-f", "--file", help="Save log to a file, use with --debug flag.") - parser.add_argument("--nothread", dest='nothread', action='store_true', help="Disable threading on GUI.") - parser.add_argument("-v", "--version", dest='version', action='store_true', help="Show the version.") + + parser = argparse.ArgumentParser( + description="Andriller execution with CLI options." + ) + parser.add_argument( + "-d", + "--debug", + dest="debug", + action="store_true", + help="Run with log level set to debug.", + ) + parser.add_argument( + "-f", "--file", help="Save log to a file, use with --debug flag." + ) + parser.add_argument( + "--nothread", + dest="nothread", + action="store_true", + help="Disable threading on GUI.", + ) + parser.add_argument( + "-v", "--version", dest="version", action="store_true", help="Show the version." + ) parser.set_defaults(debug=False, file=None, version=None) args = parser.parse_args() # Set logging level @@ -26,21 +44,23 @@ def run(): # Print version if args.version: import sys + print(__version__) sys.exit(0) # Log to file if args.file: - logging.basicConfig(filename=args.file, filemode='a', level=level) + logging.basicConfig(filename=args.file, filemode="a", level=level) # No thread if args.nothread: - os.environ['NOTHREAD'] = '1' + os.environ["NOTHREAD"] = "1" # Run main App from .gui import windows + try: root = windows.MainWindow(log_level=level) root.mainloop() except Exception: - logger.exception('Failed to execute a gui window.') + logger.exception("Failed to execute a gui window.") diff --git a/andriller/messages.py b/andriller/messages.py index df6f2ba..c33e85d 100644 --- a/andriller/messages.py +++ b/andriller/messages.py @@ -3,25 +3,33 @@ def about_msg(): - return messagebox.showinfo(f'\ -About {__app_name__}', f"\ + return messagebox.showinfo( + f"\ +About {__app_name__}", + f"\ Version: {__version__}\n\ License: {__license__}\n\ -Copyright \u00A9 2012-2021\n\ -Website: {__website__}") +Copyright \u00A9 2012-2022\n\ +Website: {__website__}", + ) def msg_do_backup(): - return messagebox.showwarning('Extraction via Backup method', '\ + return messagebox.showwarning( + "Extraction via Backup method", + '\ Attention!\n\ 1. Unlock the screen;\n\ 2. Tap on "Back up my data".\n\ Click OK to Continue\n\ -(Extraction may take some time..)') +(Extraction may take some time..)', + ) def screen_guide(): - return messagebox.showinfo('Usage Guide', ''' + return messagebox.showinfo( + "Usage Guide", + """ USAGE INSTRUCTIONS - Works with Android versions 4.x and above. - Connect a device via cable with USB debugging enabled. @@ -33,33 +41,34 @@ def screen_guide(): - Custom comments can be added with each capture. - Tick [Remember] to reuse last comment. - Captures can be taken just by pressing . -- Press [Report] to generate and open a HTML report.''') +- Press [Report] to generate and open a HTML report.""", + ) content_protect = "** Content Protection Enabled! **\nIt is not possible to capture this type of content." -GUIDE_WA = ''' +GUIDE_WA = """ This utility will decode multiple WhatsApp databases and produce combined messages on one report (without duplicates). Use recovered and decrypted backup databases. Instructions: Browse and select the folder with all "msgstore.db" (unencrypted and/or decrypted) databases. -''' +""" def select_output(): - return messagebox.showwarning( - 'Error!', - "Select the 'Output' directory first!") + return messagebox.showwarning("Error!", "Select the 'Output' directory first!") def device_not_detected(): return messagebox.showwarning( - 'Device not detected!', - '- Is an Android device connected?\n- Is USB Debugging enabled?\n- Are device Drivers installed?\n- Did you accept the RSA fingerprint?') + "Device not detected!", + "- Is an Android device connected?\n- Is USB Debugging enabled?\n- Are device Drivers installed?\n- Did you accept the RSA fingerprint?", + ) def license_applied(exp): return messagebox.showinfo( - 'License update', - f'License code successfully written!\nExpiry date:{exp}\nPlease restart Andriller.') + "License update", + f"License code successfully written!\nExpiry date:{exp}\nPlease restart Andriller.", + ) diff --git a/requirements-dev.txt b/requirements-dev.txt index 4b736f8..a55fdb6 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,5 +1,4 @@ -r requirements.txt --e . flake8 pytest-cov pytest-mock diff --git a/requirements.txt b/requirements.txt index cbc9975..4b1d1b2 100644 --- a/requirements.txt +++ b/requirements.txt @@ -5,7 +5,7 @@ python-dateutil XlsxWriter Jinja2>=2.11.3,<3 MarkupSafe==2.0.1 -wrapt-timeout-decorator==1.3.1 +wrapt-timeout-decorator==1.3.10 appdirs>=1.4.4,<2 requests dataclasses>=0.8;python_version=="3.6" diff --git a/setup.cfg b/setup.cfg index 9d5f765..c78ed0e 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [bumpversion] commit = True -current_version = 3.6.1 +current_version = 3.6.3 files = andriller/__init__.py tag = True tag_name = {new_version} diff --git a/setup.py b/setup.py index 007fb40..4db9d4f 100644 --- a/setup.py +++ b/setup.py @@ -2,25 +2,25 @@ from setuptools import setup, find_packages from andriller import __version__, __website__, __package_name__ -req = os.path.join(os.path.dirname(__file__), 'requirements.txt') -with open(req, 'rt', encoding="utf-8") as f: - install_requires = [dep for dep in f.read().splitlines() if not dep.startswith('#')] +req = os.path.join(os.path.dirname(__file__), "requirements.txt") +with open(req, "rt", encoding="utf-8") as f: + install_requires = [dep for dep in f.read().splitlines() if not dep.startswith("#")] -reme = os.path.join(os.path.dirname(__file__), 'README.md') -with open(reme, 'rt', encoding='utf-8') as f: +reme = os.path.join(os.path.dirname(__file__), "README.md") +with open(reme, "rt", encoding="utf-8") as f: long_description = f.read() setup( name=__package_name__, - scripts=['andriller-gui.py'], + scripts=["andriller-gui.py"], version=__version__, - description='Andriller CE | Android Forensic Tools', - author='Denis Sazonov', - author_email='den@saz.lt', + description="Andriller CE | Android Forensic Tools", + author="Denis Sazonov", + author_email="den@saz.lt", url=__website__, - packages=find_packages(exclude=['tests*']), - license='MIT License', + packages=find_packages(exclude=["tests*"]), + license="MIT License", keywords="andriller android forensic forensics adb dfir".split(), long_description=long_description, long_description_content_type="text/markdown", @@ -31,5 +31,6 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", ], - python_requires=">=3.6,<3.10", - zip_safe=True) + python_requires=">=3.6", + zip_safe=True, +) diff --git a/tox.ini b/tox.ini index 3853c3d..4793c0b 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39 +envlist = py36,py37,py38,py39,py310 [testenv] setenv = @@ -22,3 +22,6 @@ basepython = python3.8 [testenv:py39] basepython = python3.9 + +[testenv:py310] +basepython = python3.10